@pi-chamber/web 1.0.5 → 1.0.6-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (539) hide show
  1. package/dist/assets/{DiagramView-CrKjR8CR.js → DiagramView-BdDt1SI7.js} +1 -1
  2. package/dist/assets/DiffView-Dk3VIX9E.js +18 -0
  3. package/dist/assets/FileSaveConflictDialog-DpyPjMH1.js +3 -0
  4. package/dist/assets/{FilesView-BRR3N7UA.js → FilesView-CumrwioK.js} +3 -3
  5. package/dist/assets/{GitHubDetailScaffold-C1UHuETI.js → GitHubDetailScaffold-CW2ZqU0Y.js} +3 -3
  6. package/dist/assets/{GitHubLinkPicker-B0O3Vapu.js → GitHubLinkPicker-BjJNQ7Ap.js} +1 -1
  7. package/dist/assets/{GitHubListPrimitives-DvQDU--z.js → GitHubListPrimitives-BcB-cCTs.js} +1 -1
  8. package/dist/assets/{GitView-wAscrRhO.js → GitView-BoCaX5AO.js} +4 -4
  9. package/dist/assets/{IssuesSurface-mh50UUQ8.js → IssuesSurface-CDZENHrE.js} +3 -3
  10. package/dist/assets/{JsonTreeView-BfErTllU.js → JsonTreeView-DpCgOUXg.js} +1 -1
  11. package/dist/assets/{MarkdownRendererImpl-SXAK4uOu.js → MarkdownRendererImpl-BkT5TUWF.js} +2 -2
  12. package/dist/assets/{PatchDiff-CHr79sJ6.js → PatchDiff-Dcr3EQgA.js} +1 -1
  13. package/dist/assets/{PierreDiffViewer-CGpKcLro.js → PierreDiffViewer-o_Edh6ny.js} +3 -3
  14. package/dist/assets/PullRequestsSurface-eSXl6sef.js +2 -0
  15. package/dist/assets/{SessionSwitcherContent-DEAw6v12.js → SessionSwitcherContent-Dm30bfpn.js} +1 -1
  16. package/dist/assets/SessionSwitcherDropdown-CFj9VWSa.js +2 -0
  17. package/dist/assets/SessionUnreadDot-CHlK2awX.js +1 -0
  18. package/dist/assets/SettingsView-CcHRUyev.js +6 -0
  19. package/dist/assets/{SettingsWindow-BiY5FmhZ.js → SettingsWindow-BMzUErrM.js} +1 -1
  20. package/dist/assets/{StickyHorizontalScrollbar-BMITjK4e.js → StickyHorizontalScrollbar-p7EbL2-E.js} +2 -2
  21. package/dist/assets/{ToolOutputDialog-B3RRLhR3.js → ToolOutputDialog-QC8IoeBH.js} +4 -4
  22. package/dist/assets/{ToolPartDiffPreview-D9m_vrht.js → ToolPartDiffPreview-BigGwtul.js} +1 -1
  23. package/dist/assets/{VirtualizedFileDiff-B8lhZGLu.js → VirtualizedFileDiff-DvLCd7Qq.js} +4 -4
  24. package/dist/assets/{Virtualizer-DP6HbEeC.js → Virtualizer-DNJrJKVb.js} +1 -1
  25. package/dist/assets/{appThemeRegistry-gegrE2dq.js → appThemeRegistry-Ca8eGRB9.js} +1 -1
  26. package/dist/assets/{collapsible-9MJx4VhA.js → collapsible-0yfy07W2.js} +1 -1
  27. package/dist/assets/{computeVirtualFileMetrics-Bjhk2CQS.js → computeVirtualFileMetrics-aX6tjjqv.js} +2 -2
  28. package/dist/assets/{contextFileOpenGuard-CsF5Boky.js → contextFileOpenGuard-CZKJuHxf.js} +1 -1
  29. package/dist/assets/{document-attachments-BslE4Ns7.js → document-attachments-CZl9rK1z.js} +5 -5
  30. package/dist/assets/{gitStatusPredicates-B3Zxud6E.js → gitStatusPredicates-3i8CcYWJ.js} +1 -1
  31. package/dist/assets/{githubLink-CbGYxsIq.js → githubLink-BvevcNay.js} +5 -5
  32. package/dist/assets/index-BMdbHCFt.js +1 -0
  33. package/dist/assets/{index-D4n3TVp2.js → index-C2ISrmRR.js} +10 -10
  34. package/dist/assets/index-DgwThEwf.css +1 -0
  35. package/dist/assets/{lua-BgMRiT3U.js → lua-VAEuO923.js} +1 -1
  36. package/dist/assets/main-BM-b2y8p.js +2 -0
  37. package/dist/assets/main-BXZ561E3.js +137 -0
  38. package/dist/assets/{markdown-shiki.worker-DnvH1S1x.js → markdown-shiki.worker-BVA5NZBT.js} +5 -5
  39. package/dist/assets/markdownCore-DbS8DkKw.js +2 -0
  40. package/dist/assets/miniChat-DO3DW6kJ.js +2 -0
  41. package/dist/assets/mobile-BgWLkut6.js +2 -0
  42. package/dist/assets/{nativeFileSave-BJsGPh58.js → nativeFileSave-Bhafll_7.js} +1 -1
  43. package/dist/assets/nsis-LY0VT_u5.js +1 -0
  44. package/dist/assets/permissionStore-zIpxq9Pq.js +1 -0
  45. package/dist/assets/pi-session-focus-preference-ChYVctYk.js +9 -0
  46. package/dist/assets/{registerCustomTheme-DmolaWWZ.js → registerCustomTheme-C-h6lsYW.js} +1 -1
  47. package/dist/assets/{renderDiffWithHighlighter-BhMEWmHn.js → renderDiffWithHighlighter-xlvSvnTf.js} +1 -1
  48. package/dist/assets/renderElectronMiniChatApp-CgVqxKDm.js +2 -0
  49. package/dist/assets/{renderFileWithHighlighter-DUGluXlw.js → renderFileWithHighlighter-CCoYfC-t.js} +1 -1
  50. package/dist/assets/renderMobileApp-CoY1tsk5.js +11 -0
  51. package/dist/assets/ruby-BK5aLJev.js +1 -0
  52. package/dist/assets/runtimeEndpointReset-fozcAShH.js +62 -0
  53. package/dist/assets/runtimeSurface-CJN1oo_1.js +1 -0
  54. package/dist/assets/themeResolver-DrfmQi8i.js +1 -0
  55. package/dist/assets/useAppFontEffects-D_gtiA95.js +215 -0
  56. package/dist/assets/useFilesViewSearch-BUxcZj60.js +7 -0
  57. package/dist/assets/{useGitHubRemoteSearch-DYoLQ4ro.js → useGitHubRemoteSearch-CevR5iLf.js} +1 -1
  58. package/dist/assets/{useSwitcherItems-BS6E199F.js → useSwitcherItems-kaRkXggX.js} +1 -1
  59. package/dist/assets/vendor-aparajita-capacitor-secure-storage-BLsm9T1Y.js +1 -0
  60. package/dist/assets/vendor-base-ui-C7vVMZTg.js +1 -0
  61. package/dist/assets/{vendor-beautiful-mermaid-DApbjBp2.js → vendor-beautiful-mermaid-b48gT2g0.js} +1 -1
  62. package/dist/assets/vendor-boot-CoTxysn6.js +65 -0
  63. package/dist/assets/{vendor-capacitor-app-BaupizkW.js → vendor-capacitor-app-NX6DULfp.js} +1 -1
  64. package/dist/assets/{vendor-capacitor-keyboard-9BVxykO7.js → vendor-capacitor-keyboard-DJD81I9f.js} +1 -1
  65. package/dist/assets/{vendor-capacitor-status-bar-BsrUwiaA.js → vendor-capacitor-status-bar-DV24OoQV.js} +1 -1
  66. package/dist/assets/vendor-codemirror-autocomplete-qsuH4Dh-.js +1 -0
  67. package/dist/assets/vendor-codemirror-lang-angular-ZHWyBf7j.js +1 -0
  68. package/dist/assets/vendor-codemirror-lang-cpp-pCTOmv-k.js +1 -0
  69. package/dist/assets/vendor-codemirror-lang-css-2bFuyM70.js +1 -0
  70. package/dist/assets/{vendor-codemirror-lang-go-Crwca_X7.js → vendor-codemirror-lang-go-DrG_c7D7.js} +2 -2
  71. package/dist/assets/vendor-codemirror-lang-html-BV8lrR8v.js +1 -0
  72. package/dist/assets/vendor-codemirror-lang-java-DrsvH6T2.js +1 -0
  73. package/dist/assets/vendor-codemirror-lang-javascript-Dkzl3s07.js +13 -0
  74. package/dist/assets/vendor-codemirror-lang-jinja-8Nn3bnoP.js +1 -0
  75. package/dist/assets/vendor-codemirror-lang-json-CsdmtHhi.js +1 -0
  76. package/dist/assets/vendor-codemirror-lang-less-DJuZ4cZe.js +1 -0
  77. package/dist/assets/vendor-codemirror-lang-liquid-D2RO-Pzr.js +1 -0
  78. package/dist/assets/vendor-codemirror-lang-markdown-C0Zu3b3n.js +1 -0
  79. package/dist/assets/vendor-codemirror-lang-php-CuDtt2Zj.js +1 -0
  80. package/dist/assets/vendor-codemirror-lang-python-Cv2exx_M.js +3 -0
  81. package/dist/assets/vendor-codemirror-lang-rust-C4TxJ6Rg.js +1 -0
  82. package/dist/assets/vendor-codemirror-lang-sass-BmtPz8kf.js +1 -0
  83. package/dist/assets/{vendor-codemirror-lang-sql-B0f-qCZo.js → vendor-codemirror-lang-sql-BF1ZaXqJ.js} +2 -2
  84. package/dist/assets/vendor-codemirror-lang-vue-DZgXrP2k.js +1 -0
  85. package/dist/assets/vendor-codemirror-lang-wast-DsnaGtL_.js +1 -0
  86. package/dist/assets/vendor-codemirror-lang-xml-D8DzzFat.js +1 -0
  87. package/dist/assets/vendor-codemirror-lang-yaml-D5hBv7m6.js +1 -0
  88. package/dist/assets/{vendor-codemirror-language-data-CqU7kHmg.js → vendor-codemirror-language-data-vn2RyN9T.js} +2 -2
  89. package/dist/assets/vendor-codemirror-search-BVCYIV0D.js +2 -0
  90. package/dist/assets/vendor-dompurify-BGCr_sdL.js +3 -0
  91. package/dist/assets/vendor-elkjs-D1S1RCAO.js +24 -0
  92. package/dist/assets/vendor-fuse.js-t_7AcMTv.js +1 -0
  93. package/dist/assets/{vendor-hast-util-to-html-BKBhbTDb.js → vendor-hast-util-to-html-O3stl53j.js} +1 -1
  94. package/dist/assets/{vendor-heic2any-pq-UTQQR.js → vendor-heic2any-sztndhZI.js} +1 -1
  95. package/dist/assets/vendor-lezer-cpp-vqXSn3lv.js +1 -0
  96. package/dist/assets/vendor-lezer-css-JnEzSyZR.js +1 -0
  97. package/dist/assets/{vendor-lezer-go-CHIhCNY6.js → vendor-lezer-go-dD2gQMIL.js} +1 -1
  98. package/dist/assets/{vendor-lezer-html-B3h0MOrG.js → vendor-lezer-html-Cr3U-1pu.js} +1 -1
  99. package/dist/assets/vendor-lezer-java-CRM0IMCo.js +1 -0
  100. package/dist/assets/vendor-lezer-javascript-B3s21DIS.js +1 -0
  101. package/dist/assets/{vendor-lezer-json-BP_UAzLL.js → vendor-lezer-json-DPFM6EBV.js} +1 -1
  102. package/dist/assets/vendor-lezer-lr-Bllrq8hY.js +1 -0
  103. package/dist/assets/vendor-lezer-markdown-6-3PLvXG.js +6 -0
  104. package/dist/assets/vendor-lezer-php-DOyzfHRl.js +1 -0
  105. package/dist/assets/{vendor-lezer-python-EJ4Im4y2.js → vendor-lezer-python-CdHdN5qt.js} +1 -1
  106. package/dist/assets/vendor-lezer-rust-CqnW8EMH.js +1 -0
  107. package/dist/assets/{vendor-lezer-sass-CMi6zfXI.js → vendor-lezer-sass-BbcF4y6A.js} +1 -1
  108. package/dist/assets/{vendor-lezer-xml-0MHMeZDp.js → vendor-lezer-xml-C31AyWoo.js} +1 -1
  109. package/dist/assets/{vendor-lezer-yaml-BE2EFjpA.js → vendor-lezer-yaml-Cv908yC2.js} +1 -1
  110. package/dist/assets/{vendor-lru_map-DOPmc7GU.js → vendor-lru_map-BbiDqlyL.js} +1 -1
  111. package/dist/assets/vendor-marked-Be78pDn1.js +59 -0
  112. package/dist/assets/{vendor-oniguruma-parser-C0D4_9rT.js → vendor-oniguruma-parser-BrbMHgHx.js} +1 -1
  113. package/dist/assets/vendor-oniguruma-to-es-DgwFOwdE.js +94 -0
  114. package/dist/assets/{vendor-pierre-theming-Dgp7B_O4.js → vendor-pierre-theming-BO6EPniU.js} +1 -1
  115. package/dist/assets/vendor-property-information-C40bX6nM.js +1 -0
  116. package/dist/assets/{vendor-qrcode-Dv4uniC1.js → vendor-qrcode-gzL9QFkg.js} +5 -5
  117. package/dist/assets/vendor-react-Bz1tRBxM.js +1 -0
  118. package/dist/assets/{vendor-react-drawio-Duu5LgQA.js → vendor-react-drawio-IYnLUY5N.js} +1 -1
  119. package/dist/assets/vendor-remend-DcBOpbSu.js +24 -0
  120. package/dist/assets/vendor-replit-codemirror-vim-Cwhyn_5f.js +6 -0
  121. package/dist/assets/vendor-replit-codemirror-vim-core-FHzKdNUS.js +34 -0
  122. package/dist/assets/vendor-shiki-BEwTOAFg.js +1 -0
  123. package/dist/assets/{vendor-shikijs-core-CGM_jqPK.js → vendor-shikijs-core-Ck_OPM_T.js} +1 -1
  124. package/dist/assets/{vendor-shikijs-engine-javascript-Cme4830A.js → vendor-shikijs-engine-javascript-DL394yyj.js} +1 -1
  125. package/dist/assets/vendor-shikijs-vscode-textmate-DPFxvYtK.js +3 -0
  126. package/dist/assets/vendor-tailwind-merge-BKkUfl9q.js +1 -0
  127. package/dist/assets/vendor-workbox-window-BBnX5xw4.js +2 -0
  128. package/dist/assets/vendor-zumer-snapdom-SJzqoCHV.js +8 -0
  129. package/dist/assets/vendor-zustand-CXhN0IMY.js +6 -0
  130. package/dist/assets/{web-components-DzQ9ybbb.js → web-components-6ORYp3Iv.js} +1 -1
  131. package/dist/assets/worker-CKCfxIfO.js +153 -0
  132. package/dist/assets/workerFactory-DlGfNFqf.js +1 -0
  133. package/dist/assets/zig-BB16gwVL.js +1 -0
  134. package/dist/index.html +8 -8
  135. package/dist/mini-chat.html +7 -7
  136. package/dist/mobile.html +7 -7
  137. package/package.json +54 -53
  138. package/server/index.js +18 -1
  139. package/server/lib/client-auth/live-revocation.test.js +4 -0
  140. package/server/lib/fs/DOCUMENTATION.md +10 -0
  141. package/server/lib/fs/project-icon.js +243 -0
  142. package/server/lib/fs/project-icon.test.js +114 -0
  143. package/server/lib/fs/routes.js +35 -0
  144. package/server/lib/fs/routes.test.js +74 -0
  145. package/server/lib/git/DOCUMENTATION.md +2 -1
  146. package/server/lib/git/routes.js +11 -3
  147. package/server/lib/git/routes.test.js +80 -0
  148. package/server/lib/git/service.js +38 -3
  149. package/server/lib/git/service.test.js +93 -0
  150. package/server/lib/open-url/DOCUMENTATION.md +35 -0
  151. package/server/lib/open-url/browser-env.js +199 -0
  152. package/server/lib/open-url/browser-env.test.js +147 -0
  153. package/server/lib/open-url/browser-handler.mjs +154 -0
  154. package/server/lib/open-url/browser-handler.test.js +69 -0
  155. package/server/lib/open-url/intake.js +187 -0
  156. package/server/lib/open-url/intake.test.js +75 -0
  157. package/server/lib/pi/extension-protocol.js +149 -0
  158. package/server/lib/pi/extension-protocol.test.js +20 -1
  159. package/server/lib/pi/routes.js +195 -1
  160. package/server/lib/pi/routes.test.js +129 -0
  161. package/server/lib/pi/session-daemon/DOCUMENTATION.md +38 -10
  162. package/server/lib/pi/session-daemon/builtin-extensions.js +14 -4
  163. package/server/lib/pi/session-daemon/daemon-process.js +13 -0
  164. package/server/lib/pi/session-daemon/extension-bridge-draft.test.js +6 -1
  165. package/server/lib/pi/session-daemon/extension-bridge.js +40 -6
  166. package/server/lib/pi/session-daemon/extension-custom-host.js +1259 -0
  167. package/server/lib/pi/session-daemon/extension-custom-host.test.js +759 -0
  168. package/server/lib/pi/session-daemon/extension-keybindings.js +21 -0
  169. package/server/lib/pi/session-daemon/extension-keybindings.test.js +37 -0
  170. package/server/lib/pi/session-daemon/extension-message-render.js +7 -4
  171. package/server/lib/pi/session-daemon/extension-message-render.test.js +14 -2
  172. package/server/lib/pi/session-daemon/extension-tool-render.js +7 -0
  173. package/server/lib/pi/session-daemon/extension-tool-render.test.js +26 -0
  174. package/server/lib/pi/session-daemon/open-request.js +60 -0
  175. package/server/lib/pi/session-daemon/open-request.test.js +54 -0
  176. package/server/lib/pi/session-daemon/prompt-preflight.test.js +134 -0
  177. package/server/lib/pi/session-daemon/sdk-upgrade.test.js +21 -4
  178. package/server/lib/pi/session-daemon/session-daemon-bash.e2e.test.js +225 -0
  179. package/server/lib/pi/session-daemon/session-daemon-directory-catalog.e2e.test.js +156 -0
  180. package/server/lib/pi/session-daemon/session-daemon-directory-catalog.test.js +381 -0
  181. package/server/lib/pi/session-daemon/session-daemon-engines.test.js +11 -2
  182. package/server/lib/pi/session-daemon/session-daemon-extensions.test.js +30 -4
  183. package/server/lib/pi/session-daemon/session-daemon-list-live.test.js +20 -0
  184. package/server/lib/pi/session-daemon/session-daemon-mcp.e2e.test.js +16 -4
  185. package/server/lib/pi/session-daemon/session-daemon-turn.e2e.test.js +7 -2
  186. package/server/lib/pi/session-daemon/session-daemon.js +448 -49
  187. package/server/lib/pi/session-daemon/session-daemon.test.js +91 -4
  188. package/server/lib/pi/session-daemon/session-engine-router.js +9 -3
  189. package/server/lib/pi/session-daemon/session-engine-router.test.js +12 -2
  190. package/server/lib/pi/session-daemon/session-engines.js +7 -2
  191. package/server/lib/pi/session-daemon/session-jsonl.js +170 -75
  192. package/server/lib/pi/session-daemon/session-jsonl.test.js +106 -2
  193. package/server/lib/pi/session-daemon/supervisor.js +4 -0
  194. package/server/lib/pi/session-daemon/user-bash.js +326 -0
  195. package/server/lib/pi/session-daemon/user-bash.test.js +371 -0
  196. package/server/lib/preview/proxy-runtime.js +140 -45
  197. package/server/lib/preview/proxy-runtime.test.js +174 -3
  198. package/server/lib/preview/proxy-runtime.websocket.test.js +89 -0
  199. package/server/lib/relay/tunnel-host.js +1 -0
  200. package/server/lib/security/request-security.js +37 -0
  201. package/server/lib/security/request-security.test.js +54 -0
  202. package/server/lib/security/server-network-host.js +107 -0
  203. package/server/lib/security/server-network-host.test.js +70 -0
  204. package/server/lib/server-browser/DOCUMENTATION.md +243 -0
  205. package/server/lib/server-browser/browser-tab.js +524 -0
  206. package/server/lib/server-browser/chrome-executable.js +138 -0
  207. package/server/lib/server-browser/chrome-launch.js +138 -0
  208. package/server/lib/server-browser/dev-servers.js +288 -0
  209. package/server/lib/server-browser/dev-servers.test.js +152 -0
  210. package/server/lib/server-browser/downloads.js +75 -0
  211. package/server/lib/server-browser/frame-policy.js +183 -0
  212. package/server/lib/server-browser/frame-policy.test.js +98 -0
  213. package/server/lib/server-browser/network-guard.js +235 -0
  214. package/server/lib/server-browser/page-scripts.js +209 -0
  215. package/server/lib/server-browser/runtime.integration.test.js +474 -0
  216. package/server/lib/server-browser/runtime.js +300 -0
  217. package/server/lib/server-browser/runtime.test.js +50 -0
  218. package/server/lib/server-browser/server-browser.js +431 -0
  219. package/server/lib/server-browser/server-browser.test.js +975 -0
  220. package/server/lib/server-browser/tab-input.js +241 -0
  221. package/server/lib/server-browser/tab-prompts.js +125 -0
  222. package/server/lib/server-browser/tab-stream.js +252 -0
  223. package/server/lib/server-browser/uploads.js +98 -0
  224. package/server/lib/stt/runtime.js +4 -1
  225. package/server/lib/stt/runtime.test.js +43 -0
  226. package/server/lib/terminal/runtime.js +4 -1
  227. package/server/lib/terminal/runtime.test.js +41 -0
  228. package/server/lib/ui-auth/DOCUMENTATION.md +29 -1
  229. package/server/lib/ui-auth/ui-auth.js +1 -0
  230. package/server/lib/ui-auth/ui-auth.test.js +9 -1
  231. package/server/lib/workspace/host.js +20 -3
  232. package/dist/assets/DiffView-CSonR3pr.js +0 -18
  233. package/dist/assets/FileSaveConflictDialog-Cun0LIbj.js +0 -3
  234. package/dist/assets/PullRequestsSurface-CfaOpeZn.js +0 -2
  235. package/dist/assets/SessionSwitcherDropdown-BSutduo7.js +0 -2
  236. package/dist/assets/SessionUnreadDot-Dav_rix1.js +0 -1
  237. package/dist/assets/SettingsView-CQJkOPJh.js +0 -6
  238. package/dist/assets/abap-BdImnpbu.js +0 -1
  239. package/dist/assets/actionscript-3-CoDkCxhg.js +0 -1
  240. package/dist/assets/ada-bCR0ucgS.js +0 -1
  241. package/dist/assets/angular-html-CU67Zn6k.js +0 -1
  242. package/dist/assets/angular-ts-BwZT4LLn.js +0 -1
  243. package/dist/assets/apache-Pmp26Uib.js +0 -1
  244. package/dist/assets/apex-D8_7TLub.js +0 -1
  245. package/dist/assets/apl-dKokRX4l.js +0 -1
  246. package/dist/assets/applescript-Co6uUVPk.js +0 -1
  247. package/dist/assets/ara-BRHolxvo.js +0 -1
  248. package/dist/assets/asciidoc-Ve4PFQV2.js +0 -1
  249. package/dist/assets/asm-D_Q5rh1f.js +0 -1
  250. package/dist/assets/astro-CbQHKStN.js +0 -1
  251. package/dist/assets/awk-DMzUqQB5.js +0 -1
  252. package/dist/assets/ballerina-BFfxhgS-.js +0 -1
  253. package/dist/assets/bat-BkioyH1T.js +0 -1
  254. package/dist/assets/beancount-k_qm7-4y.js +0 -1
  255. package/dist/assets/berry-uYugtg8r.js +0 -1
  256. package/dist/assets/bibtex-CHM0blh-.js +0 -1
  257. package/dist/assets/bicep-Bmn6On1c.js +0 -1
  258. package/dist/assets/bird2-DPOp833l.js +0 -1
  259. package/dist/assets/blade-D4QpJJKB.js +0 -1
  260. package/dist/assets/bsl-BO_Y6i37.js +0 -1
  261. package/dist/assets/c-BIGW1oBm.js +0 -1
  262. package/dist/assets/c3-eo99z4R2.js +0 -1
  263. package/dist/assets/cadence-Bv_4Rxtq.js +0 -1
  264. package/dist/assets/cairo-KRGpt6FW.js +0 -1
  265. package/dist/assets/clarity-D53aC0YG.js +0 -1
  266. package/dist/assets/clojure-P80f7IUj.js +0 -1
  267. package/dist/assets/cmake-D1j8_8rp.js +0 -1
  268. package/dist/assets/cobol-nwyudZeR.js +0 -1
  269. package/dist/assets/codeowners-Bp6g37R7.js +0 -1
  270. package/dist/assets/codeql-DsOJ9woJ.js +0 -1
  271. package/dist/assets/coffee-Ch7k5sss.js +0 -1
  272. package/dist/assets/common-lisp-Cg-RD9OK.js +0 -1
  273. package/dist/assets/coq-DkFqJrB1.js +0 -1
  274. package/dist/assets/cpp-CofmeUqb.js +0 -1
  275. package/dist/assets/crystal-tKQVLTB8.js +0 -1
  276. package/dist/assets/csharp-COcwbKMJ.js +0 -1
  277. package/dist/assets/css-DPfMkruS.js +0 -1
  278. package/dist/assets/csv-fuZLfV_i.js +0 -1
  279. package/dist/assets/cue-D82EKSYY.js +0 -1
  280. package/dist/assets/cypher-COkxafJQ.js +0 -1
  281. package/dist/assets/d-85-TOEBH.js +0 -1
  282. package/dist/assets/dart-CF10PKvl.js +0 -1
  283. package/dist/assets/dax-CEL-wOlO.js +0 -1
  284. package/dist/assets/desktop-BmXAJ9_W.js +0 -1
  285. package/dist/assets/diff-D97Zzqfu.js +0 -1
  286. package/dist/assets/docker-BcOcwvcX.js +0 -1
  287. package/dist/assets/dotenv-Da5cRb03.js +0 -1
  288. package/dist/assets/dream-maker-BtqSS_iP.js +0 -1
  289. package/dist/assets/edge-BkV0erSs.js +0 -1
  290. package/dist/assets/elixir-CDX3lj18.js +0 -1
  291. package/dist/assets/elm-DbKCFpqz.js +0 -1
  292. package/dist/assets/emacs-lisp-C9XAeP06.js +0 -1
  293. package/dist/assets/erb-B12qg9BL.js +0 -1
  294. package/dist/assets/erlang-DsQrWhSR.js +0 -1
  295. package/dist/assets/fennel-BYunw83y.js +0 -1
  296. package/dist/assets/fish-BvzEVeQv.js +0 -1
  297. package/dist/assets/fluent-C4IJs8-o.js +0 -1
  298. package/dist/assets/fortran-fixed-form-CkoXwp7k.js +0 -1
  299. package/dist/assets/fortran-free-form-BxgE0vQu.js +0 -1
  300. package/dist/assets/fsharp-CXgrBDvD.js +0 -1
  301. package/dist/assets/gdresource-BOOCDP_w.js +0 -1
  302. package/dist/assets/gdscript-C5YyOfLZ.js +0 -1
  303. package/dist/assets/gdshader-DkwncUOv.js +0 -1
  304. package/dist/assets/genie-D0YGMca9.js +0 -1
  305. package/dist/assets/gherkin-DyxjwDmM.js +0 -1
  306. package/dist/assets/git-commit-F4YmCXRG.js +0 -1
  307. package/dist/assets/git-rebase-r7XF79zn.js +0 -1
  308. package/dist/assets/gleam-BspZqrRM.js +0 -1
  309. package/dist/assets/glimmer-js-Rg0-pVw9.js +0 -1
  310. package/dist/assets/glimmer-ts-U6CK756n.js +0 -1
  311. package/dist/assets/glsl-DplSGwfg.js +0 -1
  312. package/dist/assets/gn-n2N0HUVH.js +0 -1
  313. package/dist/assets/gnuplot-DdkO51Og.js +0 -1
  314. package/dist/assets/go-CxLEBnE3.js +0 -1
  315. package/dist/assets/graphql-ChdNCCLP.js +0 -1
  316. package/dist/assets/groovy-gcz8RCvz.js +0 -1
  317. package/dist/assets/hack-CaT9iCJl.js +0 -1
  318. package/dist/assets/haml-B8DHNrY2.js +0 -1
  319. package/dist/assets/handlebars-BL8al0AC.js +0 -1
  320. package/dist/assets/haskell-Df6bDoY_.js +0 -1
  321. package/dist/assets/haxe-CzTSHFRz.js +0 -1
  322. package/dist/assets/hcl-BWvSN4gD.js +0 -1
  323. package/dist/assets/hjson-D5-asLiD.js +0 -1
  324. package/dist/assets/hlsl-D3lLCCz7.js +0 -1
  325. package/dist/assets/html-GMplVEZG.js +0 -1
  326. package/dist/assets/html-derivative-BFtXZ54Q.js +0 -1
  327. package/dist/assets/http-jrhK8wxY.js +0 -1
  328. package/dist/assets/hurl-irOxFIW8.js +0 -1
  329. package/dist/assets/hxml-Bvhsp5Yf.js +0 -1
  330. package/dist/assets/hy-DFXneXwc.js +0 -1
  331. package/dist/assets/imba-DGztddWO.js +0 -1
  332. package/dist/assets/index-B0h6_x5N.js +0 -1
  333. package/dist/assets/index-BwoW_-vk.css +0 -1
  334. package/dist/assets/ini-BEwlwnbL.js +0 -1
  335. package/dist/assets/java-CylS5w8V.js +0 -1
  336. package/dist/assets/javascript-wDzz0qaB.js +0 -1
  337. package/dist/assets/jinja-4LBKfQ-Z.js +0 -1
  338. package/dist/assets/jison-wvAkD_A8.js +0 -1
  339. package/dist/assets/json-Cp-IABpG.js +0 -1
  340. package/dist/assets/json5-C9tS-k6U.js +0 -1
  341. package/dist/assets/jsonc-Des-eS-w.js +0 -1
  342. package/dist/assets/jsonl-DcaNXYhu.js +0 -1
  343. package/dist/assets/jsonnet-DFQXde-d.js +0 -1
  344. package/dist/assets/jssm-C2t-YnRu.js +0 -1
  345. package/dist/assets/jsx-g9-lgVsj.js +0 -1
  346. package/dist/assets/julia-CxzCAyBv.js +0 -1
  347. package/dist/assets/just-Cw27pwNe.js +0 -1
  348. package/dist/assets/kdl-DV7GczEv.js +0 -1
  349. package/dist/assets/kotlin-BdnUsdx6.js +0 -1
  350. package/dist/assets/kusto-DZf3V79B.js +0 -1
  351. package/dist/assets/latex-CWtU0Tv5.js +0 -1
  352. package/dist/assets/lean-BZvkOJ9d.js +0 -1
  353. package/dist/assets/less-B1dDrJ26.js +0 -1
  354. package/dist/assets/liquid-DYVedYrR.js +0 -1
  355. package/dist/assets/llvm-DjAJT7YJ.js +0 -1
  356. package/dist/assets/log-2UxHyX5q.js +0 -1
  357. package/dist/assets/logo-BtOb2qkB.js +0 -1
  358. package/dist/assets/lua-BaeVxFsk.js +0 -1
  359. package/dist/assets/luau-C-HG3fhB.js +0 -1
  360. package/dist/assets/main-C6i4ph9N.js +0 -2
  361. package/dist/assets/main-r5elIPBi.js +0 -136
  362. package/dist/assets/make-CHLpvVh8.js +0 -1
  363. package/dist/assets/markdown-Cvjx9yec.js +0 -1
  364. package/dist/assets/markdownCore-C2YQ3Z0q.js +0 -2
  365. package/dist/assets/marko-CnJfTvn9.js +0 -1
  366. package/dist/assets/matlab-D7o27uSR.js +0 -1
  367. package/dist/assets/mdc-BMNejdWA.js +0 -1
  368. package/dist/assets/mdx-Cmh6b_Ma.js +0 -1
  369. package/dist/assets/mermaid-mWjccvbQ.js +0 -1
  370. package/dist/assets/miniChat-d_GCHoIf.js +0 -2
  371. package/dist/assets/mipsasm-CKIfxQSi.js +0 -1
  372. package/dist/assets/mobile-BJ3tgyKd.js +0 -2
  373. package/dist/assets/mojo-rZm6bMo-.js +0 -1
  374. package/dist/assets/moonbit-_H4v1dQx.js +0 -1
  375. package/dist/assets/move-IF9eRakj.js +0 -1
  376. package/dist/assets/narrat-DRg8JJMk.js +0 -1
  377. package/dist/assets/nextflow-Zz6hmt5N.js +0 -1
  378. package/dist/assets/nextflow-groovy-BeH2EWoN.js +0 -1
  379. package/dist/assets/nginx-BpAMiNFr.js +0 -1
  380. package/dist/assets/nim-CVrawwO9.js +0 -1
  381. package/dist/assets/nix-CwoSXNpI.js +0 -1
  382. package/dist/assets/nsis-LdVXkNf5.js +0 -1
  383. package/dist/assets/nushell-Cz2AlsmD.js +0 -1
  384. package/dist/assets/objective-c-DXmwc3jG.js +0 -1
  385. package/dist/assets/objective-cpp-CLxacb5B.js +0 -1
  386. package/dist/assets/ocaml-C0hk2d4L.js +0 -1
  387. package/dist/assets/odin-BBf5iR-q.js +0 -1
  388. package/dist/assets/openscad-C4EeE6gA.js +0 -1
  389. package/dist/assets/pascal-D93ZcfNL.js +0 -1
  390. package/dist/assets/perl-C0TMdlhV.js +0 -1
  391. package/dist/assets/permissionStore-B9Hkrqny.js +0 -1
  392. package/dist/assets/php-Dhbhpdrm.js +0 -1
  393. package/dist/assets/pi-session-focus-preference-BFnGFuvP.js +0 -9
  394. package/dist/assets/pkl-u5AG7uiY.js +0 -1
  395. package/dist/assets/plsql-ChMvpjG-.js +0 -1
  396. package/dist/assets/po-BTJTHyun.js +0 -1
  397. package/dist/assets/polar-C0HS_06l.js +0 -1
  398. package/dist/assets/postcss-CXtECtnM.js +0 -1
  399. package/dist/assets/powerquery-CEu0bR-o.js +0 -1
  400. package/dist/assets/powershell-Dpen1YoG.js +0 -1
  401. package/dist/assets/prisma-Dd19v3D-.js +0 -1
  402. package/dist/assets/prolog-CbFg5uaA.js +0 -1
  403. package/dist/assets/proto-C7zT0LnQ.js +0 -1
  404. package/dist/assets/pug-CGlum2m_.js +0 -1
  405. package/dist/assets/puppet-BMWR74SV.js +0 -1
  406. package/dist/assets/purescript-CklMAg4u.js +0 -1
  407. package/dist/assets/python-B6aJPvgy.js +0 -1
  408. package/dist/assets/qml-3beO22l8.js +0 -1
  409. package/dist/assets/qmldir-C8lEn-DE.js +0 -1
  410. package/dist/assets/qss-IeuSbFQv.js +0 -1
  411. package/dist/assets/r-Dspwwk_N.js +0 -1
  412. package/dist/assets/racket-BqYA7rlc.js +0 -1
  413. package/dist/assets/raku-DXvB9xmW.js +0 -1
  414. package/dist/assets/razor-Uh8Bk_45.js +0 -1
  415. package/dist/assets/reg-C-SQnVFl.js +0 -1
  416. package/dist/assets/regexp-CDVJQ6XC.js +0 -1
  417. package/dist/assets/rel-C3B-1QV4.js +0 -1
  418. package/dist/assets/renderElectronMiniChatApp-Bap5OwgB.js +0 -2
  419. package/dist/assets/renderMobileApp-DJbslvby.js +0 -11
  420. package/dist/assets/riscv-BM1_JUlF.js +0 -1
  421. package/dist/assets/ron-D8l8udqQ.js +0 -1
  422. package/dist/assets/rosmsg-BJDFO7_C.js +0 -1
  423. package/dist/assets/rst-BrH8l1NY.js +0 -1
  424. package/dist/assets/ruby-B2Rjki9n.js +0 -1
  425. package/dist/assets/ruby-Dw2BHqvy.js +0 -1
  426. package/dist/assets/runtimeEndpointReset-D22U_Vjs.js +0 -62
  427. package/dist/assets/runtimeSurface-k1Eit61v.js +0 -1
  428. package/dist/assets/rust-B1yitclQ.js +0 -1
  429. package/dist/assets/sas-cz2c8ADy.js +0 -1
  430. package/dist/assets/sass-Cj5Yp3dK.js +0 -1
  431. package/dist/assets/scala-C151Ov-r.js +0 -1
  432. package/dist/assets/scheme-C98Dy4si.js +0 -1
  433. package/dist/assets/scss-OYdSNvt2.js +0 -1
  434. package/dist/assets/sdbl-DVxCFoDh.js +0 -1
  435. package/dist/assets/shaderlab-Dg9Lc6iA.js +0 -1
  436. package/dist/assets/shellscript-Yzrsuije.js +0 -1
  437. package/dist/assets/shellsession-BADoaaVG.js +0 -1
  438. package/dist/assets/smalltalk-BERRCDM3.js +0 -1
  439. package/dist/assets/solidity-rGO070M0.js +0 -1
  440. package/dist/assets/soy-Brmx7dQM.js +0 -1
  441. package/dist/assets/sparql-rVzFXLq3.js +0 -1
  442. package/dist/assets/splunk-BtCnVYZw.js +0 -1
  443. package/dist/assets/sql-BLtJtn59.js +0 -1
  444. package/dist/assets/ssh-config-_ykCGR6B.js +0 -1
  445. package/dist/assets/stata-BH5u7GGu.js +0 -1
  446. package/dist/assets/stylus-BEDo0Tqx.js +0 -1
  447. package/dist/assets/surrealql-Bq5Q-fJD.js +0 -1
  448. package/dist/assets/svelte-C_ipcX3V.js +0 -1
  449. package/dist/assets/swift-D82vCrfD.js +0 -1
  450. package/dist/assets/system-verilog-CnnmHF94.js +0 -1
  451. package/dist/assets/systemd-4A_iFExJ.js +0 -1
  452. package/dist/assets/talonscript-CkByrt1z.js +0 -1
  453. package/dist/assets/tasl-QIJgUcNo.js +0 -1
  454. package/dist/assets/tcl-dwOrl1Do.js +0 -1
  455. package/dist/assets/templ-P3uqSqPl.js +0 -1
  456. package/dist/assets/terraform-BETggiCN.js +0 -1
  457. package/dist/assets/tex-idrVyKtj.js +0 -1
  458. package/dist/assets/themeResolver-yJ9XpNMI.js +0 -1
  459. package/dist/assets/toml-vGWfd6FD.js +0 -1
  460. package/dist/assets/ts-tags-zn1MmPIZ.js +0 -1
  461. package/dist/assets/tsv-B_m7g4N7.js +0 -1
  462. package/dist/assets/tsx-COt5Ahok.js +0 -1
  463. package/dist/assets/turtle-BsS91CYL.js +0 -1
  464. package/dist/assets/twig-DNn4PbVi.js +0 -1
  465. package/dist/assets/typescript-BPQ3VLAy.js +0 -1
  466. package/dist/assets/typespec-BGHnOYBU.js +0 -1
  467. package/dist/assets/typst-DHCkPAjA.js +0 -1
  468. package/dist/assets/useAppFontEffects-CqHhRKmN.js +0 -212
  469. package/dist/assets/useFilesViewSearch-CqoYEK0U.js +0 -7
  470. package/dist/assets/v-BcVCzyr7.js +0 -1
  471. package/dist/assets/vala-CsfeWuGM.js +0 -1
  472. package/dist/assets/vb-D17OF-Vu.js +0 -1
  473. package/dist/assets/vendor-aparajita-capacitor-secure-storage-BDrMx_CE.js +0 -1
  474. package/dist/assets/vendor-base-ui-CKRUCG-f.js +0 -1
  475. package/dist/assets/vendor-boot-EC6IyLt1.js +0 -69
  476. package/dist/assets/vendor-codemirror-autocomplete-CGpAsPWp.js +0 -1
  477. package/dist/assets/vendor-codemirror-lang-angular-CDJoHJSY.js +0 -1
  478. package/dist/assets/vendor-codemirror-lang-cpp-BmHofQls.js +0 -1
  479. package/dist/assets/vendor-codemirror-lang-css-RM2HqXZ0.js +0 -1
  480. package/dist/assets/vendor-codemirror-lang-html-CHSHUpwq.js +0 -1
  481. package/dist/assets/vendor-codemirror-lang-java-lhQXgWu0.js +0 -1
  482. package/dist/assets/vendor-codemirror-lang-javascript-Dw4kFO4e.js +0 -13
  483. package/dist/assets/vendor-codemirror-lang-jinja-_pAC3UTN.js +0 -1
  484. package/dist/assets/vendor-codemirror-lang-json-B-b1vAv-.js +0 -1
  485. package/dist/assets/vendor-codemirror-lang-less-xIgOi1ze.js +0 -1
  486. package/dist/assets/vendor-codemirror-lang-liquid-CP49m5dB.js +0 -1
  487. package/dist/assets/vendor-codemirror-lang-markdown-BTht2ATe.js +0 -1
  488. package/dist/assets/vendor-codemirror-lang-php-BguZDhaO.js +0 -1
  489. package/dist/assets/vendor-codemirror-lang-python-CH6_em9L.js +0 -3
  490. package/dist/assets/vendor-codemirror-lang-rust-EG_DtGyi.js +0 -1
  491. package/dist/assets/vendor-codemirror-lang-sass-BknY5Qpo.js +0 -1
  492. package/dist/assets/vendor-codemirror-lang-vue-CyGn9snv.js +0 -1
  493. package/dist/assets/vendor-codemirror-lang-wast-CsFfSyyB.js +0 -1
  494. package/dist/assets/vendor-codemirror-lang-xml-Cdan_Jp1.js +0 -1
  495. package/dist/assets/vendor-codemirror-lang-yaml-COI5hck8.js +0 -1
  496. package/dist/assets/vendor-codemirror-search-DUfSCF9S.js +0 -2
  497. package/dist/assets/vendor-dompurify-r8glNMJW.js +0 -2
  498. package/dist/assets/vendor-elkjs-D27273Ms.js +0 -24
  499. package/dist/assets/vendor-fuse.js-Dw8P0qyA.js +0 -1
  500. package/dist/assets/vendor-lezer-cpp-DMZOJzBa.js +0 -1
  501. package/dist/assets/vendor-lezer-css-DUkkbMp7.js +0 -1
  502. package/dist/assets/vendor-lezer-java-tMazV_6X.js +0 -1
  503. package/dist/assets/vendor-lezer-javascript-ctwLWf4v.js +0 -1
  504. package/dist/assets/vendor-lezer-lr-B8TQctNw.js +0 -1
  505. package/dist/assets/vendor-lezer-markdown-aGLZf_3h.js +0 -6
  506. package/dist/assets/vendor-lezer-php-D5zCNzlt.js +0 -1
  507. package/dist/assets/vendor-lezer-rust-DO5c7OtA.js +0 -1
  508. package/dist/assets/vendor-marked-CX41MkDF.js +0 -59
  509. package/dist/assets/vendor-oniguruma-to-es-DLBnFDCE.js +0 -94
  510. package/dist/assets/vendor-property-information-rJCbAzvX.js +0 -1
  511. package/dist/assets/vendor-react-DASdDPIk.js +0 -1
  512. package/dist/assets/vendor-remend-BWYYytN3.js +0 -22
  513. package/dist/assets/vendor-replit-codemirror-vim-AnOuN8yJ.js +0 -39
  514. package/dist/assets/vendor-shiki-Bbf2GEcE.js +0 -2
  515. package/dist/assets/vendor-shikijs-vscode-textmate-BgLrS_2D.js +0 -3
  516. package/dist/assets/vendor-tailwind-merge-CPcsbTWB.js +0 -1
  517. package/dist/assets/vendor-workbox-window-BIl4cyR9.js +0 -2
  518. package/dist/assets/vendor-zumer-snapdom-Btyu_Xi2.js +0 -8
  519. package/dist/assets/vendor-zustand-CUi8eEds.js +0 -6
  520. package/dist/assets/verilog-BQ8w6xss.js +0 -1
  521. package/dist/assets/vhdl-CeAyd5Ju.js +0 -1
  522. package/dist/assets/viml-CJc9bBzg.js +0 -1
  523. package/dist/assets/vue-DN_0RTcg.js +0 -1
  524. package/dist/assets/vue-html-AaS7Mt5G.js +0 -1
  525. package/dist/assets/vue-vine-CQOfvN7w.js +0 -1
  526. package/dist/assets/vyper-CDx5xZoG.js +0 -1
  527. package/dist/assets/wasm-MzD3tlZU.js +0 -1
  528. package/dist/assets/wenyan-BV7otONQ.js +0 -1
  529. package/dist/assets/wgsl-Dx-B1_4e.js +0 -1
  530. package/dist/assets/wikitext-BhOHFoWU.js +0 -1
  531. package/dist/assets/wit-5i3qLPDT.js +0 -1
  532. package/dist/assets/wolfram-lXgVvXCa.js +0 -1
  533. package/dist/assets/worker-BBk7yuNN.js +0 -153
  534. package/dist/assets/workerFactory-tw7cIdmV.js +0 -1
  535. package/dist/assets/xml-sdJ4AIDG.js +0 -1
  536. package/dist/assets/xsl-CtQFsRM5.js +0 -1
  537. package/dist/assets/yaml-Buea-lGh.js +0 -1
  538. package/dist/assets/zenscript-DVFEvuxE.js +0 -1
  539. package/dist/assets/zig-VOosw3JB.js +0 -1
@@ -0,0 +1,65 @@
1
+ import{r as Jm,a as S,b as ta,g as eH,R as be}from"./vendor-react-Bz1tRBxM.js";import{c as tH}from"./vendor-clsx-B-dksMZM.js";var _l;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(_l||(_l={}));class Hp extends Error{constructor(e,n,i){super(e),this.message=e,this.code=n,this.data=i}}const nH=t=>{var e,n;return t?.androidBridge?"android":!((n=(e=t?.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},iH=t=>{const e=t.CapacitorCustomPlatform||null,n=t.Capacitor||{},i=n.Plugins=n.Plugins||{},r=()=>e!==null?e.name:nH(t),o=()=>r()!=="web",a=p=>{const y=h.get(p);return!!(y?.platforms.has(r())||c(p))},c=p=>{var y;return(y=n.PluginHeaders)===null||y===void 0?void 0:y.find(b=>b.name===p)},f=p=>t.console.error(p),h=new Map,m=(p,y={})=>{const b=h.get(p);if(b)return console.warn(`Capacitor plugin "${p}" already registered. Cannot register plugins twice.`),b.proxy;const x=r(),w=c(p);let C;const E=async()=>(!C&&x in y?C=typeof y[x]=="function"?C=await y[x]():C=y[x]:e!==null&&!C&&"web"in y&&(C=typeof y.web=="function"?C=await y.web():C=y.web),C),O=(I,L)=>{var B,H;if(w){const U=w?.methods.find(F=>L===F.name);if(U)return U.rtype==="promise"?F=>n.nativePromise(p,L.toString(),F):(F,K)=>n.nativeCallback(p,L.toString(),F,K);if(I)return(B=I[L])===null||B===void 0?void 0:B.bind(I)}else{if(I)return(H=I[L])===null||H===void 0?void 0:H.bind(I);throw new Hp(`"${p}" plugin is not implemented on ${x}`,_l.Unimplemented)}},T=I=>{let L;const B=(...H)=>{const U=E().then(F=>{const K=O(F,I);if(K){const z=K(...H);return L=z?.remove,z}else throw new Hp(`"${p}.${I}()" is not implemented on ${x}`,_l.Unimplemented)});return I==="addListener"&&(U.remove=async()=>L()),U};return B.toString=()=>`${I.toString()}() { [capacitor code] }`,Object.defineProperty(B,"name",{value:I,writable:!1,configurable:!1}),B},A=T("addListener"),D=T("removeListener"),k=(I,L)=>{const B=A({eventName:I},L),H=async()=>{const F=await B;D({eventName:I,callbackId:F},L)},U=new Promise(F=>B.then(()=>F({remove:H})));return U.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await H()},U},M=new Proxy({},{get(I,L){switch(L){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return w?k:A;case"removeListener":return D;default:return T(L)}}});return i[p]=M,h.set(p,{name:p,proxy:M,platforms:new Set([...Object.keys(y),...w?[x]:[]])}),M};return n.convertFileSrc||(n.convertFileSrc=p=>p),n.getPlatform=r,n.handleError=f,n.isNativePlatform=o,n.isPluginAvailable=a,n.registerPlugin=m,n.Exception=Hp,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},rH=t=>t.Capacitor=iH(t),am=rH(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}),$f=am.registerPlugin;class eg{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,n){let i=!1;this.listeners[e]||(this.listeners[e]=[],i=!0),this.listeners[e].push(n);const o=this.windowListeners[e];o&&!o.registered&&this.addWindowListener(o),i&&this.sendRetainedArgumentsForEvent(e);const a=async()=>this.removeListener(e,n);return Promise.resolve({remove:a})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,n,i){const r=this.listeners[e];if(!r){if(i){let o=this.retainedEventArguments[e];o||(o=[]),o.push(n),this.retainedEventArguments[e]=o}return}r.forEach(o=>o(n))}hasListeners(e){var n;return!!(!((n=this.listeners[e])===null||n===void 0)&&n.length)}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:i=>{this.notifyListeners(n,i)}}}unimplemented(e="not implemented"){return new am.Exception(e,_l.Unimplemented)}unavailable(e="not available"){return new am.Exception(e,_l.Unavailable)}async removeListener(e,n){const i=this.listeners[e];if(!i)return;const r=i.indexOf(n);r!==-1&&this.listeners[e].splice(r,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const n=this.retainedEventArguments[e];n&&(delete this.retainedEventArguments[e],n.forEach(i=>{this.notifyListeners(e,i)}))}}const sH=$f("WebView"),RA=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),AA=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class oH extends eg{async getCookies(){const e=document.cookie,n={};return e.split(";").forEach(i=>{if(i.length<=0)return;let[r,o]=i.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=AA(r).trim(),o=AA(o).trim(),n[r]=o}),n}async setCookie(e){try{const n=RA(e.key),i=RA(e.value),r=e.expires?`; expires=${e.expires.replace("expires=","")}`:"",o=(e.path||"/").replace("path=",""),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${i||""}${r}; path=${o}; ${a};`}catch(n){return Promise.reject(n)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}const lH=$f("CapacitorCookies",{web:()=>new oH}),aH=async t=>new Promise((e,n)=>{const i=new FileReader;i.onload=()=>{const r=i.result;e(r.indexOf(",")>=0?r.split(",")[1]:r)},i.onerror=r=>n(r),i.readAsDataURL(t)}),uH=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(r=>r.toLocaleLowerCase()).reduce((r,o,a)=>(r[o]=t[e[a]],r),{})},cH=(t,e=!0)=>t?Object.entries(t).reduce((i,r)=>{const[o,a]=r;let c,f;return Array.isArray(a)?(f="",a.forEach(h=>{c=e?encodeURIComponent(h):h,f+=`${o}=${c}&`}),f.slice(0,-1)):(c=e?encodeURIComponent(a):a,f=`${o}=${c}`),`${i}&${f}`},"").substr(1):null,iP=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),r=uH(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[a,c]of Object.entries(t.data||{}))o.set(a,c);n.body=o.toString()}else if(r.includes("multipart/form-data")||t.data instanceof FormData){const o=new FormData;if(t.data instanceof FormData)t.data.forEach((c,f)=>{o.append(f,c)});else for(const c of Object.keys(t.data))o.append(c,t.data[c]);n.body=o;const a=new Headers(n.headers);a.delete("content-type"),n.headers=a}else(r.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class fH extends eg{async request(e){const n=iP(e,e.webFetchExtra),i=cH(e.params,e.shouldEncodeUrlParams),r=i?`${e.url}?${i}`:e.url,o=await fetch(r,n),a=o.headers.get("content-type")||"";let{responseType:c="text"}=o.ok?e:{};a.includes("application/json")&&(c="json");let f,h;switch(c){case"arraybuffer":case"blob":h=await o.blob(),f=await aH(h);break;case"json":f=await o.json();break;default:f=await o.text()}const m={};return o.headers.forEach((p,y)=>{m[y]=p}),{data:f,headers:m,status:o.status,url:o.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}const dH=$f("CapacitorHttp",{web:()=>new fH});var rS;(function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"})(rS||(rS={}));var sS;(function(t){t.StatusBar="StatusBar",t.NavigationBar="NavigationBar"})(sS||(sS={}));class hH extends eg{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}const pH=$f("SystemBars",{web:()=>new hH}),Xte=Object.freeze(Object.defineProperty({__proto__:null,Capacitor:am,CapacitorCookies:lH,CapacitorException:Hp,CapacitorHttp:dH,get ExceptionCode(){return _l},get SystemBarType(){return sS},SystemBars:pH,get SystemBarsStyle(){return rS},WebPlugin:eg,WebView:sH,buildRequestInit:iP,registerPlugin:$f},Symbol.toStringTag,{value:"Module"}));var _0={exports:{}},Kc={};var OA;function mH(){if(OA)return Kc;OA=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,o){var a=null;if(o!==void 0&&(a=""+o),r.key!==void 0&&(a=""+r.key),"key"in r){o={};for(var c in r)c!=="key"&&(o[c]=r[c])}else o=r;return r=o.ref,{$$typeof:t,type:i,key:a,ref:r!==void 0?r:null,props:o}}return Kc.Fragment=e,Kc.jsx=n,Kc.jsxs=n,Kc}var MA;function gH(){return MA||(MA=1,_0.exports=mH()),_0.exports}var fe=gH(),H0={exports:{}},Yc={},F0={exports:{}},U0={};var DA;function yH(){return DA||(DA=1,(function(t){function e(V,X){var j=V.length;V.push(X);e:for(;0<j;){var Y=j-1>>>1,$=V[Y];if(0<r($,X))V[Y]=X,V[j]=$,j=Y;else break e}}function n(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var X=V[0],j=V.pop();if(j!==X){V[0]=j;e:for(var Y=0,$=V.length,te=$>>>1;Y<te;){var N=2*(Y+1)-1,ne=V[N],q=N+1,G=V[q];if(0>r(ne,j))q<$&&0>r(G,ne)?(V[Y]=G,V[q]=j,Y=q):(V[Y]=ne,V[N]=j,Y=N);else if(q<$&&0>r(G,j))V[Y]=G,V[q]=j,Y=q;else break e}}return X}function r(V,X){var j=V.sortIndex-X.sortIndex;return j!==0?j:V.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var f=[],h=[],m=1,p=null,y=3,b=!1,x=!1,w=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var X=n(h);X!==null;){if(X.callback===null)i(h);else if(X.startTime<=V)i(h),X.sortIndex=X.expirationTime,e(f,X);else break;X=n(h)}}function D(V){if(w=!1,A(V),!x)if(n(f)!==null)x=!0,k||(k=!0,U());else{var X=n(h);X!==null&&z(D,X.startTime-V)}}var k=!1,M=-1,I=5,L=-1;function B(){return C?!0:!(t.unstable_now()-L<I)}function H(){if(C=!1,k){var V=t.unstable_now();L=V;var X=!0;try{e:{x=!1,w&&(w=!1,O(M),M=-1),b=!0;var j=y;try{t:{for(A(V),p=n(f);p!==null&&!(p.expirationTime>V&&B());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,y=p.priorityLevel;var $=Y(p.expirationTime<=V);if(V=t.unstable_now(),typeof $=="function"){p.callback=$,A(V),X=!0;break t}p===n(f)&&i(f),A(V)}else i(f);p=n(f)}if(p!==null)X=!0;else{var te=n(h);te!==null&&z(D,te.startTime-V),X=!1}}break e}finally{p=null,y=j,b=!1}X=void 0}}finally{X?U():k=!1}}}var U;if(typeof T=="function")U=function(){T(H)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,K=F.port2;F.port1.onmessage=H,U=function(){K.postMessage(null)}}else U=function(){E(H,0)};function z(V,X){M=E(function(){V(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(V){switch(y){case 1:case 2:case 3:var X=3;break;default:X=y}var j=y;y=X;try{return V()}finally{y=j}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(V,X){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var j=y;y=V;try{return X()}finally{y=j}},t.unstable_scheduleCallback=function(V,X,j){var Y=t.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?Y+j:Y):j=Y,V){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=j+$,V={id:m++,callback:X,priorityLevel:V,startTime:j,expirationTime:$,sortIndex:-1},j>Y?(V.sortIndex=j,e(h,V),n(f)===null&&V===n(h)&&(w?(O(M),M=-1):w=!0,z(D,j-Y))):(V.sortIndex=$,e(f,V),x||b||(x=!0,k||(k=!0,U()))),V},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(V){var X=y;return function(){var j=y;y=X;try{return V.apply(this,arguments)}finally{y=j}}}})(U0)),U0}var kA;function vH(){return kA||(kA=1,F0.exports=yH()),F0.exports}var j0={exports:{}},Zn={};var PA;function bH(){if(PA)return Zn;PA=1;var t=Jm();function e(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),a=Symbol.for("react.optimistic_key");function c(m,p,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:b==null?null:b===a?a:""+b,children:m,containerInfo:p,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Zn.browser=function(m){return{$$typeof:o,_reason:m}},Zn.createPortal=function(m,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return c(m,p,null,y)},Zn.flushSync=function(m){var p=f.T,y=i.p;try{if(f.T=null,i.p=2,m)return m()}finally{f.T=p,i.p=y,i.d.f()}},Zn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(m,p))},Zn.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},Zn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var y=p.as,b=h(y,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?i.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:x,fetchPriority:w}):y==="script"&&i.d.X(m,{crossOrigin:b,integrity:x,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Zn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=h(p.as,p.crossOrigin);i.d.M(m,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&i.d.M(m)},Zn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,b=h(y,p.crossOrigin);i.d.L(m,y,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Zn.preloadModule=function(m,p){if(typeof m=="string")if(p){var y=h(p.as,p.crossOrigin);i.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else i.d.m(m)},Zn.requestFormReset=function(m){i.d.r(m)},Zn.unstable_batchedUpdates=function(m,p){return m(p)},Zn.useFormState=function(m,p,y){return f.H.useFormState(m,p,y)},Zn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Zn.version="19.3.1",Zn}var IA;function rP(){if(IA)return j0.exports;IA=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),j0.exports=bH(),j0.exports}var NA;function SH(){if(NA)return Yc;NA=1;var t=vH(),e=Jm(),n=rP();function i(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){for(var l=s,u=l;u&&!u.alternate;)l=u,(l.flags&4098)!==0&&(s=l.return),u=l.return;for(;l.return;)l=l.return;return l.tag===3?s:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function f(s){if(o(s)!==s)throw Error(i(188))}function h(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(i(188));return l!==s?null:s}for(var u=s,d=l;;){var g=u.return;if(g===null)break;var v=g.alternate;if(v===null){if(d=g.return,d!==null){u=d;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===u)return f(g),s;if(v===d)return f(g),l;v=v.sibling}throw Error(i(188))}if(u.return!==d.return)u=g,d=v;else{for(var R=!1,P=g.child;P;){if(P===u){R=!0,u=g,d=v;break}if(P===d){R=!0,d=g,u=v;break}P=P.sibling}if(!R){for(P=v.child;P;){if(P===u){R=!0,u=v,d=g;break}if(P===d){R=!0,d=v,u=g;break}P=P.sibling}if(!R)throw Error(i(189))}}if(u.alternate!==d)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?s:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(s),l!==null)return l;s=s.sibling}return null}function p(s,l,u,d,g,v){for(;s!==null;){if((s.tag===5||s.tag===27||s.tag===6)&&u(s,d,g,v)||(s.tag!==22||s.memoizedState===null)&&(l||s.tag!==5&&s.tag!==27)&&p(s.child,l,u,d,g,v))return!0;s=s.sibling}return!1}function y(s){for(s=s.return;s!==null;){if(s.tag===3||s.tag===5||s.tag===27)return s;s=s.return}return null}function b(s){var l=!1;for(s=s.return;s!==null&&(s.tag===4&&(l=!0),!(s.tag===3||s.tag===5||s.tag===27));)s=s.return;return l}function x(s){var l=[null,null],u=y(s);return u===null||w(l,s,u.child,{foundSelf:!1}),l}function w(s,l,u,d){for(;u!==null;){if(u===l)d.foundSelf=!0;else if(u.tag===5||u.tag===27||u.tag===6){if(d.foundSelf)return s[1]=u,!0;s[0]=u}else if((u.tag!==22||u.memoizedState===null)&&w(s,l,u.child,d))return!0;u=u.sibling}return!1}function C(s){switch(s.tag){case 5:case 27:case 6:return s.stateNode;case 3:return s.stateNode.containerInfo;default:throw Error(i(559))}}var E=null,O=null;function T(s,l,u){return s===u?!0:s===l?(E=s,!0):!1}function A(s,l,u){return s===u?(O=s,!1):s===l?(O!==null&&(E=s),!0):!1}function D(s){if(s===null)return null;do s=s===null?null:s.return;while(s&&s.tag!==5&&s.tag!==27&&s.tag!==3);return s||null}function k(s,l,u){for(var d=0,g=s;g;g=u(g))d++;g=0;for(var v=l;v;v=u(v))g++;for(;0<d-g;)s=u(s),d--;for(;0<g-d;)l=u(l),g--;for(;d--;){if(s===l||l!==null&&s===l.alternate)return s;s=u(s),l=u(l)}return null}var M=Object.assign,I=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),z=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),N=Symbol.for("react.legacy_hidden"),ne=Symbol.for("react.memo_cache_sentinel"),q=Symbol.for("react.view_transition"),G=Symbol.for("react.recoverable"),Z=Symbol.iterator;function ae(s){return s===null||typeof s!="object"?null:(s=Z&&s[Z]||s["@@iterator"],typeof s=="function"?s:null)}var Se=Symbol.for("react.client.reference");function le(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Se?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case H:return"Fragment";case F:return"Profiler";case U:return"StrictMode";case X:return"Suspense";case j:return"SuspenseList";case te:return"Activity";case q:return"ViewTransition"}if(typeof s=="object")switch(s.$$typeof){case B:return"Portal";case z:return s.displayName||"Context";case K:return(s._context.displayName||"Context")+".Consumer";case V:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case Y:return l=s.displayName||null,l!==null?l:le(s.type)||"Memo";case $:l=s._payload,s=s._init;try{return le(s(l))}catch{}}return null}var ge=Array.isArray,ce=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},ye=[],Pe=-1;function Ee(s){return{current:s}}function Me(s){0>Pe||(s.current=ye[Pe],ye[Pe]=null,Pe--)}function Be(s,l){Pe++,ye[Pe]=s.current,s.current=l}var ve=Ee(null),Ie=Ee(null),de=Ee(null),ke=Ee(null);function it(s,l){switch(Be(de,l),Be(Ie,s),Be(ve,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?LR(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=LR(l),s=BR(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Me(ve),Be(ve,s)}function tt(){Me(ve),Me(Ie),Me(de)}function se(s){var l=s.memoizedState;l!==null&&(Ya._currentValue=l.memoizedState,Be(ke,s)),l=ve.current;var u=BR(l,s.type);l!==u&&(Be(Ie,s),Be(ve,u))}function me(s){Ie.current===s&&(Me(ve),Me(Ie)),ke.current===s&&(Me(ke),Ya._currentValue=Te)}var _e,we;function Re(s){if(_e===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);_e=l&&l[1]||"",we=-1<u.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+_e+s+we}var gt=!1;function Je(s,l){if(!s||gt)return"";gt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(Ne){var Q=Ne}Reflect.construct(s,[],pe)}else{try{pe.call()}catch(Ne){Q=Ne}pe=!1;try{var re=Object.getOwnPropertyDescriptor(s.prototype,"props");Object.defineProperty(s.prototype,"props",{configurable:!0,set:function(){throw Error()}}),pe=!0,new s}finally{pe&&(re!==void 0?Object.defineProperty(s.prototype,"props",re):delete s.prototype.props)}}}else{try{throw Error()}catch(Ne){Q=Ne}(pe=s())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(Ne){if(Ne&&Q&&typeof Ne.stack=="string")return[Ne.stack,Q.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),R=v[0],P=v[1];if(R&&P){var _=R.split(`
4
+ `),ee=P.split(`
5
+ `);for(g=d=0;d<_.length&&!_[d].includes("DetermineComponentFrameRoot");)d++;for(;g<ee.length&&!ee[g].includes("DetermineComponentFrameRoot");)g++;if(d===_.length||g===ee.length)for(d=_.length-1,g=ee.length-1;1<=d&&0<=g&&_[d]!==ee[g];)g--;for(;1<=d&&0<=g;d--,g--)if(_[d]!==ee[g]){if(d!==1||g!==1)do if(d--,g--,0>g||_[d]!==ee[g]){var oe=`
6
+ `+_[d].replace(" at new "," at ");return s.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",s.displayName)),oe}while(1<=d&&0<=g);break}}}finally{gt=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Re(u):""}function rt(s,l){switch(s.tag){case 26:case 27:case 5:return Re(s.type);case 16:return Re("Lazy");case 13:return s.child!==l&&l!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Je(s.type,!1);case 11:return Je(s.type.render,!1);case 1:return Je(s.type,!0);case 31:return Re("Activity");case 30:return Re("ViewTransition");default:return""}}function Et(s){try{var l="",u=null;do l+=rt(s,u),u=s,s=s.return;while(s);return l}catch(d){return`
7
+ Error generating stack: `+d.message+`
8
+ `+d.stack}}var yt=Object.prototype.hasOwnProperty,hn=t.unstable_scheduleCallback,qt=t.unstable_cancelCallback,tn=t.unstable_shouldYield,qe=t.unstable_requestPaint,st=t.unstable_now,Lt=t.unstable_getCurrentPriorityLevel,ot=t.unstable_ImmediatePriority,lt=t.unstable_UserBlockingPriority,vt=t.unstable_NormalPriority,Tt=t.unstable_LowPriority,un=t.unstable_IdlePriority,Ce=t.log,Qe=t.unstable_setDisableYieldValue,Ae=null,Oe=null;function Ke(s){if(typeof Ce=="function"&&Qe(s),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Ae,s)}catch{}}var Xe=Math.clz32?Math.clz32:at,dt=Math.log,Ge=Math.LN2;function at(s){return s>>>=0,s===0?32:31-(dt(s)/Ge|0)|0}var pt=256,zt=262144,pn=4194304;function Cn(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&-s;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function gr(s,l,u){var d=s.pendingLanes;if(d===0)return 0;var g=0,v=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var P=d&134217727;return P!==0?(d=P&~v,d!==0?g=Cn(d):(R&=P,R!==0?g=Cn(R):u||(u=P&~s,u!==0&&(g=Cn(u))))):(P=d&~v,P!==0?g=Cn(P):R!==0?g=Cn(R):u||(u=d&~s,u!==0&&(g=Cn(u)))),g===0?0:l!==0&&l!==g&&(l&v)===0&&(v=g&-g,u=l&-l,v>=u||v===32&&(u&4194048)!==0)?l:g}function yr(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function ra(s,l){(l&8)!==0&&(l|=l&32);var u=s.entangledLanes;if(u!==0)for(s=s.entanglements,u&=l;0<u;){var d=31-Xe(u),g=1<<d;l|=s[d],u&=~g}return l}function Ad(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function aC(){var s=pn;return pn<<=1,(pn&62914560)===0&&(pn=4194304),s}function dy(s){for(var l=[],u=0;31>u;u++)l.push(s);return l}function Ju(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function m_(s,l,u,d,g,v){var R=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var P=s.entanglements,_=s.expirationTimes,ee=s.hiddenUpdates;for(u=R&~u;0<u;){var oe=31-Xe(u),pe=1<<oe;P[oe]=0,_[oe]=-1;var Q=ee[oe];if(Q!==null)for(ee[oe]=null,oe=0;oe<Q.length;oe++){var re=Q[oe];re!==null&&(re.lane&=-536870913)}u&=~pe}d!==0&&uC(s,d,0),v!==0&&g===0&&s.tag!==0&&(s.suspendedLanes|=v&~(R&~l))}function uC(s,l,u){s.pendingLanes|=l,s.suspendedLanes&=~l;var d=31-Xe(l);s.entangledLanes|=l,s.entanglements[d]=s.entanglements[d]|1073741824|u&261930}function cC(s,l){var u=s.entangledLanes|=l;for(s=s.entanglements;u;){var d=31-Xe(u),g=1<<d;g&l|s[d]&l&&(s[d]|=l),u&=~g}}function fC(s,l){var u=l&-l;return u=(u&42)!==0?1:hy(u),(u&(s.suspendedLanes|l))!==0?0:u}function hy(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function py(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function dC(){var s=ue.p;return s!==0?s:(s=window.event,s===void 0?32:bA(s.type))}function hC(s,l){var u=ue.p;try{return ue.p=s,l()}finally{ue.p=u}}var xs=Math.random().toString(36).slice(2),qn="__reactFiber$"+xs,wi="__reactProps$"+xs,sa="__reactContainer$"+xs,pC="__reactEvents$"+xs,g_="__reactListeners$"+xs,y_="__reactHandles$"+xs,mC="__reactResources$"+xs,ec="__reactMarker$"+xs,Od="__reactLoad$"+xs;function Md(s){delete s[qn],delete s[wi],delete s[g_],delete s[y_]}function nl(s){var l;if(l=s[qn])return l;for(var u=s.parentNode;u;){if(l=u[sa]||u[qn]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(s=JR(s);s!==null;){if(u=s[qn])return u;s=JR(s)}return l}s=u,u=s.parentNode}return null}function oa(s){if(s=s[qn]||s[sa]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function tc(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(i(33))}function la(s){var l=s[mC];return l||(l=s[mC]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function _n(s){s[ec]=!0}function gC(s){s[Od]=void 0}var yC=new Set,vC={};function il(s,l){aa(s,l),aa(s+"Capture",l)}function aa(s,l){for(vC[s]=l,s=0;s<l.length;s++)yC.add(l[s])}var v_=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),bC={},SC={};function b_(s){return yt.call(SC,s)?!0:yt.call(bC,s)?!1:v_.test(s)?SC[s]=!0:(bC[s]=!0,!1)}var Pt=!1;function xC(){var s=Pt;return Pt=!1,s}function Dd(s,l,u){if(b_(l))if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var d=l.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,u)}}function kd(s,l,u){if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,u)}}function ws(s,l,u,d){if(d===null)s.removeAttribute(u);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(l,u,d)}}function Ni(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function wC(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function S_(s,l,u){var d=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,v=d.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return g.call(this)},set:function(R){u=""+R,v.call(this,R)}}),Object.defineProperty(s,l,{enumerable:d.enumerable}),{getValue:function(){return u},setValue:function(R){u=""+R},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function my(s){if(!s._valueTracker){var l=wC(s)?"checked":"value";s._valueTracker=S_(s,l,""+s[l])}}function CC(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var u=l.getValue(),d="";return s&&(d=wC(s)?s.checked?"true":"false":s.value),s=d,s!==u?(l.setValue(s),!0):!1}var x_=/[\n"\\]/g;function Wi(s){return s.replace(x_,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function gy(s,l,u,d,g,v,R,P){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),l!=null?R==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Ni(l)):s.value!==""+Ni(l)&&(s.value=""+Ni(l)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),l!=null?R==="number"&&s.value==l?yy(s,Ni(s.value)):yy(s,Ni(l)):u!=null?yy(s,Ni(u)):d!=null&&s.removeAttribute("value"),g==null&&v!=null&&(s.defaultChecked=!!v),g!=null&&(s.checked=g&&typeof g!="function"&&typeof g!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.name=""+Ni(P):s.removeAttribute("name")}function EC(s,l,u,d,g,v,R,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(s.type=v),l!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||l!=null)){my(s);return}u=u!=null?""+Ni(u):"",l=l!=null?""+Ni(l):u,P||l===s.value||(s.value=l),s.defaultValue=l}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,s.checked=P?s.checked:!!d,s.defaultChecked=!!d,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),my(s)}function yy(s,l){s.defaultValue!==""+l&&(s.defaultValue=""+l)}function ua(s,l,u,d){if(s=s.options,l){l={};for(var g=0;g<u.length;g++)l["$"+u[g]]=!0;for(u=0;u<s.length;u++)g=l.hasOwnProperty("$"+s[u].value),s[u].selected!==g&&(s[u].selected=g),g&&d&&(s[u].defaultSelected=!0)}else{for(u=""+Ni(u),l=null,g=0;g<s.length;g++){if(s[g].value===u){s[g].selected=!0,d&&(s[g].defaultSelected=!0);return}l!==null||s[g].disabled||(l=s[g])}l!==null&&(l.selected=!0)}}function TC(s,l,u){if(l!=null&&(l=""+Ni(l),l!==s.value&&(s.value=l),u==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=u!=null?""+Ni(u):""}function RC(s,l,u,d){if(l==null){if(d!=null){if(u!=null)throw Error(i(92));if(ge(d)){if(1<d.length)throw Error(i(93));d=d[0]}u=d}u==null&&(u=""),l=u}u=Ni(l),s.defaultValue=u,d=s.textContent,d===u&&d!==""&&d!==null&&(s.value=d),my(s)}function ca(s,l){if(l){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=l;return}}s.textContent=l}var w_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function AC(s,l,u){var d=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?d?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":d?s.setProperty(l,u):typeof u!="number"||u===0||w_.has(l)?l==="float"?s.cssFloat=u:s[l]=(""+u).trim():s[l]=u+"px"}function OC(s,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(s=s.style,u!=null){for(var d in u)!u.hasOwnProperty(d)||l!=null&&l.hasOwnProperty(d)||(d.indexOf("--")===0?s.setProperty(d,""):d==="float"?s.cssFloat="":s[d]="",Pt=!0);for(var g in l)d=l[g],l.hasOwnProperty(g)&&u[g]!==d&&(AC(s,g,d),Pt=!0)}else for(var v in l)l.hasOwnProperty(v)&&AC(s,v,l[v])}function vy(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var C_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),E_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Pd(s){return E_.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function zr(){}var by=null;function Sy(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var fa=null,da=null;function MC(s){var l=oa(s);if(l&&(s=l.stateNode)){var u=s[wi]||null;e:switch(s=l.stateNode,l.type){case"input":if(gy(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Wi(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var d=u[l];if(d!==s&&d.form===s.form){var g=d[wi]||null;if(!g)throw Error(i(90));gy(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(l=0;l<u.length;l++)d=u[l],d.form===s.form&&CC(d)}break e;case"textarea":TC(s,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&ua(s,!!u.multiple,l,!1)}}}var xy=!1;function DC(s,l,u){if(xy)return s(l,u);xy=!0;try{var d=s(l);return d}finally{if(xy=!1,(fa!==null||da!==null)&&(Ph(),fa&&(l=fa,s=da,da=fa=null,MC(l),s)))for(l=0;l<s.length;l++)MC(s[l])}}function nc(s,l){var u=s.stateNode;if(u===null)return null;var d=u[wi]||null;if(d===null)return null;u=d[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(s=s.type,d=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!d;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var Cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wy=!1;if(Cs)try{var ic={};Object.defineProperty(ic,"passive",{get:function(){wy=!0}}),window.addEventListener("test",ic,ic),window.removeEventListener("test",ic,ic)}catch{wy=!1}var to=null,Cy=null,Id=null;function kC(){if(Id)return Id;var s,l=Cy,u=l.length,d,g="value"in to?to.value:to.textContent,v=g.length;for(s=0;s<u&&l[s]===g[s];s++);var R=u-s;for(d=1;d<=R&&l[u-d]===g[v-d];d++);return Id=g.slice(s,1<d?1-d:void 0)}function Nd(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Ld(){return!0}function PC(){return!1}function ci(s){function l(u,d,g,v,R){this._reactName=u,this._targetInst=g,this.type=d,this.nativeEvent=v,this.target=R,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(u=s[P],this[P]=u?u(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ld:PC,this.isPropagationStopped=PC,this}return M(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ld)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ld)},persist:function(){},isPersistent:Ld}),l}var no={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bd=ci(no),rc=M({},no,{view:0,detail:0}),T_=ci(rc),Ey,Ty,sc,Vd=M({},rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ay,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==sc&&(sc&&s.type==="mousemove"?(Ey=s.screenX-sc.screenX,Ty=s.screenY-sc.screenY):Ty=Ey=0,sc=s),Ey)},movementY:function(s){return"movementY"in s?s.movementY:Ty}}),IC=ci(Vd),R_=M({},Vd,{dataTransfer:0}),A_=ci(R_),O_=M({},rc,{relatedTarget:0}),Ry=ci(O_),M_=M({},no,{animationName:0,elapsedTime:0,pseudoElement:0}),D_=ci(M_),k_=M({},no,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),P_=ci(k_),I_=M({},no,{data:0}),NC=ci(I_),N_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},L_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},B_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function V_(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=B_[s])?!!l[s]:!1}function Ay(){return V_}var z_=M({},rc,{key:function(s){if(s.key){var l=N_[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Nd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?L_[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ay,charCode:function(s){return s.type==="keypress"?Nd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Nd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),__=ci(z_),H_=M({},Vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),LC=ci(H_),F_=M({},no,{submitter:0}),U_=ci(F_),j_=M({},rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ay}),K_=ci(j_),Y_=M({},no,{propertyName:0,elapsedTime:0,pseudoElement:0}),q_=ci(Y_),G_=M({},Vd,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),W_=ci(G_),X_=M({},no,{newState:0,oldState:0,source:0}),$_=ci(X_),Q_=[9,13,27,32],Oy=Cs&&"CompositionEvent"in window,oc=null;Cs&&"documentMode"in document&&(oc=document.documentMode);var Z_=Cs&&"TextEvent"in window&&!oc,BC=Cs&&(!Oy||oc&&8<oc&&11>=oc),VC=" ",zC=!1;function _C(s,l){switch(s){case"keyup":return Q_.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ha=!1;function J_(s,l){switch(s){case"compositionend":return HC(l);case"keypress":return l.which!==32?null:(zC=!0,VC);case"textInput":return s=l.data,s===VC&&zC?null:s;default:return null}}function e4(s,l){if(ha)return s==="compositionend"||!Oy&&_C(s,l)?(s=kC(),Id=Cy=to=null,ha=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return BC&&l.locale!=="ko"?null:l.data;default:return null}}var t4={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function FC(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!t4[s.type]:l==="textarea"}function UC(s,l,u,d){fa?da?da.push(d):da=[d]:fa=d,l=zh(l,"onChange"),0<l.length&&(u=new Bd("onChange","change",null,u,d),s.push({event:u,listeners:l}))}var lc=null,ac=null;function n4(s){MR(s,0)}function zd(s){var l=tc(s);if(CC(l))return s}function jC(s,l){if(s==="change")return l}var KC=!1;if(Cs){var My;if(Cs){var Dy="oninput"in document;if(!Dy){var YC=document.createElement("div");YC.setAttribute("oninput","return;"),Dy=typeof YC.oninput=="function"}My=Dy}else My=!1;KC=My&&(!document.documentMode||9<document.documentMode)}function qC(){lc&&(lc.detachEvent("onpropertychange",GC),ac=lc=null)}function GC(s){if(s.propertyName==="value"&&zd(ac)){var l=[];UC(l,ac,s,Sy(s)),DC(n4,l)}}function i4(s,l,u){s==="focusin"?(qC(),lc=l,ac=u,lc.attachEvent("onpropertychange",GC)):s==="focusout"&&qC()}function r4(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return zd(ac)}function s4(s,l){if(s==="click")return zd(l)}function o4(s,l){if(s==="input"||s==="change")return zd(l)}function l4(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var Li=typeof Object.is=="function"?Object.is:l4;function uc(s,l){if(Li(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var u=Object.keys(s),d=Object.keys(l);if(u.length!==d.length)return!1;for(d=0;d<u.length;d++){var g=u[d];if(!yt.call(l,g)||!Li(s[g],l[g]))return!1}return!0}function ky(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function WC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function XC(s,l){var u=WC(s);s=0;for(var d;u;){if(u.nodeType===3){if(d=s+u.textContent.length,s<=l&&d>=l)return{node:u,offset:l-s};s=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=WC(u)}}function $C(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?$C(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function QC(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=ky(s.document);l instanceof s.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)s=l.contentWindow;else break;l=ky(s.document)}return l}function Py(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var a4=Cs&&"documentMode"in document&&11>=document.documentMode,pa=null,Iy=null,cc=null,Ny=!1;function ZC(s,l,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Ny||pa==null||pa!==ky(d)||(d=pa,"selectionStart"in d&&Py(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),cc&&uc(cc,d)||(cc=d,d=zh(Iy,"onSelect"),0<d.length&&(l=new Bd("onSelect","select",null,l,u),s.push({event:l,listeners:d}),l.target=pa)))}function rl(s,l){var u={};return u[s.toLowerCase()]=l.toLowerCase(),u["Webkit"+s]="webkit"+l,u["Moz"+s]="moz"+l,u}var ma={animationend:rl("Animation","AnimationEnd"),animationiteration:rl("Animation","AnimationIteration"),animationstart:rl("Animation","AnimationStart"),transitionrun:rl("Transition","TransitionRun"),transitionstart:rl("Transition","TransitionStart"),transitioncancel:rl("Transition","TransitionCancel"),transitionend:rl("Transition","TransitionEnd")},Ly={},JC={};Cs&&(JC=document.createElement("div").style,"AnimationEvent"in window||(delete ma.animationend.animation,delete ma.animationiteration.animation,delete ma.animationstart.animation),"TransitionEvent"in window||delete ma.transitionend.transition);function sl(s){if(Ly[s])return Ly[s];if(!ma[s])return s;var l=ma[s],u;for(u in l)if(l.hasOwnProperty(u)&&u in JC)return Ly[s]=l[u];return s}var eE=sl("animationend"),tE=sl("animationiteration"),nE=sl("animationstart"),u4=sl("transitionrun"),c4=sl("transitionstart"),f4=sl("transitioncancel"),iE=sl("transitionend"),rE=new Map,By="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");By.push("scrollEnd");function vr(s,l){rE.set(s,l),il(l,[s])}var d4=0;function Es(s,l){if(s.name!=null&&s.name!=="auto")return s.name;if(l.autoName!==null)return l.autoName;s=wr.identifierPrefix;var u=d4++;return s="_"+s+"t_"+u.toString(32)+"_",l.autoName=s}function sE(s){if(s==null||typeof s=="string")return s;var l=null,u=La;if(u!==null)for(var d=0;d<u.length;d++){var g=s[u[d]];if(g!=null){if(g==="none")return"none";l=l==null?g:l+(" "+g)}}return l??s.default}function Ts(s,l){return s=sE(s),l=sE(l),l==null?s==="auto"?null:s:l==="auto"?null:l}var _d=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Xi=[],ga=0,Vy=0;function Hd(){for(var s=ga,l=Vy=ga=0;l<s;){var u=Xi[l];Xi[l++]=null;var d=Xi[l];Xi[l++]=null;var g=Xi[l];Xi[l++]=null;var v=Xi[l];if(Xi[l++]=null,d!==null&&g!==null){var R=d.pending;R===null?g.next=g:(g.next=R.next,R.next=g),d.pending=g}v!==0&&oE(u,g,v)}}function Fd(s,l,u,d){Xi[ga++]=s,Xi[ga++]=l,Xi[ga++]=u,Xi[ga++]=d,Vy|=d,s.lanes|=d,s=s.alternate,s!==null&&(s.lanes|=d)}function zy(s,l,u,d){return Fd(s,l,u,d),Ud(s)}function ol(s,l){return Fd(s,null,null,l),Ud(s)}function oE(s,l,u){s.lanes|=u;var d=s.alternate;d!==null&&(d.lanes|=u);for(var g=!1,v=s.return;v!==null;)v.childLanes|=u,d=v.alternate,d!==null&&(d.childLanes|=u),v.tag===22&&(s=v.stateNode,s===null||s._visibility&1||(g=!0)),s=v,v=v.return;return s.tag===3?(v=s.stateNode,g&&l!==null&&(g=31-Xe(u),s=v.hiddenUpdates,d=s[g],d===null?s[g]=[l]:d.push(l),l.lane=u|536870912),v):null}function Ud(s){if(50<Pc)throw Pc=0,kh=null,Error(i(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var ya={};function h4(s,l,u,d){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ci(s,l,u,d){return new h4(s,l,u,d)}function _y(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Rs(s,l){var u=s.alternate;return u===null?(u=Ci(s.tag,l,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=l,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&1206910976,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,l=s.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function lE(s,l){s.flags&=1206910978;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,l=u.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function jd(s,l,u,d,g,v){var R=0;if(d=s,typeof d=="function")_y(d)&&(R=1);else if(typeof d=="string")R=F5(s,u,ve.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(d){case te:return s=Ci(31,u,l,g),s.elementType=te,s.lanes=v,s;case H:return ll(u.children,g,v,l);case U:R=8,g|=24;break;case F:return s=Ci(12,u,l,g|2),s.elementType=F,s.lanes=v,s;case X:return s=Ci(13,u,l,g),s.elementType=X,s.lanes=v,s;case j:return s=Ci(19,u,l,g),s.elementType=j,s.lanes=v,s;case N:case q:return s=g|32,s=Ci(30,u,l,s),s.elementType=q,s.lanes=v,s.stateNode={autoName:null,paired:null,clones:null,ref:null},s;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case z:R=10;break e;case K:R=9;break e;case V:R=11;break e;case Y:R=14;break e;case $:R=16,d=null;break e}R=29,u=Error(i(130,s===null?"null":typeof s,"")),d=null}return l=Ci(R,u,l,g),l.elementType=s,l.type=d,l.lanes=v,l}function ll(s,l,u,d){return s=Ci(7,s,d,l),s.lanes=u,s}function Hy(s,l,u){return s=Ci(6,s,null,l),s.lanes=u,s}function aE(s){var l=Ci(18,null,null,0);return l.stateNode=s,l}function Fy(s,l,u){return l=Ci(4,s.children!==null?s.children:[],s.key,l),l.lanes=u,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var uE=new WeakMap;function $i(s,l){if(typeof s=="object"&&s!==null){var u=uE.get(s);return u!==void 0?u:(l={value:s,source:l,stack:Et(l)},uE.set(s,l),l)}return{value:s,source:l,stack:Et(l)}}var va=[],ba=0,Kd=null,fc=0,Qi=[],Zi=0,io=null,_r=1,Hr="";function As(s,l){va[ba++]=fc,va[ba++]=Kd,Kd=s,fc=l}function cE(s,l,u){Qi[Zi++]=_r,Qi[Zi++]=Hr,Qi[Zi++]=io,io=s;var d=_r;s=Hr;var g=32-Xe(d)-1;d&=~(1<<g),u+=1;var v=32-Xe(l)+g;if(30<v){var R=g-g%5;v=(d&(1<<R)-1).toString(32),d>>=R,g-=R,_r=1<<32-Xe(l)+g|u<<g|d,Hr=v+s}else _r=1<<v|u<<g|d,Hr=s}function Yd(s){s.return!==null&&(As(s,1),cE(s,1,0))}function Uy(s){for(;s===Kd;)Kd=va[--ba],va[ba]=null,fc=va[--ba],va[ba]=null;for(;s===io;)io=Qi[--Zi],Qi[Zi]=null,Hr=Qi[--Zi],Qi[Zi]=null,_r=Qi[--Zi],Qi[Zi]=null}function fE(s,l){Qi[Zi++]=_r,Qi[Zi++]=Hr,Qi[Zi++]=io,_r=l.id,Hr=l.overflow,io=s}var Hn=null,nn=null,ht=!1,ro=null,Ji=!1,jy=Error(i(519));function so(s){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dc($i(l,s)),jy}function dE(s){var l=s.stateNode,u=s.type,d=s.memoizedProps;switch(l[qn]=s,l[wi]=d,u){case"dialog":St("cancel",l),St("close",l);break;case"iframe":case"object":case"embed":St("load",l);break;case"video":case"audio":for(u=0;u<Nc.length;u++)St(Nc[u],l);break;case"source":St("error",l);break;case"img":case"image":case"link":St("error",l),St("load",l);break;case"details":St("toggle",l);break;case"input":St("invalid",l),EC(l,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":St("invalid",l);break;case"textarea":St("invalid",l),RC(l,d.value,d.defaultValue,d.children)}u=d.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||d.suppressHydrationWarning===!0||IR(l.textContent,u)?(d.popover!=null&&(St("beforetoggle",l),St("toggle",l)),d.onScroll!=null&&St("scroll",l),d.onScrollEnd!=null&&St("scrollend",l),d.onClick!=null&&(l.onclick=zr),l=!0):l=!1,l||so(s,!0)}function qd(s){for(Hn=s.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Ji=!1;return;case 27:case 3:Ji=!0;return;default:Hn=Hn.return}}function Sa(s){if(s!==Hn)return!1;if(!ht)return qd(s),ht=!0,!1;var l=s.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||b0(s.type,s.memoizedProps)),u=!u),u&&nn&&so(s),qd(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));nn=ZR(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));nn=ZR(s)}else l===27?(l=nn,wo(s.type)?(s=O0,O0=null,nn=s):nn=l):nn=Hn?tr(s.stateNode.nextSibling):null;return!0}function al(){nn=Hn=null,ht=!1}function Ky(){var s=ro;return s!==null&&(Ri===null?Ri=s:Ri.push.apply(Ri,s),ro=null),s}function dc(s){ro===null?ro=[s]:ro.push(s)}var Yy=Ee(null),ul=null,Os=null;function oo(s,l,u){Be(Yy,l._currentValue),l._currentValue=u}function Ms(s){s._currentValue=Yy.current,Me(Yy)}function Gd(s,l,u){for(;s!==null;){var d=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,d!==null&&(d.childLanes|=l)):d!==null&&(d.childLanes&l)!==l&&(d.childLanes|=l),s===u)break;s=s.return}}function qy(s,l,u,d){var g=s.child;for(g!==null&&(g.return=s);g!==null;){var v=g.dependencies;if(v!==null){var R=g.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=g;for(var _=0;_<l.length;_++)if(P.context===l[_]){v.lanes|=u,P=v.alternate,P!==null&&(P.lanes|=u),Gd(v.return,u,s),d||(R=null);break e}v=P.next}}else if(g.tag===18){if(R=g.return,R===null)throw Error(i(341));R.lanes|=u,v=R.alternate,v!==null&&(v.lanes|=u),Gd(R,u,s),R=null}else g.tag===13&&g.memoizedState!==null&&g.memoizedState.dehydrated===null?(g.lanes|=u,R=g.alternate,R!==null&&(R.lanes|=u),Gd(g.return,u,s),R=g.child,R=R!==null?R.sibling:null):R=g.child;if(R!==null)R.return=g;else for(R=g;R!==null;){if(R===s){R=null;break}if(g=R.sibling,g!==null){g.return=R.return,R=g;break}R=R.return}g=R}}function cl(s,l,u,d){s=null;for(var g=l,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var R=g.alternate;if(R===null)throw Error(i(387));if(R=R.memoizedProps,R!==null){var P=g.type;Li(g.pendingProps.value,R.value)||(s!==null?s.push(P):s=[P])}}else if(g===ke.current){if(R=g.alternate,R===null)throw Error(i(387));R.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(s!==null?s.push(Ya):s=[Ya])}g=g.return}return s!==null&&qy(l,s,u,d),l.flags|=262144,s!==null}function Wd(s){for(s=s.firstContext;s!==null;){if(!Li(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function fl(s){ul=s,Os=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Gn(s){return hE(ul,s)}function Xd(s,l){return ul===null&&fl(s),hE(s,l)}function hE(s,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Os===null){if(s===null)throw Error(i(308));Os=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Os=Os.next=l;return u}var p4=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(u,d){s.push(d)}};this.abort=function(){l.aborted=!0,s.forEach(function(u){return u()})}},m4=t.unstable_scheduleCallback,g4=t.unstable_NormalPriority,En={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gy(){return{controller:new p4,data:new Map,refCount:0}}function hc(s){s.refCount--,s.refCount===0&&m4(g4,function(){s.controller.abort()})}function pE(s,l){if((s.pendingLanes&4194048)!==0){var u=s.transitionTypes;for(u===null&&(u=s.transitionTypes=[]),s=0;s<l.length;s++){var d=l[s];u.indexOf(d)===-1&&u.push(d)}}}var pc=null;function y4(s){var l=s.transitionTypes;return s.transitionTypes=null,l}var mc=null,Wy=0,dl=0,xa=null;function v4(s,l){if(mc===null){var u=mc=[];Wy=0,dl=c0(),xa={status:"pending",value:void 0,then:function(d){u.push(d)}}}return Wy++,l.then(mE,mE),l}function mE(){if(--Wy===0&&(pc=null,mc!==null)){xa!==null&&(xa.status="fulfilled");var s=mc;mc=null,dl=0,xa=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function b4(s,l){var u=[],d={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return s.then(function(){d.status="fulfilled",d.value=l;for(var g=0;g<u.length;g++)(0,u[g])(l)},function(g){for(d.status="rejected",d.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),d}var gE=ce.S;ce.S=function(s,l){if(aR=st(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&v4(s,l),pc!==null)for(var u=_a;u!==null;)pE(u,pc),u=u.next;if(u=s.types,u!==null){for(var d=_a;d!==null;)pE(d,u),d=d.next;if(dl!==0){d=pc,d===null&&(d=pc=[]);for(var g=0;g<u.length;g++){var v=u[g];d.indexOf(v)===-1&&d.push(v)}}}gE!==null&&gE(s,l)};var hl=Ee(null);function Xy(){var s=hl.current;return s!==null?s:Gt.pooledCache}function $d(s,l){l===null?Be(hl,hl.current):Be(hl,l.pool)}function yE(){var s=Xy();return s===null?null:{parent:En._currentValue,pool:s}}var wa=Error(i(460)),$y=Error(i(474)),Qd=Error(i(542)),Zd={then:function(){}};function vE(s){return s=s.status,s==="fulfilled"||s==="rejected"}function bE(s,l,u){switch(u=s[u],u===void 0?s.push(l):u!==l&&(l.then(zr,zr),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,xE(s),s===void 0&&!("reason"in l)?Error(i(600)):s;default:if(typeof l.status=="string")l.then(zr,zr);else{if(s=Gt,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=l,s.status="pending",s.then(function(d){if(l.status==="pending"){var g=l;g.status="fulfilled",g.value=d}},function(d){if(l.status==="pending"){var g=l;g.status="rejected",g.reason=d}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,xE(s),s}throw ml=l,wa}}function pl(s){try{var l=s._init;return l(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(ml=u,wa):u}}var ml=null;function SE(){if(ml===null)throw Error(i(459));var s=ml;return ml=null,s}function xE(s){if(s===wa||s===Qd)throw Error(i(483))}var Ca=null,gc=0;function Jd(s){var l=gc;return gc+=1,Ca===null&&(Ca=[]),bE(Ca,s,l)}function lo(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function eh(s,l){throw l.$$typeof===I?Error(i(525)):(s=Object.prototype.toString.call(l),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function wE(s){function l(J,W){if(s){var ie=J.deletions;ie===null?(J.deletions=[W],J.flags|=16):ie.push(W)}}function u(J,W){if(!s)return null;for(;W!==null;)l(J,W),W=W.sibling;return null}function d(J){for(var W=new Map;J!==null;)J.key===null?W.set(J.index,J):W.set(J.key,J),J=J.sibling;return W}function g(J,W){return J=Rs(J,W),J.index=0,J.sibling=null,J}function v(J,W,ie){return J.index=ie,s?(ie=J.alternate,ie!==null?(ie=ie.index,ie<W?(J.flags|=2,W):ie):(J.flags|=134217730,W)):(J.flags|=1048576,W)}function R(J){return s&&J.alternate===null&&(J.flags|=134217730),J}function P(J,W,ie,he){return W===null||W.tag!==6?(W=Hy(ie,J.mode,he),W.return=J,W):(W=g(W,ie),W.return=J,W)}function _(J,W,ie,he){var Fe=ie.type;return Fe===H?(J=oe(J,W,ie.props.children,he,ie.key),lo(J,ie),J):W!==null&&(W.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===$&&pl(Fe)===W.type)?(W=g(W,ie.props),lo(W,ie),W.return=J,W):(W=jd(ie.type,ie.key,ie.props,null,J.mode,he),lo(W,ie),W.return=J,W)}function ee(J,W,ie,he){return W===null||W.tag!==4||W.stateNode.containerInfo!==ie.containerInfo||W.stateNode.implementation!==ie.implementation?(W=Fy(ie,J.mode,he),W.return=J,W):(W=g(W,ie.children||[]),W.return=J,W)}function oe(J,W,ie,he,Fe){return W===null||W.tag!==7?(W=ll(ie,J.mode,he,Fe),W.return=J,W):(W=g(W,ie),W.return=J,W)}function pe(J,W,ie){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Hy(""+W,J.mode,ie),W.return=J,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case L:return ie=jd(W.type,W.key,W.props,null,J.mode,ie),lo(ie,W),ie.return=J,ie;case B:return W=Fy(W,J.mode,ie),W.return=J,W;case $:return W=pl(W),pe(J,W,ie)}if(ge(W)||ae(W))return W=ll(W,J.mode,ie,null),W.return=J,W;if(typeof W.then=="function")return pe(J,Jd(W),ie);if(W.$$typeof===z)return pe(J,Xd(J,W),ie);eh(J,W)}return null}function Q(J,W,ie,he){var Fe=W!==null?W.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Fe!==null?null:P(J,W,""+ie,he);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case L:return ie.key===Fe?_(J,W,ie,he):null;case B:return ie.key===Fe?ee(J,W,ie,he):null;case $:return ie=pl(ie),Q(J,W,ie,he)}if(ge(ie)||ae(ie))return Fe!==null?null:oe(J,W,ie,he,null);if(typeof ie.then=="function")return Q(J,W,Jd(ie),he);if(ie.$$typeof===z)return Q(J,W,Xd(J,ie),he);eh(J,ie)}return null}function re(J,W,ie,he,Fe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return J=J.get(ie)||null,P(W,J,""+he,Fe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case L:return J=J.get(he.key===null?ie:he.key)||null,_(W,J,he,Fe);case B:return J=J.get(he.key===null?ie:he.key)||null,ee(W,J,he,Fe);case $:return he=pl(he),re(J,W,ie,he,Fe)}if(ge(he)||ae(he))return J=J.get(ie)||null,oe(W,J,he,Fe,null);if(typeof he.then=="function")return re(J,W,ie,Jd(he),Fe);if(he.$$typeof===z)return re(J,W,ie,Xd(W,he),Fe);eh(W,he)}return null}function Ne(J,W,ie,he){for(var Fe=null,Ct=null,$e=W,et=W=0,An=null;$e!==null&&et<ie.length;et++){$e.index>et?(An=$e,$e=null):An=$e.sibling;var Rt=Q(J,$e,ie[et],he);if(Rt===null){$e===null&&($e=An);break}s&&$e&&Rt.alternate===null&&l(J,$e),W=v(Rt,W,et),Ct===null?Fe=Rt:Ct.sibling=Rt,Ct=Rt,$e=An}if(et===ie.length)return u(J,$e),ht&&As(J,et),Fe;if($e===null){for(;et<ie.length;et++)$e=pe(J,ie[et],he),$e!==null&&(W=v($e,W,et),Ct===null?Fe=$e:Ct.sibling=$e,Ct=$e);return ht&&As(J,et),Fe}for($e=d($e);et<ie.length;et++)An=re($e,J,et,ie[et],he),An!==null&&(s&&(Rt=An.alternate,Rt!==null&&$e.delete(Rt.key===null?et:Rt.key)),W=v(An,W,et),Ct===null?Fe=An:Ct.sibling=An,Ct=An);return s&&$e.forEach(function(Ao){return l(J,Ao)}),ht&&As(J,et),Fe}function Ue(J,W,ie,he){if(ie==null)throw Error(i(151));for(var Fe=null,Ct=null,$e=W,et=W=0,An=null,Rt=ie.next();$e!==null&&!Rt.done;et++,Rt=ie.next()){$e.index>et?(An=$e,$e=null):An=$e.sibling;var Ao=Q(J,$e,Rt.value,he);if(Ao===null){$e===null&&($e=An);break}s&&$e&&Ao.alternate===null&&l(J,$e),W=v(Ao,W,et),Ct===null?Fe=Ao:Ct.sibling=Ao,Ct=Ao,$e=An}if(Rt.done)return u(J,$e),ht&&As(J,et),Fe;if($e===null){for(;!Rt.done;et++,Rt=ie.next())Rt=pe(J,Rt.value,he),Rt!==null&&(W=v(Rt,W,et),Ct===null?Fe=Rt:Ct.sibling=Rt,Ct=Rt);return ht&&As(J,et),Fe}for($e=d($e);!Rt.done;et++,Rt=ie.next())Rt=re($e,J,et,Rt.value,he),Rt!==null&&(s&&(An=Rt.alternate,An!==null&&$e.delete(An.key===null?et:An.key)),W=v(Rt,W,et),Ct===null?Fe=Rt:Ct.sibling=Rt,Ct=Rt);return s&&$e.forEach(function(J5){return l(J,J5)}),ht&&As(J,et),Fe}function ct(J,W,ie,he){if(typeof ie=="object"&&ie!==null&&ie.type===H&&ie.key===null&&ie.props.ref===void 0&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case L:e:{for(var Fe=ie.key;W!==null;){if(W.key===Fe){if(Fe=ie.type,Fe===H){if(W.tag===7){u(J,W.sibling),he=g(W,ie.props.children),lo(he,ie),he.return=J,J=he;break e}}else if(W.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===$&&pl(Fe)===W.type){u(J,W.sibling),he=g(W,ie.props),lo(he,ie),he.return=J,J=he;break e}u(J,W);break}else l(J,W);W=W.sibling}ie.type===H?(he=ll(ie.props.children,J.mode,he,ie.key),lo(he,ie),he.return=J,J=he):(he=jd(ie.type,ie.key,ie.props,null,J.mode,he),lo(he,ie),he.return=J,J=he)}return R(J);case B:e:{for(Fe=ie.key;W!==null;){if(W.key===Fe)if(W.tag===4&&W.stateNode.containerInfo===ie.containerInfo&&W.stateNode.implementation===ie.implementation){u(J,W.sibling),he=g(W,ie.children||[]),he.return=J,J=he;break e}else{u(J,W);break}else l(J,W);W=W.sibling}he=Fy(ie,J.mode,he),he.return=J,J=he}return R(J);case $:return ie=pl(ie),ct(J,W,ie,he)}if(ge(ie))return Ne(J,W,ie,he);if(ae(ie)){if(Fe=ae(ie),typeof Fe!="function")throw Error(i(150));return ie=Fe.call(ie),Ue(J,W,ie,he)}if(typeof ie.then=="function")return ct(J,W,Jd(ie),he);if(ie.$$typeof===z)return ct(J,W,Xd(J,ie),he);eh(J,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,W!==null&&W.tag===6?(u(J,W.sibling),he=g(W,ie),he.return=J,J=he):(u(J,W),he=Hy(ie,J.mode,he),he.return=J,J=he),R(J)):u(J,W)}return function(J,W,ie,he){try{gc=0;var Fe=ct(J,W,ie,he);return Ca=null,Fe}catch($e){if($e===wa||$e===Qd)throw $e;var Ct=Ci(29,$e,null,J.mode);return Ct.lanes=he,Ct.return=J,Ct}}}var gl=wE(!0),CE=wE(!1),ao=!1;function Qy(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zy(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function uo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function co(s,l,u){var d=s.updateQueue;if(d===null)return null;if(d=d.shared,(It&2)!==0){var g=d.pending;return g===null?l.next=l:(l.next=g.next,g.next=l),d.pending=l,l=Ud(s),oE(s,null,u),l}return Fd(s,d,l,u),Ud(s)}function yc(s,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var d=l.lanes;d&=s.pendingLanes,u|=d,l.lanes=u,cC(s,u)}}function Jy(s,l){var u=s.updateQueue,d=s.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var g=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var R={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?g=v=R:v=v.next=R,u=u.next}while(u!==null);v===null?g=v=l:v=v.next=l}else g=v=l;u={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=l}var ev=!1;function vc(){if(ev){var s=xa;if(s!==null)throw s}}function bc(s,l,u,d){ev=!1;var g=s.updateQueue;ao=!1;var v=g.firstBaseUpdate,R=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var _=P,ee=_.next;_.next=null,R===null?v=ee:R.next=ee,R=_;var oe=s.alternate;oe!==null&&(oe=oe.updateQueue,P=oe.lastBaseUpdate,P!==R&&(P===null?oe.firstBaseUpdate=ee:P.next=ee,oe.lastBaseUpdate=_))}if(v!==null){var pe=g.baseState;R=0,oe=ee=_=null,P=v;do{var Q=P.lane&-536870913,re=Q!==P.lane;if(re?(wt&Q)===Q:(d&Q)===Q){Q!==0&&Q===dl&&(ev=!0),oe!==null&&(oe=oe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ne=s,Ue=P;Q=l;var ct=u;switch(Ue.tag){case 1:if(Ne=Ue.payload,typeof Ne=="function"){pe=Ne.call(ct,pe,Q);break e}pe=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ue.payload,Q=typeof Ne=="function"?Ne.call(ct,pe,Q):Ne,Q==null)break e;pe=M({},pe,Q);break e;case 2:ao=!0}}Q=P.callback,Q!==null&&(s.flags|=64,re&&(s.flags|=8192),re=g.callbacks,re===null?g.callbacks=[Q]:re.push(Q))}else re={lane:Q,tag:P.tag,payload:P.payload,callback:P.callback,next:null},oe===null?(ee=oe=re,_=pe):oe=oe.next=re,R|=Q;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;re=P,P=re.next,re.next=null,g.lastBaseUpdate=re,g.shared.pending=null}}while(!0);oe===null&&(_=pe),g.baseState=_,g.firstBaseUpdate=ee,g.lastBaseUpdate=oe,v===null&&(g.shared.lanes=0),vo|=R,s.lanes=R,s.memoizedState=pe}}function EE(s,l){if(typeof s!="function")throw Error(i(191,s));s.call(l)}function TE(s,l){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)EE(u[s],l)}var fo=Ee(null),th=Ee(0);function RE(s,l){s=Ns,Be(th,s),Be(fo,l),Ns=s|l.baseLanes}function tv(){Be(th,Ns),Be(fo,fo.current)}function nv(){Ns=th.current,Me(fo),Me(th)}var Wn=Ee(null),si=null;function ho(s){var l=s.alternate;Be(Xn,Xn.current&1),Be(Wn,s),si===null&&(l===null||fo.current!==null||l.memoizedState!==null)&&(si=s)}function iv(s){Be(Xn,Xn.current),Be(Wn,s),si===null&&(si=s)}function AE(s){s.tag===22?(Be(Xn,Xn.current),Be(Wn,s),si===null&&(si=s)):po()}function po(){Be(Xn,Xn.current),Be(Wn,Wn.current)}function Bi(s){Me(Wn),si===s&&(si=null),Me(Xn)}var Xn=Ee(0);function Sc(s,l){Be(Wn,Wn.current),Be(Xn,l)}function rv(s){Me(Xn),Me(Wn),si===s&&(si=null)}function nh(s){for(var l=s;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||R0(u)||A0(u)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!=="independent"){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Ds=0,ut=null,jt=null,Tn=null,ih=!1,Ea=!1,yl=!1,rh=0,xc=0,Ta=null,S4=0;function mn(){throw Error(i(321))}function sv(s,l){if(l===null)return!1;for(var u=0;u<l.length&&u<s.length;u++)if(!Li(s[u],l[u]))return!1;return!0}function ov(s,l,u,d,g,v){return Ds=v,ut=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,ce.H=s===null||s.memoizedState===null?cT:fT,yl=!1,v=u(d,g),yl=!1,Ea&&(v=ME(l,u,d,g)),OE(s),v}function OE(s){ce.H=fh;var l=jt!==null&&jt.next!==null;if(Ds=0,Tn=jt=ut=null,ih=!1,xc=0,Ta=null,l)throw Error(i(300));s===null||Rn||(s=s.dependencies,s!==null&&Wd(s)&&(Rn=!0))}function ME(s,l,u,d){ut=s;var g=0;do{if(Ea&&(Ta=null),xc=0,Ea=!1,25<=g)throw Error(i(301));if(g+=1,Tn=jt=null,s.updateQueue!=null){var v=s.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}ce.H=O4,v=l(u,d)}while(Ea);return v}function x4(){var s=ce.H,l=s.useState()[0];return l=typeof l.then=="function"?wc(l):l,s=s.useState()[0],(jt!==null?jt.memoizedState:null)!==s&&(ut.flags|=1024),l}function lv(){var s=rh!==0;return rh=0,s}function av(s,l,u){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~u}function uv(s){if(ih){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}ih=!1}Ds=0,Tn=jt=ut=null,Ea=!1,xc=rh=0,Ta=null}function fi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?ut.memoizedState=Tn=s:Tn=Tn.next=s,Tn}function Sn(){if(jt===null){var s=ut.alternate;s=s!==null?s.memoizedState:null}else s=jt.next;var l=Tn===null?ut.memoizedState:Tn.next;if(l!==null)Tn=l,jt=s;else{if(s===null)throw ut.alternate===null?Error(i(467)):Error(i(310));jt=s,s={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Tn===null?ut.memoizedState=Tn=s:Tn=Tn.next=s}return Tn}function sh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wc(s){var l=xc;return xc+=1,Ta===null&&(Ta=[]),s=bE(Ta,s,l),l=ut,(Tn===null?l.memoizedState:Tn.next)===null&&(l=l.alternate,ce.H=l===null||l.memoizedState===null?cT:fT),s}function oh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return wc(s);if(s.$$typeof===G)return;if(s.$$typeof===z)return Gn(s)}throw Error(i(438,String(s)))}function cv(s){var l=null,u=ut.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var d=ut.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(l={data:d.data.map(function(g){return g.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=sh(),ut.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(s),d=0;d<s;d++)u[d]=ne;return l.index++,u}function ks(s,l){return typeof l=="function"?l(s):l}function lh(s){var l=Sn();return fv(l,jt,s)}function fv(s,l,u){var d=s.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=u;var g=s.baseQueue,v=d.pending;if(v!==null){if(g!==null){var R=g.next;g.next=v.next,v.next=R}l.baseQueue=g=v,d.pending=null}if(v=s.baseState,g===null)s.memoizedState=v;else{l=g.next;var P=R=null,_=null,ee=l,oe=!1;do{var pe=ee.lane&-536870913;if(pe!==ee.lane?(wt&pe)===pe:(Ds&pe)===pe){var Q=ee.revertLane;if(Q===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),pe===dl&&(oe=!0);else if((Ds&Q)===Q){ee=ee.next,Q===dl&&(oe=!0);continue}else pe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},_===null?(P=_=pe,R=v):_=_.next=pe,ut.lanes|=Q,vo|=Q;pe=ee.action,yl&&u(v,pe),v=ee.hasEagerState?ee.eagerState:u(v,pe)}else Q={lane:pe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},_===null?(P=_=Q,R=v):_=_.next=Q,ut.lanes|=pe,vo|=pe;ee=ee.next}while(ee!==null&&ee!==l);if(_===null?R=v:_.next=P,!Li(v,s.memoizedState)&&(Rn=!0,oe&&(u=xa,u!==null)))throw u;s.memoizedState=v,s.baseState=R,s.baseQueue=_,d.lastRenderedState=v}return g===null&&(d.lanes=0),[s.memoizedState,d.dispatch]}function dv(s){var l=Sn(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=s;var d=u.dispatch,g=u.pending,v=l.memoizedState;if(g!==null){u.pending=null;var R=g=g.next;do v=s(v,R.action),R=R.next;while(R!==g);Li(v,l.memoizedState)||(Rn=!0),l.memoizedState=v,l.baseQueue===null&&(l.baseState=v),u.lastRenderedState=v}return[v,d]}function DE(s,l,u){var d=ut,g=Sn(),v=ht;if(v){if(u===void 0)throw Error(i(407));u=u()}else u=l();var R=!Li((jt||g).memoizedState,u);if(R&&(g.memoizedState=u,Rn=!0),g=g.queue,mv(IE.bind(null,d,g,s),[s]),s=g.getSnapshot!==l||R||Tn!==null&&(Tn.memoizedState.tag&1)!==0,Ra(s?9:8,{destroy:void 0},PE.bind(null,d,g,u,l),null),s){if(d.flags|=2048,Gt===null)throw Error(i(349));v||(Ds&127)!==0||kE(d,l,u)}return u}function kE(s,l,u){s.flags|=16384,s={getSnapshot:l,value:u},l=ut.updateQueue,l===null?(l=sh(),ut.updateQueue=l,l.stores=[s]):(u=l.stores,u===null?l.stores=[s]:u.push(s))}function PE(s,l,u,d){l.value=u,l.getSnapshot=d,NE(l)&&LE(s)}function IE(s,l,u){return u(function(){NE(l)&&LE(s)})}function NE(s){var l=s.getSnapshot;s=s.value;try{var u=l();return!Li(s,u)}catch{return!0}}function LE(s){var l=ol(s,2);l!==null&&Ai(l,s,2)}function hv(s){var l=fi();if(typeof s=="function"){var u=s;if(s=u(),yl){Ke(!0);try{u()}finally{Ke(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:s},l}function BE(s,l,u,d){return s.baseState=u,fv(s,jt,typeof d=="function"?d:ks)}function w4(s,l,u,d,g){if(ch(s))throw Error(i(485));if(s=l.action,s!==null){var v={payload:g,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){v.listeners.push(R)}};ce.T!==null?u(!0):v.isTransition=!1,d(v),u=l.pending,u===null?(v.next=l.pending=v,VE(l,v)):(v.next=u.next,l.pending=u.next=v)}}function VE(s,l){var u=l.action,d=l.payload,g=s.state;if(l.isTransition){var v=ce.T,R={};R.types=v!==null?v.types:null,ce.T=R;try{var P=u(g,d),_=ce.S;_!==null&&_(R,P),zE(s,l,P)}catch(ee){pv(s,l,ee)}finally{v!==null&&R.types!==null&&(v.types=R.types),ce.T=v}}else try{v=u(g,d),zE(s,l,v)}catch(ee){pv(s,l,ee)}}function zE(s,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(d){_E(s,l,d)},function(d){return pv(s,l,d)}):_E(s,l,u)}function _E(s,l,u){l.status="fulfilled",l.value=u,HE(l),s.state=u,l=s.pending,l!==null&&(u=l.next,u===l?s.pending=null:(u=u.next,l.next=u,VE(s,u)))}function pv(s,l,u){var d=s.pending;if(s.pending=null,d!==null){d=d.next;do l.status="rejected",l.reason=u,HE(l),l=l.next;while(l!==d)}s.action=null}function HE(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function FE(s,l){return l}function UE(s,l){if(ht){var u=Gt.formState;if(u!==null){e:{var d=ut;if(ht){if(nn){t:{for(var g=nn,v=Ji;g.nodeType!==8;){if(!v){g=null;break t}if(g=tr(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){nn=tr(g.nextSibling),d=g.data==="F!";break e}}so(d)}d=!1}d&&(l=u[0])}}return u=fi(),u.memoizedState=u.baseState=l,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:FE,lastRenderedState:l},u.queue=d,u=lT.bind(null,ut,d),d.dispatch=u,d=hv(!1),v=Sv.bind(null,ut,!1,d.queue),d=fi(),g={state:l,dispatch:null,action:s,pending:null},d.queue=g,u=w4.bind(null,ut,g,v,u),g.dispatch=u,d.memoizedState=s,[l,u,!1]}function jE(s){var l=Sn();return KE(l,jt,s)}function KE(s,l,u){if(l=fv(s,l,FE)[0],s=lh(ks)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var d=wc(l)}catch(R){throw R===wa?Qd:R}else d=l;l=Sn();var g=l.queue,v=g.dispatch;return u!==l.memoizedState&&(ut.flags|=2048,Ra(9,{destroy:void 0},C4.bind(null,g,u),null)),[d,v,s]}function C4(s,l){s.action=l}function YE(s){var l=Sn(),u=jt;if(u!==null)return KE(l,u,s);Sn(),l=l.memoizedState,u=Sn();var d=u.queue.dispatch;return u.memoizedState=s,[l,d,!1]}function Ra(s,l,u,d){return s={tag:s,create:u,deps:d,inst:l,next:null},l=ut.updateQueue,l===null&&(l=sh(),ut.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=s.next=s:(d=u.next,u.next=s,s.next=d,l.lastEffect=s),s}function qE(){return Sn().memoizedState}function ah(s,l,u,d){var g=fi();ut.flags|=s,g.memoizedState=Ra(1|l,{destroy:void 0},u,d===void 0?null:d)}function uh(s,l,u,d){var g=Sn();d=d===void 0?null:d;var v=g.memoizedState.inst;jt!==null&&d!==null&&sv(d,jt.memoizedState.deps)?g.memoizedState=Ra(l,v,u,d):(ut.flags|=s,g.memoizedState=Ra(1|l,v,u,d))}function GE(s,l){ah(8390656,8,s,l)}function mv(s,l){uh(2048,8,s,l)}function E4(s){ut.flags|=4;var l=ut.updateQueue;if(l===null)l=sh(),ut.updateQueue=l,l.events=[s];else{var u=l.events;u===null?l.events=[s]:u.push(s)}}function WE(s){var l=Sn().memoizedState;return E4({ref:l,nextImpl:s}),function(){if((It&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function XE(s,l){return uh(4,2,s,l)}function $E(s,l){return uh(4,4,s,l)}function QE(s,l){if(typeof l=="function"){s=s();var u=l(s);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function ZE(s,l,u){u=u!=null?u.concat([s]):null,uh(4,4,QE.bind(null,l,s),u)}function gv(){}function JE(s,l){var u=Sn();l=l===void 0?null:l;var d=u.memoizedState;return l!==null&&sv(l,d[1])?d[0]:(u.memoizedState=[s,l],s)}function eT(s,l){var u=Sn();l=l===void 0?null:l;var d=u.memoizedState;if(l!==null&&sv(l,d[1]))return d[0];if(d=s(),yl){Ke(!0);try{s()}finally{Ke(!1)}}return u.memoizedState=[d,l],d}function yv(s,l,u){return u===void 0||(Ds&1073741824)!==0&&(wt&261930)===0?s.memoizedState=l:(s.memoizedState=u,s=cR(),ut.lanes|=s,vo|=s,u)}function tT(s,l,u,d){return Li(u,l)?u:fo.current!==null?(s=yv(s,u,d),Li(s,l)||(Rn=!0),s):(Ds&106)===0||(Ds&1073741824)!==0&&(wt&261930)===0?(Rn=!0,s.memoizedState=u):(s=cR(),ut.lanes|=s,vo|=s,l)}function nT(s,l,u,d,g){var v=ue.p;ue.p=v!==0&&8>v?v:8;var R=ce.T,P={};P.types=R!==null?R.types:null,ce.T=P,Sv(s,!1,l,u);try{var _=g(),ee=ce.S;if(ee!==null&&ee(P,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var oe=b4(_,d);Cc(s,l,oe,Hi(s))}else Cc(s,l,d,Hi(s))}catch(pe){Cc(s,l,{then:function(){},status:"rejected",reason:pe},Hi())}finally{ue.p=v,R!==null&&P.types!==null&&(R.types=P.types),ce.T=R}}function T4(){}function vv(s,l,u,d){if(s.tag!==5)throw Error(i(476));var g=iT(s).queue;nT(s,g,l,Te,u===null?T4:function(){return rT(s),u(d)})}function iT(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:Te},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:u},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function rT(s){var l=iT(s);l.next===null&&(l=s.alternate.memoizedState),Cc(s,l.next.queue,{},Hi())}function bv(){return Gn(Ya)}function sT(){return Sn().memoizedState}function oT(){return Sn().memoizedState}function R4(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var u=Hi();s=uo(u);var d=co(l,s,u);d!==null&&(Ai(d,l,u),yc(d,l,u)),l={cache:Gy()},s.payload=l;return}l=l.return}}function A4(s,l,u){var d=Hi();u={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ch(s)?aT(l,u):(u=zy(s,l,u,d),u!==null&&(Ai(u,s,d),uT(u,l,d)))}function lT(s,l,u){var d=Hi();Cc(s,l,u,d)}function Cc(s,l,u,d){var g={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ch(s))aT(l,g);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=l.lastRenderedReducer,v!==null))try{var R=l.lastRenderedState,P=v(R,u);if(g.hasEagerState=!0,g.eagerState=P,Li(P,R))return Fd(s,l,g,0),Gt===null&&Hd(),!1}catch{}if(u=zy(s,l,g,d),u!==null)return Ai(u,s,d),uT(u,l,d),!0}return!1}function Sv(s,l,u,d){if(d={lane:2,revertLane:c0(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ch(s)){if(l)throw Error(i(479))}else l=zy(s,u,d,2),l!==null&&Ai(l,s,2)}function ch(s){var l=s.alternate;return s===ut||l!==null&&l===ut}function aT(s,l){Ea=ih=!0;var u=s.pending;u===null?l.next=l:(l.next=u.next,u.next=l),s.pending=l}function uT(s,l,u){if((u&4194048)!==0){var d=l.lanes;d&=s.pendingLanes,u|=d,l.lanes=u,cC(s,u)}}var fh={readContext:Gn,use:oh,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useInsertionEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useSyncExternalStore:mn,useId:mn,useHostTransitionStatus:mn,useFormState:mn,useActionState:mn,useOptimistic:mn,useMemoCache:mn,useCacheRefresh:mn,useEffectEvent:mn},cT={readContext:Gn,use:oh,useCallback:function(s,l){return fi().memoizedState=[s,l===void 0?null:l],s},useContext:Gn,useEffect:GE,useImperativeHandle:function(s,l,u){u=u!=null?u.concat([s]):null,ah(4194308,4,QE.bind(null,l,s),u)},useLayoutEffect:function(s,l){return ah(4194308,4,s,l)},useInsertionEffect:function(s,l){ah(4,2,s,l)},useMemo:function(s,l){var u=fi();l=l===void 0?null:l;var d=s();if(yl){Ke(!0);try{s()}finally{Ke(!1)}}return u.memoizedState=[d,l],d},useReducer:function(s,l,u){var d=fi();if(u!==void 0){var g=u(l);if(yl){Ke(!0);try{u(l)}finally{Ke(!1)}}}else g=l;return d.memoizedState=d.baseState=g,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:g},d.queue=s,s=s.dispatch=A4.bind(null,ut,s),[d.memoizedState,s]},useRef:function(s){var l=fi();return s={current:s},l.memoizedState=s},useState:function(s){s=hv(s);var l=s.queue,u=lT.bind(null,ut,l);return l.dispatch=u,[s.memoizedState,u]},useDebugValue:gv,useDeferredValue:function(s,l){var u=fi();return yv(u,s,l)},useTransition:function(){var s=hv(!1);return s=nT.bind(null,ut,s.queue,!0,!1),fi().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,u){var d=ut,g=fi();if(ht){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),Gt===null)throw Error(i(349));(wt&127)!==0||kE(d,l,u)}g.memoizedState=u;var v={value:u,getSnapshot:l};return g.queue=v,GE(IE.bind(null,d,v,s),[s]),d.flags|=2048,Ra(9,{destroy:void 0},PE.bind(null,d,v,u,l),null),u},useId:function(){var s=fi(),l=Gt.identifierPrefix;if(ht){var u=Hr,d=_r;u=(d&~(1<<32-Xe(d)-1)).toString(32)+u,l="_"+l+"R_"+u,u=rh++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=S4++,l="_"+l+"r_"+u.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:bv,useFormState:UE,useActionState:UE,useOptimistic:function(s){var l=fi();l.memoizedState=l.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Sv.bind(null,ut,!0,u),u.dispatch=l,[s,l]},useMemoCache:cv,useCacheRefresh:function(){return fi().memoizedState=R4.bind(null,ut)},useEffectEvent:function(s){var l=fi(),u={impl:s};return l.memoizedState=u,function(){if((It&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},fT={readContext:Gn,use:oh,useCallback:JE,useContext:Gn,useEffect:mv,useImperativeHandle:ZE,useInsertionEffect:XE,useLayoutEffect:$E,useMemo:eT,useReducer:lh,useRef:qE,useState:function(){return lh(ks)},useDebugValue:gv,useDeferredValue:function(s,l){var u=Sn();return tT(u,jt.memoizedState,s,l)},useTransition:function(){var s=lh(ks)[0],l=Sn().memoizedState;return[typeof s=="boolean"?s:wc(s),l]},useSyncExternalStore:DE,useId:sT,useHostTransitionStatus:bv,useFormState:jE,useActionState:jE,useOptimistic:function(s,l){var u=Sn();return BE(u,jt,s,l)},useMemoCache:cv,useCacheRefresh:oT,useEffectEvent:WE},O4={readContext:Gn,use:oh,useCallback:JE,useContext:Gn,useEffect:mv,useImperativeHandle:ZE,useInsertionEffect:XE,useLayoutEffect:$E,useMemo:eT,useReducer:dv,useRef:qE,useState:function(){return dv(ks)},useDebugValue:gv,useDeferredValue:function(s,l){var u=Sn();return jt===null?yv(u,s,l):tT(u,jt.memoizedState,s,l)},useTransition:function(){var s=dv(ks)[0],l=Sn().memoizedState;return[typeof s=="boolean"?s:wc(s),l]},useSyncExternalStore:DE,useId:sT,useHostTransitionStatus:bv,useFormState:YE,useActionState:YE,useOptimistic:function(s,l){var u=Sn();return jt!==null?BE(u,jt,s,l):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:cv,useCacheRefresh:oT,useEffectEvent:WE};function xv(s,l,u,d){l=s.memoizedState,u=u(d,l),u=u==null?l:M({},l,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var wv={enqueueSetState:function(s,l,u){s=s._reactInternals;var d=Hi(),g=uo(d);g.payload=l,u!=null&&(g.callback=u),l=co(s,g,d),l!==null&&(Ai(l,s,d),yc(l,s,d))},enqueueReplaceState:function(s,l,u){s=s._reactInternals;var d=Hi(),g=uo(d);g.tag=1,g.payload=l,u!=null&&(g.callback=u),l=co(s,g,d),l!==null&&(Ai(l,s,d),yc(l,s,d))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var u=Hi(),d=uo(u);d.tag=2,l!=null&&(d.callback=l),l=co(s,d,u),l!==null&&(Ai(l,s,u),yc(l,s,u))}};function dT(s,l,u,d,g,v,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(d,v,R):l.prototype&&l.prototype.isPureReactComponent?!uc(u,d)||!uc(g,v):!0}function hT(s,l,u,d){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,d),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,d),l.state!==s&&wv.enqueueReplaceState(l,l.state,null)}function vl(s,l){var u=l;if("ref"in l){u={};for(var d in l)d!=="ref"&&(u[d]=l[d])}if(s=s.defaultProps){u===l&&(u=M({},u));for(var g in s)u[g]===void 0&&(u[g]=s[g])}return u}function pT(s){_d(s)}function mT(s){console.error(s)}function gT(s){_d(s)}function dh(s,l){try{var u=s.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(d){setTimeout(function(){throw d})}}function yT(s,l,u){try{var d=s.onCaughtError;d(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Cv(s,l,u){return u=uo(u),u.tag=3,u.payload={element:null},u.callback=function(){dh(s,l)},u}function vT(s){return s=uo(s),s.tag=3,s}function bT(s,l,u,d){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var v=d.value;s.payload=function(){return g(v)},s.callback=function(){yT(l,u,d)}}var R=u.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){yT(l,u,d),typeof g!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var P=d.stack;this.componentDidCatch(d.value,{componentStack:P!==null?P:""})})}function M4(s,l,u,d,g){if(u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(l=u.alternate,l!==null&&cl(l,u,g,!0),u=Wn.current,u!==null){switch(u.tag){case 31:case 13:case 19:return si===null?Ih():u.alternate===null&&gn===0&&(gn=3),u.flags&=-257,u.flags|=65536,u.lanes=g,d===Zd?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([d]):l.add(d),l0(s,d,g)),!1;case 22:return u.flags|=65536,d===Zd?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([d])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([d]):u.add(d)),l0(s,d,g)),!1}throw Error(i(435,u.tag))}return l0(s,d,g),Ih(),!1}if(ht)return l=Wn.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=g,d!==jy&&(s=Error(i(422),{cause:d}),dc($i(s,u)))):(d!==jy&&(l=Error(i(423),{cause:d}),dc($i(l,u))),s=s.current.alternate,s.flags|=65536,g&=-g,s.lanes|=g,d=$i(d,u),g=Cv(s.stateNode,d,g),Jy(s,g),gn!==4&&(gn=2)),!1;var v=Error(i(520),{cause:d});if(v=$i(v,u),kc===null?kc=[v]:kc.push(v),gn!==4&&(gn=2),l===null)return!0;d=$i(d,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,s=g&-g,u.lanes|=s,s=Cv(u.stateNode,d,s),Jy(u,s),!1;case 1:if(l=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(bo===null||!bo.has(v))))return u.flags|=65536,g&=-g,u.lanes|=g,g=vT(g),bT(g,s,u,d),Jy(u,g),!1;break;case 22:if(u.memoizedState!==null)return u.flags|=65536,!1}u=u.return}while(u!==null);return!1}var Ev=Error(i(461)),Rn=!1;function Pn(s,l,u,d){l.child=s===null?CE(l,null,u,d):gl(l,s.child,u,d)}function ST(s,l,u,d,g){u=u.render;var v=l.ref;if("ref"in d){var R={};for(var P in d)P!=="ref"&&(R[P]=d[P])}else R=d;return fl(l),d=ov(s,l,u,R,v,g),P=lv(),s!==null&&!Rn?(av(s,l,g),Ps(s,l,g)):(ht&&P&&Yd(l),l.flags|=1,Pn(s,l,d,g),l.child)}function xT(s,l,u,d,g){if(s===null){var v=u.type;return typeof v=="function"&&!_y(v)&&v.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=v,wT(s,l,v,d,g)):(s=jd(u.type,null,d,l,l.mode,g),s.ref=l.ref,s.return=l,l.child=s)}if(v=s.child,!Pv(s,g)){var R=v.memoizedProps;if(u=u.compare,u=u!==null?u:uc,u(R,d)&&s.ref===l.ref)return Ps(s,l,g)}return l.flags|=1,s=Rs(v,d),s.ref=l.ref,s.return=l,l.child=s}function wT(s,l,u,d,g){if(s!==null){var v=s.memoizedProps;if(uc(v,d)&&s.ref===l.ref)if(Rn=!1,l.pendingProps=d=v,Pv(s,g))(s.flags&131072)!==0&&(Rn=!0);else return l.lanes=s.lanes,Ps(s,l,g)}return Tv(s,l,u,d,g)}function CT(s,l,u,d){var g=d.children,v=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((l.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,s!==null){for(d=l.child=s.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~v}else d=0,l.child=null;return ET(s,l,v,u,d)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&$d(l,v!==null?v.cachePool:null),v!==null?RE(l,v):tv(),AE(l);else return d=l.lanes=536870912,ET(s,l,v!==null?v.baseLanes|u:u,u,d)}else v!==null?($d(l,v.cachePool),RE(l,v),po(),l.memoizedState=null):(s!==null&&$d(l,null),tv(),po());return Pn(s,l,g,u),l.child}function Ec(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function ET(s,l,u,d,g){var v=Xy();return v=v===null?null:{parent:En._currentValue,pool:v},l.memoizedState={baseLanes:u,cachePool:v},s!==null&&$d(l,null),tv(),AE(l),s!==null&&cl(s,l,d,!0),l.childLanes=g,null}function hh(s,l){return l=ph({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function TT(s,l,u){return gl(l,s.child,null,u),s=hh(l,l.pendingProps),s.flags|=2,Bi(l),l.memoizedState=null,s}function D4(s,l,u){var d=l.pendingProps,g=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(ht){if(d.mode==="hidden")return s=hh(l,d),l.lanes=536870912,s.memoizedState={baseLanes:0,cachePool:null},Ec(null,s);if(iv(l),(s=nn)?(s=QR(s,Ji),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:io!==null?{id:_r,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},u=aE(s),u.return=l,l.child=u,Hn=l,nn=null)):s=null,s===null)throw so(l);return l.lanes=536870912,null}return hh(l,d)}var v=s.memoizedState;if(v!==null){var R=v.dehydrated;if(iv(l),g)if(l.flags&256)l.flags&=-257,l=TT(s,l,u);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(i(558));else if(Rn||cl(s,l,u,!1),g=(u&s.childLanes)!==0,Rn||g){if(fo.current===null){if(d=Gt,d!==null&&(R=fC(d,u),R!==0&&R!==v.retryLane))throw v.retryLane=R,ol(s,R),Ai(d,s,R),Ev;Ih()}l=TT(s,l,u)}else s=v.treeContext,nn=tr(R.nextSibling),Hn=l,ht=!0,ro=null,Ji=!1,s!==null&&fE(l,s),l=hh(l,d),l.flags|=134221824;return l}return s=Rs(s.child,{mode:d.mode,children:d.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Aa(s,l){var u=l.ref;if(u===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(s===null||s.ref!==u)&&(l.flags|=4194816)}}function Tv(s,l,u,d,g){return fl(l),u=ov(s,l,u,d,void 0,g),d=lv(),s!==null&&!Rn?(av(s,l,g),Ps(s,l,g)):(ht&&d&&Yd(l),l.flags|=1,Pn(s,l,u,g),l.child)}function RT(s,l,u,d,g,v){return fl(l),l.updateQueue=null,u=ME(l,d,u,g),OE(s),d=lv(),s!==null&&!Rn?(av(s,l,v),Ps(s,l,v)):(ht&&d&&Yd(l),l.flags|=1,Pn(s,l,u,v),l.child)}function AT(s,l,u,d,g){if(fl(l),l.stateNode===null){var v=ya,R=u.contextType;typeof R=="object"&&R!==null&&(v=Gn(R)),v=new u(d,v),l.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=wv,l.stateNode=v,v._reactInternals=l,v=l.stateNode,v.props=d,v.state=l.memoizedState,v.refs={},Qy(l),R=u.contextType,v.context=typeof R=="object"&&R!==null?Gn(R):ya,v.state=l.memoizedState,R=u.getDerivedStateFromProps,typeof R=="function"&&(xv(l,u,R,d),v.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(R=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),R!==v.state&&wv.enqueueReplaceState(v,v.state,null),bc(l,d,v,g),vc(),v.state=l.memoizedState),typeof v.componentDidMount=="function"&&(l.flags|=4194308),d=!0}else if(s===null){v=l.stateNode;var P=l.memoizedProps,_=vl(u,P);v.props=_;var ee=v.context,oe=u.contextType;R=ya,typeof oe=="object"&&oe!==null&&(R=Gn(oe));var pe=u.getDerivedStateFromProps;oe=typeof pe=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=l.pendingProps!==P,oe||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||ee!==R)&&hT(l,v,d,R),ao=!1;var Q=l.memoizedState;v.state=Q,bc(l,d,v,g),vc(),ee=l.memoizedState,P||Q!==ee||ao?(typeof pe=="function"&&(xv(l,u,pe,d),ee=l.memoizedState),(_=ao||dT(l,u,_,d,Q,ee,R))?(oe||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(l.flags|=4194308)):(typeof v.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=d,l.memoizedState=ee),v.props=d,v.state=ee,v.context=R,d=_):(typeof v.componentDidMount=="function"&&(l.flags|=4194308),d=!1)}else{v=l.stateNode,Zy(s,l),R=l.memoizedProps,oe=vl(u,R),v.props=oe,pe=l.pendingProps,Q=v.context,ee=u.contextType,_=ya,typeof ee=="object"&&ee!==null&&(_=Gn(ee)),P=u.getDerivedStateFromProps,(ee=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(R!==pe||Q!==_)&&hT(l,v,d,_),ao=!1,Q=l.memoizedState,v.state=Q,bc(l,d,v,g),vc();var re=l.memoizedState;R!==pe||Q!==re||ao||s!==null&&s.dependencies!==null&&Wd(s.dependencies)?(typeof P=="function"&&(xv(l,u,P,d),re=l.memoizedState),(oe=ao||dT(l,u,oe,d,Q,re,_)||s!==null&&s.dependencies!==null&&Wd(s.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,re,_),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,re,_)),typeof v.componentDidUpdate=="function"&&(l.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof v.componentDidUpdate!="function"||R===s.memoizedProps&&Q===s.memoizedState||(l.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&Q===s.memoizedState||(l.flags|=1024),l.memoizedProps=d,l.memoizedState=re),v.props=d,v.state=re,v.context=_,d=oe):(typeof v.componentDidUpdate!="function"||R===s.memoizedProps&&Q===s.memoizedState||(l.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&Q===s.memoizedState||(l.flags|=1024),d=!1)}return v=d,Aa(s,l),d=(l.flags&128)!==0,v||d?(v=l.stateNode,u=d&&typeof u.getDerivedStateFromError!="function"?null:v.render(),l.flags|=1,s!==null&&d?(l.child=gl(l,s.child,null,g),l.child=gl(l,null,u,g)):Pn(s,l,u,g),l.memoizedState=v.state,s=l.child):s=Ps(s,l,g),s}function OT(s,l,u,d){return al(),l.flags|=256,Pn(s,l,u,d),l.child}var Rv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Av(s){return{baseLanes:s,cachePool:yE()}}function Ov(s,l,u){return s=s!==null?s.childLanes&~u:0,l&&(s|=_i),s}function MT(s,l,u){var d=l.pendingProps,g=!1,v=(l.flags&128)!==0,R;if((R=v)||(R=s!==null&&s.memoizedState===null?!1:(Xn.current&2)!==0),R&&(g=!0,l.flags&=-129),R=(l.flags&32)!==0,l.flags&=-33,s===null){if(ht){if(g?ho(l):po(),(s=nn)?(s=QR(s,Ji),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:io!==null?{id:_r,overflow:Hr}:null,retryLane:536870912,hydrationErrors:null},u=aE(s),u.return=l,l.child=u,Hn=l,nn=null)):s=null,s===null)throw so(l);return A0(s)?l.lanes=32:l.lanes=536870912,null}return v=d.children,d=d.fallback,g?(po(),g=l.mode,v=ph({mode:"hidden",children:v},g),d=ll(d,g,u,null),v.return=l,d.return=l,v.sibling=d,l.child=v,d=l.child,d.memoizedState=Av(u),d.childLanes=Ov(s,R,u),l.memoizedState=Rv,Ec(null,d)):(ho(l),Mv(l,v))}var P=s.memoizedState;if(P!==null){var _=P.dehydrated;if(_!==null)return k4(s,l,v,R,d,_,P,u)}return g?(po(),g=d.fallback,v=l.mode,P=s.child,_=P.sibling,d=Rs(P,{mode:"hidden",children:d.children}),d.subtreeFlags=P.subtreeFlags&1206910976,_!==null?g=Rs(_,g):(g=ll(g,v,u,null),g.flags|=2),g.return=l,d.return=l,d.sibling=g,l.child=d,Ec(null,d),d=l.child,g=s.child.memoizedState,g===null?g=Av(u):(v=g.cachePool,v!==null?(P=En._currentValue,v=v.parent!==P?{parent:P,pool:P}:v):v=yE(),g={baseLanes:g.baseLanes|u,cachePool:v}),d.memoizedState=g,d.childLanes=Ov(s,R,u),l.memoizedState=Rv,Ec(s.child,d)):(ho(l),u=s.child,s=u.sibling,u=Rs(u,{mode:"visible",children:d.children}),u.return=l,u.sibling=null,s!==null&&(R=l.deletions,R===null?(l.deletions=[s],l.flags|=16):R.push(s)),l.child=u,l.memoizedState=null,u)}function Mv(s,l){return l=ph({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function ph(s,l){return s=Ci(22,s,null,l),s.lanes=0,s}function mh(s,l,u){return gl(l,s.child,null,u),s=Mv(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function k4(s,l,u,d,g,v,R,P){if(u)return l.flags&256?(ho(l),l.flags&=-257,mh(s,l,P)):l.memoizedState!==null?(po(),l.child=s.child,l.flags|=128,null):(po(),v=g.fallback,R=l.mode,g=ph({mode:"visible",children:g.children},R),v=ll(v,R,P,null),v.flags|=2,g.return=l,v.return=l,g.sibling=v,l.child=g,gl(l,s.child,null,P),g=l.child,g.memoizedState=Av(P),g.childLanes=Ov(s,d,P),l.memoizedState=Rv,Ec(null,g));if(ho(l),A0(v)){if(d=v.nextSibling&&v.nextSibling.dataset,d)var _=d.dgst;return d=_,d!==""&&(g=Error(i(419)),g.stack="",g.digest=d,dc({value:g,source:null,stack:null})),mh(s,l,P)}if(Rn||cl(s,l,P,!1),d=(P&s.childLanes)!==0,Rn||d){if(fo.current!==null)return mh(s,l,P);if(d=Gt,d!==null&&(g=fC(d,P),g!==0&&g!==R.retryLane))throw R.retryLane=g,ol(s,g),Ai(d,s,g),Ev;return R0(v)||Ih(),mh(s,l,P)}return R0(v)?(l.flags|=192,l.child=s.child,null):(s=R.treeContext,nn=tr(v.nextSibling),Hn=l,ht=!0,ro=null,Ji=!1,s!==null&&fE(l,s),l=Mv(l,g.children),l.flags|=134221824,l)}function DT(s,l,u){s.lanes|=l;var d=s.alternate;d!==null&&(d.lanes|=l),Gd(s.return,l,u)}function kT(s){for(var l=null;s!==null;){var u=s.alternate;u!==null&&nh(u)===null&&(l=s),s=s.sibling}return l}function gh(s,l,u,d,g,v){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:g,treeForkCount:v}:(R.isBackwards=l,R.rendering=null,R.renderingStartTime=0,R.last=d,R.tail=u,R.tailMode=g,R.treeForkCount=v)}function Dv(s){var l=s.child;for(s.child=null;l!==null;){var u=l.sibling;l.sibling=s.child,s.child=l,l=u}}function kv(s,l,u){var d=l.pendingProps,g=d.revealOrder,v=d.tail;d=d.children;var R=Xn.current;if(l.flags&128)return Sc(l,R),null;var P=(R&2)!==0;if(P?(R=R&1|2,l.flags|=128):R&=1,Sc(l,R),g==="backwards"&&s!==null?(Dv(s),Pn(s,l,d,u),Dv(s)):Pn(s,l,d,u),d=ht?fc:0,!P&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&DT(s,u,l);else if(s.tag===19)DT(s,u,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(g){case"backwards":u=kT(l.child),u===null?(g=l.child,l.child=null):(g=u.sibling,u.sibling=null,Dv(l)),gh(l,!0,g,null,v,d);break;case"unstable_legacy-backwards":for(u=null,g=l.child,l.child=null;g!==null;){if(s=g.alternate,s!==null&&nh(s)===null){l.child=g;break}s=g.sibling,g.sibling=u,u=g,g=s}gh(l,!0,u,null,v,d);break;case"together":gh(l,!1,null,null,void 0,d);break;case"independent":l.memoizedState=null;break;default:u=kT(l.child),u===null?(g=l.child,l.child=null):(g=u.sibling,u.sibling=null),gh(l,!1,g,u,v,d)}return l.child}function PT(s,l,u){var d=l.pendingProps;return oo(l,l.type,d.value),Pn(s,l,d.children,u),l.child}function Ps(s,l,u){if(s!==null&&(l.dependencies=s.dependencies),vo|=l.lanes,(u&l.childLanes)===0)if(s!==null){if(cl(s,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(i(153));if(l.child!==null){for(s=l.child,u=Rs(s,s.pendingProps),l.child=u,u.return=l;s.sibling!==null;)s=s.sibling,u=u.sibling=Rs(s,s.pendingProps),u.return=l;u.sibling=null}return l.child}function Pv(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Wd(s)))}function P4(s,l,u){switch(l.tag){case 3:it(l,l.stateNode.containerInfo),oo(l,En,s.memoizedState.cache),al();break;case 27:case 5:se(l);break;case 4:it(l,l.stateNode.containerInfo);break;case 10:oo(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,iv(l),null;break;case 13:var d=l.memoizedState;if(d!==null){if(d.dehydrated!==null)return ho(l),l.flags|=128,null;d=cl(s,l,u,!1);var g=l.child.childLanes;return d||(u&g)!==0?MT(s,l,u):(ho(l),s=Ps(s,l,u),s!==null?s.sibling:null)}ho(l);break;case 19:if(l.flags&128)return kv(s,l,u);if(g=(s.flags&128)!==0,d=(u&l.childLanes)!==0,d||(cl(s,l,u,!1),d=(u&l.childLanes)!==0),g){if(d)return kv(s,l,u);l.flags|=128}if(g=l.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Sc(l,Xn.current),d)break;return null;case 22:return l.lanes=0,CT(s,l,u,l.pendingProps);case 24:oo(l,En,s.memoizedState.cache)}return Ps(s,l,u)}function IT(s,l,u){if(s!==null)if(s.memoizedProps!==l.pendingProps)Rn=!0;else{if(!Pv(s,u)&&(l.flags&128)===0)return Rn=!1,P4(s,l,u);Rn=(s.flags&131072)!==0}else Rn=!1,ht&&(l.flags&1048576)!==0&&cE(l,fc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var d=l.pendingProps;if(s=pl(l.elementType),l.type=s,typeof s=="function")_y(s)?(d=vl(s,d),l.tag=1,l=AT(null,l,s,d,u)):(l.tag=0,l=Tv(null,l,s,d,u));else{if(s!=null){var g=s.$$typeof;if(g===V){l.tag=11,l=ST(null,l,s,d,u);break e}else if(g===Y){l.tag=14,l=xT(null,l,s,d,u);break e}else if(g===z){l.tag=10,l.type=s,l=PT(null,l,u);break e}}throw l=le(s)||s,Error(i(306,l,""))}}return l;case 0:return Tv(s,l,l.type,l.pendingProps,u);case 1:return d=l.type,g=vl(d,l.pendingProps),AT(s,l,d,g,u);case 3:e:{if(it(l,l.stateNode.containerInfo),s===null)throw Error(i(387));d=l.pendingProps;var v=l.memoizedState;g=v.element,Zy(s,l),bc(l,d,null,u);var R=l.memoizedState;if(d=R.cache,oo(l,En,d),d!==v.cache&&qy(l,[En],u,!0),vc(),d=R.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:R.cache},l.updateQueue.baseState=v,l.memoizedState=v,l.flags&256){l=OT(s,l,d,u);break e}else if(d!==g){g=$i(Error(i(424)),l),dc(g),l=OT(s,l,d,u);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,nn=tr(s.firstChild),Hn=l,ht=!0,ro=null,Ji=!0,u=CE(l,null,d,u),l.child=u;u;)u.flags=u.flags&-3|134221824,u=u.sibling;else{if(al(),d===g){l=Ps(s,l,u);break e}Pn(s,l,d,u)}l=l.child}return l;case 26:return Aa(s,l),s===null?(u=rA(l.type,null,l.pendingProps,null))?l.memoizedState=u:ht||(l.stateNode=VR(l.type,l.pendingProps,de.current,l)):l.memoizedState=rA(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return se(l),s===null&&ht&&(d=l.stateNode=eA(l.type,l.pendingProps,de.current),Hn=l,Ji=!0,g=nn,wo(l.type)?(O0=g,nn=tr(d.firstChild)):nn=g),Pn(s,l,l.pendingProps.children,u),Aa(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&ht&&((g=d=nn)&&(d=R5(d,l.type,l.pendingProps,Ji),d!==null?(l.stateNode=d,Hn=l,nn=tr(d.firstChild),Ji=!1,g=!0):g=!1),g||so(l)),se(l),g=l.type,v=l.pendingProps,R=s!==null?s.memoizedProps:null,d=v.children,b0(g,v)?d=null:R!==null&&b0(g,R)&&(l.flags|=32),l.memoizedState!==null&&(g=ov(s,l,x4,null,null,u),Ya._currentValue=g),Aa(s,l),Pn(s,l,d,u),l.child;case 6:return s===null&&ht&&((s=u=nn)&&(u=A5(u,l.pendingProps,Ji),u!==null?(l.stateNode=u,Hn=l,nn=null,s=!0):s=!1),s||so(l)),null;case 13:return MT(s,l,u);case 4:return it(l,l.stateNode.containerInfo),d=l.pendingProps,s===null?l.child=gl(l,null,d,u):Pn(s,l,d,u),l.child;case 11:return ST(s,l,l.type,l.pendingProps,u);case 7:return d=l.pendingProps,Aa(s,l),Pn(s,l,d,u),l.child;case 8:return Pn(s,l,l.pendingProps.children,u),l.child;case 12:return Pn(s,l,l.pendingProps.children,u),l.child;case 10:return PT(s,l,u);case 9:return g=l.type._context,d=l.pendingProps.children,fl(l),g=Gn(g),d=d(g),l.flags|=1,Pn(s,l,d,u),l.child;case 14:return xT(s,l,l.type,l.pendingProps,u);case 15:return wT(s,l,l.type,l.pendingProps,u);case 19:return kv(s,l,u);case 31:return D4(s,l,u);case 22:return CT(s,l,u,l.pendingProps);case 24:return fl(l),d=Gn(En),s===null?(g=Xy(),g===null&&(g=Gt,v=Gy(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=u),g=v),l.memoizedState={parent:d,cache:g},Qy(l),oo(l,En,g)):((s.lanes&u)!==0&&(Zy(s,l),bc(l,null,null,u),vc()),g=s.memoizedState,v=l.memoizedState,g.parent!==d?(g={parent:d,cache:d},l.memoizedState=g,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=g),oo(l,En,d)):(d=v.cache,oo(l,En,d),d!==g.cache&&qy(l,[En],u,!0))),Pn(s,l,l.pendingProps.children,u),l.child;case 30:return l.stateNode===null&&(l.stateNode={autoName:null,paired:null,clones:null,ref:null}),d=l.pendingProps,d.name!=null&&d.name!=="auto"?l.flags|=s===null?18882560:18874368:ht&&Yd(l),s!==null&&s.memoizedProps.name!==d.name?l.flags|=4194816:Aa(s,l),Pn(s,l,d.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function Is(s){s.flags|=4}function Iv(s,l,u,d,g){var v;if((v=(s.mode&32)!==0)&&(v=u===null?aA(l,d):aA(l,d)&&(d.src!==u.src||d.srcSet!==u.srcSet)),v){if(s.flags|=16777216,(g&335544128)===g)if(s.stateNode.complete)s.flags|=8192;else if(pR())s.flags|=8192;else throw ml=Zd,$y}else s.flags&=-16777217}function NT(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!uA(l))if(pR())s.flags|=8192;else throw ml=Zd,$y}function yh(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?aC():536870912,s.lanes|=l,Pa|=l)}function Tc(s,l){if(!ht)switch(s.tailMode){case"visible":break;case"collapsed":for(var u=s.tail,d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:d.sibling=null;break;default:for(l=s.tail,u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?s.tail=null:u.sibling=null}}function rn(s){var l=s.alternate!==null&&s.alternate.child===s.child,u=0,d=0;if(l)for(var g=s.child;g!==null;)u|=g.lanes|g.childLanes,d|=g.subtreeFlags&1206910976,d|=g.flags&1206910976,g.return=s,g=g.sibling;else for(g=s.child;g!==null;)u|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=s,g=g.sibling;return s.subtreeFlags|=d,s.childLanes=u,l}function I4(s,l,u){var d=l.pendingProps;switch(Uy(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(l),null;case 1:return rn(l),null;case 3:return u=l.stateNode,d=null,s!==null&&(d=s.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Ms(En),tt(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Sa(l)?Is(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ky())),rn(l),null;case 26:var g=l.type,v=l.memoizedState;return s===null?(Is(l),v!==null?(rn(l),NT(l,v)):(rn(l),Iv(l,g,null,d,u))):v?v!==s.memoizedState?(Is(l),rn(l),NT(l,v)):(rn(l),l.flags&=-16777217):(s=s.memoizedProps,s!==d&&Is(l),rn(l),Iv(l,g,s,d,u)),null;case 27:if(me(l),u=de.current,g=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==d&&Is(l);else{if(!d){if(l.stateNode===null)throw Error(i(166));return rn(l),l.subtreeFlags&=-33554433,null}s=ve.current,Sa(l)?dE(l):(s=eA(g,d,u),l.stateNode=s,Is(l))}return rn(l),l.subtreeFlags&=-33554433,null;case 5:if(me(l),g=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==d&&Is(l);else{if(!d){if(l.stateNode===null)throw Error(i(166));return rn(l),l.subtreeFlags&=-33554433,null}if(v=ve.current,Sa(l))dE(l);else{var R=Bc(de.current);switch(v){case 1:v=R.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=R.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=R.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=R.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=R.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?R.createElement("select",{is:d.is}):R.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?R.createElement(g,{is:d.is}):R.createElement(g)}}v[qn]=l,v[wi]=d;e:for(R=l.child;R!==null;){if(R.tag===5||R.tag===6)v.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===l)break e;for(;R.sibling===null;){if(R.return===null||R.return===l)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}l.stateNode=v;e:switch(Qn(v,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Is(l)}}return rn(l),l.subtreeFlags&=-33554433,Iv(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,u),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==d&&Is(l);else{if(typeof d!="string"&&l.stateNode===null)throw Error(i(166));if(s=de.current,Sa(l)){if(s=l.stateNode,u=l.memoizedProps,d=null,g=Hn,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}s[qn]=l,s=!!(s.nodeValue===u||d!==null&&d.suppressHydrationWarning===!0||IR(s.nodeValue,u)),s||so(l,!0)}else s=Bc(s).createTextNode(d),s[qn]=l,l.stateNode=s}return rn(l),null;case 31:if(u=l.memoizedState,s===null||s.memoizedState!==null){if(d=Sa(l),u!==null){if(s===null){if(!d)throw Error(i(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[qn]=l}else al(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;rn(l),s=!1}else u=Ky(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return l.flags&256?(Bi(l),l):(Bi(l),null);if((l.flags&128)!==0)throw Error(i(558))}return rn(l),null;case 13:if(d=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(g=Sa(l),d!==null&&d.dehydrated!==null){if(s===null){if(!g)throw Error(i(318));if(g=l.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[qn]=l}else al(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;rn(l),g=!1}else g=Ky(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=g),g=!0;if(!g)return l.flags&256?(Bi(l),l):(Bi(l),null)}return Bi(l),(l.flags&128)!==0?(l.lanes=u,l):(u=d!==null,s=s!==null&&s.memoizedState!==null,u&&(d=l.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==g&&(d.flags|=2048)),u!==s&&u&&(l.child.flags|=8192),yh(l,l.updateQueue),rn(l),null);case 4:return tt(),s===null&&p0(l.stateNode.containerInfo),l.flags|=67108864,rn(l),null;case 10:return Ms(l.type),rn(l),null;case 19:if(rv(l),d=l.memoizedState,d===null)return rn(l),null;if(g=(l.flags&128)!==0,v=d.rendering,v===null)if(g)Tc(d,!1);else{if(gn!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(v=nh(s),v!==null){for(l.flags|=128,Tc(d,!1),s=v.updateQueue,l.updateQueue=s,yh(l,s),l.subtreeFlags=0,s=u,u=l.child;u!==null;)lE(u,s),u=u.sibling;return Sc(l,Xn.current&1|2),ht&&As(l,d.treeForkCount),l.child}s=s.sibling}d.tail!==null&&st()>Mh&&(l.flags|=128,g=!0,Tc(d,!1),l.lanes=4194304)}else{if(!g)if(s=nh(v),s!==null){if(l.flags|=128,g=!0,s=s.updateQueue,l.updateQueue=s,yh(l,s),Tc(d,!0),d.tail===null&&d.tailMode!=="collapsed"&&d.tailMode!=="visible"&&!v.alternate&&!ht)return rn(l),null}else 2*st()-d.renderingStartTime>Mh&&u!==536870912&&(l.flags|=128,g=!0,Tc(d,!1),l.lanes=4194304);d.isBackwards?(v.sibling=l.child,l.child=v):(s=d.last,s!==null?s.sibling=v:l.child=v,d.last=v)}if(d.tail!==null){s=d.tail;e:{for(u=s;u!==null;){if(u.alternate!==null){u=!1;break e}u=u.sibling}u=!0}return d.rendering=s,d.tail=s.sibling,d.renderingStartTime=st(),s.sibling=null,v=Xn.current,v=g?v&1|2:v&1,d.tailMode==="visible"||d.tailMode==="collapsed"||!u||ht?Sc(l,v):(u=v,Be(Wn,l),Be(Xn,u),si===null&&(si=l)),ht&&As(l,d.treeForkCount),s}return rn(l),null;case 22:case 23:return Bi(l),nv(),d=l.memoizedState!==null,s!==null?s.memoizedState!==null!==d&&(l.flags|=8192):d&&(l.flags|=8192),d?(u&536870912)!==0&&(l.flags&128)===0&&(rn(l),l.subtreeFlags&6&&(l.flags|=8192)):rn(l),u=l.updateQueue,u!==null&&yh(l,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==u&&(l.flags|=2048),s!==null&&Me(hl),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),Ms(En),rn(l),null;case 25:return null;case 30:return l.flags|=33554432,rn(l),null}throw Error(i(156,l.tag))}function N4(s,l){switch(Uy(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Ms(En),tt(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return me(l),null;case 31:if(l.memoizedState!==null){if(Bi(l),l.alternate===null)throw Error(i(340));al()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Bi(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(i(340));al()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return rv(l),s=l.flags,s&65536?(l.flags=s&-65537|128,s=l.memoizedState,s!==null&&(s.rendering=null,s.tail=null),l.flags|=4,l):null;case 4:return tt(),null;case 10:return Ms(l.type),null;case 22:case 23:return Bi(l),nv(),s!==null&&Me(hl),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Ms(En),null;case 25:return null;default:return null}}function LT(s,l){switch(Uy(l),l.tag){case 3:Ms(En),tt();break;case 26:case 27:case 5:me(l);break;case 4:tt();break;case 31:l.memoizedState!==null&&Bi(l);break;case 13:Bi(l);break;case 19:rv(l);break;case 10:Ms(l.type);break;case 22:case 23:Bi(l),nv(),s!==null&&Me(hl);break;case 24:Ms(En)}}function Rc(s,l){try{var u=l.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var g=d.next;u=g;do{if((u.tag&s)===s){d=void 0;var v=u.create,R=u.inst;d=v(),R.destroy=d}u=u.next}while(u!==g)}}catch(P){Ht(l,l.return,P)}}function mo(s,l,u){try{var d=l.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var v=g.next;d=v;do{if((d.tag&s)===s){var R=d.inst,P=R.destroy;if(P!==void 0){R.destroy=void 0,g=l;var _=u,ee=P;try{ee()}catch(oe){Ht(g,_,oe)}}}d=d.next}while(d!==v)}}catch(oe){Ht(l,l.return,oe)}}function BT(s){var l=s.updateQueue;if(l!==null){var u=s.stateNode;try{TE(l,u)}catch(d){Ht(s,s.return,d)}}}function VT(s,l,u){u.props=vl(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(d){Ht(s,l,d)}}function Fr(s,l){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var d=s.stateNode;break;case 30:var g=s.stateNode,v=Es(s.memoizedProps,g);(g.ref===null||g.ref.name!==v)&&(g.ref=KR(v)),d=g.ref;break;case 7:if(s.stateNode===null){var R=new Fi(s);p(s.child,!1,E5,R,void 0,void 0),s.stateNode=R}d=s.stateNode;break;default:d=s.stateNode}typeof u=="function"?s.refCleanup=u(d):u.current=d}}catch(P){Ht(s,l,P)}}function $n(s,l){var u=s.ref,d=s.refCleanup;if(u!==null)if(typeof d=="function")try{d()}catch(g){Ht(s,l,g)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){Ht(s,l,g)}else u.current=null}function vh(s,l){if((s.tag===5||s.tag===27||s.tag===6)&&s.alternate===null&&l!==null)for(var u=0;u<l.length;u++)$R(s.stateNode,l[u])}function zT(s){for(var l=s.return;l!==null&&(Lv(l)&&$R(s.stateNode,l.stateNode),!Nv(l));)l=l.return}function Ac(s){for(var l=s.return;l!==null&&(Lv(l)&&T5(s.stateNode,l.stateNode),!Nv(l));)l=l.return}function Nv(s){return s.tag===5||s.tag===3||s.tag===27}function Lv(s){return s&&s.tag===7&&s.stateNode!==null}function Bv(s){var l=s.type,u=s.memoizedProps,d=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&d.focus();break e;case"img":u.src?d.src=u.src:u.srcSet&&(d.srcset=u.srcSet)}}catch(g){Ht(s,s.return,g)}}function Vv(s,l,u){try{var d=s.stateNode;o5(d,s.type,u,l),d[wi]=l}catch(g){Ht(s,s.return,g)}}function _T(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&wo(s.type)||s.tag===4}function zv(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||_T(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&wo(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function _v(s,l,u,d){var g=s.tag;if(g===5||g===6)g=s.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(g,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(g),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=zr)),vh(s,d),Pt=!0;else if(g!==4&&(g===27&&(vh(s,d),d=null,wo(s.type)&&(u=s.stateNode,l=null)),s=s.child,s!==null))for(_v(s,l,u,d),s=s.sibling;s!==null;)_v(s,l,u,d),s=s.sibling}function bh(s,l,u,d){var g=s.tag;if(g===5||g===6)g=s.stateNode,l?u.insertBefore(g,l):u.appendChild(g),vh(s,d),Pt=!0;else if(g!==4&&(g===27&&(vh(s,d),d=null,wo(s.type)&&(u=s.stateNode)),s=s.child,s!==null))for(bh(s,l,u,d),s=s.sibling;s!==null;)bh(s,l,u,d),s=s.sibling}function HT(s){var l=s.stateNode,u=s.memoizedProps;try{for(var d=s.type,g=l.attributes;g.length;)l.removeAttributeNode(g[0]);Qn(l,d,u),l[qn]=s,l[wi]=u}catch(v){Ht(s,s.return,v)}}var Sh=!1,Vi=null;function FT(s){(s.tag===30||(s.subtreeFlags&33554432)!==0)&&(Sh=!0)}var Ur=null;function UT(){var s=Ur;return Ur=null,s}var Ei=0;function Oa(s,l,u,d,g){return Ei=0,jT(s.child,l,u,d,g)}function jT(s,l,u,d,g){for(var v=!1;s!==null;){if(s.tag===5){var R=s.stateNode;if(d!==null){var P=w0(R);d.push(P),P.view&&(v=!0)}else v||w0(R).view&&(v=!0);Sh=!0,UR(R,Ei===0?l:l+"_"+Ei,u),Ei++}else(s.tag!==22||s.memoizedState===null)&&(s.tag===30&&g||jT(s.child,l,u,d,g)&&(v=!0));s=s.sibling}return v}function jr(s,l){for(;s!==null;)s.tag===5?jR(s.stateNode,s.memoizedProps):(s.tag!==22||s.memoizedState===null)&&(s.tag===30&&l||jr(s.child,l)),s=s.sibling}function xh(s){if((s.subtreeFlags&18874368)!==0)for(s=s.child;s!==null;){if((s.tag!==22||s.memoizedState===null)&&(xh(s),s.tag===30&&(s.flags&18874368)!==0&&s.stateNode.paired)){var l=s.memoizedProps;if(l.name==null||l.name==="auto")throw Error(i(544));var u=l.name;l=Ts(l.default,l.share),l!=="none"&&(Oa(s,u,l,null,!1)||jr(s.child,!1))}s=s.sibling}}function Hv(s,l){if(s.tag===30){var u=s.stateNode,d=s.memoizedProps,g=Es(d,u),v=Ts(d.default,u.paired?d.share:d.enter);v!=="none"?Oa(s,g,v,null,!1)?(xh(s),u.paired||l||Ba(s,d.onEnter)):jr(s.child,!1):xh(s)}else if((s.subtreeFlags&33554432)!==0)for(s=s.child;s!==null;)Hv(s,l),s=s.sibling;else xh(s)}function Fv(s){if(Vi!==null&&Vi.size!==0){var l=Vi;if((s.subtreeFlags&18874368)!==0)for(s=s.child;s!==null;){if(s.tag!==22||s.memoizedState===null){if(s.tag===30&&(s.flags&18874368)!==0){var u=s.memoizedProps,d=u.name;if(d!=null&&d!=="auto"){var g=l.get(d);if(g!==void 0){var v=Ts(u.default,u.share);if(v!=="none"&&(Oa(s,d,v,null,!1)?(v=s.stateNode,g.paired=v,v.paired=g,Ba(s,u.onShare)):jr(s.child,!1)),l.delete(d),l.size===0)break}}}Fv(s)}s=s.sibling}}}function Uv(s){if(s.tag===30){var l=s.memoizedProps,u=Es(l,s.stateNode),d=Vi!==null?Vi.get(u):void 0,g=Ts(l.default,d!==void 0?l.share:l.exit);g!=="none"&&(Oa(s,u,g,null,!1)?d!==void 0?(g=s.stateNode,d.paired=g,g.paired=d,Vi.delete(u),Ba(s,l.onShare)):Ba(s,l.onExit):jr(s.child,!1)),Vi!==null&&Fv(s)}else if((s.subtreeFlags&33554432)!==0)for(s=s.child;s!==null;)Uv(s),s=s.sibling;else Vi!==null&&Fv(s)}function KT(s){for(s=s.child;s!==null;){if(s.tag===30){var l=s.memoizedProps,u=Es(l,s.stateNode);l=Ts(l.default,l.update),s.flags&=-5,l!=="none"&&Oa(s,u,l,s.memoizedState=[],!1)}else(s.subtreeFlags&33554432)!==0&&KT(s);s=s.sibling}}function jv(s){if((s.subtreeFlags&18874368)!==0)for(s=s.child;s!==null;){if(s.tag!==22||s.memoizedState===null){if(s.tag===30&&(s.flags&18874368)!==0){var l=s.stateNode;l.paired!==null&&(l.paired=null,jr(s.child,!1))}jv(s)}s=s.sibling}}function wh(s){if(s.tag===30)s.stateNode.paired=null,jr(s.child,!1),jv(s);else if((s.subtreeFlags&33554432)!==0)for(s=s.child;s!==null;)wh(s),s=s.sibling;else jv(s)}function YT(s){for(s=s.child;s!==null;)s.tag===30?jr(s.child,!1):(s.subtreeFlags&33554432)!==0&&YT(s),s=s.sibling}function Kv(s,l,u,d,g,v,R){for(var P=!1;l!==null;){if(l.tag===5){var _=l.stateNode;if(v!==null&&Ei<v.length){var ee=v[Ei],oe=w0(_);(ee.view||oe.view)&&(P=!0);var pe;if(pe=(s.flags&4)===0)if(oe.clip)pe=!0;else{pe=ee.rect;var Q=oe.rect;pe=pe.y!==Q.y||pe.x!==Q.x||pe.height!==Q.height||pe.width!==Q.width}pe&&(s.flags|=4),oe.abs?oe=!ee.abs:(ee=ee.rect,oe=oe.rect,oe=ee.height!==oe.height||ee.width!==oe.width),oe&&(s.flags|=32)}else s.flags|=32;(s.flags&4)!==0&&UR(_,Ei===0?u:u+"_"+Ei,g),P&&(s.flags&4)!==0||(Ur===null&&(Ur=[]),Ur.push(_,Ei===0?d:d+"_"+Ei,l.memoizedProps)),Ei++}else(l.tag!==22||l.memoizedState===null)&&(l.tag===30&&R?s.flags|=l.flags&32:Kv(s,l.child,u,d,g,v,R)&&(P=!0));l=l.sibling}return P}function qT(s,l){for(s=s.child;s!==null;){if(s.tag===30){var u=s.memoizedProps,d=s.stateNode,g=Es(u,d),v=Ts(u.default,u.update),R;R=s.memoizedState,s.memoizedState=null,d=s;var P=s.child;Ei=0,g=Kv(d,P,g,g,v,R,!1),(s.flags&4)!==0&&g&&Ba(s,u.onUpdate)}else(s.subtreeFlags&33554432)!==0&&qT(s);s=s.sibling}}var Fn=!1,Bt=!1,Kr=!1,Yv=!1,GT=typeof WeakSet=="function"?WeakSet:Set,Un=null,Yr=!1,Oc=!1,Ch=!1,qv=!1;function L4(s,l,u){if(s=s.containerInfo,y0=qa,s=QC(s),Py(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var v=g.anchorOffset,R=g.focusNode;g=g.focusOffset;try{d.nodeType,R.nodeType}catch{d=null;break e}var P=0,_=-1,ee=-1,oe=0,pe=0,Q=s,re=null;t:for(;;){for(var Ne;Q!==d||v!==0&&Q.nodeType!==3||(_=P+v),Q!==R||g!==0&&Q.nodeType!==3||(ee=P+g),Q.nodeType===3&&(P+=Q.nodeValue.length),(Ne=Q.firstChild)!==null;)re=Q,Q=Ne;for(;;){if(Q===s)break t;if(re===d&&++oe===v&&(_=P),re===R&&++pe===g&&(ee=P),(Ne=Q.nextSibling)!==null)break;Q=re,re=Q.parentNode}Q=Ne}d=_===-1||ee===-1?null:{start:_,end:ee}}else d=null}d=d||{start:0,end:0}}else d=null;for(v0={focusedElem:s,selectionRange:d},qa=!1,u=(u&335544064)===u,Un=l,l=u?9270:1024;Un!==null;){if(s=Un,u&&(d=s.deletions,d!==null))for(v=0;v<d.length;v++)u&&Uv(d[v]);if(s.alternate===null&&(s.flags&2)!==0)u&&FT(s),Eh(u);else{if(s.tag===22){if(d=s.alternate,s.memoizedState!==null){d!==null&&d.memoizedState===null&&u&&Uv(d),Eh(u);continue}else if(d!==null&&d.memoizedState!==null){u&&FT(s),Eh(u);continue}}d=s.child,(s.subtreeFlags&l)!==0&&d!==null?(d.return=s,Un=d):(u&&KT(s),Eh(u))}}Vi=null}function Eh(s){for(;Un!==null;){var l=Un,u=s,d=l.alternate,g=l.flags;switch(l.tag){case 0:case 11:case 15:break;case 1:if((g&1024)!==0&&d!==null){u=void 0,g=d.memoizedProps,d=d.memoizedState;var v=l.stateNode;try{var R=vl(l.type,g);u=v.getSnapshotBeforeUpdate(R,d),v.__reactInternalSnapshotBeforeUpdate=u}catch(P){Ht(l,l.return,P)}}break;case 3:if((g&1024)!==0){if(d=l.stateNode.containerInfo,u=d.nodeType,u===9)T0(d);else if(u===1)switch(d.nodeName){case"HEAD":case"HTML":case"BODY":T0(d);break;default:d.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:u&&d!==null&&(u=Es(d.memoizedProps,d.stateNode),g=l.memoizedProps,g=Ts(g.default,g.update),g!=="none"&&Oa(d,u,g,d.memoizedState=[],!0));break;default:if((g&1024)!==0)throw Error(i(163))}if(d=l.sibling,d!==null){d.return=l.return,Un=d;break}Un=l.return}}function WT(s,l,u){var d=u.flags;switch(u.tag){case 0:case 11:case 15:qr(s,u),d&4&&Rc(5,u);break;case 1:if(qr(s,u),d&4)if(s=u.stateNode,l===null)try{s.componentDidMount()}catch(R){Ht(u,u.return,R)}else{var g=vl(u.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(g,l,s.__reactInternalSnapshotBeforeUpdate)}catch(R){Ht(u,u.return,R)}}d&64&&BT(u),d&512&&Fr(u,u.return);break;case 3:if(qr(s,u),d&64&&(s=u.updateQueue,s!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{TE(s,l)}catch(R){Ht(u,u.return,R)}}break;case 27:l===null&&d&4&&HT(u);case 26:case 5:qr(s,u),l===null&&d&4&&Bv(u),d&512&&Fr(u,u.return);break;case 12:qr(s,u);break;case 31:qr(s,u),d&4&&ZT(s,u);break;case 13:qr(s,u),d&4&&JT(s,u),d&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=G4.bind(null,u),O5(s,u))));break;case 22:if(d=u.memoizedState!==null||Fn,!d){var v=l!==null&&l.memoizedState!==null||Bt;l=Fn,g=Bt,Fn=d,(Bt=v)&&!g?(d=2,(u.subtreeFlags&8772)!==0&&(d|=1),xr(s,u,d)):qr(s,u),Fn=l,Bt=g}break;case 30:qr(s,u),d&512&&Fr(u,u.return);break;case 7:d&512&&Fr(u,u.return);default:qr(s,u)}}function Gv(s,l){for(s=s.child;s!==null;)XT(s,l),s=s.sibling}function XT(s,l){switch(s.tag){case 5:case 26:try{var u=s.stateNode;if(l){var d=u.style;typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"}else{var g=s.stateNode,v=s.memoizedProps.style,R=v!=null&&v.hasOwnProperty("display")?v.display:null;g.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(_){Ht(s,s.return,_)}Wv(s,l);break;case 6:try{s.stateNode.nodeValue=l?"":s.memoizedProps,Pt=!0}catch(_){Ht(s,s.return,_)}break;case 18:try{var P=s.stateNode;l?FR(P,!0):FR(s.stateNode,!1)}catch(_){Ht(s,s.return,_)}break;case 22:case 23:s.memoizedState===null&&Gv(s,l);break;default:Gv(s,l)}}function Wv(s,l){if(s.subtreeFlags&67108864)for(s=s.child;s!==null;){e:{var u=s,d=l;switch(u.tag){case 4:XT(u,d);break e;case 22:u.memoizedState===null&&Wv(u,d);break e;default:Wv(u,d)}}s=s.sibling}}function $T(s){var l=s.alternate;l!==null&&(s.alternate=null,$T(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&Md(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var cn=null,Ti=!1;function br(s,l,u){for(u=u.child;u!==null;)QT(s,l,u),u=u.sibling}function QT(s,l,u){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(Ae,u)}catch{}switch(u.tag){case 26:Bt||$n(u,l),br(s,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&!Bt&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Bt||$n(u,l),Ac(u);var d=cn,g=Ti;wo(u.type)&&(cn=u.stateNode,Ti=!1),br(s,l,u),tA(u.stateNode,u.type,u.memoizedProps),cn=d,Ti=g;break;case 5:Bt||$n(u,l),Ac(u);case 6:if(u.tag===6&&Ac(u),d=cn,g=Ti,cn=null,br(s,l,u),cn=d,Ti=g,cn!==null)if(Ti)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(u.stateNode),Pt=!0}catch(v){Ht(u,l,v)}else try{cn.removeChild(u.stateNode),Pt=!0}catch(v){Ht(u,l,v)}break;case 18:cn!==null&&(Ti?(s=cn,HR(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Ga(s)):HR(cn,u.stateNode));break;case 4:d=cn,g=Ti,cn=u.stateNode.containerInfo,Ti=!0,br(s,l,u),cn=d,Ti=g;break;case 0:case 11:case 14:case 15:mo(2,u,l),Bt||mo(4,u,l),br(s,l,u);break;case 1:Bt||($n(u,l),d=u.stateNode,typeof d.componentWillUnmount=="function"&&VT(u,l,d)),br(s,l,u);break;case 21:br(s,l,u);break;case 22:Bt=(d=Bt)||u.memoizedState!==null,br(s,l,u),Bt=d;break;case 30:$n(u,l),br(s,l,u);break;case 7:Bt||$n(u,l),br(s,l,u);break;default:br(s,l,u)}}function ZT(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Ga(s)}catch(u){Ht(l,l.return,u)}}}function JT(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Ga(s)}catch(u){Ht(l,l.return,u)}}function B4(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new GT),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new GT),l;default:throw Error(i(435,s.tag))}}function Th(s,l){var u=B4(s);l.forEach(function(d){if(!u.has(d)){u.add(d);var g=W4.bind(null,s,d);d.then(g,g)}})}function di(s,l,u){var d=l.deletions;if(d!==null)for(var g=0;g<d.length;g++){var v=d[g],R=s,P=l,_=P;e:for(;_!==null;){switch(_.tag){case 27:if(wo(_.type)){cn=_.stateNode,Ti=!1;break e}break;case 5:cn=_.stateNode,Ti=!1;break e;case 3:case 4:cn=_.stateNode.containerInfo,Ti=!0;break e}_=_.return}if(cn===null)throw Error(i(160));QT(R,P,v),cn=null,Ti=!1,R=v.alternate,R!==null&&(R.return=null),v.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)eR(l,s,u),l=l.sibling}var Sr=null;function eR(s,l,u){var d=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(g&4&&(d=s.updateQueue,d=d!==null?d.events:null,d!==null))for(var v=0;v<d.length;v++){var R=d[v];R.ref.impl=R.nextImpl}di(l,s,u),hi(s),g&4&&(mo(3,s,s.return),Rc(3,s),mo(5,s,s.return));break;case 1:di(l,s,u),hi(s),g&512&&(Bt||d===null||$n(d,d.return)),g&64&&Fn&&(s=s.updateQueue,s!==null&&(l=s.callbacks,l!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?l:u.concat(l))));break;case 26:if(v=Sr,di(l,s,u),hi(s),g&512&&(Bt||d===null||$n(d,d.return)),g&4)if(g=d!==null?d.memoizedState:null,u=s.memoizedState,d===null)if(u===null)if(s.stateNode===null)if(Fn)s.stateNode=VR(s.type,s.memoizedProps,l.containerInfo,s);else{e:{l=s.type,u=s.memoizedProps,g=v.ownerDocument||v;t:switch(l){case"title":d=g.getElementsByTagName("title")[0],(!d||d[ec]||d[qn]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=g.createElement(l),g.head.insertBefore(d,g.querySelector("head > title"))),Qn(d,l,u),d[qn]=s,_n(d),l=d;break e;case"link":if(v=lA("link","href",g).get(l+(u.href||""))){for(R=0;R<v.length;R++)if(d=v[R],d.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&d.getAttribute("rel")===(u.rel==null?null:u.rel)&&d.getAttribute("title")===(u.title==null?null:u.title)&&d.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){v.splice(R,1);break t}}d=g.createElement(l),Qn(d,l,u),g.head.appendChild(d);break;case"meta":if(v=lA("meta","content",g).get(l+(u.content||""))){for(R=0;R<v.length;R++)if(d=v[R],d.getAttribute("content")===(u.content==null?null:""+u.content)&&d.getAttribute("name")===(u.name==null?null:u.name)&&d.getAttribute("property")===(u.property==null?null:u.property)&&d.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&d.getAttribute("charset")===(u.charSet==null?null:u.charSet)){v.splice(R,1);break t}}d=g.createElement(l),Qn(d,l,u),g.head.appendChild(d);break;default:throw Error(i(468,l))}d[qn]=s,_n(d),l=d}s.stateNode=l}else Fn||P0(v,s.type,s.stateNode);else s.stateNode=oA(v,u,s.memoizedProps);else g!==u?(g===null?(l=d.stateNode,l===null||Bt||l.parentNode.removeChild(l)):g.count--,u===null?Fn||P0(v,s.type,s.stateNode):oA(v,u,s.memoizedProps)):u===null&&s.stateNode!==null&&Vv(s,s.memoizedProps,d.memoizedProps);break;case 27:di(l,s,u),hi(s),g&512&&(Bt||d===null||$n(d,d.return)),d!==null&&g&4&&Vv(s,s.memoizedProps,d.memoizedProps);break;case 5:if(v=Kr,Kr=!1,di(l,s,u),Kr=v,hi(s),g&512&&(Bt||d===null||$n(d,d.return)),s.flags&32){l=s.stateNode;try{ca(l,""),Pt=!0}catch(oe){Ht(s,s.return,oe)}}g&4&&s.stateNode!=null&&(l=s.memoizedProps,Vv(s,l,d!==null?d.memoizedProps:l)),g&1024&&(Yv=!0);break;case 6:if(di(l,s,u),hi(s),g&4){if(s.stateNode===null)throw Error(i(162));l=s.memoizedProps,u=s.stateNode;try{u.nodeValue=l,Pt=!0}catch(oe){Ht(s,s.return,oe)}}break;case 3:if(Pt=!1,Hh=null,v=Sr,Sr=Vc(l.containerInfo),di(l,s,u),Sr=v,hi(s),g&4&&d!==null&&d.memoizedState.isDehydrated)try{Ga(l.containerInfo)}catch(oe){Ht(s,s.return,oe)}Yv&&(Yv=!1,tR(s)),Pt=!1;break;case 4:g=Kr,Kr=Fn,d=xC(),v=Sr,Sr=Vc(s.stateNode.containerInfo),di(l,s,u),hi(s),Sr=v,Pt&&Oc&&(Ch=!0),Pt=d,Kr=g;break;case 12:di(l,s,u),hi(s);break;case 31:di(l,s,u),hi(s),g&4&&(l=s.updateQueue,l!==null&&(s.updateQueue=null,Th(s,l)));break;case 13:di(l,s,u),hi(s),s.child.flags&8192&&s.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Oh=st()),g&4&&(l=s.updateQueue,l!==null&&(s.updateQueue=null,Th(s,l)));break;case 22:v=s.memoizedState!==null,R=d!==null&&d.memoizedState!==null;var P=Fn,_=Bt,ee=Kr;Fn=P||v,Kr=ee||v,Bt=_||R,di(l,s,u),Bt=_,Kr=ee,Fn=P,hi(s),g&8192&&(l=s.stateNode,l._visibility=v?l._visibility&-2:l._visibility|1,!v||d===null||R||Fn||Bt||(l=R||Bt,u=Fn,d=Bt,Fn=v||Fn,Bt=l,go(s,2),Fn=u,Bt=d),!v&&Kr||Gv(s,v)),g&4&&(l=s.updateQueue,l!==null&&(u=l.retryQueue,u!==null&&(l.retryQueue=null,Th(s,u))));break;case 19:di(l,s,u),hi(s),g&4&&(l=s.updateQueue,l!==null&&(s.updateQueue=null,Th(s,l)));break;case 30:g&512&&(Bt||d===null||$n(d,d.return)),g=xC(),v=Oc,R=(u&335544064)===u,P=s.memoizedProps,Oc=R&&Ts(P.default,P.update)!=="none",di(l,s,u),hi(s),R&&d!==null&&Pt&&(s.flags|=4),Oc=v,Pt=g;break;case 21:break;case 7:g&512&&(Bt||d===null||$n(d,d.return)),d&&d.stateNode!==null&&(d.stateNode._fragmentFiber=s);default:di(l,s,u),hi(s)}}function hi(s){var l=s.flags;if(l&2){try{for(var u,d=s.return;d!==null;){if(_T(d)){u=d;break}d=d.return}d=null;for(var g=s.return;g!==null;){if(Lv(g)){var v=g.stateNode;d===null?d=[v]:d.push(v)}if(Nv(g))break;g=g.return}var R=d;if(u==null)throw Error(i(160));switch(u.tag){case 27:var P=u.stateNode,_=zv(s);bh(s,_,P,R);break;case 5:var ee=u.stateNode;u.flags&32&&(ca(ee,""),u.flags&=-33);var oe=zv(s);bh(s,oe,ee,R);break;case 3:case 4:var pe=u.stateNode.containerInfo,Q=zv(s);_v(s,Q,pe,R);break;default:throw Error(i(161))}}catch(re){Ht(s,s.return,re)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function tR(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;tR(l),l.tag===5&&l.flags&1024&&(l=l.stateNode,qa=!0,l.reset(),qa=!1),s=s.sibling}}function Ma(s,l){if(l.subtreeFlags&9270)for(l=l.child;l!==null;)nR(l,s),l=l.sibling;else qT(l)}function nR(s,l){var u=s.alternate;if(u===null)Hv(s,!1);else switch(s.tag){case 3:if(qv=Yr=!1,UT(),Ma(l,s),!Yr&&!Ch){if(s=Ur,s!==null)for(var d=0;d<s.length;d+=3){u=s[d];var g=s[d+1];jR(u,s[d+2]),u=u.ownerDocument.documentElement,u!==null&&u.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+g+")"})}s=l.containerInfo,s=s.nodeType===9?s.documentElement:s.ownerDocument.documentElement,s!==null&&s.style.viewTransitionName===""&&(s.style.viewTransitionName="none",s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),s.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),qv=!0}Ur=null;break;case 5:Ma(l,s);break;case 4:d=Yr,Yr=!1,Ma(l,s),Yr&&(Ch=!0),Yr=d;break;case 22:s.memoizedState===null&&(u.memoizedState!==null?Hv(s,!1):Ma(l,s));break;case 30:d=Yr,g=UT(),Yr=!1,Ma(l,s),Yr&&(s.flags|=4);var v=s.memoizedProps,R=s.stateNode;l=Es(v,R),R=Es(u.memoizedProps,R);var P=Ts(v.default,v.update);P==="none"?l=!1:(v=u.memoizedState,u.memoizedState=null,u=s.child,Ei=0,l=Kv(s,u,l,R,P,v,!0),Ei!==(v===null?0:v.length)&&(s.flags|=32)),(s.flags&4)!==0&&l?(Ba(s,s.memoizedProps.onUpdate),Ur=g):g!==null&&(g.push.apply(g,Ur),Ur=g),Yr=(s.flags&32)!==0?!0:d;break;default:Ma(l,s)}}function qr(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)WT(s,l.alternate,l),l=l.sibling}function go(s,l){for(s=s.child;s!==null;){var u=s,d=l;switch(u.tag){case 0:case 11:case 14:case 15:mo(4,u,u.return),go(u,d);break;case 1:$n(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&VT(u,u.return,g),go(u,d);break;case 27:(d&2)!==0&&tA(u.stateNode,u.type,u.memoizedProps);case 5:$n(u,u.return),u.tag!==5&&u.tag!==27||Ac(u),go(u,d);break;case 6:Ac(u);break;case 26:$n(u,u.return),g=u.stateNode,u.memoizedState!==null||g===null||Bt||g.parentNode.removeChild(g),go(u,d);break;case 22:u.memoizedState===null&&go(u,d);break;case 30:$n(u,u.return),go(u,d);break;case 7:$n(u,u.return);default:go(u,d)}s=s.sibling}}function xr(s,l,u){for(u=(l.subtreeFlags&8772)!==0?u:u&-2,l=l.child;l!==null;){var d=l.alternate,g=s,v=l,R=v.flags,P=(u&1)!==0;switch(v.tag){case 0:case 11:case 15:xr(g,v,u),Rc(4,v);break;case 1:if(xr(g,v,u),d=v,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(oe){Ht(d,d.return,oe)}if(d=v,g=d.updateQueue,g!==null){var _=d.stateNode;try{var ee=g.shared.hiddenCallbacks;if(ee!==null)for(g.shared.hiddenCallbacks=null,g=0;g<ee.length;g++)EE(ee[g],_)}catch(oe){Ht(d,d.return,oe)}}P&&R&64&&BT(v),Fr(v,v.return);break;case 27:(u&2)!==0&&HT(v);case 5:v.tag!==5&&v.tag!==27||zT(v),xr(g,v,u),P&&d===null&&R&4&&Bv(v),Fr(v,v.return);break;case 6:zT(v);break;case 26:_=v.stateNode,v.memoizedState!==null||_===null||Fn||P0(Vc(_.ownerDocument),v.type,_),xr(g,v,u),P&&d===null&&R&4&&Bv(v),Fr(v,v.return);break;case 12:xr(g,v,u);break;case 31:xr(g,v,u),P&&R&4&&ZT(g,v);break;case 13:xr(g,v,u),P&&R&4&&JT(g,v);break;case 22:v.memoizedState===null&&xr(g,v,u),Fr(v,v.return);break;case 30:xr(g,v,u),Fr(v,v.return);break;case 7:Fr(v,v.return);default:xr(g,v,u)}l=l.sibling}}function Xv(s,l){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&hc(u))}function $v(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&hc(s))}function er(s,l,u,d){var g=(u&335544064)===u;if(l.subtreeFlags&(g?10262:10256))for(l=l.child;l!==null;)iR(s,l,u,d),l=l.sibling;else g&&YT(l)}function iR(s,l,u,d){var g=(u&335544064)===u;g&&l.alternate===null&&l.return!==null&&l.return.alternate!==null&&wh(l);var v=l.flags;switch(l.tag){case 0:case 11:case 15:er(s,l,u,d),v&2048&&Rc(9,l);break;case 1:er(s,l,u,d);break;case 3:er(s,l,u,d),g&&qv&&(s=s.containerInfo,s=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,s.style.viewTransitionName==="root"&&(s.style.viewTransitionName=""),s=s.ownerDocument.documentElement,s!==null&&s.style.viewTransitionName==="none"&&(s.style.viewTransitionName="")),v&2048&&(v=null,l.alternate!==null&&(v=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==v&&(l.refCount++,v!=null&&hc(v)));break;case 12:if(v&2048){er(s,l,u,d),v=l.stateNode;try{var R=l.memoizedProps,P=R.id,_=R.onPostCommit;typeof _=="function"&&_(P,l.alternate===null?"mount":"update",v.passiveEffectDuration,-0)}catch(ee){Ht(l,l.return,ee)}}else er(s,l,u,d);break;case 31:er(s,l,u,d);break;case 13:er(s,l,u,d);break;case 23:break;case 22:R=l.stateNode,P=l.alternate,l.memoizedState!==null?(g&&P!==null&&P.memoizedState===null&&wh(P),R._visibility&2?er(s,l,u,d):Mc(s,l)):(g&&P!==null&&P.memoizedState!==null&&wh(l),R._visibility&2?er(s,l,u,d):(R._visibility|=2,Da(s,l,u,d,(l.subtreeFlags&10256)!==0||!1))),v&2048&&Xv(P,l);break;case 24:er(s,l,u,d),v&2048&&$v(l.alternate,l);break;case 30:g&&(v=l.alternate,v!==null&&(jr(v.child,!0),jr(l.child,!0))),er(s,l,u,d);break;default:er(s,l,u,d)}}function Da(s,l,u,d,g){for(g=g&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var v=s,R=l,P=u,_=d,ee=R.flags;switch(R.tag){case 0:case 11:case 15:Da(v,R,P,_,g),Rc(8,R);break;case 23:break;case 22:var oe=R.stateNode;R.memoizedState!==null?oe._visibility&2?Da(v,R,P,_,g):Mc(v,R):(oe._visibility|=2,Da(v,R,P,_,g)),g&&ee&2048&&Xv(R.alternate,R);break;case 24:Da(v,R,P,_,g),g&&ee&2048&&$v(R.alternate,R);break;default:Da(v,R,P,_,g)}l=l.sibling}}function Mc(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=s,d=l,g=d.flags;switch(d.tag){case 22:Mc(u,d),g&2048&&Xv(d.alternate,d);break;case 24:Mc(u,d),g&2048&&$v(d.alternate,d);break;default:Mc(u,d)}l=l.sibling}}var bl=8192;function Sl(s,l,u){if(s.subtreeFlags&bl)for(s=s.child;s!==null;)rR(s,l,u),s=s.sibling}function rR(s,l,u){switch(s.tag){case 26:Sl(s,l,u),s.flags&bl&&(s.memoizedState!==null?U5(u,Sr,s.memoizedState,s.memoizedProps):(s=s.stateNode,(l&335544128)===l&&fA(u,s)));break;case 5:Sl(s,l,u),s.flags&bl&&(s=s.stateNode,(l&335544128)===l&&fA(u,s));break;case 3:case 4:var d=Sr;Sr=Vc(s.stateNode.containerInfo),Sl(s,l,u),Sr=d;break;case 22:s.memoizedState===null&&(d=s.alternate,d!==null&&d.memoizedState!==null?(d=bl,bl=16777216,Sl(s,l,u),bl=d):Sl(s,l,u));break;case 30:if((s.flags&bl)!==0&&(d=s.memoizedProps.name,d!=null&&d!=="auto")){var g=s.stateNode;g.paired=null,Vi===null&&(Vi=new Map),Vi.set(d,g)}Sl(s,l,u);break;default:Sl(s,l,u)}}function sR(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Dc(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var d=l[u];Un=d,lR(d,s)}sR(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)oR(s),s=s.sibling}function oR(s){switch(s.tag){case 0:case 11:case 15:Dc(s),s.flags&2048&&mo(9,s,s.return);break;case 3:Dc(s);break;case 12:Dc(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Rh(s)):Dc(s);break;default:Dc(s)}}function Rh(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var d=l[u];Un=d,lR(d,s)}sR(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:mo(8,l,l.return),Rh(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Rh(l));break;default:Rh(l)}s=s.sibling}}function lR(s,l){for(;Un!==null;){var u=Un;switch(u.tag){case 0:case 11:case 15:mo(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var d=u.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:hc(u.memoizedState.cache)}if(d=u.child,d!==null)d.return=u,Un=d;else e:for(u=s;Un!==null;){d=Un;var g=d.sibling,v=d.return;if($T(d),d===u){Un=null;break e}if(g!==null){g.return=v,Un=g;break e}Un=v}}}var V4={getCacheForType:function(s){var l=Gn(En),u=l.data.get(s);return u===void 0&&(u=s(),l.data.set(s,u)),u},cacheSignal:function(){return Gn(En).controller.signal}},z4=typeof WeakMap=="function"?WeakMap:Map,It=0,Gt=null,bt=null,wt=0,_t=0,zi=null,yo=!1,ka=!1,Qv=!1,Ns=0,gn=0,vo=0,xl=0,Ah=0,_i=0,Pa=0,kc=null,Ri=null,Zv=!1,Oh=0,aR=0,Mh=1/0,Dh=null,bo=null,fn=0,wr=null,wl=null,Gr=0,Jv=0,e0=null,uR=null,Ia=null,Na=null,La=null,Pc=0,kh=null;function Hi(){return(It&2)!==0&&wt!==0?wt&-wt:ce.T!==null?c0():dC()}function cR(){if(_i===0)if((wt&536870912)===0||ht){var s=zt;zt<<=1,(zt&3932160)===0&&(zt=262144),_i=s}else _i=536870912;return s=Wn.current,s!==null&&(s.flags|=32),_i}function Ba(s,l){if(l!=null){var u=s.stateNode,d=u.ref;d===null&&(d=u.ref=KR(Es(s.memoizedProps,u))),Na===null&&(Na=[]),Na.push(l.bind(null,d))}}function Ai(s,l,u){(s===Gt&&(_t===2||_t===9)||s.cancelPendingCommit!==null)&&(Va(s,0),So(s,wt,_i,!1)),Ju(s,u),((It&2)===0||s!==Gt)&&(s===Gt&&((It&2)===0&&(xl|=u),gn===4&&So(s,wt,_i,!1)),Wr(s))}function fR(s,l,u){if((It&6)!==0)throw Error(i(327));var d=!u&&(l&127)===0&&(l&s.expiredLanes)===0||yr(s,l),g=d?F4(s,l):n0(s,l,!0),v=d;do{if(g===0){ka&&!d&&So(s,l,0,!1);break}else{if(u=s.current.alternate,v&&!_4(u)){g=n0(s,l,!1),v=!1;continue}if(g===2){if(v=l,s.errorRecoveryDisabledLanes&v)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){l=R;e:{var P=s;g=kc;var _=P.current.memoizedState.isDehydrated;if(_&&(Va(P,R).flags|=256),R=n0(P,R,!1),R!==2&&R!==6){if(Qv&&!_){P.errorRecoveryDisabledLanes|=v,xl|=v,g=4;break e}v=Ri,Ri=g,v!==null&&(Ri===null?Ri=v:Ri.push.apply(Ri,v))}g=R}if(v=!1,g!==2)continue}}if(g===1){Va(s,0),So(s,l,0,!0);break}e:{switch(d=s,v=g,v){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l&&(l&62914560)!==l)break;case 6:So(d,l,_i,!yo);break e;case 2:Ri=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(g=Oh+300-st(),10<g)){if(So(d,l,_i,!yo),gr(d,0,!0)!==0)break e;Gr=l,d.timeoutHandle=x0(dR.bind(null,d,u,Ri,Dh,Zv,l,_i,xl,Pa,yo,v,"Throttled",-0,0),g);break e}dR(d,u,Ri,Dh,Zv,l,_i,xl,Pa,yo,v,null,-0,0)}}break}while(!0);Wr(s)}function dR(s,l,u,d,g,v,R,P,_,ee,oe,pe,Q,re){s.timeoutHandle=-1;var Ne=l.subtreeFlags,Ue=(v&335544064)===v;if(pe=null,(Ue||Ne&8192||(Ne&16785408)===16785408)&&(pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zr},Vi=null,rR(l,v,pe),Ue&&(Ne=pe,Ue=s.containerInfo,Ue=(Ue.nodeType===9?Ue:Ue.ownerDocument).__reactViewTransition,Ue!=null&&(Ne.count++,Ne.waitingForViewTransition=!0,Ne=Hc.bind(Ne),Ue.finished.then(Ne,Ne))),Ne=(v&62914560)===v?Oh-st():(v&4194048)===v?aR-st():0,Ne=j5(pe,Ne),Ne!==null)){Gr=v,s.cancelPendingCommit=Ne(SR.bind(null,s,l,v,u,d,g,R,P,_,ee,oe,pe,null,Q,re)),So(s,v,R,!ee);return}SR(s,l,v,u,d,g,R,P,_,ee,oe,pe)}function _4(s){for(var l=s;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var d=0;d<u.length;d++){var g=u[d],v=g.getSnapshot;g=g.value;try{if(!Li(v(),g))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function So(s,l,u,d){l=ra(s,l),l&=~Ah,l&=~xl,s.suspendedLanes|=l,s.pingedLanes&=~l,d&&(s.warmLanes|=l),d=s.expirationTimes;for(var g=l;0<g;){var v=31-Xe(g),R=1<<v;d[v]=-1,g&=~R}u!==0&&uC(s,u,l)}function Ph(){return(It&6)===0?(Ic(0),!1):!0}function t0(){if(bt!==null){if(_t===0)var s=bt.return;else s=bt,Os=ul=null,uv(s),Ca=null,gc=0,s=bt;for(;s!==null;)LT(s.alternate,s),s=s.return;bt=null}}function Va(s,l){var u=s.timeoutHandle;return u!==-1&&(s.timeoutHandle=-1,u5(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Gr=0,t0(),Gt=s,bt=u=Rs(s.current,null),wt=l,_t=0,zi=null,yo=!1,ka=yr(s,l),Qv=!1,Pa=_i=Ah=xl=vo=gn=0,Ri=kc=null,Zv=!1,Ns=ra(s,l),Hd(),u}function hR(s,l){ut=null,ce.H=fh,l===wa||l===Qd?(l=SE(),_t=3):l===$y?(l=SE(),_t=4):_t=l===Ev?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,zi=l,bt===null&&(gn=1,dh(s,$i(l,s.current)))}function pR(){var s=Wn.current;return s===null?!0:(wt&4194048)===wt?si===null:(wt&62914560)===wt||(wt&536870912)!==0?s===si:!1}function mR(){var s=ce.H;return ce.H=fh,s===null?fh:s}function gR(){var s=ce.A;return ce.A=V4,s}function Ih(){gn=4,yo||(wt&4194048)!==wt&&Wn.current!==null||(ka=!0),(vo&134217727)===0&&(xl&134217727)===0||Gt===null||So(Gt,wt,_i,!1)}function n0(s,l,u){var d=It;It|=2;var g=mR(),v=gR();(Gt!==s||wt!==l)&&(Dh=null,Va(s,l)),l=!1;var R=gn;e:do try{if(_t!==0&&bt!==null){var P=bt,_=zi;switch(_t){case 8:t0(),R=6;break e;case 3:case 2:case 9:case 6:Wn.current===null&&(l=!0);var ee=_t;if(_t=0,zi=null,za(s,P,_,ee),u&&ka){R=0;break e}break;default:ee=_t,_t=0,zi=null,za(s,P,_,ee)}}H4(),R=gn;break}catch(oe){hR(s,oe)}while(!0);return l&&s.shellSuspendCounter++,Os=ul=null,It=d,ce.H=g,ce.A=v,bt===null&&(Gt=null,wt=0,Hd()),R}function H4(){for(;bt!==null;)yR(bt)}function F4(s,l){var u=It;It|=2;var d=mR(),g=gR();Gt!==s||wt!==l?(Dh=null,Mh=st()+500,Va(s,l)):ka=yr(s,l);e:do try{if(_t!==0&&bt!==null){l=bt;var v=zi;t:switch(_t){case 1:_t=0,zi=null,za(s,l,v,1);break;case 2:case 9:if(vE(v)){_t=0,zi=null,vR(l);break}l=function(){_t!==2&&_t!==9||Gt!==s||(_t=7),Wr(s)},v.then(l,l);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:vE(v)?(_t=0,zi=null,vR(l)):(_t=0,zi=null,za(s,l,v,7));break;case 5:var R=null;switch(bt.tag){case 26:R=bt.memoizedState;case 5:case 27:var P=bt;if(R?uA(R):P.stateNode.complete){_t=0,zi=null;var _=P.sibling;if(_!==null)bt=_;else{var ee=P.return;ee!==null?(bt=ee,Nh(ee)):bt=null}break t}}_t=0,zi=null,za(s,l,v,5);break;case 6:_t=0,zi=null,za(s,l,v,6);break;case 8:t0(),gn=6;break e;default:throw Error(i(462))}}U4();break}catch(oe){hR(s,oe)}while(!0);return Os=ul=null,ce.H=d,ce.A=g,It=u,bt!==null?0:(Gt=null,wt=0,Hd(),gn)}function U4(){for(;bt!==null&&!tn();)yR(bt)}function yR(s){var l=IT(s.alternate,s,Ns);s.memoizedProps=s.pendingProps,l===null?Nh(s):bt=l}function vR(s){var l=s,u=l.alternate;switch(l.tag){case 15:case 0:l=RT(u,l,l.pendingProps,l.type,void 0,wt);break;case 11:l=RT(u,l,l.pendingProps,l.type.render,l.ref,wt);break;case 5:uv(l);var d=l;d===Hn&&(ht?(qd(d),d.tag===5&&d.stateNode!=null&&(nn=d.stateNode)):(qd(d),ht=!0));default:LT(u,l),l=bt=lE(l,Ns),l=IT(u,l,Ns)}s.memoizedProps=s.pendingProps,l===null?Nh(s):bt=l}function za(s,l,u,d){Os=ul=null,uv(l),Ca=null,gc=0;var g=l.return;try{if(M4(s,g,l,u,wt)){gn=1,dh(s,$i(u,s.current)),bt=null;return}}catch(v){if(g!==null)throw bt=g,v;gn=1,dh(s,$i(u,s.current)),bt=null;return}l.flags&32768?(ht||d===1?s=!0:ka||(wt&536870912)!==0?s=!1:(yo=s=!0,(d===2||d===9||d===3||d===6)&&(d=Wn.current,d!==null&&d.tag===13&&(d.flags|=16384))),bR(l,s)):Nh(l)}function Nh(s){var l=s;do{if((l.flags&32768)!==0){bR(l,yo);return}s=l.return;var u=I4(l.alternate,l,Ns);if(u!==null){bt=u;return}if(l=l.sibling,l!==null){bt=l;return}bt=l=s}while(l!==null);gn===0&&(gn=5)}function bR(s,l){do{var u=N4(s.alternate,s);if(u!==null){u.flags&=32767,bt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(s=s.sibling,s!==null)){bt=s;return}bt=s=u}while(s!==null);gn=6,bt=null}function SR(s,l,u,d,g,v,R,P,_,ee,oe,pe){s.cancelPendingCommit=null;do Lh();while(fn!==0);if((It&6)!==0)throw Error(i(327));if(l!==null){if(l===s.current)throw Error(i(177));s===Gt&&(bt=Gt=null,wt=0),wl=l,wr=s,Gr=u,e0=g,uR=d,j4(s,l,u,R,P,_,pe)}}function j4(s,l,u,d,g,v,R){var P=l.lanes|l.childLanes;if(Jv=P,P|=Vy,m_(s,u,P,d,g,v),Na=null,(u&335544064)===u?(La=y4(s),d=10262):(La=null,d=10256),(l.subtreeFlags&d)!==0||(l.flags&d)!==0?(s.callbackNode=null,s.callbackPriority=0,X4(vt,function(){return o0(),null})):(s.callbackNode=null,s.callbackPriority=0),Sh=!1,d=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||d){d=ce.T,ce.T=null,g=ue.p,ue.p=2,v=It,It|=4;try{L4(s,l,u)}finally{It=v,ue.p=g,ce.T=d}}fn=1,Sh?Ia=m5(R,s.containerInfo,La,i0,r0,Y4,s0,o0,K4):(i0(),r0(),s0())}function K4(s){if(fn!==0){var l=wr.onRecoverableError;l(s,{componentStack:null})}}function Y4(){fn===3&&(fn=0,nR(wl,wr),fn=4)}function i0(){if(fn===1){fn=0;var s=wr,l=wl,u=Gr,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=ce.T,ce.T=null;var g=ue.p;ue.p=2;var v=It;It|=4;try{Oc=Ch=!1,eR(l,s,u),u=v0;var R=QC(s.containerInfo),P=u.focusedElem,_=u.selectionRange;if(R!==P&&P&&P.ownerDocument&&$C(P.ownerDocument.documentElement,P)){if(_!==null&&Py(P)){var ee=_.start,oe=_.end;if(oe===void 0&&(oe=ee),"selectionStart"in P)P.selectionStart=ee,P.selectionEnd=Math.min(oe,P.value.length);else{var pe=P.ownerDocument||document,Q=pe&&pe.defaultView||window;if(Q.getSelection){var re=Q.getSelection(),Ne=P.textContent.length,Ue=Math.min(_.start,Ne),ct=_.end===void 0?Ue:Math.min(_.end,Ne);!re.extend&&Ue>ct&&(R=ct,ct=Ue,Ue=R);var J=XC(P,Ue),W=XC(P,ct);if(J&&W&&(re.rangeCount!==1||re.anchorNode!==J.node||re.anchorOffset!==J.offset||re.focusNode!==W.node||re.focusOffset!==W.offset)){var ie=pe.createRange();ie.setStart(J.node,J.offset),re.removeAllRanges(),Ue>ct?(re.addRange(ie),re.extend(W.node,W.offset)):(ie.setEnd(W.node,W.offset),re.addRange(ie))}}}}for(pe=[],re=P;re=re.parentNode;)re.nodeType===1&&pe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<pe.length;P++){var he=pe[P];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}qa=!!y0,v0=y0=null}finally{It=v,ue.p=g,ce.T=d}}s.current=l,fn=2}}function r0(){if(fn===2){fn=0;var s=wr,l=wl,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=ce.T,ce.T=null;var d=ue.p;ue.p=2;var g=It;It|=4;try{WT(s,l.alternate,l)}finally{It=g,ue.p=d,ce.T=u}}fn=3}}function s0(){if(fn===4||fn===3){fn=0;var s=Ia;Ia=null,qe();var l=wr,u=wl,d=Gr,g=uR,v=(d&335544064)===d?10262:10256;if((u.subtreeFlags&v)!==0||(u.flags&v)!==0?fn=5:(fn=0,wl=wr=null,xR(l,l.pendingLanes)),v=l.pendingLanes,v===0&&(bo=null),py(d),u=u.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(Ae,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=ce.T,v=ue.p,ue.p=2,ce.T=null;try{for(var R=l.onRecoverableError,P=0;P<g.length;P++){var _=g[P];R(_.value,{componentStack:_.stack})}}finally{ce.T=u,ue.p=v}}if(g=Na,R=La,La=null,g!==null&&(Na=null,R===null&&(R=[]),s!==null))for(_=0;_<g.length;_++)u=(0,g[_])(R),u!==void 0&&s.finished.finally(u);(Gr&3)!==0&&Lh(),Wr(l),v=l.pendingLanes,(d&261930)!==0&&(v&42)!==0?l===kh?Pc++:(Pc=0,kh=l):(Pc=0,kh=null),Ic(0)}}function xR(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,hc(l)))}function Lh(){return Ia!==null&&(Ia.skipTransition(),Ia=null),i0(),r0(),s0(),o0()}function o0(){if(fn!==5)return!1;var s=wr,l=Jv;Jv=0;var u=py(Gr),d=ce.T,g=ue.p;try{ue.p=32>u?32:u,ce.T=null,u=e0,e0=null;var v=wr,R=Gr;if(fn=0,wl=wr=null,Gr=0,(It&6)!==0)throw Error(i(331));var P=It;if(It|=4,oR(v.current),iR(v,v.current,R,u),It=P,Ic(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Ae,v)}catch{}return!0}finally{ue.p=g,ce.T=d,xR(s,l)}}function wR(s,l,u){l=$i(u,l),l=Cv(s.stateNode,l,2),s=co(s,l,2),s!==null&&(Ju(s,2),Wr(s))}function Ht(s,l,u){if(s.tag===3)wR(s,s,u);else for(;l!==null;){if(l.tag===3){wR(l,s,u);break}else if(l.tag===1){var d=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(bo===null||!bo.has(d))){s=$i(u,s),u=vT(2),d=co(l,u,2),d!==null&&(bT(u,d,l,s),Ju(d,2),Wr(d));break}}l=l.return}}function l0(s,l,u){var d=s.pingCache;if(d===null){d=s.pingCache=new z4;var g=new Set;d.set(l,g)}else g=d.get(l),g===void 0&&(g=new Set,d.set(l,g));g.has(u)||(Qv=!0,g.add(u),s=q4.bind(null,s,l,u),l.then(s,s))}function q4(s,l,u){var d=s.pingCache;d!==null&&d.delete(l),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,Gt===s&&(wt&u)===u&&((gn===4||gn===3&&(wt&62914560)===wt&&300>st()-Oh)&&(It&2)===0?Va(s,0):Ah|=u,Pa===wt&&(Pa=0)),Wr(s)}function CR(s,l){l===0&&(l=aC()),s=ol(s,l),s!==null&&(Ju(s,l),Wr(s))}function G4(s){var l=s.memoizedState,u=0;l!==null&&(u=l.retryLane),CR(s,u)}function W4(s,l){var u=0;switch(s.tag){case 31:case 13:var d=s.stateNode,g=s.memoizedState;g!==null&&(u=g.retryLane);break;case 19:d=s.stateNode;break;case 22:d=s.stateNode._retryCache;break;default:throw Error(i(314))}d!==null&&d.delete(l),CR(s,u)}function X4(s,l){return hn(s,l)}var _a=null,Ha=null,a0=!1,Bh=!1,u0=!1,xo=0;function Wr(s){s!==Ha&&s.next===null&&(Ha===null?_a=Ha=s:Ha=Ha.next=s),Bh=!0,a0||(a0=!0,Q4())}function Ic(s,l){if(!u0&&Bh){u0=!0;do for(var u=!1,d=_a;d!==null;){if(s!==0){var g=d.pendingLanes;if(g===0)var v=0;else{var R=d.suspendedLanes,P=d.pingedLanes;v=(1<<31-Xe(42|s)+1)-1,v&=g&~(R&~P),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,AR(d,v))}else v=wt,v=gr(d,d===Gt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||yr(d,v)||(u=!0,AR(d,v));d=d.next}while(u);u0=!1}}function $4(){ER()}function ER(){Bh=a0=!1;var s=0;xo!==0&&a5()&&(s=xo);for(var l=st(),u=null,d=_a;d!==null;){var g=d.next,v=TR(d,l);v===0?(d.next=null,u===null?_a=g:u.next=g,g===null&&(Ha=u)):(u=d,(s!==0||(v&3)!==0)&&(Bh=!0)),d=g}fn!==0&&fn!==5||Ic(s),xo!==0&&(xo=0)}function TR(s,l){for(var u=s.suspendedLanes,d=s.pingedLanes,g=s.expirationTimes,v=s.pendingLanes&-62914561;0<v;){var R=31-Xe(v),P=1<<R,_=g[R];_===-1?((P&u)===0||(P&d)!==0)&&(g[R]=Ad(P,l)):_<=l&&(s.expiredLanes|=P),v&=~P}if(l=Gt,u=wt,u=gr(s,s===l?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),d=s.callbackNode,u===0||s===l&&(_t===2||_t===9)||s.cancelPendingCommit!==null)return d!==null&&d!==null&&qt(d),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||yr(s,u)){if(l=u&-u,l===s.callbackPriority)return l;switch(d!==null&&qt(d),py(u)){case 2:case 8:u=lt;break;case 32:u=vt;break;case 268435456:u=un;break;default:u=vt}return d=RR.bind(null,s),u=hn(u,d),s.callbackPriority=l,s.callbackNode=u,l}return d!==null&&d!==null&&qt(d),s.callbackPriority=2,s.callbackNode=null,2}function RR(s,l){if(fn!==0&&fn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Lh()&&s.callbackNode!==u)return null;var d=wt;return d=gr(s,s===Gt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),d===0?null:(fR(s,d,l),TR(s,st()),s.callbackNode!=null&&s.callbackNode===u?RR.bind(null,s):null)}function AR(s,l){if(Lh())return null;fR(s,l,!0)}function Q4(){c5(function(){(It&6)!==0?hn(ot,$4):ER()})}function c0(){if(xo===0){var s=dl;s===0&&(s=pt,pt<<=1,(pt&261888)===0&&(pt=256)),xo=s}return xo}function OR(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Pd(s)}function Z4(s,l,u,d,g){if(l==="submit"&&u&&u.stateNode===g){var v=OR((g[wi]||null).action),R=d.submitter;R&&(l=(l=R[wi]||null)?OR(l.formAction):R.getAttribute("formAction"),l!==null&&(v=l,R=null));var P=new Bd("action","action",null,d,g);s.push({event:P,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(xo!==0){var _=new FormData(g,R);vv(u,{pending:!0,data:_,method:g.method,action:v},null,_)}}else typeof v=="function"&&(P.preventDefault(),_=new FormData(g,R),vv(u,{pending:!0,data:_,method:g.method,action:v},v,_))},currentTarget:g}]})}}for(var f0=0;f0<By.length;f0++){var d0=By[f0],J4=d0.toLowerCase(),e5=d0[0].toUpperCase()+d0.slice(1);vr(J4,"on"+e5)}vr(eE,"onAnimationEnd"),vr(tE,"onAnimationIteration"),vr(nE,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(u4,"onTransitionRun"),vr(c4,"onTransitionStart"),vr(f4,"onTransitionCancel"),vr(iE,"onTransitionEnd"),aa("onMouseEnter",["mouseout","mouseover"]),aa("onMouseLeave",["mouseout","mouseover"]),aa("onPointerEnter",["pointerout","pointerover"]),aa("onPointerLeave",["pointerout","pointerover"]),il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),il("onBeforeInput",["compositionend","keypress","textInput","paste"]),il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),t5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function MR(s,l){l=(l&4)!==0;for(var u=0;u<s.length;u++){var d=s[u],g=d.event;d=d.listeners;e:{var v=void 0;if(l)for(var R=d.length-1;0<=R;R--){var P=d[R],_=P.instance,ee=P.currentTarget;if(P=P.listener,_!==v&&g.isPropagationStopped())break e;v=P,g.currentTarget=ee;try{v(g)}catch(oe){_d(oe)}g.currentTarget=null,v=_}else for(R=0;R<d.length;R++){if(P=d[R],_=P.instance,ee=P.currentTarget,P=P.listener,_!==v&&g.isPropagationStopped())break e;v=P,g.currentTarget=ee;try{v(g)}catch(oe){_d(oe)}g.currentTarget=null,v=_}}}}function St(s,l){var u=l[pC];u===void 0&&(u=l[pC]=new Set);var d=s+"__bubble";u.has(d)||(DR(l,s,2,!1),u.add(d))}function h0(s,l,u){var d=0;l&&(d|=4),DR(u,s,d,l)}var Vh="_reactListening"+Math.random().toString(36).slice(2);function p0(s){if(!s[Vh]){s[Vh]=!0,yC.forEach(function(u){u!=="selectionchange"&&(t5.has(u)||h0(u,!1,s),h0(u,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Vh]||(l[Vh]=!0,h0("selectionchange",!1,l))}}function DR(s,l,u,d){switch(bA(l)){case 2:var g=G5;break;case 8:g=W5;break;default:g=N0}u=g.bind(null,l,u,s),g=void 0,!wy||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(g=!0),d?g!==void 0?s.addEventListener(l,u,{capture:!0,passive:g}):s.addEventListener(l,u,!0):g!==void 0?s.addEventListener(l,u,{passive:g}):s.addEventListener(l,u,!1)}function m0(s,l,u,d,g){var v=d;if((l&1)===0&&(l&2)===0&&d!==null)e:for(;;){if(d===null)return;var R=d.tag;if(R===3||R===4){var P=d.stateNode.containerInfo;if(P===g)break;if(R===4)for(R=d.return;R!==null;){var _=R.tag;if((_===3||_===4)&&R.stateNode.containerInfo===g)return;R=R.return}for(;P!==null;){if(R=nl(P),R===null)return;if(_=R.tag,_===5||_===6||_===26||_===27){d=v=R;continue e}P=P.parentNode}}d=d.return}DC(function(){var ee=v,oe=Sy(u),pe=[];e:{var Q=rE.get(s);if(Q!==void 0){var re=Bd,Ne=s;switch(s){case"keypress":if(Nd(u)===0)break e;case"keydown":case"keyup":re=__;break;case"focusin":Ne="focus",re=Ry;break;case"focusout":Ne="blur",re=Ry;break;case"beforeblur":case"afterblur":re=Ry;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=IC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=A_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=K_;break;case eE:case tE:case nE:re=D_;break;case iE:re=q_;break;case"scroll":case"scrollend":re=T_;break;case"wheel":re=W_;break;case"copy":case"cut":case"paste":re=P_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=LC;break;case"submit":re=U_;break;case"toggle":case"beforetoggle":re=$_}var Ue=(l&4)!==0,ct=!Ue&&(s==="scroll"||s==="scrollend"),J=Ue?Q!==null?Q+"Capture":null:Q;Ue=[];for(var W=ee,ie;W!==null;){var he=W;if(ie=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ie===null||J===null||(he=nc(W,J),he!=null&&Ue.push(Lc(W,he,ie))),ct)break;W=W.return}0<Ue.length&&(Q=new re(Q,Ne,null,u,oe),pe.push({event:Q,listeners:Ue}))}}if((l&7)===0){e:{if(re=s==="mouseover"||s==="pointerover",Q=s==="mouseout"||s==="pointerout",re&&u!==by&&(Ne=u.relatedTarget||u.fromElement)&&(nl(Ne)||Ne[sa]))break e;(Q||re)&&(Ne=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,Q?(re=u.relatedTarget||u.toElement,Q=ee,re=re?nl(re):null,re!==null&&(ct=o(re),Ue=re.tag,re!==ct||Ue!==5&&Ue!==27&&Ue!==6)&&(re=null)):(Q=null,re=ee),Q!==re&&(Ue=IC,he="onMouseLeave",J="onMouseEnter",W="mouse",(s==="pointerout"||s==="pointerover")&&(Ue=LC,he="onPointerLeave",J="onPointerEnter",W="pointer"),ct=Q==null?Ne:tc(Q),ie=re==null?Ne:tc(re),Ne=new Ue(he,W+"leave",Q,u,oe),Ne.target=ct,Ne.relatedTarget=ie,he=null,nl(oe)===ee&&(Ue=new Ue(J,W+"enter",re,u,oe),Ue.target=ie,Ue.relatedTarget=ct,he=Ue),ct=he,Ue=Q&&re?k(Q,re,n5):null,Q!==null&&kR(pe,Ne,Q,Ue,!1),re!==null&&ct!==null&&kR(pe,ct,re,Ue,!0)))}e:{if(Q=ee?tc(ee):window,re=Q.nodeName&&Q.nodeName.toLowerCase(),re==="select"||re==="input"&&Q.type==="file")var Fe=jC;else if(FC(Q))if(KC)Fe=o4;else{Fe=r4;var Ct=i4}else re=Q.nodeName,!re||re.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?ee&&vy(ee.elementType)&&(Fe=jC):Fe=s4;if(Fe&&(Fe=Fe(s,ee))){UC(pe,Fe,u,oe);break e}Ct&&Ct(s,Q,ee)}switch(Ct=ee?tc(ee):window,s){case"focusin":(FC(Ct)||Ct.contentEditable==="true")&&(pa=Ct,Iy=ee,cc=null);break;case"focusout":cc=Iy=pa=null;break;case"mousedown":Ny=!0;break;case"contextmenu":case"mouseup":case"dragend":Ny=!1,ZC(pe,u,oe);break;case"selectionchange":if(a4)break;case"keydown":case"keyup":ZC(pe,u,oe)}var $e;if(Oy)e:{switch(s){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else ha?_C(s,u)&&(et="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(et="onCompositionStart");et&&(BC&&u.locale!=="ko"&&(ha||et!=="onCompositionStart"?et==="onCompositionEnd"&&ha&&($e=kC()):(to=oe,Cy="value"in to?to.value:to.textContent,ha=!0)),Ct=zh(ee,et),0<Ct.length&&(et=new NC(et,s,null,u,oe),pe.push({event:et,listeners:Ct}),$e?et.data=$e:($e=HC(u),$e!==null&&(et.data=$e)))),($e=Z_?J_(s,u):e4(s,u))&&(et=zh(ee,"onBeforeInput"),0<et.length&&(Ct=new NC("onBeforeInput","beforeinput",null,u,oe),pe.push({event:Ct,listeners:et}),Ct.data=$e)),Z4(pe,s,ee,u,oe)}MR(pe,l)})}function Lc(s,l,u){return{instance:s,listener:l,currentTarget:u}}function zh(s,l){for(var u=l+"Capture",d=[];s!==null;){var g=s,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=nc(s,u),g!=null&&d.unshift(Lc(s,g,v)),g=nc(s,l),g!=null&&d.push(Lc(s,g,v))),s.tag===3)return d;s=s.return}return[]}function n5(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function kR(s,l,u,d,g){for(var v=l._reactName,R=[];u!==null&&u!==d;){var P=u,_=P.alternate,ee=P.stateNode;if(P=P.tag,_!==null&&_===d)break;P!==5&&P!==26&&P!==27||ee===null||(_=ee,g?(ee=nc(u,v),ee!=null&&R.unshift(Lc(u,ee,_))):g||(ee=nc(u,v),ee!=null&&R.push(Lc(u,ee,_)))),u=u.return}R.length!==0&&s.push({event:l,listeners:R})}var i5=/\r\n?/g,r5=/\u0000|\uFFFD/g;function PR(s){return(typeof s=="string"?s:""+s).replace(i5,`
9
+ `).replace(r5,"")}function IR(s,l){return l=PR(l),PR(s)===l}function Ft(s,l,u,d,g,v){switch(u){case"children":if(typeof d=="string")l==="body"||l==="textarea"&&d===""||ca(s,d);else if(typeof d=="number"||typeof d=="bigint")l!=="body"&&ca(s,""+d);else return;break;case"className":kd(s,"class",d);break;case"tabIndex":kd(s,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":kd(s,u,d);break;case"style":OC(s,d,v);return;case"data":if(l!=="object"){kd(s,"data",d);break}case"src":case"href":if(d===""&&(l!=="a"||u!=="href")){s.removeAttribute(u);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(u);break}d=Pd(d),s.setAttribute(u,d);break;case"action":case"formAction":if(typeof d=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(u==="formAction"?(l!=="input"&&Ft(s,l,"name",g.name,g,null),Ft(s,l,"formEncType",g.formEncType,g,null),Ft(s,l,"formMethod",g.formMethod,g,null),Ft(s,l,"formTarget",g.formTarget,g,null)):(Ft(s,l,"encType",g.encType,g,null),Ft(s,l,"method",g.method,g,null),Ft(s,l,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(u);break}d=Pd(d),s.setAttribute(u,d);break;case"onClick":d!=null&&(s.onclick=zr);return;case"onScroll":d!=null&&St("scroll",s);return;case"onScrollEnd":d!=null&&St("scrollend",s);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(u=d.__html,u!=null){if(g.children!=null)throw Error(i(60));v?.__html!==u&&(s.innerHTML=u)}}break;case"multiple":s.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":s.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){s.removeAttribute("xlink:href");break}u=Pd(d),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(u,d):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":d===!0?s.setAttribute(u,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(u,d):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?s.setAttribute(u,d):s.removeAttribute(u);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?s.removeAttribute(u):s.setAttribute(u,d);break;case"popover":St("beforetoggle",s),St("toggle",s),Dd(s,"popover",d);break;case"xlinkActuate":ws(s,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ws(s,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ws(s,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ws(s,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ws(s,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ws(s,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ws(s,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ws(s,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ws(s,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Dd(s,"is",d);break;case"innerText":case"textContent":return;default:if(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")u=C_.get(u)||u,Dd(s,u,d);else return}Pt=!0}function g0(s,l,u,d,g,v){switch(u){case"style":OC(s,d,v);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(u=d.__html,u!=null){if(g.children!=null)throw Error(i(60));v?.__html!==u&&(s.innerHTML=u)}}break;case"children":if(typeof d=="string")ca(s,d);else if(typeof d=="number"||typeof d=="bigint")ca(s,""+d);else return;break;case"onScroll":d!=null&&St("scroll",s);return;case"onScrollEnd":d!=null&&St("scrollend",s);return;case"onClick":d!=null&&(s.onclick=zr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!vC.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),v=u.slice(2,g?u.length-7:void 0),l=s[wi]||null,l=l!=null?l[u]:null,typeof l=="function"&&s.removeEventListener(v,l,g),typeof d=="function")){typeof l!="function"&&l!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(v,d,g);break e}Pt=!0,u in s?s[u]=d:d===!0?s.setAttribute(u,""):Dd(s,u,d)}return}Pt=!0}function Qn(s,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",s),St("load",s);var d=!1,g=!1,v;for(v in u)if(u.hasOwnProperty(v)){var R=u[v];if(R!=null)switch(v){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Ft(s,l,v,R,u,null)}}g&&Ft(s,l,"srcSet",u.srcSet,u,null),d&&Ft(s,l,"src",u.src,u,null);return;case"input":St("invalid",s);var P=v=R=g=null,_=null,ee=null;for(d in u)if(u.hasOwnProperty(d)){var oe=u[d];if(oe!=null)switch(d){case"name":g=oe;break;case"type":R=oe;break;case"checked":_=oe;break;case"defaultChecked":ee=oe;break;case"value":v=oe;break;case"defaultValue":P=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,l));break;default:Ft(s,l,d,oe,u,null)}}EC(s,v,P,_,ee,R,g,!1);return;case"select":St("invalid",s),d=R=v=null;for(g in u)if(u.hasOwnProperty(g)&&(P=u[g],P!=null))switch(g){case"value":v=P;break;case"defaultValue":R=P;break;case"multiple":d=P;default:Ft(s,l,g,P,u,null)}l=v,u=R,s.multiple=!!d,l!=null?ua(s,!!d,l,!1):u!=null&&ua(s,!!d,u,!0);return;case"textarea":St("invalid",s),v=g=d=null;for(R in u)if(u.hasOwnProperty(R)&&(P=u[R],P!=null))switch(R){case"value":d=P;break;case"defaultValue":g=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(91));break;default:Ft(s,l,R,P,u,null)}RC(s,d,g,v);return;case"option":for(_ in u)u.hasOwnProperty(_)&&(d=u[_],d!=null)&&(_==="selected"?s.selected=d&&typeof d!="function"&&typeof d!="symbol":Ft(s,l,_,d,u,null));return;case"dialog":St("beforetoggle",s),St("toggle",s),St("cancel",s),St("close",s);break;case"iframe":case"object":St("load",s);break;case"video":case"audio":for(d=0;d<Nc.length;d++)St(Nc[d],s);break;case"image":St("error",s),St("load",s);break;case"details":St("toggle",s);break;case"embed":case"source":case"link":St("error",s),St("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in u)if(u.hasOwnProperty(ee)&&(d=u[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Ft(s,l,ee,d,u,null)}return;default:if(vy(l)){for(oe in u)u.hasOwnProperty(oe)&&(d=u[oe],d!==void 0&&g0(s,l,oe,d,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(d=u[P],d!=null&&Ft(s,l,P,d,u,null))}var s5={};function o5(s,l,u,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,R=null,P=null,_=null,ee=null,oe=null;for(re in u){var pe=u[re];if(u.hasOwnProperty(re)&&pe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":_=pe;default:d.hasOwnProperty(re)||Ft(s,l,re,null,d,pe)}}for(var Q in d){var re=d[Q];if(pe=u[Q],d.hasOwnProperty(Q)&&(re!=null||pe!=null))switch(Q){case"type":re!==pe&&(Pt=!0),v=re;break;case"name":re!==pe&&(Pt=!0),g=re;break;case"checked":re!==pe&&(Pt=!0),ee=re;break;case"defaultChecked":re!==pe&&(Pt=!0),oe=re;break;case"value":re!==pe&&(Pt=!0),R=re;break;case"defaultValue":re!==pe&&(Pt=!0),P=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,l));break;default:re!==pe&&Ft(s,l,Q,re,d,pe)}}gy(s,R,P,_,ee,oe,v,g);return;case"select":re=R=P=Q=null;for(v in u)if(_=u[v],u.hasOwnProperty(v)&&_!=null)switch(v){case"value":break;case"multiple":re=_;default:d.hasOwnProperty(v)||Ft(s,l,v,null,d,_)}for(g in d)if(v=d[g],_=u[g],d.hasOwnProperty(g)&&(v!=null||_!=null))switch(g){case"value":v!==_&&(Pt=!0),Q=v;break;case"defaultValue":v!==_&&(Pt=!0),P=v;break;case"multiple":v!==_&&(Pt=!0),R=v;default:v!==_&&Ft(s,l,g,v,d,_)}l=P,u=R,d=re,Q!=null?ua(s,!!u,Q,!1):!!d!=!!u&&(l!=null?ua(s,!!u,l,!0):ua(s,!!u,u?[]:"",!1));return;case"textarea":re=Q=null;for(P in u)if(g=u[P],u.hasOwnProperty(P)&&g!=null&&!d.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Ft(s,l,P,null,d,g)}for(R in d)if(g=d[R],v=u[R],d.hasOwnProperty(R)&&(g!=null||v!=null))switch(R){case"value":g!==v&&(Pt=!0),Q=g;break;case"defaultValue":g!==v&&(Pt=!0),re=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==v&&Ft(s,l,R,g,d,v)}TC(s,Q,re);return;case"option":for(var Ne in u)Q=u[Ne],u.hasOwnProperty(Ne)&&Q!=null&&!d.hasOwnProperty(Ne)&&(Ne==="selected"?s.selected=!1:Ft(s,l,Ne,null,d,Q));for(_ in d)Q=d[_],re=u[_],d.hasOwnProperty(_)&&Q!==re&&(Q!=null||re!=null)&&(_==="selected"?(Q!==re&&(Pt=!0),s.selected=Q&&typeof Q!="function"&&typeof Q!="symbol"):Ft(s,l,_,Q,d,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ue in u)Q=u[Ue],u.hasOwnProperty(Ue)&&Q!=null&&!d.hasOwnProperty(Ue)&&Ft(s,l,Ue,null,d,Q);for(ee in d)if(Q=d[ee],re=u[ee],d.hasOwnProperty(ee)&&Q!==re&&(Q!=null||re!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,l));break;default:Ft(s,l,ee,Q,d,re)}return;default:if(vy(l)){for(var ct in u)Q=u[ct],u.hasOwnProperty(ct)&&Q!==void 0&&!d.hasOwnProperty(ct)&&g0(s,l,ct,void 0,d,Q);for(oe in d)Q=d[oe],re=u[oe],!d.hasOwnProperty(oe)||Q===re||Q===void 0&&re===void 0||g0(s,l,oe,Q,d,re);return}}for(var J in u)Q=u[J],u.hasOwnProperty(J)&&Q!=null&&!d.hasOwnProperty(J)&&Ft(s,l,J,null,d,Q);for(pe in d)Q=d[pe],re=u[pe],!d.hasOwnProperty(pe)||Q===re||Q==null&&re==null||Ft(s,l,pe,Q,d,re)}function NR(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l5(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,u=performance.getEntriesByType("resource"),d=0;d<u.length;d++){var g=u[d],v=g.transferSize,R=g.initiatorType,P=g.duration;if(v&&P&&NR(R)){for(R=0,P=g.responseEnd,d+=1;d<u.length;d++){var _=u[d],ee=_.startTime;if(ee>P)break;var oe=_.transferSize,pe=_.initiatorType;oe&&NR(pe)&&(_=_.responseEnd,R+=oe*(_<P?1:(P-ee)/(_-ee)))}if(--d,l+=8*(v+R)/(g.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var y0=null,v0=null;function Bc(s){return s.nodeType===9?s:s.ownerDocument}function LR(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function BR(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function VR(s,l,u,d){return u=Bc(u).createElement(s),u[qn]=d,u[wi]=l,Qn(u,s,l),_n(u),u}function b0(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var S0=null;function a5(){var s=window.event;return s&&s.type==="popstate"?s===S0?!1:(S0=s,!0):(S0=null,!1)}var x0=typeof setTimeout=="function"?setTimeout:void 0,u5=typeof clearTimeout=="function"?clearTimeout:void 0,zR=typeof Promise=="function"?Promise:void 0,_R=typeof requestAnimationFrame=="function"?requestAnimationFrame:x0,c5=typeof queueMicrotask=="function"?queueMicrotask:typeof zR<"u"?function(s){return zR.resolve(null).then(s).catch(f5)}:x0;function f5(s){setTimeout(function(){throw s})}function wo(s){return s==="head"}function HR(s,l){var u=l,d=0;do{var g=u.nextSibling;if(s.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"||u==="/&"){if(d===0){s.removeChild(g),Ga(l);return}d--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")d++;else if(u==="html")M0(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,M0(u);for(var v=u.firstChild;v;){var R=v.nextSibling,P=v.nodeName;v[ec]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=R}}else u==="body"&&M0(s.ownerDocument.body);u=g}while(u);Ga(l)}function FR(s,l){var u=s;s=0;do{var d=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),d&&d.nodeType===8)if(u=d.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=d}while(u)}function UR(s,l,u){if(l=CSS.escape(l)!==l?"r-"+btoa(l).replace(/=/g,""):l,s.style.viewTransitionName=l,u!=null&&(s.style.viewTransitionClass=u),u=getComputedStyle(s),u.display==="inline"){if(l=s.getClientRects(),l.length===1)var d=1;else for(var g=d=0;g<l.length;g++){var v=l[g];0<v.width&&0<v.height&&d++}d===1&&(s=s.style,s.display=l.length===1?"inline-block":"block",s.marginTop="-"+u.paddingTop,s.marginBottom="-"+u.paddingBottom)}}function jR(s,l){s=s.style,l=l.style;var u=l!=null?l.hasOwnProperty("viewTransitionName")?l.viewTransitionName:l.hasOwnProperty("view-transition-name")?l["view-transition-name"]:null:null;s.viewTransitionName=u==null||typeof u=="boolean"?"":(""+u).trim(),u=l!=null?l.hasOwnProperty("viewTransitionClass")?l.viewTransitionClass:l.hasOwnProperty("view-transition-class")?l["view-transition-class"]:null:null,s.viewTransitionClass=u==null||typeof u=="boolean"?"":(""+u).trim(),s.display==="inline-block"&&(l==null?s.display=s.margin="":(u=l.display,s.display=u==null||typeof u=="boolean"?"":u,u=l.margin,u!=null?s.margin=u:(u=l.hasOwnProperty("marginTop")?l.marginTop:l["margin-top"],s.marginTop=u==null||typeof u=="boolean"?"":u,l=l.hasOwnProperty("marginBottom")?l.marginBottom:l["margin-bottom"],s.marginBottom=l==null||typeof l=="boolean"?"":l)))}function d5(s,l,u){return u=u.ownerDocument.defaultView,{rect:s,abs:l.position==="absolute"||l.position==="fixed",clip:l.clipPath!=="none"||l.overflow!=="visible"||l.filter!=="none"||l.mask!=="none"||l.mask!=="none"||l.borderRadius!=="0px",view:0<=s.bottom&&0<=s.right&&s.top<=u.innerHeight&&s.left<=u.innerWidth}}function w0(s){var l=s.getBoundingClientRect(),u=getComputedStyle(s);return d5(l,u,s)}function h5(s){return s.documentElement.clientHeight}function p5(s){this.addEventListener("load",s),this.addEventListener("error",s)}function m5(s,l,u,d,g,v,R,P,_){var ee=l.nodeType===9?l:l.ownerDocument;try{var oe=ee.startViewTransition({update:function(){var Q=ee.defaultView,re=Q.navigation&&Q.navigation.transition,Ne=ee.fonts.status;d();var Ue=[];if(Ne==="loaded"&&(h5(ee),ee.fonts.status==="loading"&&Ue.push(ee.fonts.ready)),Ne=Ue.length,s!==null)for(var ct=s.suspenseyImages,J=0,W=0;W<ct.length;W++){var ie=ct[W];if(!ie.complete){var he=ie.getBoundingClientRect();if(0<he.bottom&&0<he.right&&he.top<Q.innerHeight&&he.left<Q.innerWidth){if(J+=cA(ie),J>Fh){Ue.length=Ne;break}ie=new Promise(p5.bind(ie)),Ue.push(ie)}}}if(0<Ue.length)return Q=Promise.race([Promise.all(Ue),new Promise(function(Fe){return setTimeout(Fe,500)})]).then(g,g),(re?Promise.allSettled([re.finished,Q]):Q).then(v,v);if(g(),re)return re.finished.then(v,v);v()},types:u});ee.__reactViewTransition=oe;var pe=[];return oe.ready.then(function(){for(var Q=ee.documentElement.getAnimations({subtree:!0}),re=0;re<Q.length;re++){var Ne=Q[re],Ue=Ne.effect,ct=Ue.pseudoElement;if(ct!=null&&ct.startsWith("::view-transition")){pe.push(Ne),Ne=Ue.getKeyframes();for(var J=ct=void 0,W=!0,ie=0;ie<Ne.length;ie++){var he=Ne[ie],Fe=he.width;if(ct===void 0)ct=Fe;else if(ct!==Fe){W=!1;break}if(Fe=he.height,J===void 0)J=Fe;else if(J!==Fe){W=!1;break}delete he.width,delete he.height,he.transform==="none"&&delete he.transform}W&&ct!==void 0&&J!==void 0&&(Ue.setKeyframes(Ne),W=getComputedStyle(Ue.target,Ue.pseudoElement),W.width!==ct||W.height!==J)&&(W=Ne[0],W.width=ct,W.height=J,W=Ne[Ne.length-1],W.width=ct,W.height=J,Ue.setKeyframes(Ne))}}R()},function(Q){ee.__reactViewTransition===oe&&(ee.__reactViewTransition=null);try{typeof Q=="object"&&Q!==null&&Q.name==="InvalidStateError"&&(Q.message==="View transition was skipped because document visibility state is hidden."||Q.message==="Skipping view transition because document visibility state has become hidden."||Q.message==="Skipping view transition because viewport size changed."||Q.message==="Transition was aborted because of invalid state")&&(Q=null),Q!==null&&_(Q)}finally{d(),g(),R()}}),oe.finished.finally(function(){for(var Q=0;Q<pe.length;Q++)pe[Q].cancel();ee.__reactViewTransition===oe&&(ee.__reactViewTransition=null),P()}),oe}catch{return d(),g(),R(),null}}function Cl(s,l){this._scope=document.documentElement,this._selector="::view-transition-"+s+"("+l+")"}Cl.prototype.animate=function(s,l){return l=typeof l=="number"?{duration:l}:M({},l),l.pseudoElement=this._selector,this._scope.animate(s,l)},Cl.prototype.getAnimations=function(){for(var s=this._scope,l=this._selector,u=s.getAnimations({subtree:!0}),d=[],g=0;g<u.length;g++){var v=u[g].effect;v!==null&&v.target===s&&v.pseudoElement===l&&d.push(u[g])}return d},Cl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function KR(s){return{name:s,group:new Cl("group",s),imagePair:new Cl("image-pair",s),old:new Cl("old",s),new:new Cl("new",s)}}function Fi(s){this._fragmentFiber=s,this._observers=this._eventListeners=null}Fi.prototype.addEventListener=function(s,l,u){var d=null,g=null;if(!(u!=null&&typeof u!="boolean"&&(d=u.signal||null,d!==null&&d.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var v=this._eventListeners;if(qR(v,s,l,u)===-1){var R=this,P=l;u!=null&&typeof u!="boolean"&&u.once===!0&&(P=function(_){R.removeEventListener(s,l,u),typeof l=="function"?l.call(this,_):l.handleEvent(_)}),d!==null&&(g=R.removeEventListener.bind(R,s,l,u),d.addEventListener("abort",g,{once:!0}),g=d.removeEventListener.bind(d,"abort",g)),d=Fa(u),v.push({type:s,listener:l,optionsOrUseCapture:u,attachedListener:P,cleanup:g}),p(this._fragmentFiber.child,!1,g5,s,P,d)}this._eventListeners=v}};function g5(s,l,u,d){return C(s).addEventListener(l,u,d),!1}Fi.prototype.removeEventListener=function(s,l,u){var d=this._eventListeners;if(d!==null&&(l=qR(d,s,l,u),l!==-1)){var g=d[l];u=g.attachedListener;var v=g.cleanup;g=Fa(g.optionsOrUseCapture),p(this._fragmentFiber.child,!1,y5,s,u,g),d.splice(l,1),v!==null&&v()}};function y5(s,l,u,d){return C(s).removeEventListener(l,u,d),!1}function Fa(s){return s!=null&&typeof s!="boolean"&&(s.once===!0||s.signal instanceof AbortSignal)?{capture:s.capture,passive:s.passive}:s}function YR(s){return s==null?"c=0":typeof s=="boolean"?"c="+(s?"1":"0"):"c="+(s.capture?"1":"0")}function qR(s,l,u,d){if(s.length===0)return-1;d=YR(d);for(var g=0;g<s.length;g++){var v=s[g];if(v.type===l&&v.listener===u&&YR(v.optionsOrUseCapture)===d)return g}return-1}Fi.prototype.dispatchEvent=function(s){var l=y(this._fragmentFiber);if(l===null)return!0;l=C(l);var u=this._eventListeners;if(u!==null&&0<u.length||!s.bubbles){var d=l.nodeType===9?l.createComment(""):document.createTextNode("");if(u)for(var g=0;g<u.length;g++){var v=u[g];d.addEventListener(v.type,v.attachedListener,Fa(v.optionsOrUseCapture))}if(l.appendChild(d),s=d.dispatchEvent(s),u)for(g=0;g<u.length;g++)v=u[g],d.removeEventListener(v.type,v.attachedListener,Fa(v.optionsOrUseCapture));return l.removeChild(d),s}return l.dispatchEvent(s)},Fi.prototype.focus=function(s){p(this._fragmentFiber.child,!0,GR,s,void 0,void 0)};function GR(s,l){return s.tag===6?!1:(s=C(s),M5(s,l))}Fi.prototype.focusLast=function(s){var l=[];p(this._fragmentFiber.child,!0,C0,l,void 0,void 0);for(var u=l.length-1;0<=u&&!GR(l[u],s);u--);};function C0(s,l){return l.push(s),!1}Fi.prototype.blur=function(){var s=y(this._fragmentFiber);s!==null&&(s=C(s),s=Bc(s).activeElement,s!==null&&p(this._fragmentFiber.child,!1,v5,s,void 0,void 0))};function v5(s,l){return s.tag===6?!1:(s=C(s),s===l||s.contains(l)?(l.blur(),!0):!1)}Fi.prototype.observeUsing=function(s){this._observers===null&&(this._observers=new Set),this._observers.add(s),p(this._fragmentFiber.child,!1,b5,s,void 0,void 0)};function b5(s,l){return s.tag===6||(s=C(s),l.observe(s)),!1}Fi.prototype.unobserveUsing=function(s){var l=this._observers;if(l!==null&&l.has(s)){l.delete(s),p(this._fragmentFiber.child,!1,S5,s,void 0,void 0);for(var u=l=0;u<Cr.length;u++){var d=Cr[u];d.fragmentInstance===this&&d.observer===s?s.unobserve(d.instance):Cr[l++]=d}Cr.length=l}};function S5(s,l){return s.tag===6||(s=C(s),l.unobserve(s)),!1}var Cr=[],E0=!1;function x5(s,l,u){Cr.push({fragmentInstance:s,observer:l,instance:u}),E0||(E0=!0,D5(function(){E0=!1;var d=Cr;Cr=[];for(var g=0;g<d.length;g++){var v=d[g];v.observer.unobserve(v.instance)}}))}Fi.prototype.getClientRects=function(){var s=[];return p(this._fragmentFiber.child,!1,w5,s,void 0,void 0),s};function w5(s,l){if(s.tag===6){s=s.stateNode;var u=s.ownerDocument.createRange();u.selectNodeContents(s),l.push.apply(l,u.getClientRects())}else s=C(s),l.push.apply(l,s.getClientRects());return!1}Fi.prototype.getRootNode=function(s){var l=y(this._fragmentFiber);return l===null?this:C(l).getRootNode(s)},Fi.prototype.compareDocumentPosition=function(s){var l=y(this._fragmentFiber);if(l===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var u=[];p(this._fragmentFiber.child,!1,C0,u,void 0,void 0);var d=C(l);if(u.length===0){if(u=d,b(this._fragmentFiber)){e:{for(l=this._fragmentFiber.return;l!==null;){if(l.tag===4){l=l.stateNode.containerInfo;break e}if(l.tag===3||l.tag===5||l.tag===27)break;l=l.return}l=null}l!=null&&(u=l)}l=this._fragmentFiber;var g=d=u.compareDocumentPosition(s);return u===s?g=Node.DOCUMENT_POSITION_CONTAINS:d&Node.DOCUMENT_POSITION_CONTAINED_BY&&(u=x(l)[1],u===null?g=Node.DOCUMENT_POSITION_PRECEDING:(s=C(u).compareDocumentPosition(s),g=s===0||s&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),g|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}l=C(u[0]),g=C(u[u.length-1]);var v=b(this._fragmentFiber)?l.parentElement:d;if(v==null)return Node.DOCUMENT_POSITION_DISCONNECTED;d=v.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_CONTAINED_BY,v=v.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY;var R=l.compareDocumentPosition(s),P=g.compareDocumentPosition(s),_=R&Node.DOCUMENT_POSITION_CONTAINED_BY||P&Node.DOCUMENT_POSITION_CONTAINED_BY;return P=d&&v&&R&Node.DOCUMENT_POSITION_FOLLOWING&&P&Node.DOCUMENT_POSITION_PRECEDING,l=d&&l===s||v&&g===s||_||P?Node.DOCUMENT_POSITION_CONTAINED_BY:!d&&l===s||!v&&g===s?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:R,l&Node.DOCUMENT_POSITION_DISCONNECTED||l&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||C5(l,this._fragmentFiber,u[0],u[u.length-1],s)?l:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function C5(s,l,u,d,g){var v=nl(g);if(s&Node.DOCUMENT_POSITION_CONTAINED_BY){if(u=!!v)e:{for(;v!==null;){if(v.tag===7&&(v===l||v.alternate===l)){u=!0;break e}v=v.return}u=!1}return u}if(s&Node.DOCUMENT_POSITION_CONTAINS){if(v===null)return v=g.ownerDocument,g===v||g===v.documentElement||g===v.body;e:{for(v=l,l=y(l);v!==null;){if(!(v.tag!==5&&v.tag!==3&&v.tag!==27||v!==l&&v.alternate!==l)){v=!0;break e}v=v.return}v=!1}return v}return s&Node.DOCUMENT_POSITION_PRECEDING?((l=!!v)&&!(l=v===u)&&(l=k(u,v,D),l===null?l=!1:(p(l,!0,T,v,u),v=E,E=null,l=v!==null)),l):s&Node.DOCUMENT_POSITION_FOLLOWING?((l=!!v)&&!(l=v===d)&&(l=k(d,v,D),l===null?l=!1:(p(l,!0,A,v,d),v=E,O=E=null,l=v!==null)),l):!1}function WR(s,l){var u=s.ownerDocument.createRange();u.selectNodeContents(s),s=u.getBoundingClientRect(),window.scrollTo(window.scrollX+s.left,l?window.scrollY+s.top:window.scrollY+s.bottom-window.innerHeight)}Fi.prototype.scrollIntoView=function(s){if(typeof s=="object")throw Error(i(566));var l=[];p(this._fragmentFiber.child,!1,C0,l,void 0,void 0);var u=s!==!1;if(l.length===0){var d=x(this._fragmentFiber);if(d=u?d[1]||d[0]||y(this._fragmentFiber):d[0]||d[1],d===null)return;if(d.tag===6){s=C(d),WR(s,u);return}if(d=C(d),d.nodeType!==9){if(d.nodeType===11){u="host"in d?d.host:null,u!==null&&u.scrollIntoView(s);return}d.scrollIntoView(s)}}for(d=u?l.length-1:0;d!==(u?-1:l.length);){var g=l[d];g.tag===6?(g=C(g),WR(g,u)):C(g).scrollIntoView(s),d+=u?-1:1}};function E5(s,l){return s=C(s),XR(s,l),!1}function XR(s,l){s.reactFragments==null&&(s.reactFragments=new Set),s.reactFragments.add(l)}function $R(s,l){var u=l._eventListeners;if(u!==null)for(var d=0;d<u.length;d++){var g=u[d];s.addEventListener(g.type,g.attachedListener,Fa(g.optionsOrUseCapture))}s.nodeType!==3&&(u=l._observers,u!==null&&u.forEach(function(v){for(var R=0,P=0;P<Cr.length;P++){var _=Cr[P];(_.fragmentInstance!==l||_.observer!==v||_.instance!==s)&&(Cr[R++]=_)}Cr.length=R,v.observe(s)}),XR(s,l))}function T5(s,l){var u=l._eventListeners;if(u!==null)for(var d=0;d<u.length;d++){var g=u[d];s.removeEventListener(g.type,g.attachedListener,Fa(g.optionsOrUseCapture))}s.nodeType!==3&&(u=l._observers,u!==null&&u.forEach(function(v){typeof v.rootMargin=="string"?x5(l,v,s):v.unobserve(s)}),s.reactFragments!=null&&s.reactFragments.delete(l))}function T0(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":T0(u),Md(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function R5(s,l,u,d){for(;s.nodeType===1;){var g=u;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!d&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(d){if(!s[ec])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(v=s.getAttribute("rel"),v==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(v!==g.rel||s.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||s.getAttribute("title")!==(g.title==null?null:g.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(v=s.getAttribute("src"),(v!==(g.src==null?null:g.src)||s.getAttribute("type")!==(g.type==null?null:g.type)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&s.getAttribute("name")===v)return s}else return s;if(s=tr(s.nextSibling),s===null)break}return null}function A5(s,l,u){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=tr(s.nextSibling),s===null))return null;return s}function QR(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=tr(s.nextSibling),s===null))return null;return s}function R0(s){return s.data==="$?"||s.data==="$~"}function A0(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function O5(s,l){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||u.readyState!=="loading")l();else{var d=function(){l(),u.removeEventListener("DOMContentLoaded",d)};u.addEventListener("DOMContentLoaded",d),s._reactRetry=d}}function tr(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var O0=null;function ZR(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(l===0)return tr(s.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}s=s.nextSibling}return null}function JR(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return s;l--}else u!=="/$"&&u!=="/&"||l++}s=s.previousSibling}return null}function M5(s,l){function u(){d=!0}if(s.ownerDocument.activeElement===s)return!0;var d=!1;try{s.ownerDocument.addEventListener("focus",u,!0),(s.focus||HTMLElement.prototype.focus).call(s,l)}finally{s.ownerDocument.removeEventListener("focus",u,!0)}return d}function D5(s){_R(function(){_R(function(l){return s(l)})})}function eA(s,l,u){switch(l=Bc(u),s){case"html":if(s=l.documentElement,!s)throw Error(i(452));return s;case"head":if(s=l.head,!s)throw Error(i(453));return s;case"body":if(s=l.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function tA(s,l,u){for(var d in u){var g=u[d];u.hasOwnProperty(d)&&g!=null&&Ft(s,l,d,null,s5,g)}u.dangerouslySetInnerHTML!=null&&(s.textContent=""),s.onclick===zr&&(s.onclick=null),Md(s)}function M0(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);Md(s)}var nr=new Map,nA=new Set;function Vc(s){if(typeof s.getRootNode=="function"){var l=s.getRootNode();if(l.nodeType===9||l.nodeType===11)return l}return s.nodeType===9?s:s.ownerDocument}var Ls=ue.d;ue.d={f:k5,r:P5,D:I5,C:N5,L:L5,m:B5,X:z5,S:V5,M:_5};function k5(){var s=Ls.f(),l=Ph();return s||l}function P5(s){var l=oa(s);l!==null&&l.tag===5&&l.type==="form"?rT(l):Ls.r(s)}var Ua=typeof document>"u"?null:document;function iA(s,l,u){var d=Ua;if(d&&typeof l=="string"&&l){var g=Wi(l);g='link[rel="'+s+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),nA.has(g)||(nA.add(g),s={rel:s,crossOrigin:u,href:l},d.querySelector(g)===null&&(l=d.createElement("link"),Qn(l,"link",s),_n(l),d.head.appendChild(l)))}}function I5(s){Ls.D(s),iA("dns-prefetch",s,null)}function N5(s,l){Ls.C(s,l),iA("preconnect",s,l)}function L5(s,l,u){Ls.L(s,l,u);var d=Ua;if(d&&s&&l){var g='link[rel="preload"][as="'+Wi(l)+'"]';l==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+Wi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+Wi(u.imageSizes)+'"]')):g+='[href="'+Wi(s)+'"]';var v=g;switch(l){case"style":v=ja(s);break;case"script":v=Ka(s)}if(!(nr.has(v)||(s=M({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:s,as:l},u),nr.set(v,s),d.querySelector(g)!==null||l==="style"&&d.querySelector(zc(v))||l==="script"&&d.querySelector(_c(v))))){var R=d.createElement("link");Qn(R,"link",s),l==="style"&&(R[Od]=!0,R.onload=R.onerror=function(){gC(R)}),_n(R),d.head.appendChild(R)}}}function B5(s,l){Ls.m(s,l);var u=Ua;if(u&&s){var d=l&&typeof l.as=="string"?l.as:"script",g='link[rel="modulepreload"][as="'+Wi(d)+'"][href="'+Wi(s)+'"]',v=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Ka(s)}if(!nr.has(v)&&(s=M({rel:"modulepreload",href:s},l),nr.set(v,s),u.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(_c(v)))return}d=u.createElement("link"),Qn(d,"link",s),_n(d),u.head.appendChild(d)}}}function V5(s,l,u){Ls.S(s,l,u);var d=Ua;if(d&&s){var g=la(d).hoistableStyles,v=ja(s);l=l||"default";var R=g.get(v);if(!R){var P={loading:0,preload:null};if(R=d.querySelector(zc(v)))P.loading=5;else{s=M({rel:"stylesheet",href:s,"data-precedence":l},u),(u=nr.get(v))&&D0(s,u);var _=R=d.createElement("link");_n(_),Qn(_,"link",s),_._p=new Promise(function(ee,oe){_.onload=ee,_.onerror=oe}),_.addEventListener("load",function(){P.loading|=1}),_.addEventListener("error",function(){P.loading|=2}),P.loading|=4,_h(R,l,d)}R={type:"stylesheet",instance:R,count:1,state:P},g.set(v,R)}}}function z5(s,l){Ls.X(s,l);var u=Ua;if(u&&s){var d=la(u).hoistableScripts,g=Ka(s),v=d.get(g);v||(v=u.querySelector(_c(g)),v||(s=M({src:s,async:!0},l),(l=nr.get(g))&&k0(s,l),v=u.createElement("script"),_n(v),Qn(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(g,v))}}function _5(s,l){Ls.M(s,l);var u=Ua;if(u&&s){var d=la(u).hoistableScripts,g=Ka(s),v=d.get(g);v||(v=u.querySelector(_c(g)),v||(s=M({src:s,async:!0,type:"module"},l),(l=nr.get(g))&&k0(s,l),v=u.createElement("script"),_n(v),Qn(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(g,v))}}function rA(s,l,u,d){var g=(g=de.current)?Vc(g):null;if(!g)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(u=ja(u.href),l=la(g).hoistableStyles,d=l.get(u),d||(d={type:"style",instance:null,count:0,state:null},l.set(u,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=ja(u.href);var v=la(g).hoistableStyles,R=v.get(s);if(R||(g=g.ownerDocument||g,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(s,R),(v=g.querySelector(zc(s)))?v._p||(R.instance=v,R.state.loading=5):(v=nr.get(s),v||(v={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},nr.set(s,v)),H5(g,s,v,R.state))),l&&d===null)throw Error(i(528,""));return R}if(l&&d!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(u=Ka(u),l=la(g).hoistableScripts,d=l.get(u),d||(d={type:"script",instance:null,count:0,state:null},l.set(u,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function ja(s){return'href="'+Wi(s)+'"'}function zc(s){return'link[rel="stylesheet"]['+s+"]"}function sA(s){return M({},s,{"data-precedence":s.precedence,precedence:null})}function H5(s,l,u,d){if(l=s.querySelector('link[rel="preload"][as="style"]['+l+"]")){if(l[Od]!==!0){d.loading=1;return}}else l=s.createElement("link"),l[Od]=!0,l.onload=l.onerror=gC.bind(null,l),Qn(l,"link",u),_n(l),s.head.appendChild(l);d.preload=l,l.addEventListener("load",function(){return d.loading|=1}),l.addEventListener("error",function(){return d.loading|=2})}function Ka(s){return'[src="'+Wi(s)+'"]'}function _c(s){return"script[async]"+s}function oA(s,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var d=s.querySelector('style[data-href~="'+Wi(u.href)+'"]');if(d)return l.instance=d,_n(d),d;var g=M({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return d=(s.ownerDocument||s).createElement("style"),_n(d),Qn(d,"style",g),_h(d,u.precedence,s),l.instance=d;case"stylesheet":g=ja(u.href);var v=s.querySelector(zc(g));if(v)return l.state.loading|=4,l.instance=v,_n(v),v;d=sA(u),(g=nr.get(g))&&D0(d,g),v=(s.ownerDocument||s).createElement("link"),_n(v);var R=v;return R._p=new Promise(function(P,_){R.onload=P,R.onerror=_}),Qn(v,"link",d),l.state.loading|=4,_h(v,u.precedence,s),l.instance=v;case"script":return v=Ka(u.src),(g=s.querySelector(_c(v)))?(l.instance=g,_n(g),g):(d=u,(g=nr.get(v))&&(d=M({},u),k0(d,g)),s=s.ownerDocument||s,g=s.createElement("script"),_n(g),Qn(g,"link",d),s.head.appendChild(g),l.instance=g);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(d=l.instance,l.state.loading|=4,_h(d,u.precedence,s));return l.instance}function _h(s,l,u){for(var d=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,v=g,R=0;R<d.length;R++){var P=d[R];if(P.dataset.precedence===l)v=P;else if(v!==g)break}v?v.parentNode.insertBefore(s,v.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(s,l.firstChild))}function D0(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function k0(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Hh=null;function lA(s,l,u){if(Hh===null){var d=new Map,g=Hh=new Map;g.set(u,d)}else g=Hh,d=g.get(u),d||(d=new Map,g.set(u,d));if(d.has(s))return d;for(d.set(s,null),u=u.getElementsByTagName(s),g=0;g<u.length;g++){var v=u[g];if(!(v[ec]||v[qn]||s==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var R=v.getAttribute(l)||"";R=s+R;var P=d.get(R);P?P.push(v):d.set(R,[v])}}return d}function P0(s,l,u){s=s.ownerDocument||s,s.head.insertBefore(u,l==="title"?s.querySelector("head > title"):null)}function F5(s,l,u){if(u===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function aA(s,l){return s==="img"&&l.src!=null&&l.src!==""&&l.onLoad==null&&l.loading!=="lazy"}function uA(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function cA(s){return(s.width||100)*(s.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function fA(s,l){typeof l.decode=="function"&&(s.imgCount++,l.complete||(s.imgBytes+=cA(l),s.suspenseyImages.push(l)),s=K5.bind(s),l.decode().then(s,s))}function U5(s,l,u,d){if(u.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=ja(d.href),v=l.querySelector(zc(g));if(v){l=v._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Hc.bind(s),l.then(s,s)),u.state.loading|=4,u.instance=v,_n(v);return}v=l.ownerDocument||l,d=sA(d),(g=nr.get(g))&&D0(d,g),v=v.createElement("link"),_n(v);var R=v;R._p=new Promise(function(P,_){R.onload=P,R.onerror=_}),Qn(v,"link",d),u.instance=v}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=Hc.bind(s),l.addEventListener("load",u),l.addEventListener("error",u))}}var Fh=0;function j5(s,l){return s.stylesheets&&s.count===0&&jh(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var d=setTimeout(function(){if(s.stylesheets&&jh(s,s.stylesheets),s.unsuspend){var v=s.unsuspend;s.unsuspend=null,v()}},6e4+l);0<s.imgBytes&&Fh===0&&(Fh=62500*l5());var g=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&jh(s,s.stylesheets),s.unsuspend)){var v=s.unsuspend;s.unsuspend=null,v()}},(s.imgBytes>Fh?50:800)+l);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function dA(s){if(s.count===0&&(s.imgCount===0||!s.waitingForImages)){if(s.stylesheets)jh(s,s.stylesheets);else if(s.unsuspend){var l=s.unsuspend;s.unsuspend=null,l()}}}function Hc(){this.count--,dA(this)}function K5(){this.imgCount--,dA(this)}var Uh=null;function jh(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Uh=new Map,l.forEach(Y5,s),Uh=null,Hc.call(s))}function Y5(s,l){if(!(l.state.loading&4)){var u=Uh.get(s);if(u)var d=u.get(null);else{u=new Map,Uh.set(s,u);for(var g=s.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var R=g[v];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(u.set(R.dataset.precedence,R),d=R)}d&&u.set(null,d)}g=l.instance,R=g.getAttribute("data-precedence"),v=u.get(R)||d,v===d&&u.set(null,g),u.set(R,g),this.count++,d=Hc.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),v?v.parentNode.insertBefore(g,v.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(g,s.firstChild)),l.state.loading|=4}}var Ya={$$typeof:z,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function q5(s,l,u,d,g,v,R,P,_){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=dy(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dy(0),this.hiddenUpdates=dy(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.transitionTypes=null,this.incompleteTransitions=new Map}function hA(s,l,u,d,g,v,R,P,_,ee,oe,pe){return s=new q5(s,l,u,R,_,ee,oe,pe,P),l=1,v===!0&&(l|=24),v=Ci(3,null,null,l),s.current=v,v.stateNode=s,l=Gy(),l.refCount++,s.pooledCache=l,l.refCount++,v.memoizedState={element:d,isDehydrated:u,cache:l},Qy(v),s}function pA(s){return s?(s=ya,s):ya}function mA(s,l,u,d,g,v){g=pA(g),d.context===null?d.context=g:d.pendingContext=g,d=uo(l),d.payload={element:u},v=v===void 0?null:v,v!==null&&(d.callback=v),u=co(s,d,l),u!==null&&(Ai(u,s,l),yc(u,s,l))}function gA(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<l?u:l}}function I0(s,l){gA(s,l),(s=s.alternate)&&gA(s,l)}function yA(s){if(s.tag===13||s.tag===31){var l=ol(s,67108864);l!==null&&Ai(l,s,67108864),I0(s,67108864)}}function vA(s){if(s.tag===13||s.tag===31){var l=Hi();l=hy(l);var u=ol(s,l);u!==null&&Ai(u,s,l),I0(s,l)}}var qa=!0;function G5(s,l,u,d){var g=ce.T;ce.T=null;var v=ue.p;try{ue.p=2,N0(s,l,u,d)}finally{ue.p=v,ce.T=g}}function W5(s,l,u,d){var g=ce.T;ce.T=null;var v=ue.p;try{ue.p=8,N0(s,l,u,d)}finally{ue.p=v,ce.T=g}}function N0(s,l,u,d){if(qa){var g=L0(d);if(g===null)m0(s,l,d,Kh,u),SA(s,d);else if($5(g,s,l,u,d))d.stopPropagation();else if(SA(s,d),l&4&&-1<X5.indexOf(s)){for(;g!==null;){var v=oa(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var R=Cn(v.pendingLanes);if(R!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;R;){var _=1<<31-Xe(R);P.entanglements[1]|=_,R&=~_}Wr(v),(It&6)===0&&(Mh=st()+500,Ic(0))}}break;case 31:case 13:P=ol(v,2),P!==null&&Ai(P,v,2),Ph(),I0(v,2)}if(v=L0(d),v===null&&m0(s,l,d,Kh,u),v===g)break;g=v}g!==null&&d.stopPropagation()}else m0(s,l,d,null,u)}}function L0(s){return s=Sy(s),B0(s)}var Kh=null;function B0(s){if(Kh=null,s=nl(s),s!==null){var l=o(s);if(l===null)s=null;else{var u=l.tag;if(u===13){if(s=a(l),s!==null)return s;s=null}else if(u===31){if(s=c(l),s!==null)return s;s=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Kh=s,null}function bA(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Lt()){case ot:return 2;case lt:return 8;case vt:case Tt:return 32;case un:return 268435456;default:return 32}default:return 32}}var V0=!1,Co=null,Eo=null,To=null,Fc=new Map,Uc=new Map,Ro=[],X5="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function SA(s,l){switch(s){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":Eo=null;break;case"mouseover":case"mouseout":To=null;break;case"pointerover":case"pointerout":Fc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uc.delete(l.pointerId)}}function jc(s,l,u,d,g,v){return s===null||s.nativeEvent!==v?(s={blockedOn:l,domEventName:u,eventSystemFlags:d,nativeEvent:v,targetContainers:[g]},l!==null&&(l=oa(l),l!==null&&yA(l)),s):(s.eventSystemFlags|=d,l=s.targetContainers,g!==null&&l.indexOf(g)===-1&&l.push(g),s)}function $5(s,l,u,d,g){switch(l){case"focusin":return Co=jc(Co,s,l,u,d,g),!0;case"dragenter":return Eo=jc(Eo,s,l,u,d,g),!0;case"mouseover":return To=jc(To,s,l,u,d,g),!0;case"pointerover":var v=g.pointerId;return Fc.set(v,jc(Fc.get(v)||null,s,l,u,d,g)),!0;case"gotpointercapture":return v=g.pointerId,Uc.set(v,jc(Uc.get(v)||null,s,l,u,d,g)),!0}return!1}function xA(s){var l=nl(s.target);if(l!==null){var u=o(l);if(u!==null){if(l=u.tag,l===13){if(l=a(u),l!==null){s.blockedOn=l,hC(s.priority,function(){vA(u)});return}}else if(l===31){if(l=c(u),l!==null){s.blockedOn=l,hC(s.priority,function(){vA(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Yh(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var u=L0(s.nativeEvent);if(u===null){u=s.nativeEvent;var d=new u.constructor(u.type,u);by=d,u.target.dispatchEvent(d),by=null}else return l=oa(u),l!==null&&yA(l),s.blockedOn=u,!1;l.shift()}return!0}function wA(s,l,u){Yh(s)&&u.delete(l)}function Q5(){V0=!1,Co!==null&&Yh(Co)&&(Co=null),Eo!==null&&Yh(Eo)&&(Eo=null),To!==null&&Yh(To)&&(To=null),Fc.forEach(wA),Uc.forEach(wA)}function qh(s,l){s.blockedOn===l&&(s.blockedOn=null,V0||(V0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Q5)))}var Gh=null;function CA(s){Gh!==s&&(Gh=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===s&&(Gh=null);for(var l=0;l<s.length;l+=3){var u=s[l],d=s[l+1],g=s[l+2];if(typeof d!="function"){if(B0(d||u)===null)continue;break}var v=oa(u);v!==null&&(s.splice(l,3),l-=3,vv(v,{pending:!0,data:g,method:u.method,action:d},d,g))}}))}function Ga(s){function l(_){return qh(_,s)}Co!==null&&qh(Co,s),Eo!==null&&qh(Eo,s),To!==null&&qh(To,s),Fc.forEach(l),Uc.forEach(l);for(var u=0;u<Ro.length;u++){var d=Ro[u];d.blockedOn===s&&(d.blockedOn=null)}for(;0<Ro.length&&(u=Ro[0],u.blockedOn===null);)xA(u),u.blockedOn===null&&Ro.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(d=0;d<u.length;d+=3){var g=u[d],v=u[d+1],R=g[wi]||null;if(typeof v=="function")R||CA(u);else if(R){var P=null;if(v&&v.hasAttribute("formAction")){if(g=v,R=v[wi]||null)P=R.formAction;else if(B0(g)!==null)continue}else P=R.action;typeof P=="function"?u[d+1]=P:(u.splice(d,3),d-=3),CA(u)}}}function EA(){function s(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(R){return g=R})},focusReset:"manual",scroll:"manual"})}function l(){g!==null&&(g(),g=null),d||setTimeout(u,20)}function u(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){d=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),g!==null&&(g(),g=null)}}}function z0(s){this._internalRoot=s}Wh.prototype.render=z0.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,d=Hi();mA(u,d,s,l,null,null)},Wh.prototype.unmount=z0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;mA(s.current,2,null,s,null,null),Ph(),l[sa]=null}};function Wh(s){this._internalRoot=s}Wh.prototype.unstable_scheduleHydration=function(s){if(s){var l=dC();s={blockedOn:null,target:s,priority:l};for(var u=0;u<Ro.length&&l!==0&&l<Ro[u].priority;u++);Ro.splice(u,0,s),u===0&&xA(s)}};var TA=e.version;if(TA!=="19.3.1")throw Error(i(527,TA,"19.3.1"));ue.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=h(l),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var Z5={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Ae=Xh.inject(Z5),Oe=Xh}catch{}}return Yc.createRoot=function(s,l){if(!r(s))throw Error(i(299));var u=!1,d="",g=pT,v=mT,R=gT;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),l=hA(s,1,!1,null,null,u,d,null,g,v,R,EA),s[sa]=l.current,p0(s),new z0(l)},Yc.hydrateRoot=function(s,l,u){if(!r(s))throw Error(i(299));var d=!1,g="",v=pT,R=mT,P=gT,_=null;return u!=null&&(u.unstable_strictMode===!0&&(d=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(_=u.formState)),l=hA(s,1,!0,l,u??null,d,g,_,v,R,P,EA),l.context=pA(null),u=l.current,d=Hi(),d=hy(d),g=uo(d),g.callback=null,co(u,g,d),u=d,l.current.lanes=u,Ju(l,u),Wr(l),s[sa]=l.current,p0(s),new Wh(l)},Yc.version="19.3.1",Yc}var LA;function xH(){if(LA)return H0.exports;LA=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),H0.exports=SH(),H0.exports}var $te=xH();function wH(t,e){return function(i,...r){const o=new URL(t);return o.searchParams.set("code",i.toString()),r.forEach(a=>o.searchParams.append("args[]",a)),`${e} error #${i}; visit ${o} for the full message.`}}const en=wH("https://base-ui.com/production-error","Base UI"),sP=S.createContext(void 0);function Wo(t){const e=S.useContext(sP);if(!t&&e===void 0)throw new Error(en(27));return e}const BA={};function kn(t,e){const n=S.useRef(BA);return n.current===BA&&(n.current=t(e)),n}function Ws(t,e,n,i){const r=kn(oP).current;return EH(r,t,e,n,i)&&lP(r,[t,e,n,i]),r.callback}function CH(t){const e=kn(oP).current;return TH(e,t)&&lP(e,t),e.callback}function oP(){return{callback:null,cleanup:null,refs:[]}}function EH(t,e,n,i,r){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==i||t.refs[3]!==r}function TH(t,e){return t.refs.length!==e.length||t.refs.some((n,i)=>n!==e[i])}function lP(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const i=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const o=e[r];if(o!=null)switch(typeof o){case"function":{const a=o(n);typeof a=="function"&&(i[r]=a);break}case"object":{o.current=n;break}}}t.cleanup=()=>{for(let r=0;r<e.length;r+=1){const o=e[r];if(o!=null)switch(typeof o){case"function":{const a=i[r];typeof a=="function"?a():o(null);break}case"object":{o.current=null;break}}}}}}}const RH=parseInt(S.version,10);function Zx(t){return RH>=t}function VA(t){if(!S.isValidElement(t))return null;const e=t,n=e.props;return(Zx(19)?n?.ref:e.ref)??null}function oS(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function ln(){}const Hl=Object.freeze([]),At=Object.freeze({});function AH(t,e){const n={};for(const i in t){const r=t[i];if(e?.hasOwnProperty(i)){const o=e[i](r);o!=null&&Object.assign(n,o);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function OH(t,e){return typeof t=="function"?t(e):t}function MH(t,e){return typeof t=="function"?t(e):t}const aP={};function Pi(t,e,n,i,r){if(!n&&!i&&!r&&!t)return um(e);let o=um(t);return e&&(o=rf(o,e)),n&&(o=rf(o,n)),i&&(o=rf(o,i)),r&&(o=rf(o,r)),o}function DH(t){if(t.length===0)return aP;if(t.length===1)return um(t[0]);let e=um(t[0]);for(let n=1;n<t.length;n+=1)e=rf(e,t[n]);return e}function um(t){return cP(t)?{...t(aP)}:kH(t)}function rf(t,e){return cP(e)?e(t):PH(t,e)}function kH(t){const e={...t};for(const n in e){const i=e[n];uP(n,i)&&(e[n]=fP(i))}return e}function PH(t,e){if(!e)return t;for(const n in e){const i=e[n];switch(n){case"style":{t[n]=oS(t.style,i);break}case"className":{t[n]=dP(t.className,i);break}default:uP(n,i)?t[n]=IH(t[n],i):t[n]=i}}return t}function uP(t,e){const n=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2);return n===111&&i===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function cP(t){return typeof t=="function"}function IH(t,e){return e?t?(...n)=>{const i=n[0];if(hP(i)){const o=i;cm(o);const a=e(...n);return o.baseUIHandlerPrevented||t?.(...n),a}const r=e(...n);return t?.(...n),r}:fP(e):t}function fP(t){return t&&((...e)=>{const n=e[0];return hP(n)&&cm(n),t(...e)})}function cm(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function dP(t,e){return e?t?e+" "+t:e:t}function hP(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function Ot(t,e,n={}){let i=e.render;n.enabled!==!1&&(i=Jx(i));const r=NH(e,n,i);if(n.enabled===!1)return null;const o=n.state??At;return VH(t,i,r,o)}function NH(t,e,n){const{className:i,style:r}=t,{state:o=At,ref:a,props:c,stateAttributesMapping:f,enabled:h=!0}=e,m=h?OH(i,o):void 0,p=h?MH(r,o):void 0,y=h?AH(o,f):At,b=h&&c?LH(c):void 0,x=h?oS(y,b)??{}:At;return typeof document<"u"&&(h?Array.isArray(a)?x.ref=CH([x.ref,VA(n),...a]):x.ref=Ws(x.ref,VA(n),a):Ws(null,null)),h?(m!==void 0&&(x.className=dP(x.className,m)),p!==void 0&&(x.style=oS(x.style,p)),x):At}function LH(t){return Array.isArray(t)?DH(t):Pi(void 0,t)}const BH=Symbol.for("react.lazy");function Jx(t){if(t?.$$typeof!==BH)return t;const e=S.Children.toArray(t)[0];return S.isValidElement(e)?e:t}function VH(t,e,n,i){if(e){if(typeof e=="function")return e(n,i);const r=Pi(n,e.props);return r.ref=n.ref,S.cloneElement(e,r)}return zH(t,n)}function zH(t,e){return t==="button"?S.createElement("button",{type:"button",...e,key:e.key}):t==="img"?S.createElement("img",{alt:"",...e,key:e.key}):S.createElement(t,e)}const pP="data-starting-style",_H="data-ending-style",HH={[pP]:""},FH={[_H]:""},Fu={transitionStatus(t){return t==="starting"?HH:t==="ending"?FH:null}},UH="data-open",jH="data-closed",KH="data-anchor-hidden",mP="data-popup-open",YH="data-pressed",qH={[mP]:""},GH={[mP]:"",[YH]:""},WH={[UH]:""},XH={[jH]:""},$H={[KH]:""},Qf={open(t){return t?qH:null}},Rf={open(t){return t?GH:null}},Zf={open(t){return t?WH:XH},anchorHidden(t){return t?$H:null}},tg={...Zf,...Fu},Qte=S.forwardRef(function(e,n){const{render:i,className:r,style:o,forceRender:a=!1,...c}=e,f=Wo(),h=f.useState("open"),m=f.useState("nested"),p=f.useState("mounted"),y=f.useState("transitionStatus");return Ot("div",e,{state:{open:h,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:tg,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!m})});function ng(){return typeof window<"u"}function ri(t){return ew(t)?(t.nodeName||"").toLowerCase():"#document"}function Jt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Js(t){var e;return(e=(ew(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ew(t){return ng()?t instanceof Node||t instanceof Jt(t).Node:!1}function Dt(t){return ng()?t instanceof Element||t instanceof Jt(t).Element:!1}function Xt(t){return ng()?t instanceof HTMLElement||t instanceof Jt(t).HTMLElement:!1}function Fl(t){return!ng()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Jt(t).ShadowRoot}function Jf(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=qi(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function QH(t){return/^(table|td|th)$/.test(ri(t))}function ig(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const ZH=/transform|translate|scale|rotate|perspective|filter/,JH=/paint|layout|strict|content/,El=t=>!!t&&t!=="none";let K0;function tw(t){const e=Dt(t)?qi(t):t;return El(e.transform)||El(e.translate)||El(e.scale)||El(e.rotate)||El(e.perspective)||!nw()&&(El(e.backdropFilter)||El(e.filter))||ZH.test(e.willChange||"")||JH.test(e.contain||"")}function eF(t){let e=Xs(t);for(;Xt(e)&&!js(e);){if(tw(e))return e;if(ig(e))return null;e=Xs(e)}return null}function nw(){return K0==null&&(K0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),K0}function js(t){return/^(html|body|#document)$/.test(ri(t))}function qi(t){return Jt(t).getComputedStyle(t)}function rg(t){return Dt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xs(t){if(ri(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fl(t)&&t.host||Js(t);return Fl(e)?e.host:e}function gP(t){const e=Xs(t);return js(e)?(t.ownerDocument||t).body:Xt(e)&&Jf(e)?e:gP(e)}function Af(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=gP(t),o=r===((i=t.ownerDocument)==null?void 0:i.body),a=Jt(r);if(o){const c=lS(a);return e.concat(a,a.visualViewport||[],Jf(r)?r:[],c&&n?Af(c):[])}else return e.concat(r,Af(r,[],n))}function lS(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const iw={...ta},Y0=iw.useInsertionEffect,tF=Y0&&Y0!==iw.useLayoutEffect?Y0:t=>t();function He(t){const e=kn(nF).current;return e.next=t,tF(e.effect),e.trampoline}function nF(){const t={next:void 0,callback:iF,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function iF(){}const rF=()=>{},De=typeof document<"u"?S.useLayoutEffect:rF,sF=S.createContext(void 0);function rw(t=!1){const e=S.useContext(sF);if(e===void 0&&!t)throw new Error(en(16));return e}function oF(t){const{focusableWhenDisabled:e,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:o}=t,a=i&&e!==!1,c=i&&e===!1;return{props:S.useMemo(()=>{const h={onKeyDown(m){n&&e&&m.key!=="Tab"&&m.preventDefault()}};return i||(h.tabIndex=r,!o&&n&&(h.tabIndex=e?r:-1)),(o&&(e||a)||!o&&n)&&(h["aria-disabled"]=n),o&&(!e||c)&&(h.disabled=n),h},[i,n,e,a,c,o,r])}}function xt(t){return t?.ownerDocument||document}function ff(t,e,{detail:n=0,pointerType:i=""}={}){t.dispatchEvent(new(Jt(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:i,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function Xo(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:o}=t,a=S.useRef(null),c=rw(!0),f=o??c!==void 0,{props:h}=oF({focusableWhenDisabled:n,disabled:e,composite:f,tabIndex:i,isNativeButton:r}),m=S.useCallback(()=>{const b=a.current;q0(b)&&f&&e&&h.disabled===void 0&&b.disabled&&(b.disabled=!1)},[e,h.disabled,f]);De(m,[m]);const p=S.useCallback((b={})=>{const{onClick:x,onMouseDown:w,onKeyUp:C,onKeyDown:E,onPointerDown:O,...T}=b;return Pi({onClick(A){if(e){A.preventDefault();return}x?.(A)},onMouseDown(A){e||w?.(A)},onKeyDown(A){if(e||(cm(A),E?.(A),A.baseUIHandlerPrevented))return;const D=A.target===A.currentTarget,k=A.currentTarget,M=q0(k),I=!r&&lF(k),L=D&&(r?M:!I),B=A.key==="Enter",H=A.key===" ",U=k.getAttribute("role"),F=U?.startsWith("menuitem")||U==="option"||U==="gridcell";if(D&&f&&H){if(A.defaultPrevented&&F)return;A.preventDefault(),(!r||M)&&(A.preventBaseUIHandler(),ff(k,A));return}if(!L||r||!H&&!B){D&&I&&H&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),B&&(A.preventBaseUIHandler(),ff(k,A)))},onKeyUp(A){if(!e){if(cm(A),C?.(A),A.target===A.currentTarget&&r&&f&&q0(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!r&&!f&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),ff(A.currentTarget,A))}},onPointerDown(A){if(e){A.preventDefault();return}O?.(A)}},r?{type:"button"}:{role:"button"},h,T)},[e,h,f,r]),y=He(b=>{a.current=b,m()});return{getButtonProps:p,buttonRef:y}}function q0(t){return Xt(t)&&t.tagName==="BUTTON"}function lF(t){return Xt(t)&&t.tagName==="A"&&!!t.href}function Ze(t,e,n,i){let r=!1,o=!1;const a=i??At;return{reason:t,event:e??new Event("base-ui"),cancel(){r=!0},allowPropagation(){o=!0},get isCanceled(){return r},get isPropagationAllowed(){return o},trigger:n,...a}}function aF(t,e,n){const i=n??At;return{reason:t,event:e??new Event("base-ui"),...i}}const dr="none",gs="trigger-press",vn="trigger-hover",hu="trigger-focus",sg="outside-press",Nl="item-press",yP="close-press",$s="focus-out",ed="escape-key",Of="list-navigation",vP="keyboard",bP="pointer",sw="cancel-open",sf="sibling-open",uF="disabled",td="imperative-action",cF="window-resize",Zte=S.forwardRef(function(e,n){const{render:i,className:r,style:o,disabled:a=!1,nativeButton:c=!0,...f}=e,h=Wo(),m=h.useState("open"),{getButtonProps:p,buttonRef:y}=Xo({disabled:a,native:c}),b={disabled:a};function x(w){m&&h.setOpen(!1,Ze(yP,w.nativeEvent))}return Ot("button",e,{state:b,ref:[n,y],props:[{onClick:x},f,p]})});function SP(){const[,t]=S.useState({});return S.useCallback(()=>{t({})},[])}let zA=0;function fF(t,e="mui"){const n=S.useRef(void 0),i=SP(),r=t??n.current;return S.useEffect(()=>{n.current==null&&(zA+=1,n.current=`${e}-${zA}`,t==null&&i())},[t,e,i]),r}const _A=iw.useId;function Uu(t,e){if(_A!==void 0){const n=_A();return t??(e?`${e}-${n}`:n)}return fF(t,e)}function vi(t){return Uu(t,"base-ui")}const Jte=S.forwardRef(function(e,n){const{render:i,className:r,style:o,id:a,...c}=e,f=Wo(),h=vi(a);return f.useSyncedValueWithCleanup("descriptionElementId",h),Ot("p",e,{ref:n,props:[{id:h},c]})});function ow(t){S.useEffect(t,Hl)}const qc=0;class Dr{static create(){return new Dr}currentId=qc;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=qc,n()},e)}isStarted(){return this.currentId!==qc}clear=()=>{this.currentId!==qc&&(clearTimeout(this.currentId),this.currentId=qc)};disposeEffect=()=>this.clear}function wn(){const t=kn(Dr.create).current;return ow(t.disposeEffect),t}function dF(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:hF,platform:pF,maxTouchPoints:mF}=dF(),og=hF.toLowerCase(),Mf=pF.toLowerCase(),lg=/^i(os$|p)/.test(Mf)||Mf==="macintel"&&mF>1,HA="android",aS=Mf===HA||og.includes(HA),lw=!lg&&Mf.startsWith("mac");Mf.startsWith("win");const gF=lw||lg,vs=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!vs&&og.includes("firefox");!vs&&og.includes("chrom");const xP=gF,aw=/jsdom|happydom/.test(og);function Rr(t){t.preventDefault(),t.stopPropagation()}function yF(t){return"nativeEvent"in t}function Tu(t){return t.pointerType===""&&t.isTrusted?!0:aS&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function uw(t){return aw?!1:!aS&&t.width===0&&t.height===0||t.type==="pointerdown"&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"&&(aS||t.buttons===0)||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Bo(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function vF(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function Mi(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ye(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Fl(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Df(t,e){let n=t;for(;n;){if(Dt(n)&&n.matches(e))return n;n=n.assignedSlot??n.parentNode??(Fl(n)?n.host:null)}return null}function zn(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}const uS="data-base-ui-focusable",wP="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ag="ArrowLeft",ug="ArrowRight",CP="ArrowUp",cw="ArrowDown",cS="data-trigger-disabled";function fm(t,e){if(!Dt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute(cS);for(const[,i]of e.entries())if(Ye(i,n))return!i.hasAttribute(cS);return!1}function G0(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function bF(t){return t.matches("html,body")}function nd(t){return Xt(t)&&t.matches(wP)}function SF(t){return Df(t,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${wP}`)!=null}function fS(t){return t?t.getAttribute("role")==="combobox"&&nd(t):!1}function xF(t){if(!t||aw)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function dm(t){return t?t.hasAttribute(uS)?t:t.querySelector(`[${uS}]`)||t:null}function wF(t,e){return e!=null&&!Bo(e)?0:typeof t=="function"?t():t}function Ul(t,e,n){const i=wF(t,n);return typeof i=="number"?i:i?.[e]}function FA(t){return typeof t=="function"?t():t}function EP(t,e){return e||t==="click"||t==="mousedown"}function CF(t){return t?.includes("mouse")&&t!=="mousedown"}const TP=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Dr,currentIdRef:{current:null},currentContextRef:{current:null}});function EF(t,e){t.current=e.current}function TF(t){const{children:e,delay:n,timeoutMs:i=0}=t,r=S.useRef(n),o=S.useRef(n),a=S.useRef(null),c=S.useRef(null),f=wn();return De(()=>{if(o.current=n,!a.current){r.current=n;return}r.current={open:Ul(r.current,"open"),close:Ul(n,"close")}},[n,a,r,o]),fe.jsx(TP.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:o,currentIdRef:a,timeoutMs:i,currentContextRef:c,timeout:f}),[i,f]),children:e})}function RF(t,e={open:!1}){const{open:n}=e,i=t.useState("floatingId"),r=S.useContext(TP),{currentIdRef:o,delayRef:a,timeoutMs:c,initialDelayRef:f,currentContextRef:h,hasProvider:m,timeout:p}=r,[y,b]=S.useState(!1),x=S.useRef(n);return De(()=>{x.current=n},[n]),De(()=>{function w(){h.current?.setIsInstantPhase(!1),o.current=null,h.current=null,a.current=f.current,p.clear()}if(o.current&&!n&&o.current===i){if(b(!1),c){const C=i;return p.start(c,()=>{t.select("open")||o.current&&o.current!==C||w()}),()=>{(x.current||o.current!==C)&&p.clear()}}w()}},[n,i,o,a,c,f,h,p,t]),De(()=>{if(!n)return;const w=h.current,C=o.current;p.clear(),h.current={onOpenChange:t.setOpen,setIsInstantPhase:b},o.current=i,a.current={open:0,close:Ul(f.current,"close")},C!==null&&C!==i?(b(!0),w?.setIsInstantPhase(!0),w?.onOpenChange(!1,Ze(dr))):(b(!1),w?.setIsInstantPhase(!1))},[n,i,t,o,a,f,h,p]),De(()=>()=>{if(o.current===i){if(h.current=null,!x.current)return;o.current=null,EF(a,f),p.clear()}},[h,o,a,i,f,p]),S.useMemo(()=>({activeIdRef:o,hasProvider:m,delayRef:a,isInstantPhase:y}),[o,m,a,y])}function ft(t,e,n,i){return t.addEventListener(e,n,i),()=>{t.removeEventListener(e,n,i)}}function fs(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function dn(t){const e=kn(AF,t).current;return e.next=t,De(e.effect),e}function AF(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const $h=null;class OF{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let r=0;r<n.length;r+=1)n[r]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let Qh=new OF;class ts{static create(){return new ts}static request(e){return Qh.request(e)}static cancel(e){return Qh.cancel(e)}currentId=$h;request(e){this.cancel(),this.currentId=Qh.request(()=>{this.currentId=$h,e()})}cancel=()=>{this.currentId!==$h&&(Qh.cancel(this.currentId),this.currentId=$h)};disposeEffect=()=>this.cancel}function Ru(){const t=kn(ts.create).current;return ow(t.disposeEffect),t}const RP={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},fw={...RP,position:"fixed",margin:0,top:0,left:0},AP={...RP,position:"absolute"},Vo=S.forwardRef(function(e,n){const[i,r]=S.useState();De(()=>{xP&&vs&&r("button")},[]);const o={tabIndex:0,role:i};return fe.jsx("span",{...e,ref:n,style:fw,"aria-hidden":i?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Au=Math.min,Ks=Math.max,hm=Math.round,Zh=Math.floor,Ys=t=>({x:t,y:t}),MF={left:"right",right:"left",bottom:"top",top:"bottom"};function OP(t,e,n){return Ks(t,Au(e,n))}function zo(t,e){return typeof t=="function"?t(e):t}function Ki(t){return t.split("-")[0]}function ds(t){return t.split("-")[1]}function dw(t){return t==="x"?"y":"x"}function hw(t){return t==="y"?"height":"width"}function or(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pw(t){return dw(or(t))}function DF(t,e,n){n===void 0&&(n=!1);const i=ds(t),r=pw(t),o=hw(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=pm(a)),[a,pm(a)]}function kF(t){const e=pm(t);return[dS(t),e,dS(e)]}function dS(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const UA=["left","right"],jA=["right","left"],PF=["top","bottom"],IF=["bottom","top"];function NF(t,e,n){switch(t){case"top":case"bottom":return n?e?jA:UA:e?UA:jA;case"left":case"right":return e?PF:IF;default:return[]}}function LF(t,e,n,i){const r=ds(t);let o=NF(Ki(t),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(dS)))),o}function pm(t){const e=Ki(t);return MF[e]+t.slice(e.length)}function BF(t){var e,n,i,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(i=t.bottom)!=null?i:0,left:(r=t.left)!=null?r:0}}function MP(t){return typeof t!="number"?BF(t):{top:t,right:t,bottom:t,left:t}}function kf(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function hS(t,e){return e<0||e>=t.length}function W0(t,e){return mw(t.current,{disabledIndices:e})}function KA(t,e){return mw(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function VF(t,e,n){const{decrement:i,loopFocus:r,allowEscape:o,disabledIndices:a,minIndex:c,maxIndex:f}=n,h=()=>mw(t,{startingIndex:e,decrement:i,disabledIndices:a});let m,p=!1;if(!r)m=i?Math.max(c,h()):Math.min(f,h());else if(i?e<=c:e>=f){const y=i?-1:t.length;o&&e!==y?m=-1:(m=i?f:c,p=!0)}else m=h();return{index:hS(t,m)?-1:m,wrapped:p}}function mw(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:i,amount:r=1}={}){let o=e;do o+=n?-r:r;while(o>=0&&o<=t.length-1&&DP(t,o,i));return o}function DP(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const r=t[e];return r?!cg(r)||r.matches(":disabled")?!0:!n&&(r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"):!1}function zF(t){return t.visibility==="hidden"||t.visibility==="collapse"}function cg(t,e=t?qi(t):null){return!t||!t.isConnected||!e||zF(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const _F='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function HF(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return Fl(n)?n.host:null}function pS(t){for(const e of Array.from(t.children))if(ri(e)==="summary")return e;return null}function FF(t,e){const n=pS(e);return!!n&&(t===n||Ye(n,t))}function kP(t){const e=t?ri(t):"";return t!=null&&t.matches(_F)&&(e!=="summary"||t.parentElement!=null&&ri(t.parentElement)==="details"&&pS(t.parentElement)===t)&&(e!=="details"||pS(t)==null)&&(e!=="input"||t.type!=="hidden")}function gw(t){if(!kP(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=HF(e)){const n=e!==t,i=ri(e)==="slot";if(e.hasAttribute("inert")||n&&ri(e)==="details"&&!e.open&&!FF(t,e)||e.hasAttribute("hidden")||!i&&!UF(e,n))return!1}return!0}function UF(t,e){const n=qi(t);return e?n.display!=="none":cg(t,n)}function PP(t){const e=t.tabIndex;if(e<0){const n=ri(t);if(n==="details"||n==="audio"||n==="video"||Xt(t)&&t.isContentEditable)return 0}return e}function X0(t){if(ri(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function IP(t,e){const n=X0(t);if(!n)return!0;const i=e.find(r=>{const o=X0(r);return o?.name===n.name&&o.form===n.form&&o.checked});return i?i===n:e.find(r=>{const o=X0(r);return o?.name===n.name&&o.form===n.form})===n}function NP(t){if(Xt(t)&&ri(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Xt(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function yw(t,e){NP(t).forEach(n=>{kP(n)&&e.push(n),yw(n,e)})}function LP(t,e,n){NP(t).forEach(i=>{Xt(i)&&i.matches(e)&&n.push(i),LP(i,e,n)})}function fg(t){return gw(t)&&PP(t)>=0}function BP(t){const e=[];return yw(t,e),e.filter(gw)}function dg(t){const e=BP(t);return e.filter(n=>PP(n)>=0&&IP(n,e))}function VP(t,e){const n=dg(t),i=n.length;if(i===0)return;const r=Mi(xt(t)),o=n.indexOf(r),a=o===-1?e===1?0:i-1:o+e;return n[a]}function zP(t){return VP(xt(t).body,1)||t}function _P(t){return VP(xt(t).body,-1)||t}function jF(t,e,n){if(!t)return null;const i=[];yw(xt(t).body,i);const r=i.indexOf(t);if(r===-1)return null;const o=i.filter(gw);for(let a=1;a<i.length;a+=1){const c=i[(r+e*a+i.length)%i.length];if(!Ye(n,c)&&fg(c)&&IP(c,o))return c}return i[r]}function pu(t,e){const n=e||t.currentTarget,i=t.relatedTarget;return!i||!Ye(n,i)}function KF(t){dg(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function YA(t){const e=[];LP(t,"[data-tabindex]",e),e.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function _o(t,e,n=!0){return t.filter(r=>r.parentId===e).flatMap(r=>[...!n||r.context?.open?[r]:[],..._o(t,r.id,n)])}function qA(t,e){let n=[],i=t.find(r=>r.id===e)?.parentId;for(;i;){const r=t.find(o=>o.id===i);i=r?.parentId,r&&(n=n.concat(r))}return n}function mu(t){return`data-base-ui-${t}`}let Jh=0;function Fp(t,e={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=e;cancelAnimationFrame(Jh);function o(){r&&!r()||t?.focus({preventScroll:n})}if(i)return o(),ln;const a=requestAnimationFrame(o);return Jh=a,()=>{Jh===a&&(cancelAnimationFrame(a),Jh=0)}}const GA="data-base-ui-inert";let Gc=new WeakMap,ep=new WeakSet,Wc=new WeakMap,$0=0;function HP(t){return t?Fl(t)?t.host:HP(t.parentNode):null}const WA=(t,e)=>e.map(n=>{if(t.contains(n))return n;const i=HP(n);return t.contains(i)?i:null}).filter(n=>n!=null),XA=t=>{const e=new Set;return t.forEach(n=>{let i=n;for(;i&&!e.has(i);)e.add(i),i=i.parentNode}),e},$A=(t,e,n)=>{const i=[],r=o=>{!o||n.has(o)||Array.from(o.children).forEach(a=>{ri(a)!=="script"&&(e.has(a)?r(a):i.push(a))})};return r(t),i};function YF(t,e,n,{mark:i=!0}){const r=WA(e,t),o=i?$A(e,XA(r),new Set(r)):[],a=[],c=[];if(n){const f=WA(e,Array.from(e.querySelectorAll("[aria-live]"))),h=r.concat(f);$A(e,XA(h),new Set(h)).forEach(p=>{const y=p.getAttribute("aria-hidden"),b=y!==null&&y!=="false",x=(Gc.get(p)||0)+1;Gc.set(p,x),a.push(p),x===1&&b&&ep.add(p),b||p.setAttribute("aria-hidden","true")})}return i&&o.forEach(f=>{const h=(Wc.get(f)||0)+1;Wc.set(f,h),c.push(f),h===1&&f.setAttribute(GA,"")}),$0+=1,()=>{a.forEach(f=>{const h=(Gc.get(f)||0)-1;Gc.set(f,h),h||(ep.has(f)||f.removeAttribute("aria-hidden"),ep.delete(f))}),i&&c.forEach(f=>{const h=(Wc.get(f)||0)-1;Wc.set(f,h),h||f.removeAttribute(GA)}),$0-=1,$0||(Gc=new WeakMap,ep=new WeakSet,Wc=new WeakMap)}}function QA(t,e={}){const{ariaHidden:n=!1,mark:i=!0}=e,r=xt(t[0]).body;return YF(t,r,n,{mark:i})}var Ln=rP();const qF=eH(Ln),GF=500,FP=500,WF={style:{transition:"none"}},vw="data-base-ui-click-trigger",UP={fallbackAxisSide:"none"},bw={fallbackAxisSide:"end"},XF={clipPath:"inset(50%)",position:"fixed",top:0,left:0},jP=S.createContext(null),KP=()=>S.useContext(jP),$F=mu("portal");function YP(t={}){const{ref:e,container:n,componentProps:i=At,elementProps:r}=t,o=Uu(),c=KP()?.portalNode,[f,h]=S.useState(null),[m,p]=S.useState(null),y=He(C=>{C!==null&&p(C)}),b=S.useRef(null);De(()=>{if(n===null){b.current&&(b.current=null,p(null),h(null));return}const C=(n&&(ew(n)?n:n.current))??c??document.body;if(C==null){b.current&&(b.current=null,p(null),h(null));return}b.current!==C&&(b.current=C,p(null),h(C))},[n,c]);const x=Ot("div",i,{ref:[e,y],props:[{id:o,[$F]:""},r]}),w=f&&x?Ln.createPortal(x,f):null;return{node:m,nodeId:S.isValidElement(x)?x.props.id:void 0,subtree:w}}const hg=S.forwardRef(function(e,n){const{render:i,className:r,style:o,children:a,container:c,portalOwnerRole:f,...h}=e,{node:m,nodeId:p,subtree:y}=YP({container:c,ref:n,componentProps:e,elementProps:h}),b=S.useRef(null),x=S.useRef(null),w=S.useRef(null),C=S.useRef(null),[E,O]=S.useState(null),T=S.useRef(!1),A=E?.modal,D=E?.open,k=!!E&&!E.modal&&E.open&&!!m;S.useEffect(()=>{if(!m||A)return;function I(L){m&&L.relatedTarget&&pu(L)&&(L.type==="focusin"?T.current&&(YA(m),T.current=!1):(KF(m),T.current=!0))}return fs(ft(m,"focusin",I,!0),ft(m,"focusout",I,!0))},[m,A]),De(()=>{!m||D!==!0||!T.current||(YA(m),T.current=!1)},[D,m]);const M=S.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:w,afterInsideRef:C,portalNode:m,setFocusManagerState:O}),[m]);return fe.jsxs(S.Fragment,{children:[y,fe.jsxs(jP.Provider,{value:M,children:[k&&m&&fe.jsx(Vo,{"data-type":"outside",ref:b,onFocus:I=>{if(pu(I,m))w.current?.focus();else{const L=E?E.domReference:null;_P(L)?.focus()}}}),k&&m&&fe.jsx("span",{role:f,"aria-owns":p,style:XF}),m&&Ln.createPortal(a,m),k&&m&&fe.jsx(Vo,{"data-type":"outside",ref:x,onFocus:I=>{if(pu(I,m))C.current?.focus();else{const L=E?E.domReference:null;zP(L)?.focus(),E?.closeOnFocusOut&&E?.onOpenChange(!1,Ze($s,I.nativeEvent))}}})]})]})});function qP(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class Sw{nodesRef={current:[]};events=qP();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(i=>i===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const GP=S.createContext(null),WP=S.createContext(null),$o=()=>S.useContext(GP)?.id||null,Qo=t=>{const e=S.useContext(WP);return t??e};function xw(t){const e=Uu(),n=Qo(t),i=$o();return De(()=>{if(!e)return;const r={id:e,parentId:i};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,e,i]),e}function XP(t){const{children:e,id:n}=t,i=$o();return fe.jsx(GP.Provider,{value:S.useMemo(()=>({id:n,parentId:i}),[n,i]),children:e})}function $P(t){const{children:e,externalTree:n}=t,i=kn(()=>n??new Sw).current;return fe.jsx(WP.Provider,{value:i,children:e})}function Bs(t){return t==null?t:"current"in t?t.current:t}function QF(t,e){const n=Jt(zn(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||(Tu(t)?"keyboard":e||"mouse"):"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const ZA=20;let Io=[];function ww(){Io=Io.filter(t=>t.deref()?.isConnected)}function JA(t){ww(),t&&ri(t)!=="body"&&(Io.push(new WeakRef(t)),Io.length>ZA&&(Io=Io.slice(-ZA)))}function eO(){return ww(),Io[Io.length-1]?.deref()}function ZF(t){return t?fg(t)?t:dg(t)[0]||t:null}function tO(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=BP(t).filter(r=>{const o=r.getAttribute("data-tabindex")||"";return fg(r)||r.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=t.getAttribute("tabindex");n.length===0?i!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(i!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function pg(t){const{context:e,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:o=!0,explicitReturnFocus:a,restoreFocus:c=!1,modal:f=!0,closeOnFocusOut:h=!0,openInteractionType:m="",nextFocusableElement:p,previousFocusableElement:y,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:w}=t,C=e.useState("open"),E=e.useState("domReferenceElement"),O=e.useState("floatingElement"),{events:T,dataRef:A}=e.context,D=He(()=>A.current.floatingContext?.nodeId),k=r===!1,M=fS(E)&&k,I=dn(r),L=dn(o),B=dn(a),H=dn(m),U=dn(C),F=Qo(x),K=KP(),z=S.useRef(!1),V=S.useRef(!1),X=S.useRef(!1),j=S.useRef(null),Y=S.useRef(""),$=S.useRef(""),te=S.useRef(null),N=S.useRef(null),ne=Ws(te,b,K?.beforeInsideRef),q=Ws(N,K?.afterInsideRef),G=wn(),Z=wn(),ae=Ru(),Se=K!=null,le=dm(O),ge=He((ye=le)=>ye?dg(ye):[]),ce=He(()=>w?.().filter(ye=>ye!=null)??[]);S.useEffect(()=>{if(i||!f)return;function ye(Ee){Ee.key==="Tab"&&Ye(le,Mi(xt(le)))&&ge().length===0&&!M&&Rr(Ee)}const Pe=xt(le);return ft(Pe,"keydown",ye)},[i,le,f,M,ge]),S.useEffect(()=>{if(i||!C)return;const ye=xt(le);function Pe(){X.current=!1}function Ee(Be){const ve=zn(Be),Ie=ce(),de=Ye(O,ve)||Ye(E,ve)||Ye(K?.portalNode,ve)||Ie.some(ke=>ke===ve||Ye(ke,ve));X.current=!de,$.current=Be.pointerType||"keyboard",Df(ve,`[${vw}]`)&&(V.current=!0,Z.start(0,()=>{V.current=!1}))}function Me(){$.current="keyboard"}return fs(ft(ye,"pointerdown",Ee,!0),ft(ye,"pointerup",Pe,!0),ft(ye,"pointercancel",Pe,!0),ft(ye,"keydown",Me,!0),Pe)},[i,O,E,le,C,K,Z,ce]),S.useEffect(()=>{if(i||!h)return;const ye=xt(le);function Pe(){V.current=!0,Z.start(0,()=>{V.current=!1})}function Ee(Ie){const de=zn(Ie);fg(de)&&(j.current=de)}function Me(Ie){const de=Ie.relatedTarget,ke=Ie.currentTarget,it=zn(Ie);f&&de==null&&it!=null&&Ye(O,it)&&JA(it),queueMicrotask(()=>{const tt=D(),se=e.context.triggerElements,me=ce(),_e=de?.hasAttribute(mu("focus-guard"))&&[te.current,N.current,K?.beforeInsideRef.current,K?.afterInsideRef.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,Bs(y),Bs(p)].includes(de),we=!(Ye(E,de)||Ye(O,de)||Ye(de,O)||Ye(K?.portalNode,de)||me.some(Re=>Re===de||Ye(Re,de))||se.hasMatchingElement(Re=>Ye(Re,de))||_e||F&&(_o(F.nodesRef.current,tt).find(Re=>Ye(Re.context?.elements.floating,de)||Ye(Re.context?.elements.domReference,de))||qA(F.nodesRef.current,tt).find(Re=>[Re.context?.elements.floating,dm(Re.context?.elements.floating)].includes(de)||Re.context?.elements.domReference===de)));if(ke===E&&le&&tO(le),c&&ke!==E&&!cg(it)&&Mi(ye)===ye.body){if(Xt(le)&&(le.focus(),c==="popup")){ae.request(()=>{le.focus()});return}const Re=ge(),gt=j.current,Je=(gt&&Re.includes(gt)?gt:null)||Re[Re.length-1]||le;Xt(Je)&&Je.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(M||!f)&&de&&we&&!V.current&&(M||de!==eO())&&(z.current=!0,e.setOpen(!1,Ze($s,Ie)))})}function Be(){X.current||(A.current.insideReactTree=!0,G.start(0,()=>{A.current.insideReactTree=!1}))}const ve=Xt(E)?E:null;if(!(!O&&!ve))return fs(ve&&ft(ve,"focusout",Me),ve&&ft(ve,"pointerdown",Pe),O&&ft(O,"focusin",Ee),O&&ft(O,"focusout",Me),O&&K&&ft(O,"focusout",Be,!0))},[i,E,O,le,f,F,K,e,h,c,ge,M,D,A,G,Z,ae,p,y,ce]),S.useEffect(()=>{if(i||!O||!C)return;const ye=Array.from(K?.portalNode?.querySelectorAll(`[${mu("portal")}]`)||[]),Ee=(F?qA(F.nodesRef.current,D()):[]).find(ke=>fS(ke.context?.elements.domReference||null))?.context?.elements.domReference,Be=[...[O,...ye,te.current,N.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,...ce()],Ee,Bs(y),Bs(p),M?E:null].filter(ke=>ke!=null),ve=QA(Be,{ariaHidden:f||M,mark:!1}),Ie=[O,...ye].filter(ke=>ke!=null),de=QA(Ie);return()=>{de(),ve()}},[C,i,E,O,f,K,M,F,D,p,y,ce]),De(()=>{if(!C||i||!Xt(le))return;Y.current="",$.current="";const ye=xt(le),Pe=Mi(ye);queueMicrotask(()=>{const Ee=I.current,Me=typeof Ee=="function"?Ee(H.current||""):Ee;if(Me===void 0||Me===!1||Ye(le,Pe))return;let ve=null;const Ie=()=>(ve==null&&(ve=ge(le)),ve[0]||le);let de;Me===!0||Me===null?de=Ie():de=Bs(Me),de=de||Ie();const ke=Ye(le,Mi(ye)),it=A.current.openEvent,tt=it?.type==="mousedown"&&Tu(it);Fp(de,{sync:tt,preventScroll:de===le,shouldFocus(){if(!U.current)return!1;if(ke)return!0;const se=Mi(ye);return!(se!==de&&Ye(le,se))}})})},[i,C,le,ge,I,H,U,A]);const ue=S.useRef(null);De(()=>{if(i||!le){ue.current=null;return}ue.current&&(ue.current.cancelled=!0,ue.current=null);const ye=xt(le),Pe=Mi(ye),Ee=H.current==null;JA(Pe);function Me(ve){if(ve.open||(Y.current=QF(ve.nativeEvent,$.current)),(ve.reason===$s&&ve.triggerElement?.hasAttribute(mu("focus-guard"))||ve.reason===vn&&ve.nativeEvent.type==="mouseleave")&&(z.current=!0),ve.reason===sg)if(ve.nested)z.current=!1;else if(Tu(ve.nativeEvent)||uw(ve.nativeEvent))z.current=!1;else{let Ie=!1;xt(le).createElement("div").focus({get preventScroll(){return Ie=!0,!1}}),Ie?z.current=!1:z.current=!0}}T.on("openchange",Me);function Be(ve){const Ie=L.current;let de=typeof Ie=="function"?Ie(ve):Ie;if(de===void 0||de===!1)return null;de===null&&(de=!0);const ke=E?.isConnected?E:null,it=Pe?.isConnected&&ri(Pe)!=="body"?Pe:null;let tt=Ee?it||ke:ke||it;return tt||(tt=eO()||null),typeof de=="boolean"?tt:Bs(de)||tt||null}return()=>{T.off("openchange",Me);const ve=Mi(ye),Ie=ce(),de=Ye(O,ve)||Ie.some(me=>me===ve||Ye(me,ve))||F&&_o(F.nodesRef.current,D(),!1).some(me=>Ye(me.context?.elements.floating,ve)),ke=L.current,it=Y.current,tt=Be(it),se={cancelled:!1};ue.current=se,queueMicrotask(()=>{ue.current===se&&(ue.current=null);const me=ZF(tt),_e=B.current??typeof ke!="boolean";if(!se.cancelled&&ke&&!z.current&&Xt(me)&&(!(!_e&&me!==ve&&ve!==ye.body)||de)){const we={preventScroll:!0};it==="keyboard"&&(we.focusVisible=!0),me.focus(we)}z.current=!1})}},[i,O,le,L,B,H,T,F,E,D,ce]),De(()=>{if(!vs||C||!O)return;const ye=Mi(xt(O));!Xt(ye)||!nd(ye)||Ye(O,ye)&&ye.blur()},[C,O]),De(()=>{if(!(i||!K))return K.setFocusManagerState({modal:f,closeOnFocusOut:h,open:C,onOpenChange:e.setOpen,domReference:E}),()=>{K.setFocusManagerState(null)}},[i,K,f,C,e,h,E]),De(()=>{if(!(i||!le))return tO(le),()=>{queueMicrotask(ww)}},[i,le]);const Te=!i&&(f?!M:!0)&&(Se||f);return fe.jsxs(S.Fragment,{children:[Te&&fe.jsx(Vo,{"data-type":"inside",ref:ne,onFocus:ye=>{if(f){const Pe=ge();Fp(Pe[Pe.length-1])}else K?.portalNode&&(z.current=!1,pu(ye,K.portalNode)?zP(E)?.focus():Bs(y??K.beforeOutsideRef)?.focus())}}),n,Te&&fe.jsx(Vo,{"data-type":"inside",ref:q,onFocus:ye=>{f?Fp(ge()[0]):K?.portalNode&&(h&&(z.current=!0),pu(ye,K.portalNode)?_P(E)?.focus():Bs(p??K.afterOutsideRef)?.focus())}})]})}function id(t,e={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:o=!1,stickIfOpen:a=!0,touchOpenDelay:c=0,reason:f=gs}=e,h=t.context.dataRef,m=S.useRef(void 0),p=Ru(),y=wn(),b=S.useMemo(()=>{function x(C,E,O,T){const A=Ze(f,E,O);C&&T==="touch"&&c>0?y.start(c,()=>{t.setOpen(!0,A)}):t.setOpen(C,A)}function w(C,E,O){const T=h.current.openEvent,A=t.select("domReferenceElement")!==E;return C&&A||!C||!r?!0:T&&(typeof a=="function"?a():a)?!O(T.type):!1}return{onPointerDown(C){m.current=Bo(C.pointerType,!0)&&uw(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const E=m.current,O=C.nativeEvent,T=t.select("open");if(C.button!==0||i==="click"||Bo(E,!0)&&o)return;const A=w(T,C.currentTarget,I=>I==="click"||I==="mousedown"),D=zn(O),k=nd(D);if(k||E==="virtual"){x(A,O,k?D:C.currentTarget,E);return}const M=C.currentTarget;p.request(()=>{x(A,O,M,E)})},onClick(C){if(i==="mousedown-only")return;const E=m.current;if(i==="mousedown"&&E){m.current=void 0;return}if(Bo(E,!0)&&o)return;const O=t.select("open"),T=w(O,C.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");x(T,C.nativeEvent,C.currentTarget,E)},onKeyDown(){m.current=void 0}}},[h,i,o,f,t,a,r,p,y,c]);return S.useMemo(()=>n?{reference:b}:At,[n,b])}function JF(t,e){let n=null,i=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const o=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=e.axis==="x"||e.axis==="both",c=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch",h=e.axis==="y"?o.width:0,m=e.axis==="x"?o.height:0;let p=o.x,y=o.y;return n==null&&e.x&&a&&(n=o.x-e.x),i==null&&e.y&&c&&(i=o.y-e.y),p-=n||0,y-=i||0,(!r||f)&&(p=a&&e.x!=null?e.x:p,y=c&&e.y!=null?e.y:y),r=!0,{width:h,height:m,x:p,y,top:y,right:p+h,bottom:y+m,left:p}}}}function nO(t){return t!=null&&t.clientX!=null}function eU(t,e={}){const{enabled:n=!0,axis:i="both"}=e,r=t.useState("open"),o=t.useState("floatingElement"),a=t.useState("domReferenceElement"),c=t.context.dataRef,f=S.useRef(!1),h=S.useRef(null),[m,p]=S.useState(),[y,b]=S.useState([]),x=He(T=>{t.set("positionReference",T)}),w=He((T,A,D)=>{f.current||c.current.openEvent&&!nO(c.current.openEvent)||t.set("positionReference",JF(D??a,{x:T,y:A,axis:i,dataRef:c,pointerType:m}))}),C=He(T=>{r?h.current||(w(T.clientX,T.clientY,T.currentTarget),b([])):w(T.clientX,T.clientY,T.currentTarget)}),E=Bo(m)?o:r;S.useEffect(()=>{if(!n){x(a);return}if(!E)return;function T(){h.current?.(),h.current=null}const A=Jt(o);function D(k){const M=zn(k);Ye(o,M)?T():w(k.clientX,k.clientY)}return!c.current.openEvent||nO(c.current.openEvent)?h.current=ft(A,"mousemove",D):x(a),T},[E,n,o,c,a,t,w,x,y]),S.useEffect(()=>()=>{t.set("positionReference",null)},[t]),S.useEffect(()=>{n&&!o&&(f.current=!1)},[n,o]),S.useEffect(()=>{!n&&r&&(f.current=!0)},[n,r]);const O=S.useMemo(()=>{function T(A){p(A.pointerType)}return{onPointerDown:T,onPointerEnter:T,onMouseMove:C,onMouseEnter:C}},[C]);return S.useMemo(()=>n?{reference:O,trigger:O}:{},[n,O])}function tU(){return!1}function nU(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function rd(t,e={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:o="sloppy",referencePress:a=tU,bubbles:c,externalTree:f}=e,h=t.useState("open"),m=t.useState("floatingElement"),{dataRef:p,events:y}=t.context,b=Qo(f),x=He(typeof r=="function"?r:()=>!1),w=typeof r=="function"?x:r,C=w!==!1,E=He(()=>o),{escapeKey:O,outsidePress:T}=nU(c),A=S.useRef(!1),D=S.useRef(!1),k=S.useRef(!1),M=S.useRef(!1),I=S.useRef(!1),L=S.useRef(""),B=S.useRef(null),H=wn(),U=wn(),F=wn(),K=He(()=>{U.clear(),p.current.insideReactTree=!1}),z=He(q=>{const G=p.current.floatingContext?.nodeId;return(b?_o(b.nodesRef.current,G):[]).some(ae=>ae.context?.open&&!ae.context.dataRef.current[q])}),V=He(q=>G0(q,t.select("floatingElement"))||G0(q,t.select("domReferenceElement"))),X=He(q=>{a()&&t.setOpen(!1,Ze(gs,q.nativeEvent))}),j=He(q=>{if(!h||!n||!i||q.key!=="Escape")return;const G=yF(q)?q.nativeEvent:q;if(I.current||G.isComposing||!O&&z("__escapeKeyBubbles"))return;const Z=Ze(ed,G);t.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!O&&!Z.isPropagationAllowed&&q.stopPropagation()}),Y=He(()=>{p.current.insideReactTree=!0,U.start(0,K)}),$=He(q=>{if(!h||!n||q.button!==0)return;const G=zn(q.nativeEvent);Ye(t.select("floatingElement"),G)&&(A.current||(A.current=!0,D.current=!1))}),te=He(q=>{!h||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&A.current&&(D.current=!0)});S.useEffect(()=>{function q(G){G.open||(M.current=!1)}return y.on("openchange",q),()=>{y.off("openchange",q)}},[y]),S.useEffect(()=>K,[K]),S.useEffect(()=>{if(!h||!n)return h||(M.current=!1,I.current=!1,L.current="",B.current=null),K;p.current.__escapeKeyBubbles=O,p.current.__outsidePressBubbles=T;const q=new Dr,G=xt(m);function Z(){F.clear(),I.current=!0}function ae(){I.current=!0,F.start(vs?5:0,()=>{I.current=!1})}function Se(){k.current=!0,q.start(0,()=>{k.current=!1})}function le(){A.current=!1,D.current=!1}function ge(){const se=L.current,me=se==="pen"||!se?"mouse":se,_e=E(),we=typeof _e=="function"?_e():_e;return typeof we=="string"?we:we[me]}function ce(se){const me=ge();return me==="intentional"&&se.type!=="click"||me==="sloppy"&&se.type==="click"}function ue(se){const me=p.current.floatingContext?.nodeId,_e=b&&_o(b.nodesRef.current,me).some(we=>G0(se,we.context?.elements.floating));return V(se)||_e}function Te(se){if(ce(se)){se.type!=="click"&&!V(se)&&(q.clear(),k.current=!1),K();return}if(p.current.insideReactTree){K();return}const me=zn(se),_e=`[${mu("inert")}]`,we=Dt(me)?me.getRootNode():null,Re=Array.from((Fl(we)?we:xt(t.select("floatingElement"))).querySelectorAll(_e)),gt=t.context.triggerElements;if(me&&(gt.hasElement(me)||gt.hasMatchingElement(rt=>Ye(rt,me))))return;let Je=Dt(me)?me:null;for(;Je&&!js(Je);){const rt=Xs(Je);if(js(rt)||!Dt(rt))break;Je=rt}if(!(Re.length&&Dt(me)&&!bF(me)&&!Ye(me,t.select("floatingElement"))&&Re.every(rt=>!Ye(Je,rt)))){if(Xt(me)&&!("touches"in se)){const rt=js(me),Et=qi(me),yt=/auto|scroll/,hn=rt||yt.test(Et.overflowX),qt=rt||yt.test(Et.overflowY),tn=hn&&me.clientWidth>0&&me.scrollWidth>me.clientWidth,qe=qt&&me.clientHeight>0&&me.scrollHeight>me.clientHeight,st=Et.direction==="rtl",Lt=qe&&(st?se.offsetX<=me.offsetWidth-me.clientWidth:se.offsetX>me.clientWidth),ot=tn&&se.offsetY>me.clientHeight;if(Lt||ot)return}if(!ue(se)){if(ge()==="intentional"){if(se.detail!==0&&!Tu(se)&&!M.current)return;if(k.current){q.clear(),k.current=!1;return}}typeof w=="function"&&!w(se)||z("__outsidePressBubbles")||(t.setOpen(!1,Ze(sg,se)),K())}}}function ye(se){ge()!=="sloppy"||se.pointerType==="touch"||!t.select("open")||!n||V(se)||Te(se)}function Pe(se){if(ge()!=="sloppy"||!t.select("open")||!n||V(se))return;const me=se.touches[0];me&&(B.current={startTime:Date.now(),startX:me.clientX,startY:me.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function Ee(se,me){const _e=zn(se);if(!_e)return;const we=ft(_e,se.type,()=>{me(se),we()})}function Me(se){L.current="touch",Ee(se,Pe)}function Be(se){H.clear(),se.type==="pointerdown"&&(se.button===0&&(M.current=!0),L.current=se.pointerType),!(se.type==="mousedown"&&B.current&&!B.current.dismissOnMouseDown)&&Ee(se,me=>{me.type==="pointerdown"?ye(me):Te(me)})}function ve(se){if(se.type==="pointercancel"&&(M.current=!1),!A.current)return;const me=D.current;if(le(),ge()==="intentional"){if(se.type==="pointercancel"){me&&Se();return}if(!ue(se)){if(me){Se();return}typeof w=="function"&&!w(se)||(q.clear(),k.current=!0,K())}}}function Ie(se){if(ge()!=="sloppy"||!B.current||V(se))return;const me=se.touches[0];if(!me)return;const _e=Math.abs(me.clientX-B.current.startX),we=Math.abs(me.clientY-B.current.startY),Re=Math.sqrt(_e*_e+we*we);Re>5&&(B.current.dismissOnTouchEnd=!0),Re>10&&(Te(se),H.clear(),B.current=null)}function de(se){Ee(se,Ie)}function ke(se){ge()!=="sloppy"||!B.current||V(se)||(B.current.dismissOnTouchEnd&&Te(se),H.clear(),B.current=null)}function it(se){Ee(se,ke)}const tt=fs(i&&fs(ft(G,"keydown",j),ft(G,"compositionstart",Z),ft(G,"compositionend",ae)),C&&fs(ft(G,"click",Be,!0),ft(G,"pointerdown",Be,!0),ft(G,"pointerup",ve,!0),ft(G,"pointercancel",ve,!0),ft(G,"mousedown",Be,!0),ft(G,"mouseup",ve,!0),ft(G,"touchstart",Me,{capture:!0,passive:!0}),ft(G,"touchmove",de,{capture:!0,passive:!0}),ft(G,"touchend",it,{capture:!0,passive:!0})));return()=>{tt(),q.clear(),le(),k.current=!1}},[p,m,i,C,w,h,n,O,T,j,K,E,z,V,b,t,H,F]);const N=S.useMemo(()=>({onKeyDown:j,onPointerDown:X,onClick:X}),[j,X]),ne=S.useMemo(()=>({onKeyDown:j,onPointerDown:te,onMouseDown:te,onClickCapture:Y,onMouseDownCapture(q){Y(),$(q)},onPointerDownCapture(q){Y(),$(q)},onMouseUpCapture:Y,onTouchEndCapture:Y,onTouchMoveCapture:Y}),[j,Y,$,te]);return S.useMemo(()=>n?{reference:N,floating:ne,trigger:N}:{},[n,N,ne])}function QP(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:o,onOpenChange:a}=t,c=e.useState("open"),f=e.useState("activeTriggerElement"),h=e.useState(n?"popupElement":"positionerElement"),m=a;return e.useSyncedValue("floatingId",r),De(()=>{const p={open:c,floatingId:r,referenceElement:f,floatingElement:h};Dt(f)&&(p.domReferenceElement=f),i.state.positionReference===i.state.referenceElement&&(p.positionReference=f),i.update(p)},[c,r,f,h,i]),i.context.onOpenChange=m,i.context.nested=o,i}function mg(t,e=!1,n=!1,i=!1){const[r,o]=S.useState(t&&e?"idle":void 0),[a,c]=S.useState(t&&!i);return t&&!a&&(c(!0),o("starting")),!t&&a&&r!=="ending"&&!n&&o("ending"),!t&&!a&&r==="ending"&&o(void 0),De(()=>{if(!t&&a&&r!=="ending"&&n){const f=ts.request(()=>{o("ending")});return()=>{ts.cancel(f)}}},[t,a,r,n]),De(()=>{if(!t||e||r===void 0)return;const f=ts.request(()=>{o(void 0)});return()=>{ts.cancel(f)}},[e,t,r]),De(()=>{if(!t||!e)return;t&&a&&r!=="idle"&&o("starting");const f=ts.request(()=>{o("idle")});return()=>{ts.cancel(f)}},[e,t,a,r]),{mounted:a,setMounted:c,transitionStatus:r}}function iO(t,e){return t.getAnimations(e).filter(n=>{const i=n.effect?.getTiming();return i?.duration!==1/0&&i?.iterations!==1/0})}let tp=null;function iU(t){if(!tp){const e=[];tp=e,queueMicrotask(()=>{tp=null,Ln.flushSync(()=>{for(const n of e)n()})})}tp.push(t)}function Cw(t,e=!1,n=!1){const i=Ru();return He((r,o=null)=>{i.cancel();const a=Bs(t);if(a==null)return;const c=a,f=()=>{if(!n){Ln.flushSync(r);return}iU(()=>{o?.aborted||r()})};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function h(){Promise.all(iO(c).map(m=>m.finished.then(ln))).then(()=>{o?.aborted||f()},()=>{if(o?.aborted)return;if(iO(c).some(p=>p.pending||p.playState!=="finished")){h();return}f()})}if(e){const m=pP;if(!c.hasAttribute(m)){i.request(h);return}const p=new MutationObserver(()=>{c.hasAttribute(m)||(p.disconnect(),h())});p.observe(c,{attributes:!0,attributeFilter:[m]}),o?.addEventListener("abort",()=>p.disconnect(),{once:!0});return}i.request(h)})}function eo(t){const{enabled:e=!0,open:n,ref:i,batch:r=!1,onComplete:o}=t,a=He(o),c=Cw(i,n,r);S.useEffect(()=>{if(!e)return;const f=new AbortController;return c(a,f.signal),()=>{f.abort()}},[e,n,a,c])}function ZP(t){const{open:e,ref:n,preventUnmountOnClose:i,setPreventUnmountOnClose:r,onUnmount:o,animateInitialOpen:a}=t,c=He(r),{mounted:f,setMounted:h,transitionStatus:m}=mg(e,!1,!1,a),p=e?!1:i;De(()=>{e&&c(!1)},[e,c]);const y=S.useRef(f),b=S.useRef(!1),x=SP(),w=()=>{y.current=!1,h(!1),o()};De(()=>{y.current=f,b.current&&(b.current=!1,!e&&f&&w())});const C=He(()=>{if(y.current){if(e){b.current=!0,x();return}w()}});return eo({enabled:f&&!e&&!p,open:e,ref:n,onComplete(){e||C()}}),{mounted:f,transitionStatus:m,preventUnmountingOnClose:p,forceUnmount:C}}const sd={tabIndex:-1,[uS]:""};function JP(t){return e=>e==="touch"?t.current:!0}function Ew(t,e=!1){const n=Uu(),i=$o()!=null,r=kn(()=>t(n,i)).current;return QP({popupStore:r,treatPopupAsFloatingElement:e,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function gg({handle:t,store:e}){return De(()=>t.attachStore(e),[t,e]),null}function rO(t){const e=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==e&&t.set("triggerCount",e)}function eI(t,e){const n=S.useRef(null);return He(i=>{const r=n.current;if(r!==null){if(r.element===i&&r.store===e&&r.id===t)return;n.current=null;const o=r.store;o.context.triggerElements.getById(r.id)===r.element&&(o.context.triggerElements.delete(r.id),rO(o))}i!==null&&t!==void 0&&(n.current={store:e,id:t,element:i},e.context.triggerElements.add(t,i),rO(e))})}function yg(t,e,n,i=!1){let r=t.preventUnmountingOnClose;e?r=!1:i&&(r=!0);const o=n?.id??null;let a=t.activeTriggerId,c=t.activeTriggerElement;return(o||e)&&(a=o,c=n??null),{open:e,preventUnmountingOnClose:r,activeTriggerId:a,activeTriggerElement:c,openedWithoutTrigger:e?n==null:t.openedWithoutTrigger}}function vg(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function rU(t,e,n,i={}){const r=n.reason,o=r===vn,a=e&&r===hu,c=!e&&(r===gs||r===ed),f=vg(n);if(t.context.onOpenChange?.(e,n),n.isCanceled)return;i.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(e,n);const h=()=>{const m=yg(t.state,e,n.trigger,f()),p={...i.extraState,...m};a?p.instantType="focus":c?p.instantType="dismiss":o&&(p.instantType=void 0),t.update(p)};o?Ln.flushSync(h):h()}function bg(t,e,n,i){const r=n.useState("isMountedByTrigger",t),o=eI(t,n),a=He(f=>{const h=n.select("open"),m=n.select("activeTriggerId");if(m===t){const p={activeTriggerElement:f,...h?i:null};n.update(p);return}if(m==null&&h&&!n.state.openedWithoutTrigger){const p={activeTriggerId:t??null,activeTriggerElement:f,...i};n.update(p)}}),c=He(f=>{o(f),f&&a(f)});return De(()=>(c(e.current),()=>c(null)),[c,e,n,t]),De(()=>{if(r){const f={activeTriggerElement:e.current,...i};n.update(f)}},[r,n,e,...Object.values(i)]),{registerTrigger:c,isMountedByThisTrigger:r}}function Sg(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,i=S.useRef(null),r=t.useState("open"),o=t.useState("triggerCount"),a=t.useState("activeTriggerId"),c=t.useState("activeTriggerElement");De(()=>{if(!r){i.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0),t.state.openedWithoutTrigger&&t.set("openedWithoutTrigger",!1);return}const f=t.context.triggerElements.size,h={};t.state.triggerCount!==f&&(h.triggerCount=f);const m=t.select("activeTriggerId");let p=null;if(m){const y=t.context.triggerElements.getById(m);if(y)i.current=m,y!==t.state.activeTriggerElement&&(h.activeTriggerElement=y);else{for(const[b,x]of t.context.triggerElements.entries())if(x===t.state.activeTriggerElement){h.activeTriggerId=b,h.activeTriggerElement=x,i.current=b;break}h.activeTriggerId===void 0&&(i.current===m?p=m:i.current=null)}}else i.current=null;if(!p&&!m&&!t.state.openedWithoutTrigger&&f===1){const y=t.context.triggerElements.entries().next();if(!y.done){const[b,x]=y.value;h.activeTriggerId=b,h.activeTriggerElement=x,i.current=b}}(h.triggerCount!==void 0||h.activeTriggerId!==void 0||h.activeTriggerElement!==void 0)&&t.update(h),p&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===p&&!t.context.triggerElements.getById(p)){const y=Ze(dr);t.setOpen(!1,y),y.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,t,o,a,c,n])}function xg(t,e,n,i){const{mounted:r,transitionStatus:o,forceUnmount:a}=ZP({open:t,ref:e.context.popupRef,preventUnmountOnClose:e.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:c=>e.set("preventUnmountingOnClose",c),animateInitialOpen:i,onUnmount(){e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)}});return kn(()=>(e.set("mounted",r),null)),e.useSyncedValues({mounted:r,transitionStatus:o}),{forceUnmount:a,transitionStatus:o}}function wg(t,e){t.useSyncedValues(e),De(()=>()=>{t.update({activeTriggerProps:At,inactiveTriggerProps:At,popupProps:At})},[t])}function tI(t,e){De(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),De(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class od{idMap=new Map;add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var Q0={exports:{}},Z0={};var sO;function sU(){if(sO)return Z0;sO=1;var t=Jm();function e(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,r=t.useEffect,o=t.useLayoutEffect,a=t.useDebugValue;function c(p,y){var b=y(),x=i({inst:{value:b,getSnapshot:y}}),w=x[0].inst,C=x[1];return o(function(){w.value=b,w.getSnapshot=y,f(w)&&C({inst:w})},[p,b,y]),r(function(){return f(w)&&C({inst:w}),p(function(){f(w)&&C({inst:w})})},[p]),a(b),b}function f(p){var y=p.getSnapshot;p=p.value;try{var b=y();return!n(p,b)}catch{return!0}}function h(p,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Z0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:m,Z0}var oO;function nI(){return oO||(oO=1,Q0.exports=sU()),Q0.exports}var Tw=nI(),J0={exports:{}},eb={};var lO;function oU(){if(lO)return eb;lO=1;var t=Jm(),e=nI();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var i=typeof Object.is=="function"?Object.is:n,r=e.useSyncExternalStore,o=t.useRef,a=t.useEffect,c=t.useMemo,f=t.useDebugValue;return eb.useSyncExternalStoreWithSelector=function(h,m,p,y,b){var x=o(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function E(k){if(!O){if(O=!0,T=k,k=y(k),b!==void 0&&w.hasValue){var M=w.value;if(b(M,k))return A=M}return A=k}if(M=A,i(T,k))return M;var I=y(k);return b!==void 0&&b(M,I)?(T=k,M):(T=k,A=I)}var O=!1,T,A,D=p===void 0?null:p;return[function(){return E(m())},D===null?void 0:function(){return E(D())}]},[m,p,y,b]);var C=r(h,x[0],x[1]);return a(function(){w.hasValue=!0,w.value=C},[C]),f(C),C},eb}var aO;function lU(){return aO||(aO=1,J0.exports=oU()),J0.exports}var aU=lU();const mS=[];let gS;function uU(){return gS}function cU(t){mS.push(t)}function ld(t){const e=(n,i)=>{const r=kn(fU).current;let o;try{gS=r;for(const a of mS)a.before(r);o=t(n,i);for(const a of mS)a.after(r);r.didInitialize=!0}finally{gS=void 0}return o};return e.displayName=t.displayName||t.name,e}function Cg(t){return S.forwardRef(ld(t))}function fU(){return{didInitialize:!1}}const dU=Zx(19),hU=dU?mU:gU;function iI(t,e,n,i,r){return hU(t,e,n,i,r)}function pU(t,e,n,i,r){const o=S.useCallback(()=>e(t.getSnapshot(),n,i,r),[t,e,n,i,r]);return Tw.useSyncExternalStore(t.subscribe,o,o)}cU({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const i=t.syncHooks[n],r=i.selector(i.store.state,i.a1,i.a2,i.a3);Object.is(i.value,r)||(e=!0,i.value=r)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const r of t.syncHooks)n.add(r.store);const i=[];for(const r of n)i.push(r.subscribe(e));return()=>{for(const r of i)r()}}),Tw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function mU(t,e,n,i,r){const o=uU();if(!o)return pU(t,e,n,i,r);const a=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[a],(c.store!==t||c.selector!==e||!Object.is(c.a1,n)||!Object.is(c.a2,i)||!Object.is(c.a3,r))&&(c.store!==t&&(o.didChangeStore=!0),c.store=t,c.selector=e,c.a1=n,c.a2=i,c.a3=r,c.value=e(t.getSnapshot(),n,i,r))):(c={store:t,selector:e,a1:n,a2:i,a3:r,value:e(t.getSnapshot(),n,i,r)},o.syncHooks.push(c)),c.value}function gU(t,e,n,i,r){return aU.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,o=>e(o,n,i,r))}class yU{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,i,r){return iI(this,e,n,i,r)}}class ju extends yU{constructor(e,n={},i){super(e),this.context=n,this.selectors=i}useSyncedValue(e,n){S.useDebugValue(e);const i=this;De(()=>{i.state[e]!==n&&i.set(e,n)},[i,e,n])}useSyncedValueWithCleanup(e,n){const i=this;De(()=>(i.state[e]!==n&&i.set(e,n),()=>{i.set(e,void 0)}),[i,e,n])}useSyncedValues(e){const n=this,i=Object.values(e);De(()=>{n.update(e)},[n,...i])}useControlledProp(e,n){S.useDebugValue(e);const i=this,r=n!==void 0;De(()=>{r&&!Object.is(i.state[e],n)&&i.setState({...i.state,[e]:n})},[i,e,n,r])}select(e,n,i,r){const o=this.selectors[e];return o(this.state,n,i,r)}useState(e,n,i,r){return S.useDebugValue(e),iI(this,this.selectors[e],n,i,r)}useContextCallback(e,n){S.useDebugValue(e);const i=He(n??ln);this.context[e]=i}useStateSetter(e){const n=S.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(e,i)}),n.current}observe(e,n){let i;typeof e=="function"?i=e:i=this.selectors[e];let r=i(this.state);return n(r,r,this),this.subscribe(o=>{const a=i(o);if(!Object.is(r,a)){const c=r;r=a,n(a,c,this)}})}}const vU={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class rI extends ju{constructor(e){const{syncOnly:n,nested:i,onOpenChange:r,triggerElements:o,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:qP(),nested:i,triggerElements:o},vU),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&vF(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const i={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",i)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function Eg(t,e,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new rI({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:e,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:At,inactiveTriggerProps:At,popupProps:At}}const df=t=>t.triggerIdProp??t.activeTriggerId,mm=t=>t.openProp??t.open,uO=t=>(t.popupElement?.id??t.floatingId)||void 0;function sI(t,e){return e!==void 0&&mm(t)&&df(t)===e}function bU(t,e){return sI(t,e)?!0:e!==void 0&&mm(t)&&df(t)==null&&!t.openedWithoutTrigger&&t.triggerCount===1}const Fs={open:mm,mounted:t=>t.mounted,transitionStatus:t=>mm(t)&&!t.mounted?"starting":t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:df,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:uO,isTriggerActive:(t,e)=>e!==void 0&&df(t)===e,isOpenedByTrigger:(t,e)=>sI(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&df(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>bU(t,e)?uO(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function Tg(t){const e=S.useCallback(i=>t===void 0?ln:t.subscribeStore(i),[t]),n=S.useCallback(()=>t===void 0?void 0:t.store,[t]);return Tw.useSyncExternalStore(e,n,()=>t?.serverStore)}function SU(t){const{open:e=!1,onOpenChange:n,elements:i={}}=t,r=Uu(),o=$o()!=null,a=kn(()=>new rI({open:e,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new od,floatingId:r,syncOnly:!1,nested:o})).current;return De(()=>{const c={open:e,floatingId:r};i.reference!==void 0&&(c.referenceElement=i.reference,c.domReferenceElement=Dt(i.reference)?i.reference:null),i.floating!==void 0&&(c.floatingElement=i.floating),a.update(c)},[e,r,i.reference,i.floating,a]),a.context.onOpenChange=n,a.context.nested=o,a}const tb=lw&&vs;function oI(t,e={}){const{enabled:n=!0,delay:i}=e,{events:r,dataRef:o}=t.context,a=S.useRef(!1),c=S.useRef(null),f=S.useRef(!0),h=wn();S.useEffect(()=>{const p=t.select("domReferenceElement");if(!n)return;const y=Jt(p);function b(){const C=t.select("domReferenceElement");!t.select("open")&&Xt(C)&&C===Mi(xt(C))&&(a.current=!0,c.current=C)}function x(){f.current=!0}function w(){f.current=!1}return fs(ft(y,"blur",b),tb&&ft(y,"keydown",x,!0),tb&&ft(y,"pointerdown",w,!0))},[t,n]),S.useEffect(()=>{if(!n)return;function p(y){if(y.reason===gs||y.reason===ed){const b=t.select("domReferenceElement");Dt(b)&&(c.current=b,a.current=!0)}}return r.on("openchange",p),()=>{r.off("openchange",p)}},[r,n,t]);const m=S.useMemo(()=>{function p(){a.current=!1,c.current=null}return{onMouseLeave(){p()},onFocus(y){const b=y.currentTarget;if(a.current){if(c.current===b)return;p()}const x=zn(y.nativeEvent);if(Dt(x)){if(tb&&!y.relatedTarget){if(!f.current&&!nd(x))return}else if(!xF(x))return}const w=fm(y.relatedTarget,t.context.triggerElements),{nativeEvent:C,currentTarget:E}=y;if(t.select("open")&&w||!i){t.setOpen(!0,Ze(hu,C,E));return}h.start(i,()=>{a.current||t.setOpen(!0,Ze(hu,C,E))})},onBlur(y){p();const b=y.relatedTarget,x=y.nativeEvent,w=Dt(b)&&b.hasAttribute(mu("focus-guard"))&&b.getAttribute("data-type")==="outside";h.start(0,()=>{const C=t.select("domReferenceElement"),E=Mi(xt(C));!b&&E===C||Ye(o.current.floatingContext?.refs.floating.current,E)||Ye(C,E)||w||fm(b??E,t.context.triggerElements)||t.setOpen(!1,Ze(hu,x))})}}},[o,i,t,h]);return S.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class Rw{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Dr;restTimeout=new Dr;handleCloseOptions=void 0;static create(){return new Rw}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const gm=new WeakMap;function ym(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&gm.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),gm.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function lI(t,e){const{scopeElement:n,referenceElement:i,floatingElement:r}=e,o=gm.get(n);o&&o!==t&&ym(o),ym(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=i,t.pointerEventsFloatingElement=r,gm.set(n,t),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function Aw(t){const e=t.context.dataRef.current,n=kn(()=>e.hoverInteractionState??Rw.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),ow(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function Ow(t,e={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=e,o=t.useState("open"),a=t.useState("floatingElement"),c=t.useState("domReferenceElement"),{dataRef:f}=t.context,h=Qo(),m=$o(),p=Aw(t),y=wn(),b=He(()=>EP(f.current.openEvent?.type,p.interactedInside)),x=He(()=>CF(f.current.openEvent?.type)),w=He(()=>{ym(p)});De(()=>{o||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,w())},[o,p,w]),S.useEffect(()=>w,[w]),De(()=>{if(n&&o&&p.handleCloseOptions?.blockPointerEvents&&x()&&Dt(c)&&a){const C=c,E=a,O=xt(a),T=h?.nodesRef.current.find(M=>M.id===m)?.context?.elements.floating;T&&(T.style.pointerEvents="");const A=p.pointerEventsScopeElement!==E?p.pointerEventsScopeElement:null,D=T!==E?T:null,k=p.handleCloseOptions?.getScope?.()??A??D??Df(C,"[data-rootownerid]")??O.body;return lI(p,{scopeElement:k,referenceElement:C,floatingElement:E}),()=>{w()}}},[n,o,c,a,p,x,h,m,w]),S.useEffect(()=>{if(!n)return;function C(){return!!(h&&m&&_o(h.nodesRef.current,m).length>0)}function E(M){const I=Ul(i,"close",p.pointerType),L=()=>{t.setOpen(!1,Ze(vn,M)),h?.events.emit("floating.closed",M)};I?p.openChangeTimeout.start(I,L):(p.openChangeTimeout.clear(),L())}function O(M){const I=zn(M);if(!SF(I)){p.interactedInside=!1;return}p.interactedInside=Df(I,"[aria-haspopup]")!=null}function T(){p.openChangeTimeout.clear(),y.clear(),h?.events.off("floating.closed",D),w()}function A(M){if(C()&&h){h.events.on("floating.closed",D);return}if(fm(M.relatedTarget,t.context.triggerElements))return;const I=f.current.floatingContext?.nodeId??r,L=M.relatedTarget;if(!(h&&I&&Dt(L)&&_o(h.nodesRef.current,I,!1).some(H=>Ye(H.context?.elements.floating,L)))){if(p.handler){p.handler(M);return}w(),x()&&!b()&&E(M)}}function D(M){!h||!m||C()||y.start(0,()=>{h.events.off("floating.closed",D),t.setOpen(!1,Ze(vn,M)),h.events.emit("floating.closed",M)})}const k=a;return fs(k&&ft(k,"mouseenter",T),k&&ft(k,"mouseleave",A),k&&ft(k,"pointerdown",O,!0),()=>{h?.events.off("floating.closed",D)})},[n,a,t,f,i,r,x,b,w,p,h,m,y])}const xU={current:null};function Rg(t,e={}){const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:o=!1,restMs:a=0,move:c=!0,triggerElementRef:f=xU,externalTree:h,isActiveTrigger:m=!0,getHandleCloseContext:p,isClosing:y,shouldOpen:b,guardStaleOpen:x=!1}=e,{dataRef:w,events:C}=t.context,E=Qo(h),O=Aw(t),T=S.useRef(!1),A=dn(r),D=dn(i),k=dn(a),M=dn(n),I=dn(b),L=dn(y),B=He(()=>EP(w.current.openEvent?.type,O.interactedInside)),H=He(()=>I.current?.()!==!1),U=He((z,V,X)=>{const j=t.context.triggerElements;if(j.hasElement(V))return!z||!Ye(z,V);if(!Dt(X))return!1;const Y=X;return j.hasMatchingElement($=>Ye($,Y))&&(!z||!Ye(z,Y))}),F=He(()=>{if(!O.handler)return;xt(t.select("domReferenceElement")).removeEventListener("mousemove",O.handler),O.handler=void 0}),K=He(()=>{ym(O)});return m&&(O.handleCloseOptions=r?.__options),S.useEffect(()=>F,[F]),S.useEffect(()=>{if(!n)return;function z(V){V.open?T.current=!1:(T.current=V.reason===vn,F(),O.openChangeTimeout.clear(),O.restTimeout.clear(),O.blockMouseMove=!0,O.restTimeoutPending=!1)}return C.on("openchange",z),()=>{C.off("openchange",z)}},[n,C,O,F]),S.useEffect(()=>{if(!n)return;function z(te,N=!0){const ne=Ul(D.current,"close",O.pointerType);ne?O.openChangeTimeout.start(ne,()=>{t.setOpen(!1,Ze(vn,te)),E?.events.emit("floating.closed",te)}):N&&(O.openChangeTimeout.clear(),t.setOpen(!1,Ze(vn,te)),E?.events.emit("floating.closed",te))}const V=f.current??(m?t.select("domReferenceElement"):null);if(!Dt(V))return;function X(te){if(O.openChangeTimeout.clear(),O.blockMouseMove=!1,o&&!Bo(O.pointerType))return;const N=FA(k.current),ne=Ul(D.current,"open",O.pointerType),q=zn(te),G=te.currentTarget??null,Z=t.select("domReferenceElement");let ae=G;if(Dt(q)&&!t.context.triggerElements.hasElement(q)){for(const Ee of t.context.triggerElements.elements())if(Ye(Ee,q)){ae=Ee;break}}Dt(G)&&Dt(Z)&&!t.context.triggerElements.hasElement(G)&&Ye(G,Z)&&(ae=Z);const Se=ae==null?!1:U(Z,ae,q),le=t.select("open"),ge=L.current?.()??t.select("transitionStatus")==="ending",ce=!le&&ge&&T.current,ue=!Se&&Dt(ae)&&Dt(Z)&&Ye(Z,ae)&&ce,Te=N>0&&!ne,ye=Se&&(le||ce)||ue,Pe=!le||Se;if(ye){H()&&t.setOpen(!0,Ze(vn,te,ae));return}Te||(ne?O.openChangeTimeout.start(ne,()=>{Pe&&H()&&t.setOpen(!0,Ze(vn,te,ae))}):Pe&&H()&&t.setOpen(!0,Ze(vn,te,ae)))}function j(te){if(B()){K();return}F();const N=t.select("domReferenceElement"),ne=xt(N);O.restTimeout.clear(),O.restTimeoutPending=!1;const q=w.current.floatingContext??p?.();if(fm(te.relatedTarget,t.context.triggerElements))return;if(A.current&&q){t.select("open")||O.openChangeTimeout.clear();const Z=f.current;O.handler=A.current({...q,tree:E,x:te.clientX,y:te.clientY,onClose(){K(),F(),M.current&&!B()&&Z===t.select("domReferenceElement")&&z(te,!0)}}),ne.addEventListener("mousemove",O.handler),O.handler(te);return}(O.pointerType!=="touch"||!Ye(t.select("floatingElement"),te.relatedTarget))&&z(te)}function Y(te){Ye(V,te.relatedTarget)||(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1)}const $=x?ft(V,"mouseout",Y):void 0;return c?fs(ft(V,"mousemove",X,{once:!0}),ft(V,"mouseenter",X),ft(V,"mouseleave",j),$):fs(ft(V,"mouseenter",X),ft(V,"mouseleave",j),$)},[F,K,w,D,t,n,A,O,m,U,B,o,c,k,f,E,M,p,L,H,x]),S.useMemo(()=>{if(!n)return;function z(V){O.pointerType=V.pointerType}return{onPointerDown:z,onPointerEnter:z,onMouseMove(V){const{nativeEvent:X}=V,j=V.currentTarget,Y=t.select("domReferenceElement"),$=t.select("open"),te=U(Y,j,V.target);if(o&&!Bo(O.pointerType))return;if($&&te&&O.handleCloseOptions?.blockPointerEvents){const q=t.select("floatingElement");if(q){const G=O.handleCloseOptions?.getScope?.()??j.ownerDocument.body;lI(O,{scopeElement:G,referenceElement:j,floatingElement:q})}}const N=FA(k.current);if($&&!te||N===0||!te&&O.restTimeoutPending&&V.movementX**2+V.movementY**2<2)return;O.restTimeout.clear();function ne(){if(O.restTimeoutPending=!1,B())return;const q=t.select("open");!O.blockMouseMove&&(!q||te)&&H()&&t.setOpen(!0,Ze(vn,X,j))}O.pointerType==="touch"?Ln.flushSync(()=>{ne()}):te&&$?ne():(O.restTimeoutPending=!0,O.restTimeout.start(N,ne))}}},[n,O,B,U,o,t,k,H])}function cO(t){return vs&&t.movementX===0&&t.movementY===0}function Ag(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function np(t,e){return Ag(e,t===CP||t===cw,t===ag||t===ug)}function nb(t,e,n){return Ag(e,t===cw,n?t===ag:t===ug)||t==="Enter"||t===" "||t===""}function wU(t,e,n){return Ag(e,n?t===ag:t===ug,t===cw)}function CU(t,e,n,i){const r=n?t===ug:t===ag,o=t===CP;return e==="both"||e==="horizontal"&&i?t==="Escape":Ag(e,r,o)}function aI(t,e){const{listRef:n,activeIndex:i,onNavigate:r=()=>{},enabled:o=!0,selectedIndex:a=null,allowEscape:c=!1,loopFocus:f=!1,nested:h=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:x=!0,disabledIndices:w=void 0,orientation:C="vertical",triggerOrientation:E=C,parentOrientation:O,id:T,resetOnPointerLeave:A=!0,externalTree:D,nestedReturnFocusRef:k,grid:M}=e,I=M!=null,L=t.useState("open"),B=t.useState("floatingElement"),H=t.useState("domReferenceElement"),U=t.context.dataRef,F=dm(B),K=fS(H),z=dn(F),V=$o(),X=Qo(D),j=S.useRef(y),Y=S.useRef(a??-1),$=S.useRef(null),te=S.useRef(!0),N=He(se=>{r(Y.current===-1?null:Y.current,se)}),ne=S.useRef(!!B),q=S.useRef(L),G=S.useRef(!1),Z=S.useRef(!1),ae=S.useRef(null),Se=dn(w),le=dn(L),ge=dn(a),ce=dn(A),ue=Ru(),Te=Ru(),ye=He(()=>{ue.cancel();function se(Re){p||(ae.current=Fp(Re,{sync:G.current,preventScroll:!0}))}const me=n.current[Y.current],_e=Z.current;me&&se(me),(G.current?Re=>Re():Re=>ue.request(Re))(()=>{const Re=n.current[Y.current]||me;if(!Re)return;me||se(Re),Ie&&(_e||!te.current)&&Re.scrollIntoView?.({block:"nearest",inline:"nearest"})})});De(()=>{U.current.orientation=C},[U,C]),De(()=>{L||($.current=null),(!L||y!=="auto")&&(j.current=y)},[L,y]),De(()=>{o&&(L&&B?(Y.current=a??-1,j.current&&a!=null&&(Z.current=!0,N())):ne.current&&(Y.current=-1,N()))},[o,L,B,a,N]),De(()=>{if(o){if(!L){G.current=!1;return}if(B)if(i==null){if(G.current=!1,ge.current!=null)return;if(ne.current&&(Y.current=-1,ye()),(!q.current||!ne.current)&&j.current&&($.current!=null||j.current===!0&&$.current==null)){let se=0;const me=()=>{n.current[0]==null?(se<2&&(se?we=>Te.request(we):queueMicrotask)(me),se+=1):(Y.current=$.current==null||nb($.current,E,m)||h?W0(n):KA(n),$.current=null,N())};me()}}else hS(n.current,i)||(Y.current=i,ye(),Z.current=!1)}},[o,L,B,i,ge,h,n,E,m,N,ye,Te]),De(()=>{if(!o||B||!X||p||!ne.current)return;const se=X.nodesRef.current,me=se.find(Re=>Re.id===V)?.context?.elements.floating,_e=Mi(xt(H??me??null)),we=se.some(Re=>Re.context&&Ye(Re.context.elements.floating,_e));me&&!we&&te.current&&me.focus({preventScroll:!0})},[o,B,H,X,V,p]),De(()=>{q.current=L,ne.current=!!B});const Pe=i!=null,Ee=He(se=>{if(!le.current)return;const me=n.current.indexOf(se.currentTarget);me!==-1&&(Y.current!==me||i!==me)&&(Y.current=me,N(se))}),Me=He(()=>O??X?.nodesRef.current.find(se=>se.id===V)?.context?.dataRef?.current.orientation),Be=He(()=>W0(n,Se.current)),ve=He(se=>{if(te.current=!1,G.current=!0,se.which===229||!le.current&&se.currentTarget===z.current)return;if(h&&CU(se.key,C,m,I)){np(se.key,Me())||Rr(se),t.setOpen(!1,Ze(Of,se.nativeEvent));const Re=k?.current??H;Xt(Re)&&Re.focus();return}i!=null&&i!==Y.current&&!hS(n.current,i)&&(Y.current=i);const me=Y.current,_e=W0(n,w),we=KA(n,w);if(K||(se.key==="Home"&&(Rr(se),Y.current=_e,N(se)),se.key==="End"&&(Rr(se),Y.current=we,N(se))),M!=null){const Re=M(se,Y.current,n,C,f,m,w,_e,we);if(Re!=null&&Re!==Y.current&&(Y.current=Re,N(se)),C==="both")return}if(np(se.key,C)){Rr(se);const Re=Mi(se.currentTarget.ownerDocument);if(L&&!p&&Ye(se.currentTarget,Re)&&!n.current.some(rt=>rt!=null&&Ye(rt,Re))){Y.current=nb(se.key,C,m)?_e:we,N(se),i===Y.current&&ye();return}const{index:gt,wrapped:Je}=VF(n.current,me,{decrement:!nb(se.key,C,m),loopFocus:f,allowEscape:c,disabledIndices:w,minIndex:_e,maxIndex:we});Je&&(G.current=!1),Y.current=gt,N(se)}}),Ie=S.useMemo(()=>({onFocus(me){G.current=!0,Ee(me)},onClick({currentTarget:me}){p||me.focus({preventScroll:!0})},onMouseMove(me){cO(me)||(G.current=!0,Z.current=!1,b&&Ee(me))},onPointerLeave(me){if(!le.current||!te.current||me.pointerType==="touch")return;G.current=!0;const _e=me.relatedTarget;if(!(!b||n.current.includes(_e))&&ce.current&&(ae.current?.(),ae.current=null,Y.current=-1,N(me),!p)){const we=z.current,Re=Mi(xt(we));we&&Ye(we,Re)&&we.focus({preventScroll:!0})}}}),[Ee,le,z,b,n,N,ce,p]),de=S.useMemo(()=>p&&L&&Pe&&{"aria-activedescendant":`${T}-${i}`},[p,L,Pe,T,i]),ke=S.useMemo(()=>({...K?{}:de,onKeyDown(se){if(se.key==="Tab"&&se.shiftKey&&L&&!p){const me=zn(se.nativeEvent);if(me&&!Ye(z.current,me))return;Rr(se);const _e=Ze($s,se.nativeEvent);t.setOpen(!1,_e);const we=k?.current??H;!_e.isCanceled&&Xt(we)&&we.focus();return}ve(se)},onPointerMove(se){cO(se)||(te.current=!0)}}),[de,ve,z,K,t,L,p,H,k]),it=S.useMemo(()=>{function se(we){t.setOpen(!0,Ze(Of,we.nativeEvent,we.currentTarget))}function me(we){y==="auto"&&Tu(we.nativeEvent)&&(j.current=!p)}function _e(we){j.current=y,y==="auto"&&uw(we.nativeEvent)&&(j.current=!0)}return{onKeyDown(we){const Re=t.select("open");te.current=!1;const gt=we.key.startsWith("Arrow"),Je=wU(we.key,Me(),m),rt=np(we.key,Re?C:E),Et=(h?Je:rt)||we.key==="Enter"||we.key.trim()==="";if(p&&Re&&(!h||nd(we.currentTarget)))return ve(we);if(!(!Re&&!x&&gt)){if(Et){const yt=np(we.key,Me());$.current=h&&yt?null:we.key}if(h){Je&&(Rr(we),Re?(Y.current=Be(),N(we),p&&z.current?.focus()):se(we));return}rt&&(ge.current!=null&&(Y.current=ge.current),Rr(we),!Re&&x?se(we):ve(we),Re&&N(we))}},onFocus(we){we.target===we.currentTarget&&t.select("open")&&!p&&(Y.current=-1,N(we))},onPointerDown:_e,onPointerEnter:_e,onMouseDown:me,onClick:me}},[ve,y,Be,h,N,t,x,C,E,Me,m,ge,p,z]),tt=S.useMemo(()=>({...de,...it}),[de,it]);return S.useMemo(()=>o?{reference:tt,floating:ke,item:Ie,trigger:it}:{},[o,tt,ke,it,Ie])}function uI(t,e){const{listRef:n,elementsRef:i,activeIndex:r,onMatch:o,disabledIndices:a,onTyping:c,enabled:f=!0,resetMs:h=750,selectedIndex:m=null}=e,p=He(c),y=t.useState("open"),b=wn(),x=S.useRef(""),w=S.useRef(m??r??-1),C=S.useRef(null),E=He(A=>{function D(K){return i?.current[K]}function k(K){const z=D(K);return z&&!cg(z)||z?.matches(":disabled")?!1:a==null||!DP(Hl,K,a)}function M(K,z,V=0){if(K.length===0)return-1;const X=(V%K.length+K.length)%K.length,j=z.toLowerCase();for(let Y=0;Y<K.length;Y+=1){const $=(X+Y)%K.length;if(!(!K[$]?.toLowerCase().startsWith(j)||!k($)))return $}return-1}const I=n.current;if(x.current.length>0&&A.key===" "&&(Rr(A),p?.(!0)),x.current.length>0&&x.current[0]!==" "&&M(I,x.current)===-1&&A.key!==" "&&p?.(!1),I==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;y&&A.key!==" "&&(Rr(A),p?.(!0));const L=x.current==="";L&&(w.current=m??r??-1),I.every((K,z)=>K&&k(z)?K[0]?.toLowerCase()!==K[1]?.toLowerCase():!0)&&x.current===A.key&&(x.current="",w.current=C.current),x.current+=A.key,b.start(h,()=>{x.current="",w.current=C.current,p?.(!1)});const U=((L?m??r??-1:w.current)??0)+1,F=M(I,x.current,U);F!==-1?(o?.(F,A),C.current=F):A.key!==" "&&(x.current="",p?.(!1))}),O=He(A=>{const D=A.relatedTarget,k=t.select("domReferenceElement"),M=t.select("floatingElement");Ye(k,D)||Ye(M,D)||(b.clear(),x.current="",w.current=C.current,p?.(!1))});De(()=>{!y&&m!==null||(b.clear(),C.current=null,x.current!==""&&(x.current="",p?.(!1)))},[y,m,b,p]);const T=S.useMemo(()=>({onKeyDown:E,onBlur:O}),[E,O]);return S.useMemo(()=>f?{reference:T,floating:T}:{},[f,T])}const fO=.1,EU=fO*fO,Kt=.5;function ip(t,e,n,i,r,o){return i>=e!=o>=e&&t<=(r-n)*(e-i)/(o-i)+n}function rp(t,e,n,i,r,o,a,c,f,h){let m=!1;return ip(t,e,n,i,r,o)&&(m=!m),ip(t,e,r,o,a,c)&&(m=!m),ip(t,e,a,c,f,h)&&(m=!m),ip(t,e,f,h,n,i)&&(m=!m),m}function TU(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function sp(t,e,n,i,r,o){const a=Math.min(n,r),c=Math.max(n,r),f=Math.min(i,o),h=Math.max(i,o);return t>=a&&t<=c&&e>=f&&e<=h}function Og(t={}){const{blockPointerEvents:e=!1}=t,n=new Dr,i=({x:r,y:o,placement:a,elements:c,onClose:f,nodeId:h,tree:m})=>{const p=a?.split("-")[0];let y=!1,b=null,x=null,w=typeof performance<"u"?performance.now():0;function C(O,T){const A=performance.now(),D=A-w;if(b===null||x===null||D===0)return b=O,x=T,w=A,!1;const k=O-b,M=T-x,I=k*k+M*M,L=D*D*EU;return b=O,x=T,w=A,I<L}function E(){n.clear(),f()}return function(T){n.clear();const A=c.domReference,D=c.floating;if(!A||!D||p==null||r==null||o==null)return;const{clientX:k,clientY:M}=T,I=zn(T),L=T.type==="mouseleave",B=Ye(D,I),H=Ye(A,I);if(B&&(y=!0,!L))return;if(H&&(y=!1,!L)){y=!0;return}if(L&&Dt(T.relatedTarget)&&Ye(D,T.relatedTarget))return;function U(){return!!(m&&_o(m.nodesRef.current,h).length>0)}function F(){U()||E()}if(U())return;const K=A.getBoundingClientRect(),z=D.getBoundingClientRect(),V=r>z.right-z.width/2,X=o>z.bottom-z.height/2,j=z.width>K.width,Y=z.height>K.height,$=(j?K:z).left,te=(j?K:z).right,N=(Y?K:z).top,ne=(Y?K:z).bottom;if(p==="top"&&o>=K.bottom-1||p==="bottom"&&o<=K.top+1||p==="left"&&r>=K.right-1||p==="right"&&r<=K.left+1){F();return}let q=!1;switch(p){case"top":q=sp(k,M,$,K.top+1,te,z.bottom-1);break;case"bottom":q=sp(k,M,$,z.top+1,te,K.bottom-1);break;case"left":q=sp(k,M,z.right-1,ne,K.left+1,N);break;case"right":q=sp(k,M,K.right-1,ne,z.left+1,N);break}if(q)return;if(y&&!TU(k,M,K)){F();return}if(!L&&C(k,M)){F();return}let G=!1;switch(p){case"top":{const Z=j?Kt/2:Kt*4,ae=j||V?r+Z:r-Z,Se=j?r-Z:V?r+Z:r-Z,le=o+Kt+1,ge=V||j?z.bottom-Kt:z.top,ce=V?j?z.bottom-Kt:z.top:z.bottom-Kt;G=rp(k,M,ae,le,Se,le,z.left,ge,z.right,ce);break}case"bottom":{const Z=j?Kt/2:Kt*4,ae=j||V?r+Z:r-Z,Se=j?r-Z:V?r+Z:r-Z,le=o-Kt,ge=V||j?z.top+Kt:z.bottom,ce=V?j?z.top+Kt:z.bottom:z.top+Kt;G=rp(k,M,ae,le,Se,le,z.left,ge,z.right,ce);break}case"left":{const Z=Y?Kt/2:Kt*4,ae=Y||X?o+Z:o-Z,Se=Y?o-Z:X?o+Z:o-Z,le=r+Kt+1,ge=X||Y?z.right-Kt:z.left,ce=X?Y?z.right-Kt:z.left:z.right-Kt;G=rp(k,M,ge,z.top,ce,z.bottom,le,ae,le,Se);break}case"right":{const Z=Y?Kt/2:Kt*4,ae=Y||X?o+Z:o-Z,Se=Y?o-Z:X?o+Z:o-Z,le=r-Kt,ge=X||Y?z.left+Kt:z.right,ce=X?Y?z.left+Kt:z.right:z.left+Kt;G=rp(k,M,le,ae,le,Se,ge,z.top,ce,z.bottom);break}}G?y||n.start(40,F):F()}};return i.__options={...t,blockPointerEvents:e},i}function dO(t,e,n){let{reference:i,floating:r}=t;const o=or(e),a=pw(e),c=hw(a),f=Ki(e),h=o==="y",m=i.x+i.width/2-r.width/2,p=i.y+i.height/2-r.height/2,y=i[c]/2-r[c]/2;let b;switch(f){case"top":b={x:m,y:i.y-r.height};break;case"bottom":b={x:m,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:p};break;case"left":b={x:i.x-r.width,y:p};break;default:b={x:i.x,y:i.y}}const x=ds(e);return x&&(b[a]+=y*(x==="end"?1:-1)*(n&&h?-1:1)),b}async function RU(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:o,rects:a,elements:c,strategy:f}=t,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:y=!1,padding:b=0}=zo(e,t),x=MP(b),C=c[y?p==="floating"?"reference":"floating":p],E=kf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:h,rootBoundary:m,strategy:f})),O=p==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),A=await(o.isElement==null?void 0:o.isElement(T))&&await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1},D=kf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:O,offsetParent:T,strategy:f}):O);return{top:(E.top-D.top+x.top)/A.y,bottom:(D.bottom-E.bottom+x.bottom)/A.y,left:(E.left-D.left+x.left)/A.x,right:(D.right-E.right+x.right)/A.x}}const AU=50,OU=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:RU},f=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:p}=dO(h,i,f),y=i,b=0;const x={};for(let w=0;w<o.length;w++){const C=o[w];if(!C)continue;const{name:E,fn:O}=C,{x:T,y:A,data:D,reset:k}=await O({x:m,y:p,initialPlacement:i,placement:y,strategy:r,middlewareData:x,rects:h,platform:c,elements:{reference:t,floating:e}});m=T??m,p=A??p,x[E]={...x[E],...D},k&&b<AU&&(b++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(h=k.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):k.rects),{x:m,y:p}=dO(h,y,f)),w=-1)}return{x:m,y:p,placement:y,strategy:r,middlewareData:x}},MU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:o,rects:a,initialPlacement:c,platform:f,elements:h}=e,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...C}=zo(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Ki(r),O=or(c),T=Ki(c)===c,A=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=y||(T||!w?[pm(c)]:kF(c)),k=x!=="none";!y&&k&&D.push(...LF(c,w,x,A));const M=[c,...D],I=await f.detectOverflow(e,C),L=[];let B=((i=o.flip)==null?void 0:i.overflows)||[];if(m&&L.push(I[E]),p){const K=DF(r,a,A);L.push(I[K[0]],I[K[1]])}if(B=[...B,{placement:r,overflows:L}],!L.every(K=>K<=0)){var H,U;const K=(((H=o.flip)==null?void 0:H.index)||0)+1,z=M[K];if(z&&(!(p==="alignment"?O!==or(z):!1)||B.every(j=>or(j.placement)===O?j.overflows[0]>0:!0)))return{data:{index:K,overflows:B},reset:{placement:z}};let V=(U=B.filter(X=>X.overflows[0]<=0).sort((X,j)=>X.overflows[1]-j.overflows[1])[0])==null?void 0:U.placement;if(!V)switch(b){case"bestFit":{var F;const X=(F=B.filter(j=>{if(k){const Y=or(j.placement);return Y===O||Y==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(Y=>Y>0).reduce((Y,$)=>Y+$,0)]).sort((j,Y)=>j[1]-Y[1])[0])==null?void 0:F[0];X&&(V=X);break}case"initialPlacement":V=c;break}if(r!==V)return{reset:{placement:V}}}return{}}}},cI=new Set(["left","top"]);async function DU(t,e){const{placement:n,platform:i,elements:r}=t,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Ki(n),c=ds(n),f=or(n)==="y",h=cI.has(a)?-1:1,m=o&&f?-1:1,p=zo(e,t);let{mainAxis:y,crossAxis:b,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(b=c==="end"?x*-1:x),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const kU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:o,placement:a,middlewareData:c}=e,f=await DU(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:r+f.x,y:o+f.y,data:{...f,placement:a}}}}},PU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:f={fn:O=>{let{x:T,y:A}=O;return{x:T,y:A}}},...h}=zo(t,e),m={x:n,y:i},p=await o.detectOverflow(e,h),y=or(r),b=dw(y);let x=m[b],w=m[y];const C=(O,T)=>OP(T+p[O==="y"?"top":"left"],T,T-p[O==="y"?"bottom":"right"]);a&&(x=C(b,x)),c&&(w=C(y,w));const E=f.fn({...e,[b]:x,[y]:w});return{...E,data:{x:E.x-n,y:E.y-i,enabled:{[b]:a,[y]:c}}}}}},IU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,i;const{x:r,y:o,placement:a,rects:c,middlewareData:f}=e,{offset:h=0,mainAxis:m=!0,crossAxis:p=!0}=zo(t,e),y={x:r,y:o},b=or(a),x=dw(b);let w=y[x],C=y[b];const E=zo(h,e),O=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(i=E.crossAxis)!=null?i:0};if(m){const D=x==="y"?"height":"width",k=c.reference[x]-c.floating[D]+O.mainAxis,M=c.reference[x]+c.reference[D]-O.mainAxis;w<k?w=k:w>M&&(w=M)}if(p){var T,A;const D=x==="y"?"width":"height",k=cI.has(Ki(a)),M=c.reference[b]-c.floating[D]+(k&&((T=f.offset)==null?void 0:T[b])||0)+(k?0:O.crossAxis),I=c.reference[b]+c.reference[D]+(k?0:((A=f.offset)==null?void 0:A[b])||0)-(k?O.crossAxis:0);C<M?C=M:C>I&&(C=I)}return{[x]:w,[b]:C}}}},NU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:r,elements:o}=e,{apply:a=()=>{},...c}=zo(t,e),f=await r.detectOverflow(e,c),h=Ki(n),m=ds(n),p=or(n)==="y",{width:y,height:b}=i.floating;let x,w;h==="top"||h==="bottom"?(x=h,w=m===(await(r.isRTL==null?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(w=h,x=m==="end"?"top":"bottom");const C=b-f.top-f.bottom,E=y-f.left-f.right,O=Au(b-f[x],C),T=Au(y-f[w],E),A=e.middlewareData.shift,D=!A;let k=O,M=T;A!=null&&A.enabled.x&&(M=E),A!=null&&A.enabled.y&&(k=C),D&&!m&&(p?M=y-2*Ks(f.left,f.right):k=b-2*Ks(f.top,f.bottom)),await a({...e,availableWidth:M,availableHeight:k});const I=await r.getDimensions(o.floating);return y!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function fI(t){const e=qi(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Xt(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,c=hm(n)!==o||hm(i)!==a;return c&&(n=o,i=a),{width:n,height:i,$:c}}function Mw(t){return Dt(t)?t:t.contextElement}function gu(t){const e=Mw(t);if(!Xt(e))return Ys(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=fI(e);let a=(o?hm(n.width):n.width)/i,c=(o?hm(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const LU=Ys(0);function dI(t){const e=Jt(t);return!nw()||!e.visualViewport?LU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function BU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Jt(t)}function jl(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),o=Mw(t);let a=Ys(1);e&&(i?Dt(i)&&(a=gu(i)):a=gu(t));const c=BU(o,n,i)?dI(o):Ys(0);let f=(r.left+c.x)/a.x,h=(r.top+c.y)/a.y,m=r.width/a.x,p=r.height/a.y;if(o&&i){const y=Jt(o),b=Dt(i)?Jt(i):i;let x=y,w=lS(x);for(;w&&b!==x;){const C=gu(w),E=w.getBoundingClientRect(),O=qi(w),T=E.left+(w.clientLeft+parseFloat(O.paddingLeft))*C.x,A=E.top+(w.clientTop+parseFloat(O.paddingTop))*C.y;f*=C.x,h*=C.y,m*=C.x,p*=C.y,f+=T,h+=A,x=Jt(w),w=lS(x)}}return kf({width:m,height:p,x:f,y:h})}function Mg(t,e){const n=rg(t).scrollLeft;return e?e.left+n:jl(Js(t)).left+n}function hI(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Mg(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function VU(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const o=r==="fixed",a=Js(i),c=e?ig(e.floating):!1;if(i===a||c&&o)return n;let f={scrollLeft:0,scrollTop:0},h=Ys(1);const m=Ys(0),p=Xt(i);if((p||!o)&&((ri(i)!=="body"||Jf(a))&&(f=rg(i)),p)){const b=jl(i);h=gu(i),m.x=b.x+i.clientLeft,m.y=b.y+i.clientTop}const y=a&&!p&&!o?hI(a,f):Ys(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function zU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function _U(t){const e=rg(t),n=t.ownerDocument.body,i=Ks(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=Ks(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-e.scrollLeft+Mg(t);const a=-e.scrollTop;return qi(n).direction==="rtl"&&(o+=Ks(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:o,y:a}}const HU=25;function FU(t,e,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=Jt(t),o=Js(t),a=r.visualViewport;let c=o.clientWidth,f=o.clientHeight,h=0,m=0;if(a){const y=!nw()||e==="fixed";i?y||(h=-a.offsetLeft,m=-a.offsetTop):(c=a.width,f=a.height,y&&(h=a.offsetLeft,m=a.offsetTop))}if(Mg(o)<=0){const y=o.ownerDocument,b=y.body,x=getComputedStyle(b),w=y.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,C=Math.abs(o.clientWidth-b.clientWidth-w),E=getComputedStyle(o).scrollbarGutter==="stable both-edges"?C/2:C;E<=HU&&(c-=E)}return{width:c,height:f,x:h,y:m}}function UU(t,e){const n=jl(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=gu(t),a=t.clientWidth*o.x,c=t.clientHeight*o.y,f=r*o.x,h=i*o.y;return{width:a,height:c,x:f,y:h}}function hO(t,e,n){let i;if(e==="viewport"||e==="layoutViewport")i=FU(t,n,e);else if(e==="document")i=_U(Js(t));else if(Dt(e))i=UU(e,n);else{const r=dI(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return kf(i)}function jU(t,e){const n=e.get(t);if(n)return n;let i=Af(t,[],!1).filter(c=>Dt(c)&&ri(c)!=="body"),r=null;const o=qi(t).position==="fixed";let a=o?Xs(t):t;for(;Dt(a)&&!js(a);){const c=qi(a),f=tw(a),h=r?r.position:o?"fixed":"";!f&&(h==="fixed"||h==="absolute"&&c.position==="static")?i=i.filter(p=>p!==a):r=c,a=Xs(a)}return e.set(t,i),i}function KU(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const a=[...n==="clippingAncestors"?ig(e)?[]:jU(e,this._c):[].concat(n),i],c=hO(e,a[0],r);let f=c.top,h=c.right,m=c.bottom,p=c.left;for(let y=1;y<a.length;y++){const b=hO(e,a[y],r);f=Ks(b.top,f),h=Au(b.right,h),m=Au(b.bottom,m),p=Ks(b.left,p)}return{width:h-p,height:m-f,x:p,y:f}}function YU(t){const{width:e,height:n}=fI(t);return{width:e,height:n}}function qU(t,e,n){const i=Xt(e),r=Js(e),o=n==="fixed",a=jl(t,!0,o,e);let c={scrollLeft:0,scrollTop:0};const f=Ys(0);if((i||!o)&&((ri(e)!=="body"||Jf(r))&&(c=rg(e)),i)){const y=jl(e,!0,o,e);f.x=y.x+e.clientLeft,f.y=y.y+e.clientTop}!i&&r&&(f.x=Mg(r));const h=r&&!i&&!o?hI(r,c):Ys(0),m=a.left+c.scrollLeft-f.x-h.x,p=a.top+c.scrollTop-f.y-h.y;return{x:m,y:p,width:a.width,height:a.height}}function ib(t){return qi(t).position==="static"}function pO(t,e){if(!Xt(t)||qi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Js(t)===n&&(n=n.ownerDocument.body),n}function pI(t,e){const n=Jt(t);if(ig(t))return n;if(!Xt(t)){let r=Xs(t);for(;r&&!js(r);){if(Dt(r)&&!ib(r))return r;r=Xs(r)}return n}let i=pO(t,e);for(;i&&QH(i)&&ib(i);)i=pO(i,e);return i&&js(i)&&ib(i)&&!tw(i)?n:i||eF(t)||n}const GU=async function(t){const e=this.getOffsetParent||pI,n=this.getDimensions,i=await n(t.floating);return{reference:qU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function WU(t){return qi(t).direction==="rtl"}const mI={convertOffsetParentRelativeRectToViewportRelativeRect:VU,getDocumentElement:Js,getClippingRect:KU,getOffsetParent:pI,getElementRects:GU,getClientRects:zU,getDimensions:YU,getScale:gu,isElement:Dt,isRTL:WU};function gI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function XU(t,e,n){let i=null,r;const o=Js(t);function a(){var m;clearTimeout(r),(m=i)==null||m.disconnect(),i=null}function c(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),a();const y=t.getBoundingClientRect(),{left:b,top:x,width:w,height:C}=y;if(m||e(),!w||!C)return;const E=Zh(x),O=Zh(o.clientWidth-(b+w)),T=Zh(o.clientHeight-(x+C)),A=Zh(b),k={rootMargin:-E+"px "+-O+"px "+-T+"px "+-A+"px",threshold:Ks(0,Au(1,p))||1};let M=!0;function I(L){const B=L[0].intersectionRatio;if(!gI(y,t.getBoundingClientRect()))return c();if(B!==p){if(!M)return c();B?c(!1,B):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M=!1}try{i=new IntersectionObserver(I,{...k,root:o.ownerDocument})}catch{i=new IntersectionObserver(I,k)}i.observe(t)}const f=Jt(t),h=()=>c(n);return f.addEventListener("resize",h),c(!0),()=>{f.removeEventListener("resize",h),a()}}function mO(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,h=Mw(t),m=r||o?[...h?Af(h):[],...e?Af(e):[]]:[];m.forEach(E=>{r&&E.addEventListener("scroll",n),o&&E.addEventListener("resize",n)});const p=h&&c?XU(h,n,o):null;let y=-1,b=null;a&&(b=new ResizeObserver(E=>{let[O]=E;O&&O.target===h&&b&&e&&(b.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(e)})),n()}),h&&!f&&b.observe(h),e&&b.observe(e));let x,w=f?jl(t):null;f&&C();function C(){const E=jl(t);w&&!gI(w,E)&&n(),w=E,x=requestAnimationFrame(C)}return n(),()=>{var E;m.forEach(O=>{r&&O.removeEventListener("scroll",n),o&&O.removeEventListener("resize",n)}),p?.(),(E=b)==null||E.disconnect(),b=null,f&&cancelAnimationFrame(x)}}const $U=kU,QU=PU,ZU=MU,JU=NU,e8=IU,t8=(t,e,n)=>{const i=new Map,r=n??{},o={...mI,...r.platform,_c:i};return OU(t,e,{...r,platform:o})};var n8=typeof document<"u",i8=function(){},Up=n8?S.useLayoutEffect:i8;function vm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!vm(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!(o==="_owner"&&t.$$typeof)&&!vm(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function yI(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function gO(t,e){const n=yI(t);return Math.round(e*n)/n}function rb(t){const e=S.useRef(t);return Up(()=>{e.current=t}),e}function r8(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:f,open:h}=t,[m,p]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[y,b]=S.useState(i);vm(y,i)||b(i);const[x,w]=S.useState(null),[C,E]=S.useState(null),O=S.useCallback(j=>{j!==k.current&&(k.current=j,w(j))},[]),T=S.useCallback(j=>{j!==M.current&&(M.current=j,E(j))},[]),A=o||x,D=a||C,k=S.useRef(null),M=S.useRef(null),I=S.useRef(m),L=f!=null,B=rb(f),H=rb(r),U=rb(h),F=S.useCallback(()=>{if(!k.current||!M.current)return;const j={placement:e,strategy:n,middleware:y};H.current&&(j.platform=H.current),t8(k.current,M.current,j).then(Y=>{const $={...Y,isPositioned:U.current!==!1};K.current&&!vm(I.current,$)&&(I.current=$,Ln.flushSync(()=>{p($)}))})},[y,e,n,H,U]);Up(()=>{h===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(j=>({...j,isPositioned:!1})))},[h]);const K=S.useRef(!1);Up(()=>(K.current=!0,()=>{K.current=!1}),[]),Up(()=>{if(A&&(k.current=A),D&&(M.current=D),A&&D){if(B.current)return B.current(A,D,F);F()}},[A,D,F,B,L]);const z=S.useMemo(()=>({reference:k,floating:M,setReference:O,setFloating:T}),[O,T]),V=S.useMemo(()=>({reference:A,floating:D}),[A,D]),X=S.useMemo(()=>{const j={position:n,left:0,top:0};if(!V.floating)return j;const Y=gO(V.floating,m.x),$=gO(V.floating,m.y);return c?{...j,transform:"translate("+Y+"px, "+$+"px)",...yI(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:$}},[n,c,V.floating,m.x,m.y]);return S.useMemo(()=>({...m,update:F,refs:z,elements:V,floatingStyles:X}),[m,F,z,V,X])}const s8=(t,e)=>{const n=$U(t);return{name:n.name,fn:n.fn,options:[t,e]}},o8=(t,e)=>{const n=QU(t);return{name:n.name,fn:n.fn,options:[t,e]}},l8=(t,e)=>({fn:e8(t).fn,options:[t,e]}),a8=(t,e)=>{const n=ZU(t);return{name:n.name,fn:n.fn,options:[t,e]}},u8=(t,e)=>{const n=JU(t);return{name:n.name,fn:n.fn,options:[t,e]}},vI=S.createContext(void 0);function c8(){const t=S.useContext(vI);if(t===void 0)throw new Error(en(26));return t}const f8="ArrowUp",d8="ArrowDown",h8="ArrowLeft",p8="ArrowRight",m8="Home",g8="End",Dg=new Set([f8,d8,h8,p8,m8,g8]),y8="--nested-dialogs",v8="data-nested-dialog-open",b8={...Zf,...Fu,nestedDialogOpen(t){return t?{[v8]:""}:null}},ene=S.forwardRef(function(e,n){const{render:i,className:r,style:o,finalFocus:a,initialFocus:c,...f}=e,h=Wo(),m=h.useState("descriptionElementId"),p=h.useState("disablePointerDismissal"),y=h.useState("floatingRootContext"),b=h.useState("popupProps"),x=h.useState("modal"),w=h.useState("mounted"),C=h.useState("nested"),E=h.useState("nestedOpenDialogCount"),O=h.useState("open"),T=h.useState("openMethod"),A=h.useState("titleElementId"),D=h.useState("transitionStatus"),k=h.useState("role"),M=y.useState("floatingId");c8(),eo({open:O,ref:h.context.popupRef,onComplete(){O&&h.context.onOpenChangeComplete?.(!0)}});const I=c===void 0?JP(h.context.popupRef):c,L=E>0,B=h.useStateSetter("popupElement"),U=Ot("div",e,{state:{open:O,nested:C,transitionStatus:D,nestedDialogOpen:L},props:[b,{id:M,"aria-labelledby":A,"aria-describedby":m,role:k,...sd,hidden:!w,onKeyDown(F){Dg.has(F.key)&&F.stopPropagation()},style:{[y8]:E}},f],ref:[n,h.context.popupRef,B],stateAttributesMapping:b8});return fe.jsx(pg,{context:y,openInteractionType:T,disabled:!w,closeOnFocusOut:!p,initialFocus:I,returnFocus:a,modal:x!==!1,restoreFocus:"popup",children:U})});function kg(t){return Zx(19)?t:t?"true":void 0}const Pg=S.forwardRef(function(e,n){const{cutout:i,...r}=e;let o;if(i){const a=i.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return fe.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),tne=S.forwardRef(function(e,n){const{keepMounted:i=!1,...r}=e,o=Wo(),a=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return a||i?fe.jsx(vI.Provider,{value:i,children:fe.jsxs(hg,{ref:n,...r,children:[a&&c===!0&&fe.jsx(Pg,{ref:o.context.internalBackdropRef,inert:kg(!f)}),e.children]})}):null});let yO={},vO={},bO="";function Ig(t,e){return Jf(t)?t:e}function SO(t,e,n){return/hidden|clip/.test(t.getComputedStyle(Ig(e,n)).overflowY)}function S8(t){if(typeof document>"u")return!1;const e=xt(t);return Jt(e).innerWidth-e.documentElement.clientWidth>0}function x8(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=xt(t),i=n.documentElement,r=n.body,o=Ig(i,r),a=o.style.overflowY,c=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const h=o.offsetWidth;return o.style.overflowY=a,i.style.scrollbarGutter=c,f===h}function w8(t){const e=xt(t),n=e.documentElement,i=e.body,r=Ig(n,i),o={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,o)}}function C8(t){const e=xt(t),n=e.documentElement,i=e.body,r=Jt(n);let o=0,a=0,c=!1;const f=ts.create();if(vs&&(r.visualViewport?.scale??1)!==1)return()=>{};function h(){const b=r.getComputedStyle(n),x=r.getComputedStyle(i),E=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,a=n.scrollLeft,yO={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},bO=n.style.scrollBehavior,vO={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const O=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,A=b.overflowY==="scroll"||x.overflowY==="scroll",D=b.overflowX==="scroll"||x.overflowX==="scroll",k=Math.max(0,r.innerWidth-i.clientWidth),M=Math.max(0,r.innerHeight-i.clientHeight),I=parseFloat(x.marginTop)+parseFloat(x.marginBottom),L=parseFloat(x.marginLeft)+parseFloat(x.marginRight),B=Ig(n,i);if(c=x8(t),c){n.style.scrollbarGutter=E,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(O||A)&&(n.style.overflowY="scroll"),(T||D)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:I||M?`calc(100dvh - ${I+M}px)`:"100dvh",width:L||k?`calc(100vw - ${L+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=o,i.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,yO),Object.assign(i.style,vO),c||(n.scrollTop=o,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=bO)}function p(){m(),f.request(h)}h();const y=ft(r,"resize",p);return()=>{f.cancel(),m(),typeof r.removeEventListener=="function"&&y()}}class E8{lockCount=0;restore=null;timeoutLock=Dr.create();timeoutUnlock=Dr.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const n=xt(e),i=n.documentElement,r=n.body,o=Jt(i);if(SO(o,i,r)){const c=new o.MutationObserver(()=>{SO(o,i,r)||(c.disconnect(),this.restore=null,this.lock(e))}),f={attributes:!0};c.observe(i,f),c.observe(r,f),this.restore=()=>c.disconnect();return}const a=lg||!S8(e);this.restore=a?w8(e):C8(e)}}const T8=new E8;function bI(t=!0,e=null){De(()=>{if(t)return T8.acquire(e)},[t,e])}function R8({store:t,parentContext:e,isDrawer:n}){const i=t.useState("open"),r=t.useState("mounted"),o=t.useState("disablePointerDismissal"),a=t.useState("modal"),c=t.useState("popupElement"),f=t.useState("floatingRootContext"),[h,m]=S.useState(0),[p,y]=S.useState(0),b=h===0,x=rd(f,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!t.context.outsidePressEnabledRef.current||"button"in w&&w.button!==0)return!1;if("touches"in w){if(w.type==="touchend"){if(w.changedTouches.length!==1||w.touches.length!==0)return!1}else if(w.touches.length!==1)return!1}const C=zn(w);if(b&&!o){if(a){const E=t.context.internalBackdropRef.current,O=t.context.backdropRef.current;return E||O?E===C||O===C||Ye(C,c)&&!C?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:b});return bI(i&&a===!0,c),t.useContextCallback("onNestedDialogOpen",(w,C)=>{!t.select("open")&&!t.select("mounted")||(m(w),y(C))}),De(()=>{!i&&!r&&(m(0),y(0))},[i,r]),De(()=>(e?.onNestedDialogOpen&&i&&e.onNestedDialogOpen(h+1,p+(n?1:0)),()=>{e?.onNestedDialogOpen&&i&&e.onNestedDialogOpen(0,0)}),[n,i,h,p,e]),wg(t,{activeTriggerProps:x.reference,inactiveTriggerProps:x.trigger,popupProps:x.floating,nestedOpenDialogCount:h,nestedOpenDrawerCount:p}),null}const A8={...Fs,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class O8 extends ju{constructor(e,n,i){const r=new od,o=M8(e,r,n,i);super(o,D8(r),A8)}setOpen=(e,n)=>{n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),!n.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,n),this.update(yg(this.state,e,n.trigger)))}}function M8(t,e,n,i=!1){return{...Eg(e,n,i),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}function D8(t){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function k8(t,e){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:f=!0,actionsRef:h,handle:m,triggerId:p,defaultTriggerId:y=null}=e,b=t==="drawer",x=f,w=c,C="dialog",E=Wo(!0),O=E!=null,T={modal:x,disablePointerDismissal:w,nested:O,role:C},A=Ew((B,H)=>new O8({open:r,openProp:i,activeTriggerId:y,triggerIdProp:p,...T},B,H),!0);A.useControlledProp("openProp",i),A.useControlledProp("triggerIdProp",p),A.useSyncedValues(T),A.useContextCallback("onOpenChange",o),A.useContextCallback("onOpenChangeComplete",a);const D=A.useState("open"),k=A.useState("mounted"),M=A.useState("payload");tI(A,D),Sg(A);const{forceUnmount:I}=xg(D,A);S.useImperativeHandle(h,()=>({unmount:I,close:()=>A.setOpen(!1,Ze(td))}),[I,A]);const L=D||k||m!=null;return fe.jsxs(sP.Provider,{value:A,children:[m&&fe.jsx(gg,{handle:m,store:A}),L&&fe.jsx(R8,{store:A,parentContext:E?.context,isDrawer:b}),typeof n=="function"?n({payload:M}):n]})}const nne=ld(function(e){return k8("dialog",e)}),ine=S.forwardRef(function(e,n){const{render:i,className:r,style:o,id:a,...c}=e,f=Wo(),h=vi(a);return f.useSyncedValueWithCleanup("titleElementId",h),Ot("h2",e,{ref:n,props:[{id:h},c]})});function P8(t){const e=S.useRef(""),n=S.useCallback(r=>{r.defaultPrevented||(e.current=r.pointerType,t(r,r.pointerType))},[t]);return{onClick:S.useCallback(r=>{if(r.detail===0){t(r,"keyboard");return}"pointerType"in r?t(r,r.pointerType):t(r,e.current),e.current=""},[t]),onPointerDown:n}}function Dw(t,e){const n=S.useRef(t),i=He(e);De(()=>{n.current!==t&&i(n.current),n.current=t},[t,i])}function kw(t,e){const n=He((o,a)=>{(typeof t=="function"?t():t)||e(a||(lg?"touch":""))}),{onClick:i,onPointerDown:r}=P8(n);return S.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}function SI(t){const[e,n]=S.useState(null),i=kw(t,n);return Dw(t,r=>{r&&!t&&n(null)}),S.useMemo(()=>({openMethod:e,triggerProps:i}),[e,i])}const rne=Cg(function(e,n){const{render:i,className:r,style:o,disabled:a=!1,nativeButton:c=!0,id:f,payload:h,handle:m,...p}=e,y=Wo(!0),x=Tg(m)??y;if(!x)throw new Error(en(79));const w=vi(f),C=x.useState("floatingRootContext"),E=x.useState("isOpenedByTrigger",w),O=x.useState("triggerPopupId",w),T=S.useRef(null),{registerTrigger:A,isMountedByThisTrigger:D}=bg(w,T,x,{payload:h}),{getButtonProps:k,buttonRef:M}=Xo({disabled:a,native:c}),I=id(C),L=kw(()=>x.select("open"),U=>{x.set("openMethod",U)}),B={disabled:a,open:E},H=x.useState("triggerProps",D);return Ot("button",e,{state:B,ref:[M,n,A,T],props:[I.reference,H,L,{[vw]:"",id:w,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":O},p,k],stateAttributesMapping:Qf})}),xO=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,wO=tH,sne=(t,e)=>n=>{var i;if(e?.variants==null)return wO(t,n?.class,n?.className);const{variants:r,defaultVariants:o}=e,a=Object.keys(r).map(h=>{const m=n?.[h],p=o?.[h];if(m===null)return null;const y=xO(m)||xO(p);return r[h][y]}),c=n&&Object.entries(n).reduce((h,m)=>{let[p,y]=m;return y===void 0||(h[p]=y),h},{}),f=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((h,m)=>{let{class:p,className:y,...b}=m;return Object.entries(b).every(x=>{let[w,C]=x;return Array.isArray(C)?C.includes({...o,...c}[w]):{...o,...c}[w]===C})?[...h,p,y]:h},[]);return wO(t,a,f,n?.class,n?.className)},xI=S.createContext(void 0);function wI(t){const e=S.useContext(xI);if(e===void 0)throw new Error(en(33));return e}const Ng=S.createContext(void 0);function Lr(t){const e=S.useContext(Ng);if(e===void 0&&!t)throw new Error(en(36));return e}const CI=S.createContext(void 0);function Lg(t=!0){const e=S.useContext(CI);if(e===void 0&&!t)throw new Error(en(25));return e}function bm({controlled:t,default:e,name:n,state:i="value"}){const{current:r}=S.useRef(t!==void 0),[o,a]=S.useState(()=>e),c=r&&t!==void 0?t:o,f=S.useCallback(h=>{r||a(h)},[]);return[c,f]}const EI=S.createContext(null);function Pw(t="root"){const e=S.useContext(EI),n=S.useContext(Ng);return e===null||n===void 0?null:(t==="submenu-trigger"?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?e:null}const I8={visible:!0,ref:null};function N8(){return I8}function Iw(t,e,n="root"){const i=Pw(n),o=((n==="submenu-trigger"?i?.useSubmenuTrigger:i?.useItem)??N8)({label:t.label,children:t.children,render:t.render}),a=Ws(e,o.ref);return{visible:o.visible,ref:a,props:o.props}}function L8(t){t.preventDefault()}function B8(t){const{closeOnClick:e,highlighted:n,id:i,nodeId:r,store:o,typingRef:a,itemRef:c,itemMetadata:f}=t,h=Lr(),m=Lg(!0),p=f.type==="submenu-trigger",y=p?h.parentVirtualFocus:h.virtualFocus,x=(p&&h.parent.type==="menu"?h.parent.store:h.store).useState("webkitAriaSelected",n),{events:w}=o.useState("floatingTreeRoot"),C=o.useState("open"),E=m!==void 0,O=!y&&C&&n?0:-1;return S.useMemo(()=>({id:i,role:"menuitem",tabIndex:O,"aria-selected":x,onMouseDown:y?L8:void 0,onKeyDown(T){T.key===" "&&a?.current&&T.preventDefault()},onMouseMove(T){r&&w.emit("itemhover",{nodeId:r,target:T.currentTarget})},onClick(T){e&&w.emit("close",{domEvent:T.nativeEvent,reason:Nl})},onMouseUp(T){if(m){const A=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,E&&A&&Math.abs(T.clientX-A.x)<=1&&Math.abs(T.clientY-A.y)<=1||E&&!lw&&T.button===2)return}c.current&&o.context.allowMouseUpTriggerRef.current&&(!E||T.button===2)&&f.type==="regular-item"&&ff(c.current,T,{detail:1,pointerType:"mouse"})}}),[e,O,i,w,r,o.context.allowMouseUpTriggerRef,a,c,m,E,f.type,x,y])}const TI={type:"regular-item"};function Nw(t){const{closeOnClick:e,disabled:n,highlighted:i,id:r,store:o,typingRef:a=o.context.typingRef,nativeButton:c,itemMetadata:f,nodeId:h}=t,m=S.useRef(null),{getButtonProps:p,buttonRef:y}=Xo({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),b=B8({closeOnClick:e,highlighted:i,id:r,nodeId:h,store:o,typingRef:a,itemRef:m,itemMetadata:f}),x=S.useCallback(C=>Pi(b,{onMouseEnter(E){f.type==="submenu-trigger"&&f.setActive(E.nativeEvent)}},C,p),[b,p,f]),w=Ws(m,y);return S.useMemo(()=>({getItemProps:x,itemRef:w}),[x,w])}const RI=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function V8(){return S.useContext(RI)}function ad(t={}){const{guess:e,label:n,metadata:i,textRef:r,index:o}=t,{register:a,unregister:c,subscribeMapChange:f,nextIndexRef:h}=V8(),m=S.useRef(-1),[p,y]=S.useState(o==null&&e?()=>{if(m.current===-1){const C=h.current;h.current+=1,m.current=C}return m.current}:-1),b=o??p,x=S.useRef(null),w=S.useCallback(C=>{const E=x.current;E&&c(E),x.current=C,C&&a(C,{metadata:i??null,index:o??null,label:n,textRef:r})},[o,a,c,i,n,r]);return De(()=>{if(o==null)return f(C=>{const E=x.current?C.get(x.current)?.index:null;E!=null&&y(E)})},[o,f]),{ref:w,index:b}}const z8="data-checked",_8="data-unchecked",AI={checked(t){return t?{[z8]:""}:{[_8]:""}},...Fu},H8=S.createContext(void 0),F8=S.forwardRef(function(e,n){const{render:i,className:r,id:o,label:a,nativeButton:c=!1,disabled:f=!1,closeOnClick:h=!0,style:m,...p}=e,{store:y}=Lr(),b=ad({guess:!0,label:a}),x=vi(o),w=y.useState("disabled"),C=y.useState("isActive",b.index),E=y.useState("floatingNodeId"),O=y.useState("itemProps"),T=f||w,{getItemProps:A,itemRef:D}=Nw({closeOnClick:h,disabled:T,highlighted:C,id:x,store:y,nativeButton:c,nodeId:E,itemMetadata:TI});return Ot("div",e,{state:{disabled:T,highlighted:C},props:[O,p,A],ref:[D,n,b.ref]})}),one=S.forwardRef(function(e,n){const i=Iw(e,n);return i.visible?fe.jsx(F8,{...e,ref:i.ref}):null}),U8=S.createContext(void 0);function Lw(t){return S.useContext(U8)}function ud(t){return t==="starting"?WF:At}const OI=S.createContext(void 0);function MI(){return S.useContext(OI)}function j8(t,e){const n=Jx(t.render);if(S.isValidElement(n)){const i=n.props;if(Object.hasOwn(i,"id"))return i.id??""}return t.id??e}function K8(t,e,n){const i=j8(t,e),r=i===e?void 0:i,o=S.useCallback(a=>n?.(a?r:void 0),[r,n]);return[i,o]}function Y8(t,e,n){const i=Jx(t.render),r=S.isValidElement(i)?i.props:void 0,o=t["aria-label"]??r?.["aria-label"];let a=t["aria-labelledby"]??r?.["aria-labelledby"];return a==null&&!o&&(a=e?e.id||void 0:n||void 0),a}const q8=S.forwardRef(function(e,n){const{render:i,className:r,style:o,finalFocus:a,id:c,initialFocus:f,...h}=e,{store:m,defaultFloatingId:p,setRenderedFloatingId:y,virtualFocus:b,orientation:x}=Lr(),w=MI(),{side:C,align:E}=wI(),O=Lw()!=null,T=m.useState("open"),A=m.useState("transitionStatus"),D=m.useState("popupProps"),k=m.useState("mounted"),M=m.useState("instantType"),I=m.useState("activeTriggerElement"),L=m.useState("parent"),B=m.useState("lastOpenChangeReason"),H=m.useState("rootId"),U=m.useState("floatingRootContext"),F=m.useState("floatingTreeRoot"),K=m.useState("closeDelay"),z=m.useState("hoverEnabled"),V=m.useState("disabled"),X=m.useState("openMethod"),j=m.useState("activeTriggerId"),Y=m.useState("listElement"),[$,te]=K8(e,p,y),N=Y8(e,I,j),ne=L.type==="menu"?w:void 0,q=L.type==="context-menu";let G=f??L.type!=="menu";f===void 0&&Y&&L.type!=="menu"&&(G=()=>m.state.activeIndex!==null?!1:Y),eo({open:T,ref:m.context.popupRef,onComplete(){T&&m.context.onOpenChangeComplete?.(!0)}}),S.useEffect(()=>{function ye(Pe){m.setOpen(!1,Ze(Pe.reason,Pe.domEvent))}return F.events.on("close",ye),()=>{F.events.off("close",ye)}},[F.events,m]),Ow(U,{enabled:z&&!V&&!q&&L.type!=="menubar",closeDelay:K});const Z=m.useStateSetter("popupElement"),ae=S.useContext(EI)?.useParentHandoff??W8,{parentVirtualFocusRef:Se,handleFocus:le}=ae(m,L,T,b),ge={transitionStatus:A,side:C,align:E,open:T,nested:L.type==="menu",instant:M},ce=Ot("div",e,{state:ge,ref:[n,m.context.popupRef,Z,te],stateAttributesMapping:tg,props:[D,{id:$,...Y?{role:"presentation"}:{role:"menu","aria-orientation":x==="horizontal"?"horizontal":void 0,"aria-labelledby":N},onKeyDown(ye){ne?.onPopupKeyDown?.(ye),O&&Dg.has(ye.key)&&ye.stopPropagation()},onFocus:le},ud(A),h,{"data-rootownerid":H}]});let ue=L.type===void 0||q;(I||L.type==="menubar"&&B!==sg)&&(ue=!0);const Te=ne?.getReturnElement??Se;return fe.jsx(pg,{context:U,openInteractionType:X,modal:q,disabled:!k,returnFocus:a??Te??ue,explicitReturnFocus:a===void 0&&Te?!1:void 0,initialFocus:G,restoreFocus:!0,getInsideElements:L.type===void 0?()=>[m.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:L.type!=="menubar"?F:void 0,previousFocusableElement:I,nextFocusableElement:L.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:m.context.beforeContentFocusGuardRef,children:ce})}),G8={parentVirtualFocusRef:void 0,handleFocus:void 0};function W8(){return G8}const lne=S.forwardRef(function(e,n){const i=Pw()?.Popup??q8;return fe.jsx(i,{...e,ref:n})}),DI=S.createContext(void 0);function X8(){const t=S.useContext(DI);if(t===void 0)throw new Error(en(32));return t}const ane=S.forwardRef(function(e,n){const{keepMounted:i=!1,...r}=e,{store:o,parent:a}=Lr();if(!(o.useState("mounted")||i))return null;const h=a.type==="menu"||a.type==="menubar"?"group":void 0;return fe.jsx(DI.Provider,{value:i,children:fe.jsx(hg,{ref:n,...r,portalOwnerRole:h})})});function $8(t){const{nodeId:e,externalTree:n,rootContext:i}=t,r=i.useState("referenceElement"),o=i.useState("floatingElement"),a=i.useState("domReferenceElement"),c=i.useState("open"),f=i.useState("floatingId"),[h,m]=S.useState(null),p=S.useRef(null),y=Qo(n),b=S.useMemo(()=>({reference:r,floating:o,domReference:a}),[r,o,a]),x=r8({...t,elements:{...b,...h&&{reference:h}}}),w=S.useCallback(T=>{const A=Dt(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;m(A),x.refs.setReference(A)},[x.refs]),C=S.useMemo(()=>({...x.refs,setPositionReference:w,domReference:p}),[x.refs,w]),E=S.useMemo(()=>({...x.elements,domReference:a}),[x.elements,a]),O=S.useMemo(()=>({...x,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:f,refs:C,elements:E,nodeId:e,rootStore:i}),[x,C,E,e,i,c,f]);return De(()=>{a&&(p.current=a)},[a]),De(()=>{i.context.dataRef.current.floatingContext=O;const T=y?.nodesRef.current.find(A=>A.id===e);T&&(T.context=O)}),S.useMemo(()=>({...x,context:O,refs:C,elements:E,rootStore:i}),[x,C,E,O,i])}const Q8=S.createContext(void 0);function Bw(){return S.useContext(Q8)?.direction??"ltr"}const Z8=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:o,platform:a,elements:c,middlewareData:f}=e,{element:h,padding:m=0}=zo(t,e)||{};if(h==null)return{};const p=MP(m),y={x:n,y:i},b=pw(r),x=hw(b),w=await a.getDimensions(h),C=b==="y",E=C?"top":"left",O=C?"bottom":"right",T=C?"clientHeight":"clientWidth",A=o.reference[x]+o.reference[b]-y[b]-o.floating[x],D=y[b]-o.reference[b],k=c.floating[T]||o.floating[x],M=A/2-D/2,I=k/2-w[x]/2-1,L=Math.min(p[E],I),B=Math.min(p[O],I),H=L,U=k-w[x]-B,F=k/2-w[x]/2+M,K=OP(H,F,U),z=!f.arrow&&ds(r)!=null&&F!==K&&o.reference[x]/2-(F<H?L:B)-w[x]/2<0,V=z?F<H?F-H:F-U:0;return{[b]:y[b]+V,data:{[b]:K,centerOffset:F-K-V,...z&&{alignmentOffset:V}},reset:z}}}),J8=(t,e)=>{const{name:n,fn:i}=Z8(t);return{name:n,fn:i,options:[t,e]}},ej={name:"hide",async fn(t){const{width:e,height:n,x:i,y:r}=t.rects.reference,o=e===0&&n===0&&i===0&&r===0,a=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-e>=0||a.bottom-n>=0||a.left-e>=0||o}}}},tj={sideX:"left",sideY:"top"},nj="--available-width",ij="--available-height",rj="--anchor-width",sj="--anchor-height",oj="--transform-origin",CO=nj,EO=ij;function kI(t,e,n){const i=t==="inline-start"||t==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[e]}function TO(t,e,n){const{rects:i,placement:r}=t;return{side:kI(e,Ki(r),n),align:ds(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Bg(t){return lj(t,$8)}function lj(t,e){const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:c=0,collisionBoundary:f,collisionPadding:h=5,sticky:m=!1,arrowPadding:p=5,disableAnchorTracking:y=!1,inline:b,keepMounted:x=!1,floatingRootContext:w,mounted:C,collisionAvoidance:E,shift:O,nodeId:T,adaptiveOrigin:A,lazyFlip:D=!1,externalTree:k}=t,M=E.side||"flip",I=E.align||"flip",L=E.fallbackAxisSide||"end",B=O?.crossAxis??!1,H=O?.rootBoundary,U=typeof n=="function"?n:void 0,F=He(U),K=U?F:n,z=dn(n),V=dn(C),j=Bw()==="rtl",[Y,$]=S.useState(null);!C&&Y!==null&&$(null);const te=D==="placement",N=Y?Ki(Y):null,ne=Y&&te?ds(Y)||"center":null,q=N||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],G=ne||a,Z=G==="center"?q:`${q}-${G}`;let ae=h;typeof ae=="number"?ae={top:ae,right:ae,bottom:ae,left:ae}:ae&&(ae={top:ae.top||0,right:ae.right||0,bottom:ae.bottom||0,left:ae.left||0});const Se=1,le=r==="bottom"?Se:0,ge=r==="top"?Se:0,ce=r==="right"?Se:0,ue=r==="left"?Se:0,Te={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:ae},ye=S.useRef(null),Pe=dn(o),Ee=dn(c),Me=typeof o!="function"?o:0,Be=typeof c!="function"?c:0,ve=[];b&&ve.push(b),ve.push(s8(Ce=>{const Qe=TO(Ce,r,j),Ae=typeof Pe.current=="function"?Pe.current(Qe):Pe.current,Oe=typeof Ee.current=="function"?Ee.current(Qe):Ee.current;return{mainAxis:Ae,crossAxis:Oe,alignmentAxis:Oe}},[Me,Be,j,r]));const Ie=I==="none"&&M!=="shift",de=!Ie&&(m||B||M==="shift"),ke=M==="none"?null:a8({...Te,padding:{top:ae.top+Se+le,right:ae.right+Se+ue,bottom:ae.bottom+Se+ge,left:ae.left+Se+ce},mainAxis:!B&&M==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:L}),it=Ie?null:o8({...Te,rootBoundary:H,mainAxis:I!=="none",crossAxis:de,limiter:m||B?void 0:l8(Ce=>{if(!ye.current)return{};const{width:Qe,height:Ae}=ye.current.getBoundingClientRect(),Oe=or(Ki(Ce.placement)),Ke=Oe==="y"?Qe:Ae,Xe=Oe==="y"?ae.left+ae.right:ae.top+ae.bottom;return{offset:Ke/2+Xe/2}})},[Te,m,B,H,ae,I]);M==="shift"||I==="shift"||G==="center"?ve.push(it,ke):ve.push(ke,it),ve.push(u8({...Te,apply({elements:{floating:Ce},availableWidth:Qe,availableHeight:Ae,rects:Oe}){if(!V.current)return;const Ke=Ce.style;Ke.setProperty(CO,`${Qe}px`),Ke.setProperty(EO,`${Ae}px`);const Xe=Jt(Ce).devicePixelRatio||1,{x:dt,y:Ge,width:at,height:pt}=Oe.reference,zt=(Math.round((dt+at)*Xe)-Math.round(dt*Xe))/Xe,pn=(Math.round((Ge+pt)*Xe)-Math.round(Ge*Xe))/Xe;Ke.setProperty(rj,`${zt}px`),Ke.setProperty(sj,`${pn}px`)}}),J8(Ce=>({element:ye.current||xt(Ce.elements.floating).createElement("div"),padding:ye.current?p:0}),[p]),{name:"transformOrigin",fn(Ce){const{elements:{floating:Qe},middlewareData:Ae,placement:Oe,platform:Ke,rects:Xe,y:dt}=Ce,Ge=Ki(Oe),at=ds(Oe),pt=or(Ge)==="y",zt=ye.current,pn=typeof o=="function"?o(TO(Ce,r,j)):o;let Cn;if(!zt&&at&&Math.abs(pt?Ae.shift?.x||0:Ae.shift?.y||0)<=1)Cn=at==="start"===(pt&&Ke.isRTL?.(Qe)===!0)?"100%":"0%";else{const yr=pt?Ae.arrow?.x||0:Ae.arrow?.y||0,ra=pt?zt?.clientWidth||0:zt?.clientHeight||0;Cn=`${yr+ra/2}px`}let gr=Ge==="top"||Ge==="left"?`calc(100% + ${pn}px)`:`${-pn}px`;return de&&pt&&Math.abs(Ae.shift?.y||0)>pn&&(gr=`${Xe.reference.y+Xe.reference.height/2-dt}px`),Qe.style.setProperty(oj,pt?`${Cn} ${gr}`:`${gr} ${Cn}`),{}}},ej,A),De(()=>{!C&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[C,w]);const tt=S.useMemo(()=>({ancestorScroll:!y,elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:se,elements:me,x:_e,y:we,middlewareData:Re,update:gt,placement:Je,context:rt,isPositioned:Et,floatingStyles:yt}=e({rootContext:w,open:x?C:void 0,placement:Z,middleware:ve,strategy:i,whileElementsMounted:x?void 0:(...Ce)=>mO(...Ce,tt),nodeId:T,externalTree:k}),{sideX:hn,sideY:qt}=Re.adaptiveOrigin||tj,tn=Et?i:"fixed",qe=S.useMemo(()=>{let Ce;return Et?A?Ce={position:tn,[hn]:_e,[qt]:we}:Ce={...yt,position:tn}:Ce={position:tn,top:0,left:0},Ce[CO]="100vw",Ce[EO]="100vh",Et||(Ce.opacity=0),Ce},[A,tn,hn,_e,qt,we,yt,Et]),st=S.useRef(null);De(()=>{if(!C)return;const Ce=z.current,Qe=typeof Ce=="function"?Ce():Ce,Oe=(RO(Qe)?Qe.current:Qe)||null||null;Oe!==st.current&&(se.setPositionReference(Oe),st.current=Oe)},[C,se,K,z]),S.useEffect(()=>{if(!C)return;const Ce=z.current;typeof Ce!="function"&&RO(Ce)&&Ce.current!==st.current&&(se.setPositionReference(Ce.current),st.current=Ce.current)},[C,se,K,z]),S.useEffect(()=>{if(x&&C&&me.reference&&me.floating)return mO(me.reference,me.floating,gt,tt)},[x,C,me,gt,tt]);const Lt=Ki(Je),ot=kI(r,Lt,j),lt=ds(Je)||"center",vt=!!Re.hide?.referenceHidden;De(()=>{D&&C&&Et&&(Lt!==q||te&&lt!==G)&&$(Je)},[D,te,C,Et,Je,Lt,lt,q,G]);const Tt=S.useMemo(()=>({position:"absolute",top:Re.arrow?.y,left:Re.arrow?.x}),[Re.arrow]),un=Re.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:qe,arrowStyles:Tt,arrowRef:ye,arrowUncentered:un,side:ot,align:lt,physicalSide:Lt,anchorHidden:vt,refs:se,context:rt,isPositioned:Et,update:gt}),[qe,Tt,ye,un,ot,lt,Lt,vt,se,rt,Et,gt])}function RO(t){return t!=null&&"current"in t}function PI(t){const{children:e,elementsRef:n,labelsRef:i,onMapChange:r}=t,o=He(r),[,a]=S.useState(0),c=kn(uj).current,f=kn(aj).current,h=S.useRef(0),m=S.useRef(!0),p=S.useRef(null),y=S.useRef(null),b=He(()=>{m.current||(m.current=!0,a(D=>D+1))}),x=He((D,k)=>{f.set(D,k),b()}),w=He(D=>{f.delete(D),b()}),C=He(D=>{const k=new Map;return n.current.length=0,i&&(i.current.length=0),D.forEach(M=>{k.set(M.element,{...M.registration.metadata??{},index:M.index}),n.current[M.index]=M.element,i&&(i.current[M.index]=M.registration.label!==void 0?M.registration.label:M.registration.textRef?.current?.textContent??M.element.textContent)}),h.current=n.current.length,k});function E(D){if(y.current?.disconnect(),y.current=null,typeof MutationObserver!="function"||D.length<2)return;const k=new MutationObserver(I=>{if(!dj(I))return;let L=null;for(const B of D)if(B.isConnected){if(L&&II(L,B)>0){k.disconnect(),b();return}L=B}});y.current=k;const M=new Set;for(let I=1;I<D.length;I+=1){const L=fj(D[I-1],D[I]);L&&M.add(L)}M.forEach(I=>k.observe(I,{childList:!0}))}const O=He(()=>{const[D,k]=cj(f),M=C(D),I=p.current,L=!I||I.length!==D.length||D.some((B,H)=>{const U=I[H];return B.index!==U.index||B.element!==U.element||B.registration.index!==U.registration.index||B.registration.metadata!==U.registration.metadata});E(k),p.current=D,m.current=!1,L&&(c.forEach(B=>B(M)),o(M))});De(()=>(!m.current&&p.current&&C(p.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,C]),De(()=>{m.current&&O()}),De(()=>()=>{y.current?.disconnect(),m.current=!0},[]);const T=He(D=>(c.add(D),()=>{c.delete(D)})),A=S.useMemo(()=>({register:x,unregister:w,subscribeMapChange:T,nextIndexRef:h}),[x,w,T,h]);return fe.jsx(RI.Provider,{value:A,children:e})}function aj(){return new Map}function uj(){return new Set}function cj(t){const e=new Set,n=[],i=[];t.forEach((o,a)=>{if(!a.isConnected)return;const c=o.index,f={index:c??-1,element:a,registration:o};c===null?i.push(f):c>=0&&(e.add(c),n.push(f))});let r=0;return i.sort((o,a)=>II(o.element,a.element)),i.forEach(o=>{for(;e.has(r);)r+=1;o.index=r,n.push(o),r+=1}),e.size>0&&n.sort((o,a)=>o.index-a.index),[n,i.map(o=>o.element)]}function fj(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function dj(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function II(t,e){return t.nextElementSibling===e?-1:e.nextElementSibling===t?1:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function NI(t){const{store:e,domReference:n,positionerElement:i,open:r}=t,o=S.useRef(null),a=S.useRef(null),c=Cw(i);De(()=>{r||(a.current?.abort(),a.current=null,e.state.instantType==="trigger-change"&&e.set("instantType",void 0))},[r,e]),De(()=>{const f=n,h=o.current;if(f&&(o.current=f),!h||!f||f===h||!e.select("open"))return;e.set("instantType",void 0);const m=new AbortController;return a.current=m,c(()=>{e.select("open")&&e.set("instantType","trigger-change")},m.signal),()=>{m.abort()}},[n,c,e])}function Vg(t,e,{styles:n,transitionStatus:i,props:r,refs:o,hidden:a,inert:c=!1}){const f={...n};return c&&(f.pointerEvents="none"),Ot("div",t,{state:e,ref:o,props:[{role:"presentation",hidden:a,style:f},ud(i),r],stateAttributesMapping:Zf})}const hj=20;function Vw(t,e,n,i){const[r,o]=S.useState(!1);De(()=>{if(!t||!e||n==null){o(!1);return}const a=xt(n).documentElement.clientWidth,c=n.offsetWidth;o(a>0&&c>0&&c>=a-hj)},[t,e,n]),bI(t&&(!e||r),i)}const pj=S.forwardRef(function(e,n){const{anchor:i,positionMethod:r="absolute",className:o,render:a,side:c,align:f,sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=UP,style:E,...O}=e,{store:T,virtualFocus:A,syncHighlightedItem:D}=Lr(),k=X8(),M=Lg(!0),I=T.useState("parent"),L=T.useState("floatingRootContext"),B=T.useState("floatingTreeRoot"),H=T.useState("mounted"),U=T.useState("open"),F=T.useState("modal"),K=T.useState("openMethod"),z=T.useState("activeTriggerElement"),V=T.useState("transitionStatus"),X=T.useState("positionerElement"),j=T.useState("instantType"),Y=T.useState("adaptiveOrigin"),$=T.useState("lastOpenChangeReason"),te=T.useState("floatingNodeId"),N=T.useState("floatingParentNodeId"),ne=L.useState("domReferenceElement");let q=i,G=h,Z=m,ae=f,Se=C;I.type==="context-menu"&&(q=i??I.context?.anchor,ae=ae??"start",!c&&ae!=="center"&&(Z=e.alignOffset??2,G=e.sideOffset??-5));let le=c,ge=ae;I.type==="menu"?(le=le??"inline-end",ge=ge??"start",Se=e.collisionAvoidance??bw):I.type==="menubar"&&(le=le??(I.context.orientation==="vertical"?"inline-end":"bottom"),ge=ge??"start");const ce=I.type==="context-menu",ue=Bg({anchor:q,floatingRootContext:L,positionMethod:M?"fixed":r,mounted:H,side:le,sideOffset:G,align:ge,alignOffset:Z,arrowPadding:ce?0:b,collisionBoundary:p,collisionPadding:y,sticky:x,nodeId:te,keepMounted:k,disableAnchorTracking:w,collisionAvoidance:Se,shift:ce?{crossAxis:!("side"in Se&&Se.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:B,adaptiveOrigin:Y,lazyFlip:A?"placement":!1});S.useEffect(()=>{function Ie(de){de.open&&(de.parentNodeId===te&&T.set("hoverEnabled",!1),de.nodeId!==te&&de.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,Ze(sf)))}return B.events.on("menuopenchange",Ie),()=>{B.events.off("menuopenchange",Ie)}},[T,B.events,te]),S.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ie(de){if(de.open||de.nodeId!==T.select("floatingParentNodeId"))return;const ke=de.reason??sf;T.setOpen(!1,Ze(ke))}return B.events.on("menuopenchange",Ie),()=>{B.events.off("menuopenchange",Ie)}},[B.events,T]);const Te=wn();S.useEffect(()=>{U||Te.clear()},[U,Te]),S.useEffect(()=>{function Ie(de){if(!(!U||de.nodeId!==T.select("floatingParentNodeId")))if(de.target&&z&&z!==de.target){const ke=T.select("closeDelay");ke>0?Te.isStarted()||Te.start(ke,()=>{T.setOpen(!1,Ze(sf))}):T.setOpen(!1,Ze(sf))}else Te.clear()}return B.events.on("itemhover",Ie),()=>{B.events.off("itemhover",Ie)}},[B.events,U,z,T,Te]),S.useEffect(()=>{const Ie={open:U,nodeId:te,parentNodeId:N,reason:T.select("lastOpenChangeReason")};B.events.emit("menuopenchange",Ie)},[B.events,U,T,te,N]),NI({store:T,domReference:ne,positionerElement:X,open:U});const ye={open:U,side:ue.side,align:ue.align,anchorHidden:ue.anchorHidden,nested:I.type==="menu",instant:j},Pe=I.type==="menubar"&&I.context.modal;Vw(U&&(Pe||F&&$!==vn),K==="touch",X,z);const Me=Vg(e,ye,{styles:ue.positionerStyles,transitionStatus:V,props:O,refs:[n,T.useStateSetter("positionerElement")],hidden:!H,inert:!U}),Be=H&&I.type!=="menu"&&(I.type!=="menubar"&&F&&$!==vn||I.type==="menubar"&&I.context.modal);let ve=null;return I.type==="menubar"?ve=I.context.contentElement:I.type===void 0&&(ve=z),fe.jsxs(xI.Provider,{value:ue,children:[Be&&fe.jsx(Pg,{ref:I.type==="context-menu"||I.type==="nested-context-menu"?I.context.internalBackdropRef:null,inert:kg(!U),cutout:ve}),fe.jsx(XP,{id:te,children:fe.jsx(PI,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,onMapChange:D,children:Me})})]})}),LI=S.createContext(void 0);function mj(){const t=S.useContext(LI);if(t===void 0)throw new Error(en(34));return t}const gj=S.forwardRef(function(e,n){const{render:i,className:r,value:o,defaultValue:a,onValueChange:c,disabled:f=!1,style:h,"aria-labelledby":m,...p}=e,[y,b]=S.useState(void 0),[x,w]=bm({controlled:o,default:a,name:"MenuRadioGroup"}),C=He((A,D)=>{c?.(A,D),!D.isCanceled&&w(A)}),O=Ot("div",e,{state:{disabled:f},ref:n,props:{role:"group","aria-labelledby":m??y,"aria-disabled":f||void 0,...p}}),T=S.useMemo(()=>({value:x,setValue:C,disabled:f}),[x,C,f]);return fe.jsx(H8.Provider,{value:b,children:fe.jsx(LI.Provider,{value:T,children:O})})}),une=S.memo(S.forwardRef(function(e,n){const i=Pw()?.RadioGroup??gj;return fe.jsx(i,{...e,ref:n})})),BI=S.createContext(void 0);function yj(){const t=S.useContext(BI);if(t===void 0)throw new Error(en(35));return t}const vj=S.forwardRef(function(e,n){const{render:i,className:r,id:o,label:a,nativeButton:c=!1,disabled:f=!1,closeOnClick:h=!1,value:m,style:p,...y}=e,{store:b}=Lr(),{value:x,setValue:w,disabled:C}=mj(),E=ad({guess:!0,label:a}),O=vi(o),T=b.useState("isActive",E.index),A=b.useState("floatingNodeId"),D=b.useState("itemProps"),k=b.useState("disabled"),M=f||C||k,I=x===m,{getItemProps:L,itemRef:B}=Nw({closeOnClick:h,disabled:M,highlighted:T,id:O,store:b,nativeButton:c,nodeId:A,itemMetadata:TI}),H=S.useMemo(()=>({disabled:M,highlighted:T,checked:I}),[M,T,I]);function U(K){const z=Ze(Nl,K.nativeEvent,void 0,{preventUnmountOnClose:ln});w(m,z)}const F=Ot("div",e,{state:H,stateAttributesMapping:AI,props:[D,{role:"menuitemradio","aria-checked":I,onClick:U},y,L],ref:[B,n,E.ref]});return fe.jsx(BI.Provider,{value:H,children:F})}),cne=S.forwardRef(function(e,n){const i=Iw(e,n);return i.visible?fe.jsx(vj,{...e,ref:i.ref}):null}),fne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,keepMounted:a=!1,...c}=e,f=yj(),h=S.useRef(null),{transitionStatus:m,mounted:p,setMounted:y}=mg(f.checked);eo({batch:!0,enabled:!f.checked,open:f.checked,ref:h,onComplete(){f.checked||y(!1)}});const b={checked:f.checked,disabled:f.disabled,highlighted:f.highlighted,transitionStatus:m};return Ot("span",e,{state:b,stateAttributesMapping:AI,ref:[n,h],props:{"aria-hidden":!0,...c},enabled:a||p})}),bj=S.createContext(null);function VI(t){return S.useContext(bj)}function Sj(t){return t==null?dr:t.type.startsWith("key")?vP:t.type.startsWith("mouse")||t.type.startsWith("pointer")?bP:dr}const xj={...Fs,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,keyboardOpen:t=>t.keyboardOpen,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,listElement:t=>t.listElement,triggerControlsId:(t,e)=>{const n=Fs.triggerPopupId(t,e);return n?t.listElement?.id||n:void 0},filterTriggerProps:t=>t.filterTriggerProps,inputProps:t=>t.inputProps,webkitAriaSelected:(t,e)=>vs&&t.inputFocused&&e?!0:void 0,highlightedItemId:t=>t.highlightedItem?.id||void 0,isActive:(t,e)=>t.activeIndex===e,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType==="trigger-change"&&!Fs.open(t)?void 0:t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class wj extends ju{constructor(e,n,i=!1){const r=new od,o=Ej(r,n,i,e);super(o,Cj(r),xj),this.observe("parent",a=>{a.type==="menu"?this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef:a.type!==void 0&&(this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){const e=this.state.parent;if(e.type!=="menu")return;let n=e.store.select("rootId"),i=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return e.store.subscribe(()=>{const o=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),c=e.store.select("keyboardEventRelay");n===o&&i===a&&r===c||(n=o,i=a,r=c,this.notifyAll())})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}setActiveIndex(e,n,i){if(this.state.activeIndex!==e){const o=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=o?"none":n,this.context.highlightEvent=o?void 0:i}this.set("activeIndex",e)}highlightItem(e,n,i){const r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,n,i)}}function Cj(t){return{positionerRef:S.createRef(),popupRef:S.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:S.createRef(),beforeTriggerFocusGuardRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}function Ej(t,e,n=!1,i){return{...Eg(t,e,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:At,inputProps:At,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Sw,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:At,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...i}}const Sm=S.createContext(null);function zI(t,e){return(t===gs||t===Nl)&&e?.detail===0}function Tj(t,e){return t===Of||zI(t,e)}const _I=ld(function(e){const{children:n,open:i,onOpenChange:r,onOpenChangeComplete:o,onItemHighlighted:a,defaultOpen:c=!1,disabled:f=!1,modal:h,loopFocus:m=!0,orientation:p="vertical",actionsRef:y,closeParentOnEsc:b=!1,handle:x,triggerId:w,defaultTriggerId:C=null,highlightItemOnHover:E=!0,isSubmenu:O=!1,virtualFocus:T=!1,virtualFocusRef:A,allowEscape:D=!0,resetOnPointerLeave:k=!0}=e,M=Lg(!0),I=Lr(!0),L=VI(!0),B=I?.store,H=I?.virtualFocus??!1,U=S.useMemo(()=>O&&B?{type:"menu",store:B}:L?{type:"menubar",context:L}:M&&!B?{type:"context-menu",context:M}:{type:void 0},[M,B,L,O]),F=vi(),K=vi(),[z,V]=S.useState(void 0),X=(z??K)||void 0,j=$o(),Y=U.type==="menu"?U.store:void 0,$=(i??c)&&Y?.state.transitionStatus==="starting",te=kn(()=>$?Y?.state.instantType:void 0).current,N=kn(()=>{const Ae=new wj({open:c,openProp:i,activeTriggerId:C,triggerIdProp:w,parent:U,disabled:f,highlightItemOnHover:E,modal:U.type===void 0?h:void 0,rootId:F,instantType:te},X,j!=null);return Ae.context.virtualFocusRef=A,Ae}).current;N.useControlledProp("openProp",i),N.useControlledProp("triggerIdProp",w),N.useContextCallback("onOpenChangeComplete",o);const ne=N.useState("floatingTreeRoot"),q=xw(ne),G=N.useState("open"),Z=N.useState("activeTriggerElement"),ae=N.useState("positionerElement"),Se=N.useState("hoverEnabled"),le=N.useState("disabled"),ge=N.useState("lastOpenChangeReason"),ce=N.useState("parent"),ue=N.useState("activeIndex"),Te=N.useState("keyboardOpen"),ye=N.useState("payload"),Pe=N.useState("floatingParentNodeId"),Ee=S.useRef(null),Me=S.useRef(ce.type!=="context-menu"),Be=wn(),ve=S.useRef(!0),Ie=wn(),de=Pe!=null,{openMethod:ke,triggerProps:it}=SI(G);N.useSyncedValues({disabled:f,highlightItemOnHover:E,modal:ce.type===void 0?h:void 0,openMethod:ke,rootId:F}),Sg(N);const{forceUnmount:tt,transitionStatus:se}=xg(G,N,()=>{N.set("allowMouseEnter",!1)},$),me=Cw(N.context.popupRef);S.useEffect(()=>{if(te===void 0)return;const Ae=()=>{N.state.instantType===te&&N.set("instantType",void 0)};if(!G){Ae();return}if(se!==void 0)return;if(N.context.popupRef.current==null){Ae();return}const Oe=new AbortController;return me(Ae,Oe.signal),()=>{Oe.abort()}},[te,G,se,me,N]),De(()=>{M&&!I?N.update({parent:{type:"context-menu",context:M},floatingNodeId:q,floatingParentNodeId:j}):(I||!N.select("activeTriggerElement"))&&N.update({floatingNodeId:q,floatingParentNodeId:j})},[M,I,q,j,Z,N]),S.useEffect(()=>{if(G||(Ee.current=null),ce.type==="context-menu"){if(!G){Be.clear(),Me.current=!1;return}Be.start(500,()=>{Me.current=!0})}},[Be,G,ce.type]),De(()=>{!G&&!Se&&N.set("hoverEnabled",!0)},[G,Se,N]);const _e=He((Ae,Oe)=>{const Ke=Oe.reason;if(!Ae&&!N.select("open")||G===Ae&&Oe.trigger===Z&&ge===Ke)return;const Xe=vg(Oe);if(!Ae&&Oe.trigger==null&&(Oe.trigger=Z??void 0),r?.(Ae,Oe),Oe.isCanceled)return;N.state.floatingRootContext.dispatchOpenChange(Ae,Oe);const dt=Oe.event;if(Ae===!1&&Ke!==Nl&&dt?.type==="click"&&dt.pointerType==="touch"&&!ve.current)return;Ae&&Ke===hu?(ve.current=!1,Ie.start(300,()=>{ve.current=!0})):(ve.current=!0,Ie.clear());const Ge=!Ae&&(Ke===ed||Ke==null);Ee.current=Oe.event;const at=yg(N.state,Ae,Oe.trigger,Xe());at.openChangeReason=Ke,at.keyboardOpen=Ae&&Tj(Ke,dt),ce.type==="menubar"&&(Ke===hu||Ke===$s||Ke===vn||Ke===Of||Ke===sf)?at.instantType="group":zI(Ke,dt)?at.instantType="click":Ge?at.instantType="dismiss":at.instantType=void 0,N.update(at)}),we=QP({popupStore:N,floatingRootContext:N.state.floatingRootContext,floatingId:X,nested:j!=null,onOpenChange:_e}),Re=we.context.events;De(()=>{const Ae=({open:Oe,eventDetails:Ke})=>_e(Oe,Ke);return Re.on("setOpen",Ae),()=>{Re?.off("setOpen",Ae)}},[Re,_e]),De(()=>N.subscribeToParentMenu(),[N]);const gt=S.useCallback(()=>{N.setOpen(!1,Ze(td))},[N]);S.useImperativeHandle(y,()=>({unmount:tt,close:gt}),[tt,gt]);let Je;ce.type==="context-menu"&&(Je=ce.context),S.useImperativeHandle(Je?.positionerRef,()=>ae,[ae]),S.useImperativeHandle(Je?.actionsRef,()=>({setOpen:_e}),[_e]);const rt=rd(we,{enabled:!le,bubbles:{escapeKey:b&&ce.type==="menu"},outsidePress(){return ce.type!=="context-menu"||Ee.current?.type==="contextmenu"?!0:Me.current},externalTree:de?ne:void 0}),Et=Bw(),yt=aI(we,{enabled:!le,listRef:N.context.itemDomElements,activeIndex:ue,virtual:T,nested:ce.type==="menubar"||!T&&ce.type!==void 0,parentOrientation:ce.type==="menubar"?ce.context.orientation:void 0,loopFocus:m,focusItemOnOpen:T?Te:void 0,allowEscape:T&&m&&D,orientation:p,triggerOrientation:T?"vertical":p,rtl:Et==="rtl",disabledIndices:Hl,onNavigate(Ae,Oe){N.setActiveIndex(Ae,Sj(Oe),Oe?.nativeEvent)},openOnArrowKeyDown:ce.type!=="context-menu"&&!(T&&O),externalTree:!T&&de?ne:void 0,nestedReturnFocusRef:Y?.context.virtualFocusRef,focusItemOnHover:E,resetOnPointerLeave:k}),hn=S.useCallback(Ae=>{N.context.typingRef.current=Ae},[N]),qt=uI(we,{enabled:!le&&!T,listRef:N.context.itemLabels,elementsRef:N.context.itemDomElements,activeIndex:ue,resetMs:GF,onMatch:(Ae,Oe)=>{G&&Ae!==ue&&N.setActiveIndex(Ae,vP,Oe.nativeEvent)},onTyping:hn}),tn=He(a),qe=S.useRef(-1),st=He(()=>{const Ae=N.state.activeIndex,Oe=Ae===null?void 0:N.context.itemDomElements.current[Ae]??void 0;if(Oe?.isConnected===!1)return;const Ke=Oe===void 0?-1:Ae;if(qe.current===Ke&&N.context.reportedItem===Oe)return;qe.current=Ke,N.context.reportedItem=Oe,T&&N.set("highlightedItem",Oe);const{highlightReason:Xe,highlightEvent:dt}=N.context;N.context.highlightReason=dr,N.context.highlightEvent=void 0,a&&tn(Oe,aF(Xe,dt,{label:Oe===void 0?void 0:N.context.itemLabels.current[Ke]??void 0}))});De(()=>{st()},[ue,st]);const Lt=S.useMemo(()=>{if(!T)return yt.reference;if(!yt.trigger)return At;const{onFocus:Ae,...Oe}=yt.trigger;return Oe},[T,yt.reference,yt.trigger]);N.useSyncedValue("inputProps",T?yt.reference??At:At);const ot=S.useMemo(()=>{const Ae=Pi(qt.reference,Lt,rt.reference,{onMouseMove(){N.set("allowMouseEnter",!0)}},it);return Ae["aria-haspopup"]="menu",Ae["aria-expanded"]=G,Ae},[N,qt.reference,Lt,rt.reference,it,G]),lt=S.useMemo(()=>{const Ae=Pi(yt.trigger,rt.trigger,it);return Ae["aria-haspopup"]="menu",Ae["aria-expanded"]=!1,Ae},[yt.trigger,rt.trigger,it]);kn(()=>(N.update({inactiveTriggerProps:lt}),null));const vt=S.useMemo(()=>Pi(sd,{onMouseMove(){N.set("allowMouseEnter",!0),ce.type==="menu"&&N.set("hoverEnabled",!1)},onClick(){N.select("hoverEnabled")&&N.set("hoverEnabled",!1)},onKeyDown(Ae){const Oe=N.select("keyboardEventRelay");Oe&&!Ae.isPropagationStopped()&&Oe(Ae)}},qt.floating,yt.floating,rt.floating),[ce.type,N,qt.floating,yt.floating,rt.floating]),Tt=yt.item??At;wg(N,{floatingRootContext:we,activeTriggerProps:ot,inactiveTriggerProps:lt,popupProps:vt,itemProps:Tt});const un=S.useMemo(()=>({store:N,parent:U,orientation:p,loopFocus:m,allowEscape:D,defaultFloatingId:K,setRenderedFloatingId:V,virtualFocus:T,parentVirtualFocus:H,syncHighlightedItem:st}),[N,U,p,m,D,K,T,H,st]),Ce=typeof n=="function"?n({payload:ye}):n;let Qe=fe.jsxs(Ng.Provider,{value:un,children:[x&&fe.jsx(gg,{handle:x,store:N}),Ce]});return(ce.type===void 0||ce.type==="context-menu")&&(Qe=fe.jsx($P,{externalTree:ne,children:Qe})),Qe});function Rj(t){const e=S.useContext(Sm);if(e===null)return fe.jsx(_I,{...t});const n=e.Root;return fe.jsx(Sm.Provider,{value:null,children:fe.jsx(n,{...e.options,...t})})}const Aj={};function dne(t){Lr();const e=S.useContext(Sm);if(e!==null){const n=e.SubmenuRoot;return fe.jsx(Sm.Provider,{value:null,children:fe.jsx(n,{...e.options,...t})})}return fe.jsx(OI.Provider,{value:Aj,children:fe.jsx(_I,{...t,isSubmenu:!0})})}const op=5;function HI(t,e){const n=Oj(e);return t.clientX>=n.left-op&&t.clientX<=n.right+op&&t.clientY>=n.top-op&&t.clientY<=n.bottom+op}function Oj(t){const e=t.getBoundingClientRect(),n=Jt(t);if(aw)return e;const i=n.getComputedStyle(t,"::before"),r=n.getComputedStyle(t,"::after");if(!(i.content!=="none"||r.content!=="none"))return e;const a=parseFloat(i.width)||0,c=parseFloat(i.height)||0,f=parseFloat(r.width)||0,h=parseFloat(r.height)||0,m=Math.max(e.width,a,f),p=Math.max(e.height,c,h),y=m-e.width,b=p-e.height;return{left:e.left-y/2,right:e.right+y/2,top:e.top-b/2,bottom:e.bottom+b/2}}function Mj(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:i}=rw(),{ref:r,index:o}=ad(t),a=n===o,c=S.useRef(null),f=Ws(r,c);return{compositeProps:{tabIndex:a?0:-1,onFocus(){i(o)},onMouseMove(){const m=c.current;if(!e||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!a&&!p&&m.focus()}},compositeRef:f,index:o}}function Dj(t){const{render:e,className:n,style:i,state:r=At,props:o=Hl,refs:a=Hl,metadata:c,stateAttributesMapping:f,tag:h="div",...m}=t,{compositeProps:p,compositeRef:y}=Mj({metadata:c});return Ot(h,t,{state:r,ref:[y,...a],props:[p,...o,m],stateAttributesMapping:f})}function zw(t){if(Xt(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!js(t))return zw(Xs(t))}function FI(t,e){function n(o,a,c){const f=o.currentTarget;Ln.flushSync(()=>{t.setOpen(!1,Ze($s,o.nativeEvent,f))}),jF(f.isConnected?f:e.current,a,c)?.focus()}function i(o){n(o,-1,t.select("positionerElement"))}function r(o){const a=t.select("positionerElement");a&&pu(o,a)?t.context.beforeContentFocusGuardRef.current?.focus():n(o,1,a)}return{handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function kj(t){const{enabled:e=!0,mouseDownAction:n,open:i}=t,r=S.useRef(!1);return S.useMemo(()=>e?{onMouseDown:o=>{(n==="open"&&!i||n==="close"&&i)&&(r.current=!0,xt(o.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:o=>{r.current&&(r.current=!1,o.preventBaseUIHandler())}}:At,[e,n,i])}const hne=Cg(function(e,n){const{render:i,className:r,style:o,disabled:a=!1,nativeButton:c=!0,id:f,openOnHover:h,delay:m=100,closeDelay:p=0,handle:y,payload:b,...x}=e,w=Lr(!0),E=Tg(y)??w?.store;if(!E)throw new Error(en(85));const O=vi(f),T=E.useState("isTriggerActive",O),A=E.useState("floatingRootContext"),D=E.useState("isOpenedByTrigger",O),k=E.useState("triggerControlsId",O),M=S.useRef(null),I=Ij(),L=rw(!0),B=Qo(),H=S.useMemo(()=>B??new Sw,[B]),U=xw(H),F=$o(),{registerTrigger:K,isMountedByThisTrigger:z}=bg(O,M,E,{payload:b,closeDelay:p,parent:I,floatingTreeRoot:H,floatingNodeId:U,floatingParentNodeId:F,keyboardEventRelay:L?.relayKeyboardEvent}),V=I.type==="menubar",X=E.useState("disabled"),j=a||X||V&&I.context.disabled,{getButtonProps:Y,buttonRef:$}=Xo({disabled:j,native:c});S.useEffect(()=>{!D&&I.type===void 0&&(E.context.allowMouseUpTriggerRef.current=!1)},[E,D,I.type]);const te=S.useRef(null),N=wn(),ne=He(Ie=>{if(!te.current)return;N.clear(),E.context.allowMouseUpTriggerRef.current=!1;const de=Ie.target;Ye(te.current,de)||Ye(E.select("positionerElement"),de)||de===te.current||de!=null&&zw(de)===E.select("rootId")||HI(Ie,te.current)||H.events.emit("close",{domEvent:Ie,reason:sw})});S.useEffect(()=>{const Ie=xt(te.current);if(D&&E.select("lastOpenChangeReason")===vn)return Ie.addEventListener("mouseup",ne,{once:!0}),()=>{Ie.removeEventListener("mouseup",ne)}},[D,ne,E]);const q=V&&I.context.hasSubmenuOpen,Z=Rg(A,{enabled:(h??q)&&!j&&(!V||q&&!z),handleClose:Og({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:I.type===void 0?m:void 0,delay:{close:p},triggerElementRef:M,externalTree:H,isActiveTrigger:T,isClosing:()=>E.select("transitionStatus")==="ending"}),ae=Pj(D,E.select("lastOpenChangeReason")),Se=id(A,{enabled:!j,event:D&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:I.type===void 0?ae:!1}),le=oI(A,{enabled:!j&&q}),ge=kj({open:D,enabled:V,mouseDownAction:"open"}),ce=S.useMemo(()=>Pi(le.reference,Se.reference),[le.reference,Se.reference]),ue=E.useState("triggerProps",z),Te=E.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ye,handleFocusTargetFocus:Pe}=FI(E,M),Ee={disabled:j,open:D},Me=[te,n,$,K,M],Be=[ce,Z??At,ue,{"aria-haspopup":"menu","aria-controls":k,id:O,onMouseDown:Ie=>{if(E.select("open"))return;N.start(200,()=>{E.context.allowMouseUpTriggerRef.current=!0}),xt(Ie.currentTarget).addEventListener("mouseup",ne,{once:!0})}},Te,V?{role:"menuitem"}:{},ge,x,Y],ve=Ot("button",e,{enabled:!V,stateAttributesMapping:Rf,state:Ee,ref:Me,props:Be});return V?fe.jsx(Dj,{tag:"button",render:i,className:r,style:o,state:Ee,refs:Me,props:Be,stateAttributesMapping:Rf}):D?fe.jsxs(S.Fragment,{children:[fe.jsx(Vo,{ref:E.context.beforeTriggerFocusGuardRef,onFocus:ye},`${O}-pre-focus-guard`),fe.jsx(S.Fragment,{children:ve},O),fe.jsx(Vo,{ref:E.context.triggerFocusTargetRef,onFocus:Pe},`${O}-post-focus-guard`)]}):fe.jsx(S.Fragment,{children:ve},O)});function Pj(t,e){const n=wn(),[i,r]=S.useState(!1);return De(()=>{t&&e===vn?(r(!0),n.start(FP,()=>{r(!1)})):t||(n.clear(),r(!1))},[t,e,n]),i}function Ij(){const t=VI();return S.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}function Nj(t){const[e,n]=S.useState({current:t,previous:null});return Object.is(t,e.current)||n({current:t,previous:e.current}),e.previous}const pne=S.forwardRef(function(e,n){const{className:i,render:r,orientation:o="horizontal",style:a,...c}=e;return Ot("div",e,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},c]})});function Lj(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const Bj={"aria-expanded":void 0},Vj=S.forwardRef(function(e,n){const{render:i,className:r,style:o,label:a,id:c,nativeButton:f=!1,openOnHover:h=!0,delay:m=100,closeDelay:p=0,disabled:y=!1,...b}=e,x=Lr(!0);if(x?.parent.type!=="menu")throw new Error(en(37));const w=wI(),C=MI(),{store:E,parentVirtualFocus:O}=x,T=x.parent.store,A=ad({guess:!0,label:a}),D=vi(c),k=E.useState("open"),M=S.useRef(!1),I=E.useState("positionerElement"),L=E.useState("floatingRootContext"),B=E.useState("floatingTreeRoot"),H=E.useState("triggerPopupId",D),U=eI(D,E),F=He(Ee=>{U(Ee);const Me=E.select("activeTriggerElement");Ee!==null&&E.select("open")&&(Me===Ee||E.select("activeTriggerId")==null)&&E.update({activeTriggerId:D??null,activeTriggerElement:Ee,closeDelay:p})}),K=S.useRef(null),z=S.useCallback(Ee=>{K.current=Ee,E.set("activeTriggerElement",Ee)},[E]);De(()=>(F(K.current),()=>F(null)),[F,D,E]),De(()=>{if(!k||!I)return;function Ee(Me){zn(Me)===E.context.beforeContentFocusGuardRef.current&&(M.current=Me.relatedTarget===K.current)}return I.addEventListener("focusout",Ee,!0),()=>{M.current=!1,I.removeEventListener("focusout",Ee,!0)}},[k,I,E]),E.useSyncedValue("closeDelay",p);const V=E.useState("disabled"),X=T.useState("disabled"),j=y||V||X,Y=T.useState("itemProps"),$=T.useState("isActive",A.index),te=S.useMemo(()=>({type:"submenu-trigger",setActive(Ee){T.select("highlightItemOnHover")&&T.setActiveIndex(A.index,bP,Ee)}}),[T,A.index]),{getItemProps:N,itemRef:ne}=Nw({closeOnClick:!1,disabled:j,highlighted:$,id:D,store:E,typingRef:T.context.typingRef,nativeButton:f,itemMetadata:te,nodeId:w?.context.nodeId}),q=E.useState("hoverEnabled"),G=Rg(L,{enabled:q&&h&&!j,handleClose:Og({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:m,delay:{open:m,close:p},shouldOpen:m>0?()=>T.select("allowMouseEnter"):void 0,triggerElementRef:K,externalTree:B,isClosing:()=>E.select("transitionStatus")==="ending",guardStaleOpen:!0}),ae=id(L,{enabled:!j,event:"mousedown",toggle:!0,ignoreMouse:h,stickIfOpen:h}).reference??At,Se=E.useState("triggerProps",!0);delete Se.id;const le={disabled:j,highlighted:$,open:k},ge=E.useState("openMethod"),ue=E.useState("lastOpenChangeReason")===Of||ge==="keyboard",Te=k&&ue&&xP,ye=C?.onTriggerKeyDown?{onKeyDown:C.onTriggerKeyDown}:void 0;return Ot("div",e,{state:le,stateAttributesMapping:Qf,props:[ae,G,Se,ye,Y,Te?Bj:void 0,{"aria-controls":H,tabIndex:O||!(k||$)?-1:0,onFocus(Ee){E.select("open")&&M.current&&(M.current=!1,E.setOpen(!1,Ze($s,Ee.nativeEvent)))},onBlur(){$&&T.setActiveIndex(null,dr)}},b,N],ref:[n,A.ref,ne,F,z]})}),mne=S.forwardRef(function(e,n){const i=Iw(e,n,"submenu-trigger");if(!i.visible)return null;const r=i.props?Pi(i.props,e):e;return fe.jsx(Vj,{...r,ref:i.ref})});function yS(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function zj(t){return typeof t=="object"&&t!=null&&Array.isArray(t.items)}function UI(t){return zj(t?.[0])}function _j(t){return UI(t)?t.flatMap(e=>e.items):t}function Hj(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(UI(e)){for(const n of e)for(const i of n.items)if(i&&i.value==null&&i.label!=null)return!0;return!1}for(const n of e)if(n&&n.value==null&&n.label!=null)return!0;return!1}function jI(t,e){if(e&&t!=null)return e(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return yS(t)}function eu(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?yS(t.value):yS(t)}function KI(t,e,n){function i(){return jI(t,n)}if(n&&t!=null)return n(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(e&&!Array.isArray(e))return(Object.hasOwn(e,t)?e[t]:void 0)??i();if(Array.isArray(e)){const o=_j(e);if(t==null||typeof t!="object"){const a=o.find(c=>c.value===t);return a&&a.label!=null?a.label:i()}if("value"in t){const a=o.find(c=>c&&c.value===t.value);if(a&&a.label!=null)return a.label}}return i()}function Fj(t,e,n){return t.reduce((i,r,o)=>(o>0&&i.push(", "),i.push(fe.jsx(S.Fragment,{children:KI(r,e,n)},o)),i),[])}function Uj(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const jj=t=>{switch(t){case"success":return qj;case"info":return Wj;case"warning":return Gj;case"error":return Xj;default:return null}},Kj=Array(12).fill(0),Yj=({visible:t,className:e})=>be.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},be.createElement("div",{className:"sonner-spinner"},Kj.map((n,i)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),qj=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},be.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Gj=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},be.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Wj=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Xj=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),$j=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Qj=()=>{const[t,e]=be.useState(document.hidden);return be.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let Zj=1;const Jj=100,AO=t=>{var e;return typeof t?.id=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:Zj++};class e6{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Jj;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...i}=e,r=AO(e),o=this.pendingDismissals.get(r);o!==void 0&&(cancelAnimationFrame(o),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));const a=this.dismissedToasts.has(r),c=e.dismissible===void 0?!0:e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(h=>h.id!==r)),(a?void 0:this.toasts.find(h=>h.id===r))?this.toasts=this.toasts.map(h=>h.id===r?(this.publish({...h,...e,id:r,title:n}),{...h,...e,id:r,dismissible:c,title:n}):h):this.addToast({title:n,...i,dismissible:c,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(i=>{this.dismissedToasts.add(i.id),this.subscribers.forEach(r=>r({id:i.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(i=>i({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let i;n.loading!==void 0&&(i=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let o=i!==void 0,a;const c=r.then(async h=>{if(a=["resolve",h],be.isValidElement(h))o=!1,this.create({id:i,type:"default",message:h});else if(n6(h)&&!h.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,x=typeof p=="object"&&!be.isValidElement(p)?p:{message:p};this.create({id:i,type:"error",description:y,...x})}else if(h instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(h):n.error,y=typeof n.description=="function"?await n.description(h):n.description,x=typeof p=="object"&&!be.isValidElement(p)?p:{message:p};this.create({id:i,type:"error",description:y,...x})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(h):n.success,y=typeof n.description=="function"?await n.description(h):n.description,x=typeof p=="object"&&!be.isValidElement(p)?p:{message:p};this.create({id:i,type:"success",description:y,...x})}}).catch(async h=>{if(a=["reject",h],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(h):n.error,p=typeof n.description=="function"?await n.description(h):n.description,b=typeof m=="object"&&!be.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:p,...b})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((h,m)=>c.then(()=>a[0]==="reject"?m(a[1]):h(a[1])).catch(m));return typeof i!="string"&&typeof i!="number"?{unwrap:f}:Object.assign(i,{unwrap:f})},this.custom=(e,n)=>{const i=AO(n);return this.create({...n,jsx:e(i),id:i,type:void 0}),i},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Oi=new e6,t6=(t,e)=>Oi.message(t,e),n6=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",i6=t6,r6=()=>Oi.toasts,s6=()=>Oi.getActiveToasts(),o6=Object.assign(i6,{success:Oi.success,info:Oi.info,warning:Oi.warning,error:Oi.error,custom:Oi.custom,message:Oi.message,promise:Oi.promise,dismiss:Oi.dismiss,loading:Oi.loading},{getHistory:r6,getToasts:s6});Uj("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function lp(t){return t.label!==void 0}const l6=3,a6="24px",u6="16px",OO=4e3,c6=356,f6=14,d6=45,h6=200;function Xr(...t){return t.filter(Boolean).join(" ")}function p6(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}const m6=t=>{var e,n,i,r,o,a,c,f,h;const{invert:m,toast:p,unstyled:y,interacting:b,setHeights:x,visibleToasts:w,heights:C,index:E,toasts:O,expanded:T,removeToast:A,defaultRichColors:D,closeButton:k,style:M,cancelButtonStyle:I,actionButtonStyle:L,className:B="",descriptionClassName:H="",duration:U,position:F,gap:K,expandByDefault:z,classNames:V,icons:X,closeButtonAriaLabel:j="Close toast"}=t,[Y,$]=be.useState(null),[te,N]=be.useState(null),[ne,q]=be.useState(!1),[G,Z]=be.useState(!1),[ae,Se]=be.useState(!1),[le,ge]=be.useState(!1),[ce,ue]=be.useState(!1),[Te,ye]=be.useState(0),[Pe,Ee]=be.useState(0),Me=be.useRef(p.duration||U||OO),Be=be.useRef(null),ve=be.useRef(null),Ie=E===0,de=E+1<=w,ke=p.type,it=ke??"default",tt=p.dismissible!==!1,se=p.className||"",me=p.descriptionClassName||"",_e=be.useMemo(()=>C.findIndex(Ce=>Ce.toastId===p.id)||0,[C,p.id]),we=be.useMemo(()=>{var Ce;return(Ce=p.closeButton)!=null?Ce:k},[p.closeButton,k]),Re=be.useMemo(()=>p.duration||U||OO,[p.duration,U]),gt=be.useRef(0),Je=be.useRef(0),rt=be.useRef(0),Et=be.useRef(null),[yt,hn]=F.split("-"),qt=be.useMemo(()=>C.reduce((Ce,Qe,Ae)=>Ae>=_e?Ce:Ce+Qe.height,0),[C,_e]),tn=Qj(),qe=be.useMemo(()=>{var Ce;return(Ce=t.swipeDirections)!=null?Ce:p6(F)},[t.swipeDirections,F]),st=p.invert||m,Lt=ke==="loading";Je.current=be.useMemo(()=>_e*K+qt,[_e,qt]),be.useEffect(()=>{Me.current=Re},[Re]),be.useEffect(()=>{q(!0)},[]),be.useEffect(()=>{const Ce=ve.current;if(Ce){const Qe=Ce.getBoundingClientRect().height;return Ee(Qe),x(Ae=>[{toastId:p.id,height:Qe,position:p.position},...Ae]),()=>x(Ae=>Ae.filter(Oe=>Oe.toastId!==p.id))}},[x,p.id]),be.useLayoutEffect(()=>{if(!ne)return;const Ce=ve.current,Qe=Ce.style.height;Ce.style.height="auto";const Ae=Ce.getBoundingClientRect().height;Ce.style.height=Qe,Ee(Ae),x(Oe=>Oe.find(Xe=>Xe.toastId===p.id)?Oe.map(Xe=>Xe.toastId===p.id?{...Xe,height:Ae}:Xe):[{toastId:p.id,height:Ae,position:p.position},...Oe])},[ne,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const ot=be.useCallback(()=>{Z(!0),ye(Je.current),x(Ce=>Ce.filter(Qe=>Qe.toastId!==p.id)),setTimeout(()=>{A(p)},h6)},[p,A,x,Je]);be.useEffect(()=>{if(p.promise&&ke==="loading"||p.duration===1/0||p.type==="loading")return;let Ce;return T||b||tn?(()=>{if(rt.current<gt.current){const Oe=new Date().getTime()-gt.current;Me.current=Me.current-Oe}rt.current=new Date().getTime()})():Me.current!==1/0&&(gt.current=new Date().getTime(),Ce=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),ot()},Me.current)),()=>clearTimeout(Ce)},[T,b,p,ke,tn,ot]),be.useEffect(()=>{p.delete&&(ot(),p.onDismiss==null||p.onDismiss.call(p,p))},[ot,p.delete]);function lt(){var Ce;if(X?.loading){var Qe;return be.createElement("div",{className:Xr(V?.loader,p==null||(Qe=p.classNames)==null?void 0:Qe.loader,"sonner-loader"),"data-visible":ke==="loading"},X.loading)}return be.createElement(Yj,{className:Xr(V?.loader,p==null||(Ce=p.classNames)==null?void 0:Ce.loader),visible:ke==="loading"})}const vt=p.icon||X?.[ke]||jj(ke);var Tt,un;return be.createElement("li",{tabIndex:0,ref:ve,className:Xr(B,se,V?.toast,p==null||(e=p.classNames)==null?void 0:e.toast,V?.[it],p==null||(n=p.classNames)==null?void 0:n[it]),"data-sonner-toast":"","data-rich-colors":(Tt=p.richColors)!=null?Tt:D,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":ne,"data-promise":!!p.promise,"data-swiped":ce,"data-removed":G,"data-visible":de,"data-y-position":yt,"data-x-position":hn,"data-index":E,"data-front":Ie,"data-swiping":ae,"data-dismissible":tt,"data-type":ke,"data-invert":st,"data-swipe-out":le,"data-swipe-direction":te,"data-expanded":!!(T||z&&ne),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":O.length-E,"--offset":`${G?Te:Je.current}px`,"--initial-height":z?"auto":`${Pe}px`,...M,...p.style},onDragEnd:()=>{Se(!1),$(null),Et.current=null},onPointerDown:Ce=>{Ce.button!==2&&(Lt||!tt||(Be.current=new Date,ye(Je.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(Se(!0),Et.current={x:Ce.clientX,y:Ce.clientY})))},onPointerUp:()=>{var Ce,Qe,Ae;if(le||!tt)return;Et.current=null;const Oe=Number(((Ce=ve.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ke=Number(((Qe=ve.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xe=new Date().getTime()-((Ae=Be.current)==null?void 0:Ae.getTime()),dt=Y==="x"?Oe:Ke,Ge=Math.abs(dt)/Xe;if((Y==="x"?qe.includes(Oe>0?"right":"left"):qe.includes(Ke>0?"bottom":"top"))&&(Math.abs(dt)>=d6||Ge>.11)){ye(Je.current),p.onDismiss==null||p.onDismiss.call(p,p),N(Y==="x"?Oe>0?"right":"left":Ke>0?"down":"up"),ot(),ge(!0);return}else{var pt,zt;(pt=ve.current)==null||pt.style.setProperty("--swipe-amount-x","0px"),(zt=ve.current)==null||zt.style.setProperty("--swipe-amount-y","0px")}ue(!1),Se(!1),$(null)},onPointerMove:Ce=>{var Qe,Ae,Oe;if(!Et.current||!tt||((Qe=window.getSelection())==null?void 0:Qe.toString().length)>0)return;const Xe=Ce.clientY-Et.current.y,dt=Ce.clientX-Et.current.x;!Y&&(Math.abs(dt)>1||Math.abs(Xe)>1)&&$(Math.abs(dt)>Math.abs(Xe)?"x":"y");let Ge={x:0,y:0};const at=pt=>1/(1.5+Math.abs(pt)/20);if(Y==="y"){if(qe.includes("top")||qe.includes("bottom"))if(qe.includes("top")&&Xe<0||qe.includes("bottom")&&Xe>0)Ge.y=Xe;else{const pt=Xe*at(Xe);Ge.y=Math.abs(pt)<Math.abs(Xe)?pt:Xe}}else if(Y==="x"&&(qe.includes("left")||qe.includes("right")))if(qe.includes("left")&&dt<0||qe.includes("right")&&dt>0)Ge.x=dt;else{const pt=dt*at(dt);Ge.x=Math.abs(pt)<Math.abs(dt)?pt:dt}(Math.abs(Ge.x)>0||Math.abs(Ge.y)>0)&&ue(!0),(Ae=ve.current)==null||Ae.style.setProperty("--swipe-amount-x",`${Ge.x}px`),(Oe=ve.current)==null||Oe.style.setProperty("--swipe-amount-y",`${Ge.y}px`)}},we&&!p.jsx&&ke!=="loading"?be.createElement("button",{"aria-label":j,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!tt?()=>{}:()=>{ot(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Xr(V?.closeButton,p==null||(i=p.classNames)==null?void 0:i.closeButton)},(un=X?.close)!=null?un:$j):null,(ke||p.icon||p.promise)&&p.icon!==null&&(X?.[ke]!==null||p.icon)?be.createElement("div",{"data-icon":"",className:Xr(V?.icon,p==null||(r=p.classNames)==null?void 0:r.icon)},ke==="loading"?p.icon||lt():p.promise?lt():null,ke!=="loading"?vt:null):null,be.createElement("div",{"data-content":"",className:Xr(V?.content,p==null||(o=p.classNames)==null?void 0:o.content)},be.createElement("div",{"data-title":"",className:Xr(V?.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?be.createElement("div",{"data-description":"",className:Xr(H,me,V?.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),be.isValidElement(p.cancel)?p.cancel:p.cancel&&lp(p.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||I,onClick:Ce=>{lp(p.cancel)&&tt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ce),ot())},className:Xr(V?.cancelButton,p==null||(f=p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,be.isValidElement(p.action)?p.action:p.action&&lp(p.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Ce=>{lp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ce),!Ce.defaultPrevented&&ot())},className:Xr(V?.actionButton,p==null||(h=p.classNames)==null?void 0:h.actionButton)},p.action.label):null)};function MO(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function g6(t,e){const n={};return[t,e].forEach((i,r)=>{const o=r===1,a=o?"--mobile-offset":"--offset",c=o?u6:a6;function f(h){["top","right","bottom","left"].forEach(m=>{n[`${a}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof i=="number"||typeof i=="string"?f(i):typeof i=="object"?["top","right","bottom","left"].forEach(h=>{i[h]===void 0?n[`${a}-${h}`]=c:n[`${a}-${h}`]=typeof i[h]=="number"?`${i[h]}px`:i[h]}):f(c)}),n}const y6=be.forwardRef(function(e,n){const{id:i,invert:r,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:f,className:h,offset:m,mobileOffset:p,theme:y="light",richColors:b,duration:x,style:w,visibleToasts:C=l6,toastOptions:E,dir:O=MO(),gap:T=f6,icons:A,customAriaLabel:D,containerAriaLabel:k="Notifications"}=e,[M,I]=be.useState([]),L=be.useMemo(()=>i?M.filter(q=>q.toasterId===i):M.filter(q=>!q.toasterId),[M,i]),B=be.useMemo(()=>Array.from(new Set([o].concat(L.filter(q=>q.position).map(q=>q.position)))),[L,o]),[H,U]=be.useState([]),[F,K]=be.useState(!1),[z,V]=be.useState(!1),[X,j]=be.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=be.useRef(null),$=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=be.useRef(null),N=be.useRef(!1),ne=be.useCallback(q=>{I(G=>{var Z;return(Z=G.find(ae=>ae.id===q.id))!=null&&Z.delete||Oi.dismiss(q.id),G.filter(({id:ae})=>ae!==q.id)})},[]);return be.useEffect(()=>Oi.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{I(G=>G.map(Z=>Z.id===q.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{qF.flushSync(()=>{I(G=>{const Z=G.findIndex(ae=>ae.id===q.id);return Z!==-1?[...G.slice(0,Z),{...G[Z],...q},...G.slice(Z+1)]:[q,...G]})})})}),[]),be.useEffect(()=>{if(y!=="system"){j(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:G})=>{j(G?"dark":"light")})}catch{q.addListener(({matches:Z})=>{try{j(Z?"dark":"light")}catch(ae){console.error(ae)}})}},[y]),be.useEffect(()=>{M.length<=1&&K(!1)},[M]),be.useEffect(()=>{const q=G=>{var Z;if(a.length>0&&a.every(le=>G[le]||G.code===le)){var Se;K(!0),(Se=Y.current)==null||Se.focus()}G.code==="Escape"&&(document.activeElement===Y.current||(Z=Y.current)!=null&&Z.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[a]),be.useEffect(()=>{if(Y.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,N.current=!1)}},[Y.current]),be.createElement("section",{ref:n,"aria-label":D??`${k} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},B.map((q,G)=>{var Z;const[ae,Se]=q.split("-");return L.length?be.createElement("ol",{key:q,dir:O==="auto"?MO():O,tabIndex:-1,ref:Y,className:h,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ae,"data-x-position":Se,style:{"--front-toast-height":`${((Z=H[0])==null?void 0:Z.height)||0}px`,"--width":`${c6}px`,"--gap":`${T}px`,...w,...g6(m,p)},onBlur:le=>{N.current&&!le.currentTarget.contains(le.relatedTarget)&&(N.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||N.current||(N.current=!0,te.current=le.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{z||K(!1)},onDragEnd:()=>K(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},L.filter(le=>!le.position&&G===0||le.position===q).map((le,ge)=>{var ce,ue;return be.createElement(m6,{key:le.id,icons:A,index:ge,toast:le,defaultRichColors:b,duration:(ce=E?.duration)!=null?ce:x,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:r,visibleToasts:C,closeButton:(ue=E?.closeButton)!=null?ue:f,interacting:z,position:q,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:ne,toasts:L.filter(Te=>Te.position==le.position),heights:H.filter(Te=>Te.position==le.position),setHeights:U,expandByDefault:c,gap:T,expanded:F,swipeDirections:e.swipeDirections})})):null}))}),gne=Object.freeze(Object.defineProperty({__proto__:null,Toaster:y6,toast:o6},Symbol.toStringTag,{value:"Module"}));function v6(t){if(!t)return null;for(const e of t.elements){const n=e.tagName;if(n==="BUTTON"||n==="INPUT"){const i=e;if(i.type==="submit")return i}}return null}const b6="data-valid",S6="data-invalid",x6={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},w6={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},C6={disabled:!1,...w6},YI={valid(t){return t===null?null:t?{[b6]:""}:{[S6]:""}}},E6="data-checked",T6="data-unchecked";function qI(t){return{checked(e){return t.indeterminate?{}:e?{[E6]:""}:{[T6]:""}},...YI}}const R6={invalid:void 0,name:void 0,validityData:{state:x6,errors:[],error:"",value:"",initialValue:null},setValidityData:ln,disabled:void 0,setTouched:ln,setDirty:ln,setFilled:ln,setFocused:ln,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:C6,registerFieldControl:ln,validation:{getValidationProps:(t,e=At)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:ln,getInputControl:()=>null,commit:async()=>{},change:ln}},A6=S.createContext(R6);function cd(t=!0){const e=S.useContext(A6);if(e.setValidityData===ln&&!t)throw new Error(en(28));return e}function GI(t,e,n){const{setFocused:i,focusOwnerRef:r}=cd(),o=He(a=>{(a?!t:r.current===o)&&(r.current=a&&o,i(a))});return De(()=>{const a=e.current;return a?.getRootNode()?.activeElement===a&&o(!0),()=>o(!1)},[t,e,o]),o}function WI(t,e,n,i,r=!0,o){const{registerFieldControl:a}=cd(),c=kn(()=>Symbol());De(()=>{const f=c.current;if(!r){a(f,void 0);return}a(f,{controlRef:t,getValue:i,id:e,name:o,value:n})},[t,r,i,e,o,a,c,n]),De(()=>{const f=c.current;return()=>{a(f,void 0)}},[a,c])}const O6=S.createContext({disabled:!1});function M6(){return S.useContext(O6)}const D6=S.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ln,validationMode:"onSubmit",submitCountRef:{current:0}});function XI(){return S.useContext(D6)}const k6=S.createContext({controlId:void 0,registerControlId:ln,resetControlId:ln,labelId:void 0,setLabelId:ln,messageIds:[],setMessageIds:ln,getDescriptionProps:t=>t});function _w(){return S.useContext(k6)}function P6(t,e,n,i=!0,r,o){const[a,c]=S.useState(),f=vi(r?`${r}-label`:void 0),h=!!o?.trim(),p=t??(h?void 0:e)??a;return De(()=>{const y=t||e||h||!i?void 0:I6(n.current,f);a!==y&&c(y)}),p}function I6(t,e){const n=N6(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}function N6(t){if(!t)return;const e=t.parentElement;if(e&&e.tagName==="LABEL")return e;const n=t.id;if(n){const r=t.nextElementSibling;if(r&&r.htmlFor===n)return r}const i=t.labels;return i&&i[0]}function Hw(t={}){const{id:e,enabled:n=!0}=t,{controlId:i,registerControlId:r,resetControlId:o}=_w(),a=vi(),c=kn(()=>Symbol()),f=S.useRef(!1),h=S.useRef(!1),m=He(()=>{!f.current||r===ln||(f.current=!1,r(c.current,void 0))});return De(()=>{if(!n||r===ln){m();return}let p;if(e!==void 0)h.current=!0,p=e;else if(h.current)p=a;else{o();return}if(p===void 0){m();return}f.current=!0,r(c.current,p)},[e,n,r,o,a,c,m]),De(()=>m,[m]),(n?i:void 0)??e??a}const L6=S.createContext(void 0);function B6(){return S.useContext(L6)}const $I=S.createContext(void 0);function V6(){const t=S.useContext($I);if(t===void 0)throw new Error(en(14));return t}const z6="data-parent",yne=S.forwardRef(function(e,n){const{checked:i,className:r,defaultChecked:o=!1,"aria-labelledby":a,disabled:c=!1,form:f,id:h,indeterminate:m=!1,inputRef:p,name:y,onCheckedChange:b,parent:x=!1,readOnly:w=!1,render:C,required:E=!1,uncheckedValue:O,value:T,nativeButton:A=!1,style:D,...k}=e,{clearErrors:M}=XI(),{disabled:I,name:L,setDirty:B,setFilled:H,setTouched:U,state:F,validationMode:K,validityData:z,validation:V}=cd(),X=M6(),{labelId:j,registerControlId:Y,getDescriptionProps:$}=_w(),te=B6(),N=te?.allValues===void 0?void 0:te.parent,ne=N!==void 0,q=I||X.disabled||te?.disabled||c,G=L??y,Z=T??G,ae=vi(),Se=te?.registerControlId!==Y,le=Hw({id:h||void 0,enabled:Se}),ge=A?le:ae;let ce={};ne&&(x?ce=N.getParentProps():Z!==void 0&&(ce=N.getChildProps(Z)));const{checked:ue=i,indeterminate:Te=m,onCheckedChange:ye,...Pe}=ce,Ee=te?.value,Me=S.useRef(null),Be=GI(q,Me),{getButtonProps:ve,buttonRef:Ie}=Xo({disabled:q,native:A}),de=te?.validation??V,[ke,it]=bm({controlled:Z!==void 0&&Ee!==void 0&&!x?Ee.includes(Z):ue,default:o,name:"Checkbox",state:"checked"}),tt=ne?!!ue:ke,se=ne&&Te||m;WI(Me,ae,ke,void 0,!te&&!q,y);const me=N?.registerChildId,_e=S.useRef(null),we=de.registerInput,Re=te?Z:void 0,gt=S.useCallback(qe=>we(qe,{controlRef:Me,value:Re}),[we,Re]),Je=Ws(p,_e,x?void 0:gt),rt=P6(a,j,_e,!A,le,k["aria-label"]);De(()=>{_e.current&&(_e.current.indeterminate=se),te||H(ke)},[ke,se,te,H]),Dw(ke,()=>{te||(M(G),B(ke!==z.initialValue),de.change(ke))});const Et=Pi({checked:ke,disabled:q,form:f,name:x?void 0:G,id:A?void 0:le,required:E,ref:Je,style:G?AP:fw,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(qe){if(qe.nativeEvent.defaultPrevented)return;if(w){qe.preventDefault();return}const st=qe.currentTarget.checked,Lt=Ze(dr,qe.nativeEvent);if(b?.(st,Lt),!Lt.isCanceled&&(ye?.(st,Lt),!Lt.isCanceled&&(it(st),Z!==void 0&&te!==void 0&&!x&&!ne))){const ot=st?[...te.value,Z]:te.value.filter(lt=>lt!==Z);te.setValue(ot,Lt)}},onClick(qe){qe.stopPropagation()},onFocus(){Me.current?.focus()}},T!==void 0?{value:(te?ke&&T:T)||""}:At,$,qe=>de.getValidationProps(q,qe));S.useEffect(()=>{if(!N||Z===void 0)return;const qe=N.disabledStatesRef.current;return qe.set(Z,q),()=>{qe.delete(Z)}},[N,q,Z]);const yt=S.useMemo(()=>({...F,checked:tt,disabled:q,readOnly:w,required:E,indeterminate:se}),[F,tt,q,w,E,se]),hn=qI(yt),qt=Ot("span",e,{state:yt,ref:[Ie,Me,n],props:[{id:ge,role:"checkbox","aria-checked":se?"mixed":tt,"aria-readonly":w||void 0,"aria-required":E||void 0,"aria-labelledby":rt,[z6]:x?"":void 0,onFocus(){Be(!0)},onBlur(){const qe=_e.current;qe&&(U(!0),Be(!1),K==="onBlur"&&de.commit(te?Ee:qe.checked))},onKeyDown(qe){if(qe.key!=="Enter"||(qe.preventBaseUIHandler(),qe.defaultPrevented))return;const st=_e.current?.form??null,Lt=qe.currentTarget,ot=qe.nativeEvent,lt=qe.preventDefault,vt=ot.preventDefault;let Tt=!1;qe.preventDefault=()=>{Tt=!0,lt.call(qe)},ot.preventDefault=()=>{Tt=!0,vt.call(ot)},vt.call(ot),Jt(Lt).queueMicrotask(()=>{qe.preventDefault=lt,ot.preventDefault=vt,Tt||v6(st)?.click()})},onClick(qe){if(w||q)return;qe.preventDefault();const st=_e.current;st&&ff(st,qe)}},k,Pe,ve,$,qe=>de.getValidationProps(q,qe)],stateAttributesMapping:hn}),tn=qt.props.id;return De(()=>{if(!(!me||x||Z===void 0||tn===void 0))return me(Z,tn)},[me,x,Z,tn]),fe.jsxs($I.Provider,{value:yt,children:[qt,!ke&&!te&&G&&!x&&O!==void 0&&fe.jsx("input",{type:"hidden",form:f,name:G,value:O,disabled:q}),fe.jsx("input",{...Et,suppressHydrationWarning:!0})]})}),vne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,keepMounted:a=!1,...c}=e,f=V6(),h=f.checked||f.indeterminate,{mounted:m,transitionStatus:p,setMounted:y}=mg(h),b=S.useRef(null),x={...f,transitionStatus:p};eo({batch:!0,enabled:!h,open:h,ref:b,onComplete(){h||y(!1)}});const C={...qI(f),...Fu},E=a||m,O=Ot("span",e,{ref:[n,b],state:x,stateAttributesMapping:C,props:c});return E?O:null});function is(t){const e=new Uint8Array(t);let n="";for(const r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xm(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4,i=e.padEnd(e.length+n,"="),r=atob(i),o=new ArrayBuffer(r.length),a=new Uint8Array(o);for(let c=0;c<r.length;c++)a[c]=r.charCodeAt(c);return o}function Fw(){return _6.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const _6={stubThis:t=>t};function QI(t){const{id:e}=t;return{...t,id:xm(e),transports:t.transports}}function ZI(t){return t==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)}class Jn extends Error{constructor({message:e,code:n,cause:i,name:r}){super(e,{cause:i}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??i.name,this.code=n}}function H6({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Jn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new Jn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new Jn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(n.authenticatorSelection?.userVerification==="required")return new Jn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Jn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Jn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return n.pubKeyCredParams.filter(r=>r.type==="public-key").length===0?new Jn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Jn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const i=globalThis.location.hostname;if(ZI(i)){if(n.rp.id!==i)return new Jn({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Jn({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Jn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Jn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}class F6{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const JI=new F6,U6=["cross-platform","platform"];function eN(t){if(t&&!(U6.indexOf(t)<0))return t}async function bne(t){!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useAutoRegister:n=!1}=t;if(!Fw())throw new Error("WebAuthn is not supported in this browser");const i={...e,challenge:xm(e.challenge),user:{...e.user,id:xm(e.user.id)},excludeCredentials:e.excludeCredentials?.map(QI)},r={};n&&(r.mediation="conditional"),r.publicKey=i,r.signal=JI.createNewAbortSignal();let o;try{o=await navigator.credentials.create(r)}catch(x){throw H6({error:x,options:r})}if(!o)throw new Error("Registration was not completed");const{id:a,rawId:c,response:f,type:h}=o;let m;typeof f.getTransports=="function"&&(m=f.getTransports());let p;if(typeof f.getPublicKeyAlgorithm=="function")try{p=f.getPublicKeyAlgorithm()}catch(x){sb("getPublicKeyAlgorithm()",x)}let y;if(typeof f.getPublicKey=="function")try{const x=f.getPublicKey();x!==null&&(y=is(x))}catch(x){sb("getPublicKey()",x)}let b;if(typeof f.getAuthenticatorData=="function")try{b=is(f.getAuthenticatorData())}catch(x){sb("getAuthenticatorData()",x)}return{id:a,rawId:is(c),response:{attestationObject:is(f.attestationObject),clientDataJSON:is(f.clientDataJSON),transports:m,publicKeyAlgorithm:p,publicKey:y,authenticatorData:b},type:h,clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:eN(o.authenticatorAttachment)}}function sb(t,e){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
10
+ `,e)}function j6(){if(!Fw())return ob.stubThis(new Promise(e=>e(!1)));const t=globalThis.PublicKeyCredential;return t?.isConditionalMediationAvailable===void 0?ob.stubThis(new Promise(e=>e(!1))):ob.stubThis(t.isConditionalMediationAvailable())}const ob={stubThis:t=>t};function K6({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Jn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Jn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const i=globalThis.location.hostname;if(ZI(i)){if(n.rpId!==i)return new Jn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Jn({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Jn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function Sne(t){!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:i=!0}=t;if(!Fw())throw new Error("WebAuthn is not supported in this browser");let r;e.allowCredentials?.length!==0&&(r=e.allowCredentials?.map(QI));const o={...e,challenge:xm(e.challenge),allowCredentials:r},a={};if(n){if(!await j6())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&i)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');a.mediation="conditional",o.allowCredentials=[]}a.publicKey=o,a.signal=JI.createNewAbortSignal();let c;try{c=await navigator.credentials.get(a)}catch(b){throw K6({error:b,options:a})}if(!c)throw new Error("Authentication was not completed");const{id:f,rawId:h,response:m,type:p}=c;let y;return m.userHandle&&(y=is(m.userHandle)),{id:f,rawId:is(h),response:{authenticatorData:is(m.authenticatorData),clientDataJSON:is(m.clientDataJSON),signature:is(m.signature),userHandle:y},type:p,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:eN(c.authenticatorAttachment)}}const tN=S.createContext(void 0);function fd(t){const e=S.useContext(tN);if(e===void 0&&!t)throw new Error(en(72));return e}const Y6={...Fs,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,appliedTriggerProps:(t,e)=>e?t.activeTriggerProps:void 0,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class q6 extends ju{constructor(e,n,i){const r=new od;super(G6(e,r,n,i),W6(r),Y6)}setOpen=(e,n)=>{rU(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Ze(gs,e))}}function G6(t,e,n,i=!1){return{...Eg(e,n,i),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}function W6(t){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const xne=ld(function(e){const{disabled:n=!1,defaultOpen:i=!1,open:r,disableHoverablePopup:o=!1,trackCursorAxis:a="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:h,handle:m,triggerId:p,defaultTriggerId:y=null,children:b}=e,x=Ew((H,U)=>new q6({open:i,openProp:r,activeTriggerId:y,triggerIdProp:p},H,U));x.useControlledProp("openProp",r),x.useControlledProp("triggerIdProp",p),x.useContextCallback("onOpenChange",f),x.useContextCallback("onOpenChangeComplete",h);const w=x.useState("open"),C=!n&&w,E=x.useState("activeTriggerId"),O=x.useState("mounted"),T=x.useState("payload");x.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:o,disabled:n}),Sg(x,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:D}=xg(C,x),k=x.useState("isInstantPhase"),M=x.useState("instantType"),I=x.useState("lastOpenChangeReason"),L=S.useRef(null);De(()=>{w&&n&&x.setOpen(!1,Ze(uF))},[w,n,x]),De(()=>{D==="ending"&&I===dr||D!=="ending"&&k?(M!=="delay"&&(L.current=M),x.set("instantType","delay")):L.current!==null&&(x.set("instantType",L.current),L.current=null)},[D,k,I,M,x]),De(()=>{C&&E==null&&x.set("payload",void 0)},[x,E,C]),S.useImperativeHandle(c,()=>({unmount:A,close:()=>x.setOpen(!1,Ze(td))}),[A,x]);const B=C||O||!n&&a!=="none";return fe.jsxs(tN.Provider,{value:x,children:[m&&fe.jsx(gg,{handle:m,store:x}),B&&fe.jsx(X6,{store:x,disabled:n,trackCursorAxis:a}),typeof b=="function"?b({payload:T}):b]})});function X6({store:t,disabled:e,trackCursorAxis:n}){const i=t.useState("floatingRootContext"),r=rd(i,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),o=eU(i,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),a=S.useMemo(()=>Pi(o.reference,r.reference),[o.reference,r.reference]);return wg(t,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:r.floating??At}),null}const nN=S.createContext(void 0);function $6(){return S.useContext(nN)}const Q6=600,DO="data-base-ui-tooltip-trigger";function kO(t){const e=zn(t);return Dt(e)?e:null}const wne=Cg(function(e,n){const{render:i,className:r,style:o,handle:a,payload:c,disabled:f,delay:h,closeOnClick:m=!0,closeDelay:p,id:y,...b}=e,x=fd(!0),C=Tg(a)??x;if(!C)throw new Error(en(82));const E=vi(y),O=C.useState("isTriggerActive",E),T=C.useState("isOpenedByTrigger",E),A=C.useState("floatingRootContext"),D=S.useRef(null),k=p??0,{registerTrigger:M,isMountedByThisTrigger:I}=bg(E,D,C,{payload:c,closeOnClick:m,closeDelay:k}),L=$6(),{activeIdRef:B,delayRef:H,isInstantPhase:U,hasProvider:F}=RF(A,{open:T}),K=Aw(A);C.useSyncedValue("isInstantPhase",U);const z=C.useState("disabled"),V=f??z,X=dn(V),j=C.useState("trackCursorAxis"),Y=C.useState("disableHoverablePopup"),$=S.useRef(!1),te=wn(),N=S.useRef(void 0);function ne(){return F&&B.current!=null?0:h??L??Q6}function q(ue){const Te=D.current;if(!Te||!ue)return!1;const ye=Df(ue,`[${DO}]`);return ye!==null&&ye!==Te&&Ye(Te,ye)}function G(ue){const Te=q(ue);return $.current=Te,Te&&(K.openChangeTimeout.clear(),K.restTimeout.clear(),K.restTimeoutPending=!1,te.clear()),Te}const Z=Rg(A,{enabled:!V,mouseOnly:!0,move:!1,handleClose:!Y&&j!=="both"?Og():null,restMs:ne,delay(){return p==null&&F?{close:Ul(H.current,"close")}:{close:k}},triggerElementRef:D,isActiveTrigger:O,isClosing:()=>C.select("transitionStatus")==="ending",shouldOpen(){return!$.current}}),ae=oI(A,{enabled:!V}).reference,Se=ue=>{const Te=$.current,ye=kO(ue),Pe=G(ye),Ee=D.current,Me=Ee&&ye&&Ye(Ee,ye);if(Pe&&C.select("open")&&C.select("lastOpenChangeReason")===vn){C.setOpen(!1,Ze(vn,ue));return}if(Te&&!Pe&&Me&&!X.current&&!C.select("open")&&Ee&&Bo(N.current)){const Be=()=>{!$.current&&!X.current&&!C.select("open")&&C.setOpen(!0,Ze(vn,ue,Ee))},ve=ne();ve===0?(te.clear(),Be()):te.start(ve,Be)}},le=C.useState("appliedTriggerProps",I||j!=="none");return Ot("button",e,{state:{open:T},ref:[n,M,D],props:[Z,ae,le,{onMouseOver(ue){Se(ue.nativeEvent)},onFocus(ue){q(kO(ue.nativeEvent))&&ue.preventBaseUIHandler()},onMouseLeave(){$.current=!1,te.clear(),N.current=void 0},onPointerEnter(ue){N.current=ue.pointerType},onPointerDown(ue){N.current=ue.pointerType,C.set("closeOnClick",m),m&&!C.select("open")&&C.cancelPendingOpen(ue.nativeEvent)},onClick(ue){m&&!C.select("open")&&C.cancelPendingOpen(ue.nativeEvent)},id:E,[cS]:V?"":void 0,[DO]:V?void 0:""},b],stateAttributesMapping:Qf})}),iN=S.createContext(void 0);function Z6(){const t=S.useContext(iN);if(t===void 0)throw new Error(en(70));return t}const J6=S.forwardRef(function(e,n){const{children:i,container:r,className:o,render:a,style:c,...f}=e,{node:h,subtree:m}=YP({container:r,ref:n,componentProps:e,elementProps:f});return!m&&!h?null:fe.jsxs(S.Fragment,{children:[m,h&&Ln.createPortal(i,h)]})}),Cne=S.forwardRef(function(e,n){const{keepMounted:i=!1,...r}=e;return fd().useState("mounted")||i?fe.jsx(iN.Provider,{value:i,children:fe.jsx(J6,{ref:n,...r})}):null}),rN=S.createContext(void 0);function sN(){const t=S.useContext(rN);if(t===void 0)throw new Error(en(71));return t}const Ene=S.forwardRef(function(e,n){const{render:i,className:r,anchor:o,positionMethod:a="absolute",side:c="top",align:f="center",sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=bw,style:E,...O}=e,T=fd(),A=Z6(),D=T.useState("open"),k=T.useState("mounted"),M=T.useState("trackCursorAxis"),I=T.useState("disableHoverablePopup"),L=T.useState("floatingRootContext"),B=T.useState("instantType"),H=T.useState("transitionStatus"),U=T.useState("adaptiveOrigin"),F=Bg({anchor:o,positionMethod:a,floatingRootContext:L,mounted:k,side:c,sideOffset:h,align:f,alignOffset:m,collisionBoundary:p,collisionPadding:y,sticky:x,arrowPadding:b,disableAnchorTracking:w,keepMounted:A,collisionAvoidance:C,adaptiveOrigin:U}),K=S.useMemo(()=>({open:D,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:M!=="none"?"tracking-cursor":B}),[D,F.side,F.align,F.anchorHidden,M,B]),z=Vg(e,K,{styles:F.positionerStyles,transitionStatus:H,props:O,refs:[n,T.useStateSetter("positionerElement")],hidden:!k,inert:!D||M==="both"||I});return fe.jsx(rN.Provider,{value:F,children:z})}),Tne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,c=fd(),{side:f,align:h}=sN(),m=c.useState("open"),p=c.useState("instantType"),y=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("floatingRootContext"),w=c.useState("disabled"),C=c.useState("closeDelay");eo({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),Ow(x,{enabled:!w,closeDelay:C});const E=c.useStateSetter("popupElement");return Ot("div",e,{state:{open:m,side:f,align:h,instant:p,transitionStatus:y},ref:[n,c.context.popupRef,E],props:[sd,b,ud(y),a],stateAttributesMapping:tg})}),Rne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,c=fd(),{arrowRef:f,side:h,align:m,arrowUncentered:p,arrowStyles:y}=sN(),b=c.useState("open"),x=c.useState("instantType");return Ot("div",e,{state:{open:b,side:h,align:m,uncentered:p,instant:x},ref:[n,f],props:[{style:y,"aria-hidden":!0},a],stateAttributesMapping:Zf})}),Ane=function(e){const{delay:n,closeDelay:i,timeout:r=400}=e,o=S.useMemo(()=>({open:n,close:i}),[n,i]);return fe.jsx(nN.Provider,{value:n,children:fe.jsx(TF,{delay:o,timeoutMs:r,children:e.children})})};let vS=[],oN=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?oN:vS).push(n=n+t[e])})();function e9(t){if(t<768)return!1;for(let e=0,n=vS.length;;){let i=e+n>>1;if(t<vS[i])n=i;else if(t>=oN[i])e=i+1;else return!0;if(e==n)return!1}}function PO(t){return t>=127462&&t<=127487}const IO=8205;function t9(t,e,n=!0,i=!0){return(n?lN:n9)(t,e,i)}function lN(t,e,n){if(e==t.length)return e;e&&aN(t.charCodeAt(e))&&uN(t.charCodeAt(e-1))&&e--;let i=lb(t,e);for(e+=NO(i);e<t.length;){let r=lb(t,e);if(i==IO||r==IO||n&&e9(r))e+=NO(r),i=r;else if(PO(r)){let o=0,a=e-2;for(;a>=0&&PO(lb(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function n9(t,e,n){for(;e>1;){let i=lN(t,e-2,n);if(i<e)return i;e--}return 0}function lb(t,e){let n=t.charCodeAt(e);if(!uN(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return aN(i)?(n-55296<<10)+(i-56320)+65536:n}function aN(t){return t>=56320&&t<57344}function uN(t){return t>=55296&&t<56320}function NO(t){return t<65536?1:2}class kt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=Ou(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),rs.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ou(this,e,n);let i=[];return this.decompose(e,n,i,0),rs.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new hf(this),o=new hf(e);for(let a=n,c=n;;){if(r.next(a),o.next(a),a=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(c+=r.value.length,r.done||c>=i)return!0}}iter(e=1){return new hf(this,e)}iterRange(e,n=this.length){return new cN(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new fN(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?kt.empty:e.length<=32?new xn(e):rs.from(xn.split(e,[]))}}class xn extends kt{constructor(e,n=i9(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let o=0;;o++){let a=this.text[o],c=r+a.length;if((n?i:c)>=e)return new r9(r,c,i,a);r=c+1,i++}}decompose(e,n,i,r){let o=e<=0&&n>=this.length?this:new xn(LO(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),c=jp(o.text,a.text.slice(),0,o.length);if(c.length<=32)i.push(new xn(c,a.length+o.length));else{let f=c.length>>1;i.push(new xn(c.slice(0,f)),new xn(c.slice(f)))}}else i.push(o)}replace(e,n,i){if(!(i instanceof xn))return super.replace(e,n,i);[e,n]=Ou(this,e,n);let r=jp(this.text,jp(i.text,LO(this.text,0,e)),n),o=this.length+i.length-(n-e);return r.length<=32?new xn(r,o):rs.from(xn.split(r,[]),o)}sliceString(e,n=this.length,i=`
11
+ `){[e,n]=Ou(this,e,n);let r="";for(let o=0,a=0;o<=n&&a<this.text.length;a++){let c=this.text[a],f=o+c.length;o>e&&a&&(r+=i),e<f&&n>o&&(r+=c.slice(Math.max(0,e-o),n-o)),o=f+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let o of e)i.push(o),r+=o.length+1,i.length==32&&(n.push(new xn(i,r)),i=[],r=-1);return r>-1&&n.push(new xn(i,r)),n}}class rs extends kt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let o=0;;o++){let a=this.children[o],c=r+a.length,f=i+a.lines-1;if((n?f:c)>=e)return a.lineInner(e,n,i,r);r=c+1,i=f+1}}decompose(e,n,i,r){for(let o=0,a=0;a<=n&&o<this.children.length;o++){let c=this.children[o],f=a+c.length;if(e<=f&&n>=a){let h=r&((a<=e?1:0)|(f>=n?2:0));a>=e&&f<=n&&!h?i.push(c):c.decompose(e-a,n-a,i,h)}a=f+1}}replace(e,n,i){if([e,n]=Ou(this,e,n),i.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let a=this.children[r],c=o+a.length;if(e>=o&&n<=c){let f=a.replace(e-o,n-o,i),h=this.lines-a.lines+f.lines;if(f.lines<h>>4&&f.lines>h>>6){let m=this.children.slice();return m[r]=f,new rs(m,this.length-(n-e)+i.length)}return super.replace(o,c,f)}o=c+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
12
+ `){[e,n]=Ou(this,e,n);let r="";for(let o=0,a=0;o<this.children.length&&a<=n;o++){let c=this.children[o],f=a+c.length;a>e&&o&&(r+=i),e<f&&n>a&&(r+=c.sliceString(e-a,n-a,i)),a=f+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof rs))return 0;let i=0,[r,o,a,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,o+=n){if(r==a||o==c)return i;let f=this.children[r],h=e.children[o];if(f!=h)return i+f.scanIdentical(h,n);i+=f.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let b of e)i+=b.lines;if(i<32){let b=[];for(let x of e)x.flatten(b);return new xn(b,n)}let r=Math.max(32,i>>5),o=r<<1,a=r>>1,c=[],f=0,h=-1,m=[];function p(b){let x;if(b.lines>o&&b instanceof rs)for(let w of b.children)p(w);else b.lines>a&&(f>a||!f)?(y(),c.push(b)):b instanceof xn&&f&&(x=m[m.length-1])instanceof xn&&b.lines+x.lines<=32?(f+=b.lines,h+=b.length+1,m[m.length-1]=new xn(x.text.concat(b.text),x.length+1+b.length)):(f+b.lines>r&&y(),f+=b.lines,h+=b.length+1,m.push(b))}function y(){f!=0&&(c.push(m.length==1?m[0]:rs.from(m,h)),h=-1,f=m.length=0)}for(let b of e)p(b);return y(),c.length==1?c[0]:new rs(c,n)}}kt.empty=new xn([""],0);function i9(t){let e=-1;for(let n of t)e+=n.length+1;return e}function jp(t,e,n=0,i=1e9){for(let r=0,o=0,a=!0;o<t.length&&r<=i;o++){let c=t[o],f=r+c.length;f>=n&&(f>i&&(c=c.slice(0,i-r)),r<n&&(c=c.slice(n-r)),a?(e[e.length-1]+=c,a=!1):e.push(c)),r=f+1}return e}function LO(t,e,n){return jp(t,[""],e,n)}class hf{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof xn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],o=this.offsets[i],a=o>>1,c=r instanceof xn?r.text.length:r.children.length;if(a==(n>0?c:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
13
+ `,this;e--}else if(r instanceof xn){let f=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,f.length>Math.max(0,e))return this.value=e==0?f:n>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=r.children[a+(n<0?-1:0)];e>f.length?(e-=f.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(f),this.offsets.push(n>0?1:(f instanceof xn?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class cN{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new hf(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class fN{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(kt.prototype[Symbol.iterator]=function(){return this.iter()},hf.prototype[Symbol.iterator]=cN.prototype[Symbol.iterator]=fN.prototype[Symbol.iterator]=function(){return this});class r9{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}}function Ou(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function li(t,e,n=!0,i=!0){return t9(t,e,n,i)}function s9(t){return t>=56320&&t<57344}function o9(t){return t>=55296&&t<56320}function l9(t,e){let n=t.charCodeAt(e);if(!o9(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return s9(i)?(n-55296<<10)+(i-56320)+65536:n}function One(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function a9(t){return t<65536?1:2}const bS=/\r\n?|\n/;var ji=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(ji||(ji={}));class hs{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let o=this.sections[n++],a=this.sections[n++];a<0?(e(i,r,o),r+=o):r+=a,i+=o}}iterChangedRanges(e,n=!1){SS(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new hs(e)}composeDesc(e){return this.empty?e:e.empty?this:dN(this,e)}mapDesc(e,n=!1){return e.empty?this:xS(this,e,n)}mapPos(e,n=-1,i=ji.Simple){let r=0,o=0;for(let a=0;a<this.sections.length;){let c=this.sections[a++],f=this.sections[a++],h=r+c;if(f<0){if(h>e)return o+(e-r);o+=c}else{if(i!=ji.Simple&&h>=e&&(i==ji.TrackDel&&r<e&&h>e||i==ji.TrackBefore&&r<e||i==ji.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!c)return e==r||n<0?o:o+f;o+=f}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return o}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let o=this.sections[i++],a=this.sections[i++],c=r+o;if(a>=0&&r<=n&&c>=e)return r<e&&c>n?"cover":!0;r=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new hs(e)}static create(e){return new hs(e)}}class In extends hs{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return SS(this,(n,i,r,o,a)=>e=e.replace(r,r+(i-n),a),!1),e}mapDesc(e,n=!1){return xS(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,o=0;r<n.length;r+=2){let a=n[r],c=n[r+1];if(c>=0){n[r]=c,n[r+1]=a;let f=r>>1;for(;i.length<f;)i.push(kt.empty);i.push(a?e.slice(o,o+a):kt.empty)}o+=a}return new In(n,i)}compose(e){return this.empty?e:e.empty?this:dN(this,e,!0)}map(e,n=!1){return e.empty?this:xS(this,e,n,!0)}iterChanges(e,n=!1){SS(this,e,n)}get desc(){return hs.create(this.sections)}filter(e){let n=[],i=[],r=[],o=new Pf(this);e:for(let a=0,c=0;;){let f=a==e.length?1e9:e[a++];for(;c<f||c==f&&o.len==0;){if(o.done)break e;let m=Math.min(o.len,f-c);oi(r,m,-1);let p=o.ins==-1?-1:o.off==0?o.ins:0;oi(n,m,p),p>0&&No(i,n,o.text),o.forward(m),c+=m}let h=e[a++];for(;c<h;){if(o.done)break e;let m=Math.min(o.len,h-c);oi(n,m,-1),oi(r,m,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(m),c+=m}}return{changes:new In(n,i),filtered:hs.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],o=[],a=0,c=null;function f(m=!1){if(!m&&!r.length)return;a<n&&oi(r,n-a,-1);let p=new In(r,o);c=c?c.compose(p.map(c)):p,r=[],o=[],a=0}function h(m){if(Array.isArray(m))for(let p of m)h(p);else if(m instanceof In){if(m.length!=n)throw new RangeError(`Mismatched change set length (got ${m.length}, expected ${n})`);f(),c=c?c.compose(m.map(c)):m}else{let{from:p,to:y=p,insert:b}=m;if(p>y||p<0||y>n)throw new RangeError(`Invalid change range ${p} to ${y} (in doc of length ${n})`);let x=b?typeof b=="string"?kt.of(b.split(i||bS)):b:kt.empty,w=x.length;if(p==y&&w==0)return;p<a&&f(),p>a&&oi(r,p-a,-1),oi(r,y-p,w),No(o,r,x),a=y}}return h(e),f(!c),c}static empty(e){return new In(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let o=e[r];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((a,c)=>c&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;i.length<r;)i.push(kt.empty);i[r]=kt.of(o.slice(1)),n.push(o[0],i[r].length)}}}return new In(n,i)}static createSet(e,n){return new In(e,n)}}function oi(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function No(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(kt.empty);t.push(n)}}function SS(t,e,n){let i=t.inserted;for(let r=0,o=0,a=0;a<t.sections.length;){let c=t.sections[a++],f=t.sections[a++];if(f<0)r+=c,o+=c;else{let h=r,m=o,p=kt.empty;for(;h+=c,m+=f,f&&i&&(p=p.append(i[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)c=t.sections[a++],f=t.sections[a++];e(r,h,o,m,p),r=h,o=m}}}function xS(t,e,n,i=!1){let r=[],o=i?[]:null,a=new Pf(t),c=new Pf(e);for(let f=-1;;){if(a.done&&c.len||c.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&c.ins==-1){let h=Math.min(a.len,c.len);oi(r,h,-1),a.forward(h),c.forward(h)}else if(c.ins>=0&&(a.ins<0||f==a.i||a.off==0&&(c.len<a.len||c.len==a.len&&!n))){let h=c.len;for(oi(r,c.ins,-1);h;){let m=Math.min(a.len,h);a.ins>=0&&f<a.i&&a.len<=m&&(oi(r,0,a.ins),o&&No(o,r,a.text),f=a.i),a.forward(m),h-=m}c.next()}else if(a.ins>=0){let h=0,m=a.len;for(;m;)if(c.ins==-1){let p=Math.min(m,c.len);h+=p,m-=p,c.forward(p)}else if(c.ins==0&&c.len<m)m-=c.len,c.next();else break;oi(r,h,f<a.i?a.ins:0),o&&f<a.i&&No(o,r,a.text),f=a.i,a.forward(a.len-m)}else{if(a.done&&c.done)return o?In.createSet(r,o):hs.create(r);throw new Error("Mismatched change set lengths")}}}function dN(t,e,n=!1){let i=[],r=n?[]:null,o=new Pf(t),a=new Pf(e);for(let c=!1;;){if(o.done&&a.done)return r?In.createSet(i,r):hs.create(i);if(o.ins==0)oi(i,o.len,0,c),o.next();else if(a.len==0&&!a.done)oi(i,0,a.ins,c),r&&No(r,i,a.text),a.next();else{if(o.done||a.done)throw new Error("Mismatched change set lengths");{let f=Math.min(o.len2,a.len),h=i.length;if(o.ins==-1){let m=a.ins==-1?-1:a.off?0:a.ins;oi(i,f,m,c),r&&m&&No(r,i,a.text)}else a.ins==-1?(oi(i,o.off?0:o.len,f,c),r&&No(r,i,o.textBit(f))):(oi(i,o.off?0:o.len,a.off?0:a.ins,c),r&&!a.off&&No(r,i,a.text));c=(o.ins>f||a.ins>=0&&a.len>f)&&(c||i.length>h),o.forward2(f),a.forward(f)}}}}class Pf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?kt.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?kt.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ko{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new ko(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return xe.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return xe.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return xe.range(e.anchor,e.head)}static create(e,n,i,r){return new ko(e,n,i,r)}}class xe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:xe.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new xe([this.main],0)}addRange(e,n=!0){return xe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,xe.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new xe(e.ranges.map(n=>ko.fromJSON(n)),e.main)}static single(e,n=e){return new xe([xe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let o=e[r];if(o.empty?o.from<=i:o.from<i)return xe.normalized(e.slice(),n);i=o.to}return new xe(e,n)}static cursor(e,n=0,i,r){return ko.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,o){let a=r==null?7:Math.min(6,r);return!o&&e!=n&&(o=n<e?1:-1),o&&(a|=o<0?8:16),n<e?ko.create(n,e,a|32,i):ko.create(e,n,a,i)}static undirectionalRange(e,n){return ko.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,o)=>r.from-o.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let o=e[r],a=e[r-1];if(o.empty?o.from<=a.to:o.from<a.to){let c=a.from,f=Math.max(o.to,a.to);r<=n&&n--,e.splice(--r,2,o.anchor>o.head?xe.range(f,c):xe.range(c,f))}}return new xe(e,n)}}function hN(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Uw=0;class We{constructor(e,n,i,r,o){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=Uw++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new We(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:jw),!!e.static,e.enables)}of(e){return new Kp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Kp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Kp(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function jw(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class Kp{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=Uw++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,o=this.id,a=e[o]>>1,c=this.type==2,f=!1,h=!1,m=[];for(let p of this.dependencies)p=="doc"?f=!0:p=="selection"?h=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&m.push(e[p.id]);return{create(p){return p.values[a]=i(p),1},update(p,y){if(f&&y.docChanged||h&&(y.docChanged||y.selection)||wS(p,m)){let b=i(p);if(c?!BO(b,p.values[a],r):!r(b,p.values[a]))return p.values[a]=b,1}return 0},reconfigure:(p,y)=>{let b,x=y.config.address[o];if(x!=null){let w=Cm(y,x);if(this.dependencies.every(C=>C instanceof We?y.facet(C)===p.facet(C):C instanceof bs?y.field(C,!1)==p.field(C,!1):!0)||(c?BO(b=i(p),w,r):r(b=i(p),w)))return p.values[a]=w,0}else b=i(p);return p.values[a]=b,1}}}get extension(){return this}}function BO(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function wS(t,e){let n=!1;for(let i of e)pf(t,i)&1&&(n=!0);return n}function u9(t,e,n){let i=n.map(f=>t[f.id]),r=n.map(f=>f.type),o=i.filter(f=>!(f&1)),a=t[e.id]>>1;function c(f){let h=[];for(let m=0;m<i.length;m++){let p=Cm(f,i[m]);if(r[m]==2)for(let y of p)h.push(y);else h.push(p)}return e.combine(h)}return{create(f){for(let h of i)pf(f,h);return f.values[a]=c(f),1},update(f,h){if(!wS(f,o))return 0;let m=c(f);return e.compare(m,f.values[a])?0:(f.values[a]=m,1)},reconfigure(f,h){let m=wS(f,i),p=h.config.facets[e.id],y=h.facet(e);if(p&&!m&&jw(n,p))return f.values[a]=y,0;let b=c(f);return e.compare(b,y)?(f.values[a]=y,0):(f.values[a]=b,1)}}}const ap=We.define({static:!0});class bs{constructor(e,n,i,r,o){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=o,this.provides=void 0}static define(e){let n=new bs(Uw++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(ap).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let o=i.values[n],a=this.updateF(o,r);return this.compareF(o,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let o=i.facet(ap),a=r.facet(ap),c;return(c=o.find(f=>f.field==this))&&c!=a.find(f=>f.field==this)?(i.values[n]=c.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,ap.of({field:this,create:e})]}get extension(){return this}}const Ml={lowest:4,low:3,default:2,high:1,highest:0};function Xc(t){return e=>new pN(e,t)}const zg={highest:Xc(Ml.highest),high:Xc(Ml.high),default:Xc(Ml.default),low:Xc(Ml.low),lowest:Xc(Ml.lowest)};class pN{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}}class _g{of(e){return new CS(this,e)}reconfigure(e){return _g.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class CS{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}}class wm{constructor(e,n,i,r,o,a){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],o=Object.create(null),a=new Map;for(let y of c9(e,n,a))y instanceof bs?r.push(y):(o[y.facet.id]||(o[y.facet.id]=[])).push(y);let c=Object.create(null),f=[],h=[];for(let y of r)c[y.id]=h.length<<1,h.push(b=>y.slot(b));let m=i?.config.facets;for(let y in o){let b=o[y],x=b[0].facet,w=m&&m[y]||[];if(b.every(C=>C.type==0))if(c[x.id]=f.length<<1|1,jw(w,b))f.push(i.facet(x));else{let C=x.combine(b.map(E=>E.value));f.push(i&&x.compare(C,i.facet(x))?i.facet(x):C)}else{for(let C of b)C.type==0?(c[C.id]=f.length<<1|1,f.push(C.value)):(c[C.id]=h.length<<1,h.push(E=>C.dynamicSlot(E)));c[x.id]=h.length<<1,h.push(C=>u9(C,x,b))}}let p=h.map(y=>y(c));return new wm(e,a,p,c,f,o)}}function c9(t,e,n){let i=[[],[],[],[],[]],r=new Map;function o(a,c){let f=r.get(a);if(f!=null){if(f<=c)return;let h=i[f].indexOf(a);h>-1&&i[f].splice(h,1),a instanceof CS&&n.delete(a.compartment)}if(r.set(a,c),Array.isArray(a))for(let h of a)o(h,c);else if(a instanceof CS){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(a.compartment)||a.inner;n.set(a.compartment,h),o(h,c)}else if(a instanceof pN)o(a.inner,a.prec);else if(a instanceof bs)i[c].push(a),a.provides&&o(a.provides,c);else if(a instanceof Kp)i[c].push(a),a.facet.extensions&&o(a.facet.extensions,Ml.default);else{let h=a.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${a}).`);if(h==a)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(h,c)}}return o(t,Ml.default),i.reduce((a,c)=>a.concat(c))}function pf(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function Cm(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const mN=We.define(),ES=We.define({combine:t=>t.some(e=>e),static:!0}),gN=We.define({combine:t=>t.length?t[0]:void 0,static:!0}),yN=We.define(),vN=We.define(),bN=We.define(),SN=We.define({combine:t=>t.length?t[0]:!1});class Zo{constructor(e,n){this.type=e,this.value=n}static define(){return new f9}}class f9{of(e){return new Zo(this,e)}}class d9{constructor(e){this.map=e}of(e){return new $t(this,e)}}class $t{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new $t(this.type,n)}is(e){return this.type==e}static define(e={}){return new d9(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let o=r.map(n);o&&i.push(o)}return i}}$t.reconfigure=$t.define();$t.appendConfig=$t.define();class Bn{constructor(e,n,i,r,o,a){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,i&&hN(i,n.newLength),o.some(c=>c.type==Bn.time)||(this.annotations=o.concat(Bn.time.of(Date.now())))}static create(e,n,i,r,o,a){return new Bn(e,n,i,r,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Bn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Bn.time=Zo.define();Bn.userEvent=Zo.define();Bn.addToHistory=Zo.define();Bn.remote=Zo.define();function h9(t,e){let n=[];for(let i=0,r=0;;){let o,a;if(i<t.length&&(r==e.length||e[r]>=t[i]))o=t[i++],a=t[i++];else if(r<e.length)o=e[r++],a=e[r++];else return n;!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function xN(t,e,n){var i;let r,o,a;return n?(r=e.changes,o=In.empty(e.changes.length),a=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(o):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:$t.mapEffects(t.effects,r).concat($t.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function TS(t,e,n){let i=e.selection,r=yu(e.annotations);return e.userEvent&&(r=r.concat(Bn.userEvent.of(e.userEvent))),{changes:e.changes instanceof In?e.changes:In.of(e.changes||[],n,t.facet(gN)),selection:i&&(i instanceof xe?i:xe.single(i.anchor,i.head)),effects:yu(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function wN(t,e,n){let i=TS(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let a=!!e[o].sequential;i=xN(i,TS(t,e[o],a?i.changes.newLength:t.doc.length),a)}let r=Bn.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return m9(n?p9(r):r)}function p9(t){let e=t.startState,n=!0;for(let r of e.facet(yN)){let o=r(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:h9(n,o))}if(n!==!0){let r,o;if(n===!1)o=t.changes.invertedDesc,r=In.empty(e.doc.length);else{let a=t.changes.filter(n);r=a.changes,o=a.filtered.mapDesc(a.changes).invertedDesc}t=Bn.create(e,r,t.selection&&t.selection.map(o),$t.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let i=e.facet(vN);for(let r=i.length-1;r>=0;r--){let o=i[r](t);o instanceof Bn?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Bn?t=o[0]:t=wN(e,yu(o),!1)}return t}function m9(t){let e=t.startState,n=e.facet(bN),i=t;for(let r=n.length-1;r>=0;r--){let o=n[r](t);o&&Object.keys(o).length&&(i=xN(i,TS(e,o,t.changes.newLength),!0))}return i==t?t:Bn.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const g9=[];function yu(t){return t==null?g9:Array.isArray(t)?t:[t]}var Us=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Us||(Us={}));const y9=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let RS;try{RS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function v9(t){if(RS)return RS.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||y9.test(n)))return!0}return!1}function b9(t){return e=>{if(!/\S/.test(e))return Us.Space;if(v9(e))return Us.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Us.Word;return Us.Other}}class Ut{constructor(e,n,i,r,o,a){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)pf(this,c<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return pf(this,i),Cm(this,i)}update(...e){return wN(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let c of e.effects)c.is(_g.reconfigure)?(n&&(r=new Map,n.compartments.forEach((f,h)=>r.set(h,f)),n=null),r.set(c.value.compartment,c.value.extension)):c.is($t.reconfigure)?(n=null,i=c.value):c.is($t.appendConfig)&&(n=null,i=yu(i).concat(c.value));let o;n?o=e.startState.values.slice():(n=wm.resolve(i,r,this),o=new Ut(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,h)=>h.reconfigure(f,this),null).values);let a=e.startState.facet(ES)?e.newSelection:e.newSelection.asSingle();new Ut(n,e.newDoc,a,o,(c,f)=>f.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:xe.cursor(n.from+e.length,-1)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),o=[i.range],a=yu(i.effects);for(let c=1;c<n.ranges.length;c++){let f=e(n.ranges[c]),h=this.changes(f.changes),m=h.map(r);for(let y=0;y<c;y++)o[y]=o[y].map(m);let p=r.mapDesc(h,!0);o.push(f.range.map(p)),r=r.compose(m),a=$t.mapEffects(a,m).concat($t.mapEffects(yu(f.effects),p))}return{changes:r,selection:xe.create(o,n.mainIndex),effects:a}}changes(e=[]){return e instanceof In?e:In.of(e,this.doc.length,this.facet(Ut.lineSeparator))}toText(e){return kt.of(e.split(this.facet(Ut.lineSeparator)||bS))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(pf(this,n),Cm(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof bs&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(e,o)){let a=i[o],c=e[o];r.push(a.init(f=>a.spec.fromJSON(c,f)))}}return Ut.create({doc:e.doc,selection:xe.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=wm.resolve(e.extensions||[],new Map),i=e.doc instanceof kt?e.doc:kt.of((e.doc||"").split(n.staticFacet(Ut.lineSeparator)||bS)),r=e.selection?e.selection instanceof xe?e.selection:xe.single(e.selection.anchor,e.selection.head):xe.single(0);return hN(r,i.length),n.staticFacet(ES)||(r=r.asSingle()),new Ut(n,i,r,n.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(Ut.tabSize)}get lineBreak(){return this.facet(Ut.lineSeparator)||`
14
+ `}get readOnly(){return this.facet(SN)}phrase(e,...n){for(let i of this.facet(Ut.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let o=+(r||1);return!o||o>n.length?i:n[o-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let o of this.facet(mN))for(let a of o(this,n,i))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return b9(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-i,c=e-i;for(;a>0;){let f=li(n,a,!1);if(o(n.slice(f,a))!=Us.Word)break;a=f}for(;c<r;){let f=li(n,c);if(o(n.slice(c,f))!=Us.Word)break;c=f}return a==c?null:xe.range(a+i,c+i)}}Ut.allowMultipleSelections=ES;Ut.tabSize=We.define({combine:t=>t.length?t[0]:4});Ut.lineSeparator=gN;Ut.readOnly=SN;Ut.phrases=We.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});Ut.languageData=mN;Ut.changeFilter=yN;Ut.transactionFilter=vN;Ut.transactionExtender=bN;_g.reconfigure=$t.define();function Hg(t,e,n={}){let i={};for(let r of t)for(let o of Object.keys(r)){let a=r[o],c=i[o];if(c===void 0)i[o]=a;else if(!(c===a||a===void 0))if(Object.hasOwnProperty.call(n,o))i[o]=n[o](c,a);else throw new Error("Config merge conflict for field "+o)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Kl{eq(e){return this==e}range(e,n=e){return AS.create(e,n,this)}}Kl.prototype.startSide=Kl.prototype.endSide=0;Kl.prototype.point=!1;Kl.prototype.mapMode=ji.TrackDel;function Kw(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let AS=class CN{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new CN(e,n,i)}};function OS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Yw{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return tu(this.to)}findIndex(e,n,i,r=0){let o=i?this.to:this.from;for(let a=r,c=o.length;;){if(a==c)return a;let f=a+c>>1,h=o[f]-e||(i?this.value[f].endSide:this.value[f].startSide)-n;if(f==a)return h>=0?a:c;h>=0?c=f:a=f+1}}between(e,n,i,r){for(let o=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,o);o<a;o++)if(r(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n,i,r,o){let a=[],c=[],f=[],h=-1,m=-1;e:for(let p=0;p<this.value.length;p++){let y=this.value[p],b=this.from[p]+e,x=this.to[p]+e,w,C;if(b==x){let E=n.mapPos(b,y.startSide,y.mapMode);if(E==null||(w=C=E,y.startSide!=y.endSide&&(C=n.mapPos(b,y.endSide),C<w)))continue}else if(w=n.mapPos(b,y.startSide),C=n.mapPos(x,y.endSide),w>C||w==C&&y.startSide>0&&y.endSide<=0)continue;if(!((C-w||y.endSide-y.startSide)<0))if(h<0&&(h=w),y.point&&(m=Math.max(m,C-w)),(w-i||y.startSide-r)>=0)a.push(y),c.push(w-h),f.push(C-h),i=C,r=y.endSide;else{if(w==C)for(let E=a.length;E>0;E--){if((w-(f[E-1]+h)||y.startSide-a[E-1].endSide)>=0){a.splice(E,0,y),c.splice(E,0,w-h),f.splice(E,0,C-h);continue e}if((w-(c[E-1]+h)||y.endSide-a[E-1].startSide)>0)break}o(w,C,y)}}return{mapped:a.length?new Yw(c,f,a,m):null,pos:h}}}class Mt{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new Mt(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:o=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(OS)),this.isEmpty)return n.length?Mt.of(n):this;let c=new EN(this,null,-1).goto(0),f=0,h=[],m=new vu;for(;c.value||f<n.length;)if(f<n.length&&(c.from-n[f].from||c.startSide-n[f].value.startSide)>=0){let p=n[f++];m.addInner(p.from,p.to,p.value,!1)||h.push(p)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(c.chunkIndex)<n[f].from)&&(!a||r>this.chunkEnd(c.chunkIndex)||o<this.chunkPos[c.chunkIndex])&&m.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!a||r>c.to||o<c.from||a(c.from,c.to,c.value))&&(m.addInner(c.from,c.to,c.value,!1)||h.push(AS.create(c.from,c.to,c.value))),c.next());return m.finishInner(this.nextLayer.isEmpty&&!h.length?Mt.empty:this.nextLayer.update({add:h,filter:a,filterFrom:r,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1,o,a=(f,h,m)=>{o||(o=new vu),o.addRange(f,h,m,!1)};for(let f=0;f<this.chunk.length;f++){let h=this.chunkPos[f],m=this.chunk[f],p=e.touchesRange(h,h+m.length);if(p===!1)r=Math.max(r,m.maxPoint),n.push(m),i.push(e.mapPos(h));else if(p===!0){let[y,b]=n.length?[tu(i)+tu(n).length,tu(tu(n).value).endSide]:[-1,-1],{mapped:x,pos:w}=m.map(h,e,y,b,a);x&&(r=Math.max(r,x.maxPoint),n.push(x),i.push(w))}}let c=this.nextLayer.map(e);return o&&(c=o.finishInner(c)),n.length==0?c:new Mt(i,n,c||Mt.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],a=this.chunk[r];if(n>=o&&e<=o+a.length&&a.between(o,e-o,n-o,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return If.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return If.from(e).goto(n)}static compare(e,n,i,r,o=-1){let a=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=o),c=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=o),f=VO(a,c,i),h=new $c(a,f,o),m=new $c(c,f,o);i.iterGaps((p,y,b)=>zO(h,p,m,y,b,r)),i.empty&&i.length==0&&zO(h,0,m,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let o=e.filter(m=>!m.isEmpty&&n.indexOf(m)<0),a=n.filter(m=>!m.isEmpty&&e.indexOf(m)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let c=VO(o,a),f=new $c(o,c,0).goto(i),h=new $c(a,c,0).goto(i);for(;;){if(f.to!=h.to||!MS(f.active,h.active)||f.point&&(!h.point||!Kw(f.point,h.point)))return!1;if(f.to>r)return!0;f.next(),h.next()}}static spans(e,n,i,r,o=-1){let a=new $c(e,null,o).goto(n),c=n,f=a.openStart;for(;;){let h=Math.min(a.to,i);if(a.point){let m=a.activeForPoint(a.to),p=a.pointFrom<n?m.length+1:a.point.startSide<0?m.length:Math.min(m.length,f);r.point(c,h,a.point,m,p,a.pointRank),f=Math.min(a.openEnd(h),m.length)}else h>c&&(r.span(c,h,a.active,f),f=a.openEnd(h));if(a.to>i)return f+(a.point&&a.to>i?1:0);c=a.to,a.next()}}static of(e,n=!1){let i=new vu;for(let r of e instanceof AS?[e]:n?S9(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return Mt.empty;let n=tu(e);for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=Mt.empty;r=r.nextLayer)n=new Mt(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Mt.empty=new Mt([],[],null,-1);function tu(t){return t[t.length-1]}function S9(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(OS(e,i)>0)return t.slice().sort(OS);e=i}return t}Mt.empty.nextLayer=Mt.empty;class vu{finishChunk(e){this.chunks.push(new Yw(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addRange(e,n,i,!0)}addRange(e,n,i,r){this.addInner(e,n,i,r)||(this.nextLayer||(this.nextLayer=new vu)).addRange(e,n,i,r)}addInner(e,n,i,r){let o=e-this.lastTo||i.startSide-this.last.endSide;if(r&&o<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(Mt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Mt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function VO(t,e,n){let i=new Map;for(let o of t)for(let a=0;a<o.chunk.length;a++)o.chunk[a].maxPoint<=0&&i.set(o.chunk[a],o.chunkPos[a]);let r=new Set;for(let o of e)for(let a=0;a<o.chunk.length;a++){let c=i.get(o.chunk[a]);c!=null&&(n?n.mapPos(c):c)==o.chunkPos[a]&&!n?.touchesRange(c,c+o.chunk[a].length)&&r.add(o.chunk[a])}return r}class EN{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class If{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let o=0;o<e.length;o++)for(let a=e[o];!a.isEmpty;a=a.nextLayer)a.maxPoint>=i&&r.push(new EN(a,n,i,o));return r.length==1?r[0]:new If(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)ab(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)ab(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ab(this.heap,0)}}}function ab(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}class $c{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=If.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){up(this.active,e),up(this.activeTo,e),up(this.activeRank,e),this.minActive=_O(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||r-this.activeTo[n])>0;)n++;cp(this.active,n,i),cp(this.activeTo,n,r),cp(this.activeRank,n,o),e&&cp(e,n,this.cursor.from),this.minActive=_O(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&up(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}}function zO(t,e,n,i,r,o){t.goto(e),n.goto(i);let a=i+r,c=i,f=i-e,h=!!o.boundChange;for(let m=!1;;){let p=t.to+f-n.to,y=p||t.endSide-n.endSide,b=y<0?t.to+f:n.to,x=Math.min(b,a);if(t.point||n.point?(t.point&&n.point&&Kw(t.point,n.point)&&MS(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(c,x,t.point,n.point),m=!1):(m&&(o.boundChange(c),m=!1),x>c&&!MS(t.active,n.active)&&o.compareRange(c,x,t.active,n.active),h&&x<a&&(p||t.openEnd(b)!=n.openEnd(b))&&(m=!0)),b>a)break;c=b,y<=0&&t.next(),y>=0&&n.next()}}function MS(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Kw(t[n],e[n]))return!1;return!0}function up(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function cp(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function _O(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function Fg(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=li(t,r));return i}function x9(t,e,n,i){for(let r=0,o=0;;){if(o>=e)return r;if(r==t.length)break;o+=t.charCodeAt(r)==9?n-o%n:1,r=li(t,r)}return t.length}const DS="ͼ",HO=typeof Symbol>"u"?"__"+DS:Symbol.for(DS),kS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),FO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ho{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,c,f,h){let m=[],p=/^@(\w+)\b/.exec(a[0]),y=p&&p[1]=="keyframes";if(p&&c==null)return f.push(a[0]+";");for(let b in c){let x=c[b];if(/&/.test(b))o(b.split(/,\s*/).map(w=>a.map(C=>w.replace(/&/,C))).reduce((w,C)=>w.concat(C)),x,f);else if(x&&typeof x=="object"){if(!p)throw new RangeError("The value of a property ("+b+") should be a primitive value.");o(r(b),x,m,y)}else x!=null&&m.push(b.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+x+";")}(m.length||y)&&f.push((i&&!p&&!h?a.map(i):a).join(", ")+" {"+m.join(" ")+"}")}for(let a in e)o(r(a),e[a],this.rules)}getRules(){return this.rules.join(`
15
+ `)}static newName(){let e=FO[HO]||1;return FO[HO]=e+1,DS+e.toString(36)}static mount(e,n,i){let r=e[kS],o=i&&i.nonce;r?o&&r.setNonce(o):r=new w9(e,o),r.mount(Array.isArray(n)?n:[n],e)}}let UO=new Map;class w9{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let o=UO.get(i);if(o)return e[kS]=o;this.sheet=new r.CSSStyleSheet,UO.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[kS]=this}mount(e,n){let i=this.sheet,r=0,o=0,a=!1;for(let c=0;c<e.length;c++){let f=e[c],h=this.modules.indexOf(f);if(h<o&&h>-1&&(this.modules.splice(h,1),a=!0,o--,h=-1),h==-1){if(this.modules.splice(o++,0,f),a=!0,i)for(let m=0;m<f.rules.length;m++)i.insertRule(f.rules[m],r++)}else{for(;o<h;)r+=this.modules[o++].rules.length;r+=f.rules.length,o++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{if(a){let f="";for(let h=0;h<this.modules.length;h++)f+=this.modules[h].getRules()+`
16
+ `;this.styleTag.textContent=f}let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Fo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Nf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},C9=typeof navigator<"u"&&/Mac/.test(navigator.platform),E9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ni=0;ni<10;ni++)Fo[48+ni]=Fo[96+ni]=String(ni);for(var ni=1;ni<=24;ni++)Fo[ni+111]="F"+ni;for(var ni=65;ni<=90;ni++)Fo[ni]=String.fromCharCode(ni+32),Nf[ni]=String.fromCharCode(ni);for(var ub in Fo)Nf.hasOwnProperty(ub)||(Nf[ub]=Fo[ub]);function T9(t){var e=C9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||E9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Nf:Fo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Wa(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)TN(t,arguments[e]);return t}function TN(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)TN(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let pi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},PS=typeof document<"u"?document:{documentElement:{style:{}}};const IS=/Edge\/(\d+)/.exec(pi.userAgent),RN=/MSIE \d/.test(pi.userAgent),NS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pi.userAgent),Ug=!!(RN||NS||IS),jO=!Ug&&/gecko\/(\d+)/i.test(pi.userAgent),cb=!Ug&&/Chrome\/(\d+)/.exec(pi.userAgent),KO="webkitFontSmoothing"in PS.documentElement.style,LS=!Ug&&/Apple Computer/.test(pi.vendor),YO=LS&&(/Mobile\/\w+/.test(pi.userAgent)||pi.maxTouchPoints>2);var Ve={mac:YO||/Mac/.test(pi.platform),windows:/Win/.test(pi.platform),linux:/Linux|X11/.test(pi.platform),ie:Ug,ie_version:RN?PS.documentMode||6:NS?+NS[1]:IS?+IS[1]:0,gecko:jO,gecko_version:jO?+(/Firefox\/(\d+)/.exec(pi.userAgent)||[0,0])[1]:0,chrome:!!cb,chrome_version:cb?+cb[1]:0,ios:YO,android:/Android\b/.test(pi.userAgent),webkit:KO,webkit_version:KO?+(/\bAppleWebKit\/(\d+)/.exec(pi.userAgent)||[0,0])[1]:0,safari:LS,safari_version:LS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(pi.userAgent)||[0,0])[1]:0,tabSize:PS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function qw(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Em=Object.create(null);function Gw(t,e,n){if(t==e)return!0;t||(t=Em),e||(e=Em);let i=Object.keys(t),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let o of i)if(o!=n&&(r.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function R9(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function qO(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function A9(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}class na{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ii=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ii||(ii={}));class on extends Kl{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new dd(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Yl(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:o,end:a}=AN(e,n);i=(o?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Yl(e,i,r,n,e.widget||null,!0)}static line(e){return new hd(e)}static set(e,n=!1){return Mt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}on.none=Mt.empty;class dd extends on{constructor(e){let{start:n,end:i}=AN(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?qw(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Em}eq(e){return this==e||e instanceof dd&&this.tagName==e.tagName&&Gw(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}dd.prototype.point=!1;class hd extends on{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof hd&&this.spec.class==e.spec.class&&Gw(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}hd.prototype.mapMode=ji.TrackBefore;hd.prototype.point=!0;class Yl extends on{constructor(e,n,i,r,o,a){super(n,i,o,e),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?ji.TrackBefore:ji.TrackAfter:ji.TrackDel}get type(){return this.startSide!=this.endSide?ii.WidgetRange:this.startSide<=0?ii.WidgetBefore:ii.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Yl&&O9(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Yl.prototype.point=!0;function AN(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function O9(t,e){return t==e||!!(t&&e&&t.compare(e))}function bu(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}class Lf extends Kl{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof Lf&&this.tagName==e.tagName&&Gw(this.attributes,e.attributes)}static create(e){return new Lf(e.tagName,e.attributes||Em,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return Mt.of(e,n)}}Lf.prototype.startSide=Lf.prototype.endSide=-1;const Yn=t=>t.nodeType==1,Mu=t=>t.nodeType==3;function Bf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function BS(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function mf(t,e){if(!e.anchorNode)return!1;try{return BS(t,e.anchorNode)}catch{return!1}}function gf(t){return Mu(t)?zf(t,0,t.nodeValue.length).getClientRects():Yn(t)?t.getClientRects():[]}function yf(t,e,n,i){return n?GO(t,e,n,i,-1)||GO(t,e,n,i,1):!1}function Uo(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Tm(t){return Yn(t)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function GO(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:Qs(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||!Yn(o))return!1;e=Uo(t)+(r<0?0:1),t=o}else if(Yn(t)){if(t=t.childNodes[e+(r<0?-1:0)],Yn(t)&&(t.nodeName=="IMG"||t.nodeName=="BR"||t.contentEditable=="false"))return!1;e=r<0?Qs(t):0}else return!1}}function Qs(t){return Mu(t)?t.nodeValue.length:t.childNodes.length}function Vf(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function M9(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function ON(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function D9(t,e,n,i,r,o,a,c){let f=t.ownerDocument,h=f.defaultView||window;for(let m=t,p=!1;m&&!p;)if(Yn(m)){let y,b=m==f.body,x=1,w=1,C=!0,E=!0;if(b)y=M9(h);else{let A=getComputedStyle(m);if(/^(fixed|sticky)$/.test(A.position)&&(p=!0),(m.scrollHeight<=m.clientHeight||!/auto|scroll/.test(A.overflowY))&&(E=!1),(m.scrollWidth<=m.clientWidth||!/auto|scroll/.test(A.overflowX))&&(C=!1),!C&&!E){m=m.assignedSlot||m.parentNode;continue}let D=m.getBoundingClientRect();({scaleX:x,scaleY:w}=ON(m,D)),y={left:D.left,right:D.left+m.clientWidth*x,top:D.top,bottom:D.top+m.clientHeight*w}}let O=0,T=0;if(E)if(r=="nearest")e.top<y.top+a?(T=e.top-(y.top+a),n>0&&e.bottom>y.bottom+T&&(T=e.bottom-y.bottom+a)):e.bottom>y.bottom-a&&(T=e.bottom-y.bottom+a,n<0&&e.top-T<y.top&&(T=e.top-(y.top+a)));else{let A=e.bottom-e.top,D=y.bottom-y.top;T=(r=="center"&&A<=D?e.top+A/2-D/2:r=="start"||r=="center"&&n<0?e.top-a:e.bottom-D+a)-y.top}if(C&&(i=="nearest"?e.left<y.left+o?(O=e.left-(y.left+o),n>0&&e.right>y.right+O&&(O=e.right-y.right+o)):e.right>y.right-o&&(O=e.right-y.right+o,n<0&&e.left<y.left+O&&(O=e.left-(y.left+o))):O=(i=="center"?e.left+(e.right-e.left)/2-(y.right-y.left)/2:i=="start"==c?e.left-o:e.right-(y.right-y.left)+o)-y.left),O||T)if(b)h.scrollBy(O,T);else{let A=0,D=0;if(T){let k=m.scrollTop;m.scrollTop+=T/w,D=(m.scrollTop-k)*w}if(O){let k=m.scrollLeft;m.scrollLeft+=O/x,A=(m.scrollLeft-k)*x}e={left:e.left-A,top:e.top-D,right:e.right-A,bottom:e.bottom-D},A&&Math.abs(A-O)<1&&(i="nearest"),D&&Math.abs(D-T)<1&&(r="nearest")}if(b)break;(e.top<y.top||e.bottom>y.bottom||e.left<y.left||e.right>y.right)&&(e={left:Math.max(e.left,y.left),right:Math.min(e.right,y.right),top:Math.max(e.top,y.top),bottom:Math.min(e.bottom,y.bottom)}),m=m.assignedSlot||m.parentNode}else if(m.nodeType==11)m=m.host;else break}function MN(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let o=t.parentNode;o&&!(o==n.body||(!e||i)&&r);)if(Yn(o))!r&&o.scrollHeight>o.clientHeight&&/scroll|auto/.test(getComputedStyle(o).overflowY)&&(r=o),e&&!i&&o.scrollWidth>o.clientWidth&&/scroll|auto/.test(getComputedStyle(o).overflowX)&&(i=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:i,y:r}}class k9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?Qs(n):0),i,Math.min(e.focusOffset,i?Qs(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}function DN(t){let e=[];for(let n=t;n;n=n.nodeType==11?n.host:n.parentNode)Yn(n)&&e.push({node:n,left:n.scrollLeft,top:n.scrollTop});return e}function kN(t,e=!0){for(let{node:n,left:i,top:r}of t)e&&n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}let Al=null;Ve.safari&&Ve.safari_version>=26&&(Al=!1);function PN(t){if(t.setActive)return t.setActive();if(Al)return t.focus(Al);let e=DN(t);t.focus(Al==null?{get preventScroll(){return Al={preventScroll:!0},!0}}:void 0),Al||(Al=!1,kN(e))}let WO;function zf(t,e,n=e){let i=WO||(WO=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function Su(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,t.dispatchEvent(o);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,t.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function P9(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function I9(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,Qs(n));;)if(i){if(!Yn(n))return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=Qs(n))}else{if(n==t)return!0;i=Uo(n),n=n.parentNode}}function IN(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function NN(t,e){for(let n=t,i=e;;){if(Mu(n)&&i>0)return{node:n,offset:i};if(Yn(n)&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=Qs(n)}else if(n.parentNode&&!Tm(n))i=Uo(n),n=n.parentNode;else return null}}function LN(t,e){for(let n=t,i=e;;){if(Mu(n)&&i<n.nodeValue.length)return{node:n,offset:i};if(Yn(n)&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Tm(n))i=Uo(n)+1,n=n.parentNode;else return null}}class Or{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new Or(e.parentNode,Uo(e),n)}static after(e,n){return new Or(e.parentNode,Uo(e)+1,n)}}var an=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(an||(an={}));const Du=an.LTR,Ww=an.RTL;function BN(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const N9=BN("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),L9=BN("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),VS=Object.create(null),$r=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);VS[e]=n,VS[n]=-e}function VN(t){return t<=247?N9[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?L9[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const B9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ls{get dir(){return this.level%2?Ww:Du}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let o=-1;for(let a=0;a<e.length;a++){let c=e[a];if(c.from<=n&&c.to>=n){if(c.level==i)return a;(o<0||(r!=0?r<0?c.from<n:c.to>n:e[o].level>c.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function zN(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!zN(i.inner,r.inner))return!1}return!0}const Wt=[];function V9(t,e,n,i,r){for(let o=0;o<=i.length;o++){let a=o?i[o-1].to:e,c=o<i.length?i[o].from:n,f=o?256:r;for(let h=a,m=f,p=f;h<c;h++){let y=VN(t.charCodeAt(h));y==512?y=m:y==8&&p==4&&(y=16),Wt[h]=y==4?2:y,y&7&&(p=y),m=y}for(let h=a,m=f,p=f;h<c;h++){let y=Wt[h];if(y==128)h<c-1&&m==Wt[h+1]&&m&24?y=Wt[h]=m:Wt[h]=256;else if(y==64){let b=h+1;for(;b<c&&Wt[b]==64;)b++;let x=h&&m==8||b<n&&Wt[b]==8?p==1?1:8:256;for(let w=h;w<b;w++)Wt[w]=x;h=b-1}else y==8&&p==1&&(Wt[h]=1);m=y,y&7&&(p=y)}}}function z9(t,e,n,i,r){let o=r==1?2:1;for(let a=0,c=0,f=0;a<=i.length;a++){let h=a?i[a-1].to:e,m=a<i.length?i[a].from:n;for(let p=h,y,b,x;p<m;p++)if(b=VS[y=t.charCodeAt(p)])if(b<0){for(let w=c-3;w>=0;w-=3)if($r[w+1]==-b){let C=$r[w+2],E=C&2?r:C&4?C&1?o:r:0;E&&(Wt[p]=Wt[$r[w]]=E),c=w;break}}else{if($r.length==189)break;$r[c++]=p,$r[c++]=y,$r[c++]=f}else if((x=Wt[p])==2||x==1){let w=x==r;f=w?0:1;for(let C=c-3;C>=0;C-=3){let E=$r[C+2];if(E&2)break;if(w)$r[C+2]|=2;else{if(E&4)break;$r[C+2]|=4}}}}}function _9(t,e,n,i){for(let r=0,o=i;r<=n.length;r++){let a=r?n[r-1].to:t,c=r<n.length?n[r].from:e;for(let f=a;f<c;){let h=Wt[f];if(h==256){let m=f+1;for(;;)if(m==c){if(r==n.length)break;m=n[r++].to,c=r<n.length?n[r].from:e}else if(Wt[m]==256)m++;else break;let p=o==1,y=(m<e?Wt[m]:i)==1,b=p==y?p?1:2:i;for(let x=m,w=r,C=w?n[w-1].to:t;x>f;)x==C&&(x=n[--w].from,C=w?n[w-1].to:t),Wt[--x]=b;f=m}else o=h,f++}}}function zS(t,e,n,i,r,o,a){let c=i%2?2:1;if(i%2==r%2)for(let f=e,h=0;f<n;){let m=!0,p=!1;if(h==o.length||f<o[h].from){let w=Wt[f];w!=c&&(m=!1,p=w==16)}let y=!m&&c==1?[]:null,b=m?i:i+1,x=f;e:for(;;)if(h<o.length&&x==o[h].from){if(p)break e;let w=o[h];if(!m)for(let C=w.to,E=h+1;;){if(C==n)break e;if(E<o.length&&o[E].from==C)C=o[E++].to;else{if(Wt[C]==c)break e;break}}if(h++,y)y.push(w);else{w.from>f&&a.push(new ls(f,w.from,b));let C=w.direction==Du!=!(b%2);_S(t,C?i+1:i,r,w.inner,w.from,w.to,a),f=w.to}x=w.to}else{if(x==n||(m?Wt[x]!=c:Wt[x]==c))break;x++}y?zS(t,f,x,i+1,r,y,a):f<x&&a.push(new ls(f,x,b)),f=x}else for(let f=n,h=o.length;f>e;){let m=!0,p=!1;if(!h||f>o[h-1].to){let w=Wt[f-1];w!=c&&(m=!1,p=w==16)}let y=!m&&c==1?[]:null,b=m?i:i+1,x=f;e:for(;;)if(h&&x==o[h-1].to){if(p)break e;let w=o[--h];if(!m)for(let C=w.from,E=h;;){if(C==e)break e;if(E&&o[E-1].to==C)C=o[--E].from;else{if(Wt[C-1]==c)break e;break}}if(y)y.push(w);else{w.to<f&&a.push(new ls(w.to,f,b));let C=w.direction==Du!=!(b%2);_S(t,C?i+1:i,r,w.inner,w.from,w.to,a),f=w.from}x=w.from}else{if(x==e||(m?Wt[x-1]!=c:Wt[x-1]==c))break;x--}y?zS(t,x,f,i+1,r,y,a):x<f&&a.push(new ls(x,f,b)),f=x}}function _S(t,e,n,i,r,o,a){let c=e%2?2:1;V9(t,r,o,i,c),z9(t,r,o,i,c),_9(r,o,i,c),zS(t,r,o,e,n,i,a)}function H9(t,e,n){if(!t)return[new ls(0,0,e==Ww?1:0)];if(e==Du&&!n.length&&!B9.test(t))return _N(t.length);if(n.length)for(;t.length>Wt.length;)Wt[Wt.length]=256;let i=[],r=e==Du?0:1;return _S(t,r,r,n,0,t.length,i),i}function _N(t){return[new ls(0,t,0)]}let HN="";function F9(t,e,n,i,r){var o;if(!t.length)return null;let a=i.head-t.from,c;if(i.head==t.from&&i.assoc<0){if(!r)return null;a=e[c=0].side(!1,n)}else if(i.head==t.to&&i.assoc>0){if(r)return null;a=e[c=e.length-1].side(!0,n)}else c=ls.find(e,a,(o=i.bidiLevel)!==null&&o!==void 0?o:-1,i.assoc);let f=e[c],h=f.side(r,n);if(a==h){let y=c+=r?1:-1;if(y<0||y>=e.length)return null;f=e[c=y],a=f.side(!r,n),h=f.side(r,n)}let m=li(t.text,a,f.forward(r,n));(m<f.from||m>f.to)&&(m=h),HN=t.text.slice(Math.min(a,m),Math.max(a,m));let p=c==(r?e.length-1:0)?null:e[c+(r?1:-1)];if(m==h){if(!p)return r?xe.cursor(t.to,1):xe.cursor(t.from,-1);if(p.level+(r?0:1)<f.level)return xe.cursor(p.side(!r,n)+t.from,p.forward(r,n)?1:-1,p.level)}return xe.cursor(m+t.from,f.forward(r,n)?-1:1,f.level)}function U9(t,e,n){for(let i=e;i<n;i++){let r=VN(t.charCodeAt(i));if(r==1)return Du;if(r==2||r==4)return Ww}}const FN=We.define(),UN=We.define(),jN=We.define(),KN=We.define(),HS=We.define(),YN=We.define(),qN=We.define(),Xw=We.define(),$w=We.define(),GN=We.define({combine:t=>t.some(e=>e)}),WN=We.define({combine:t=>t.some(e=>e)}),XN=We.define();class xu{constructor(e,n,i,r,o,a=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new xu(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new xu(xe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const fp=$t.define({map:(t,e)=>t.map(e)}),$N=$t.define();function as(t,e,n){let i=t.facet(KN);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Hs=We.define({combine:t=>t.length?t[0]:!0});let j9=0;const lu=We.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}});class kr{constructor(e,n,i,r,o){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(lu.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(lu.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:i,eventObservers:r,provide:o,decorations:a}=n||{};return new kr(j9++,e,i,r,c=>{let f=[];return a&&f.push(jg.of(h=>{let m=h.plugin(c);return m?a(m):on.none})),o&&f.push(o(c)),f})}static fromClass(e,n){return kr.define((i,r)=>new e(i,r),n)}}class fb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(as(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){as(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){as(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const QN=We.define(),Qw=We.define(),jg=We.define(),ZN=We.define(),Zw=We.define(),pd=We.define(),JN=We.define();function XO(t,e){let n=t.state.facet(JN);if(!n.length)return n;let i=n.map(o=>o instanceof Function?o(t):o),r=[];return Mt.spans(i,e.from,e.to,{point(){},span(o,a,c,f){let h=o-e.from,m=a-e.from,p=r;for(let y=c.length-1;y>=0;y--,f--){let b=c[y].spec.bidiIsolate,x;if(f>0&&p.length&&(x=p[p.length-1]).to==h&&x.direction==b)x.to=m,p=x.inner;else{let w={from:h,to:m,direction:b,inner:[]};p.push(w),p=w.inner}}}}),eL(e.text,r)}function eL(t,e){for(let n of e){if(n.direction==null){for(let i=n.from,r=0;i<n.to;r++){let o=r<n.inner.length?n.inner[r]:null,a=U9(t,i,o?o.from:n.to);if(a){n.direction=a;break}if(!o)break;i=o.to}n.direction==null&&(n.direction=an.LTR)}eL(t,n.inner)}return e}const tL=We.define();function nL(t){let e=0,n=0,i=0,r=0;for(let o of t.state.facet(tL)){let a=o(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:e,right:n,top:i,bottom:r}}const of=We.define();class lr{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new lr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,o=0,a=0;;){let c=r<e.length?e[r].fromB:1e9,f=o<n.length?n[o]:1e9,h=Math.min(c,f);if(h==1e9)break;let m=h+a,p=h,y=m;for(;;)if(o<n.length&&n[o]<=p){let b=n[o+1];o+=2,p=Math.max(p,b);for(let x=r;x<e.length&&e[x].fromB<=p;x++)a=e[x].toA-e[x].toB;y=Math.max(y,b+a)}else if(r<e.length&&e[r].fromB<=p){let b=e[r++];p=Math.max(p,b.toB),y=Math.max(y,b.toA),a=b.toA-b.toB}else break;i.push(new lr(m,y,h,p))}return i}}class Rm{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=In.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let r=[];this.changes.iterChangedRanges((o,a,c,f)=>r.push(new lr(o,a,c,f))),this.changedRanges=r}static create(e,n,i){return new Rm(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const K9=[];class bn{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return K9}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&R9(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=Uo(this.dom),r=this.length?e>0:n>0;return new Or(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Yg)return e;return null}static get(e){return e.cmTile}}class Kg extends bn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,o=e?.node==n?e:null,a=0;for(let c of this.children){if(c.sync(e),a+=c.length+c.breakAfter,r=i?i.nextSibling:n.firstChild,o&&r!=c.dom&&(o.written=!0),c.dom.parentNode==n)for(;r&&r!=c.dom;)r=$O(r);else n.insertBefore(c.dom,r);i=c.dom}for(r=i?i.nextSibling:n.firstChild,o&&r&&(o.written=!0);r;)r=$O(r);this.length=a}}function $O(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Yg extends Kg{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=bn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,o=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&o++,r=n.pop()}else{let a=i.children[r++];if(a instanceof qs)n.push(r),i=a,r=0;else{let c=o+a.length,f=e(a,o);if(f!==void 0)return f;o=c+a.breakAfter}}}resolveBlock(e,n){let i,r=-1,o,a=-1;if(this.blockTiles((c,f)=>{let h=f+c.length;if(e>=f&&e<=h){if(c.isWidget()&&n>=-1&&n<=1){if(c.flags&32)return!0;c.flags&16&&(i=void 0)}(f<e||e==h&&(n<-1?c.length:c.covers(1)))&&(!i||!c.isWidget()&&i.isWidget())&&(i=c,r=e-f),(h>e||e==f&&(n>1?c.length:c.covers(-1)))&&(!o||!c.isWidget()&&o.isWidget())&&(o=c,a=e-f)}}),!i&&!o)throw new Error("No tile at position "+e);return i&&n<0||!o?{tile:i,offset:r}:{tile:o,offset:a}}}class qs extends Kg{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new qs(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class ku extends Kg{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new ku(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i=!1){let r=null,o=-1,a=null,c=-1;function f(m,p){for(let y=0,b=0;y<m.children.length&&b<=p;y++){let x=m.children[y],w=b+x.length;w>=p&&(x.isComposite()?f(x,p-b):(!a||i&&a.isHidden&&(n>0&&!(a.flags&32)||i&&q9(a,x)))&&(w>p||x.flags&32&&n<=1)?(a=x,c=p-b):(b<p||x.flags&16&&!(i&&x.isHidden)&&n>=-1)&&(r=x,o=p-b)),b=w}}f(this,e);let h=(n<0?r:a)||r||a;return h?{tile:h,offset:h==r?o:c}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):Y9(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:o}=i;if(this.dom.contains(r.dom))return r.isText()?new Or(r.dom,Math.min(r.dom.nodeValue.length,o)):r.domPosFor(o,r.flags&16?1:r.flags&32?-1:n);let a=i.tile.parent,c=!1;for(let f of a.children){if(c)return new Or(f.dom,0);f==i.tile&&(c=!0)}}return new Or(this.dom,0)}}function Y9(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=gf(e);return n[n.length-1]||null}function q9(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}class Di extends Kg{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new Di(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class Dl extends bn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let o=e,a=e,c=0;e==0&&n<0||e==r&&n>=0?Ve.chrome||Ve.gecko||(e?(o--,c=1):a<r&&(a++,c=-1)):n<0?o--:a<r&&a++;let f=zf(this.dom,o,a).getClientRects();if(!f.length)return null;let h=f[(c?c<0:n>=0)?0:f.length-1];return Ve.safari&&!c&&h.width==0&&(h=Array.prototype.find.call(f,m=>m.width)||h),i==null?h:Vf(h,(c?c>0:n<0)==i)}static of(e,n){let i=new Dl(n||document.createTextNode(e),e);return n||(i.flags|=2),i}}class ql extends bn{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return Vf(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let o=this.dom.getClientRects(),a=null;if(!o.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=c?o.length-1:0;a=o[f],!(e>0?f==0:f==o.length-1||a.top<a.bottom);f+=c?-1:1);return Vf(a,!c)}}get overrideDOMText(){if(!this.length)return kt.empty;let{root:e}=this;if(!e)return kt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,o){return o||(o=e.toDOM(n),e.editable||(o.contentEditable="false")),new ql(o,i,e,r)}}class Am extends bn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return kt.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:Vf(r,n>0==i)}}class G9{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:o,beforeBreak:a,parents:c}=this;for(;e||n>0;)if(r.isComposite())if(a){if(!e)break;i&&i.break(),e--,a=!1}else if(o==r.children.length){if(!e&&!c.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:o}=c.pop(),o++}else{let f=r.children[o],h=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!i||i.skip(f,0,f.length)!==!1||!f.isComposite)?(a=!!h,o++,e-=f.length):(c.push({tile:r,index:o}),r=f,o=0,i&&f.isComposite()&&i.enter(f))}else{let f=r.length;if(o<f&&e){let h=Math.min(e,f-o);i&&i.skip(r,o,o+h),e-=h,o+=h}if(o==f)a=!!r.breakAfter,{tile:r,index:o}=c.pop(),o++;else if(!e)break}return this.tile=r,this.index=o,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class W9{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}}class X9{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var o;this.flushBuffer();let a=this.ensureMarks(n,i),c=a.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let f=a.children[a.children.length-1]=new Dl(c.dom,c.text+e);f.parent=a}else a.append(r||Dl.of(e,(o=this.cache.find(Dl))===null||o===void 0?void 0:o.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?db(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let c=n.marks.length-1;c>=0;c--){let f=n.marks[c],h=r.lastChild;if(h instanceof Di&&h.mark.eq(f.mark))h.dom!=f.dom&&h.setDOM(db(f.dom)),r=h;else{let{dom:m}=f;this.cache.reused.get(f)&&bn.get(f.dom)&&(m=db(f.dom));let p=Di.of(f.mark,m);r.append(p),r=p}this.cache.reused.set(f,2)}let o=bn.get(e.text);o&&this.cache.reused.set(o,2);let a=new Dl(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let o=this.ensureMarks(n,i);!r&&!(e.flags&16)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=iL);let r=ku.start(e,n||((i=this.cache.find(ku))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let o=e.length-1;o>=0;o--){let a=e[o],c;if(n>0&&(c=r.lastChild)&&c instanceof Di&&c.mark.eq(a))r=c,n--;else{let f=Di.of(a,(i=this.cache.find(Di,h=>h.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(f),r=f,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!QO(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ve.ios&&QO(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(hb,0,32)||new ql(hb.toDOM(),0,hb,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new W9(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof qs&&r.wrapper.eq(i.wrapper))n=r;else{let o=qs.of(i.wrapper,(e=this.cache.find(qs,a=>a.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(o),n=o}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(Am,void 0,1);return i&&(i.flags=n),i||new Am(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class $9{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let c=this.textOff=Math.min(e,r.length);return o?null:r.slice(0,c)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const Om=[ql,ku,Dl,Di,Am,qs,Yg];for(let t=0;t<Om.length;t++)Om[t].bucket=t;class Q9{constructor(e){this.view=e,this.buckets=Om.map(()=>[]),this.index=Om.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,o=this.buckets[r],a=this.index[r];for(let c=0;c<o.length;c++){let f=(c+a)%o.length,h=o[f];if((!n||n(h))&&!this.reused.has(h))return o.splice(f,1),f<a&&this.index[r]--,this.reused.set(h,i),h}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let o=0,a=0;;o++){if(o==r.length){if(a)return null;a=1,o=0}let c=r[o];if(!this.reused.has(c)&&(a==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view,c.widget)))return r.splice(o,1),o<this.index[0]&&this.index[0]--,c.widget==e&&c.length==n&&(c.flags&497)==i?(this.reused.set(c,1),c):(this.reused.set(c,2),new ql(c.dom,n,e,c.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Z9{constructor(e,n,i,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new Q9(e),this.text=new $9(e.state.doc),this.builder=new X9(this.cache,new Yg(e,e.contentDOM),Mt.iter(i)),this.cache.reused.set(n,2),this.old=new G9(n),this.reuseWalker={skip:(a,c,f)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,o=0,a=0;;){let c=a<e.length?e[a++]:null,f=c?c.fromA:this.old.root.length;if(f>r){let h=f-r;this.preserve(h,!a,!c),r=f,o+=h}if(!c)break;n&&c.fromA<=n.range.fromA&&c.toA>=n.range.toA?(this.forward(c.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(o,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,c.toA),this.emit(n.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(o,c.toB)),o=c.toB,r=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=t7(this.old),o=this.openMarks;this.old.advance(e,i?1:-1,{skip:(a,c,f)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(f-c);else{let h=f>0||c<a.length?ql.of(a.widget,this.view,f-c,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,r,o),o=r.length)}else if(a.isText())this.builder.ensureLine(null),!c&&f==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,r,o,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(c,f),r,o)),o=r.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof Am)this.cache.add(a);else if(a instanceof Di)this.builder.ensureLine(null),this.builder.addMark(a,r,o),this.cache.reused.set(a,1),o=r.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof Di&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=o=0):a instanceof Di&&(r.shift(),o=Math.min(o,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,o=-1,a=Mt.spans(this.decorations,e,n,{point:(c,f,h,m,p,y)=>{if(h instanceof Yl){if(this.disallowBlockEffectsFor[y]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=m.length,p>m.length)r.continueWidget(f-c);else{let b=h.widget||(h.block?Pu.block:Pu.inline),x=J9(h),w=this.cache.findWidget(b,f-c,x)||ql.of(b,this.view,f-c,x);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(w)):(r.ensureLine(i),r.addInlineWidget(w,m,p))}i=null}else i=e7(i,h);f>c&&this.text.skip(f-c)},span:(c,f,h,m)=>{for(let p=c;p<f;){let y=this.text.next(Math.min(512,f-p));y==null?(r.addLineStartIfNotCovered(i),r.addBreak(),p++):(r.ensureLine(i),r.addText(y,h,p==c?m:h.length),p+=y.length),i=null}o=h.length}});o>-1&&(this.openWidget=a>o),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let o=bn.get(r);if(r==this.view.contentDOM)break;o instanceof Di?n.push(o):o?.isLine()?i=o:o instanceof qs||(r.nodeName=="DIV"&&!i?i=new ku(r,iL):i||n.push(Di.of(new dd({tagName:r.nodeName.toLowerCase(),attributes:A9(r)}),r)))}return i?{line:i,marks:n}:null}}function QO(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function J9(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const iL={class:"cm-line"};function e7(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&qw(n,t),i&&(t.class+=" "+i)),t}function t7(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof Di&&e.push(i.mark)}return e}function db(t){let e=bn.get(t);return e&&e.setDOM(t.cloneNode()),t}class Pu extends na{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Pu.inline=new Pu("span");Pu.block=new Pu("div");const hb=new class extends na{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ZO{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=on.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Yg(e,e.contentDOM),this.updateInner([new lr(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:m,toA:p})=>p<this.minWidthFrom||m>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!c7(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let o=r>-1?i7(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:m,to:p}=this.hasComposition;i=new lr(m,p,e.changes.mapPos(m,-1),e.changes.mapPos(p,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Ve.ie||Ve.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,c=this.blockWrappers;this.updateDeco();let f=o7(a,this.decorations,e.changes);f.length&&(i=lr.extendWithRanges(i,f));let h=a7(c,this.blockWrappers,e.changes);return h.length&&(i=lr.extendWithRanges(i,h)),o&&!i.some(m=>m.fromA<=o.range.fromA&&m.toA>=o.range.toA)&&(i=o.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let a=this.tile,c=new Z9(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&bn.get(n.text)&&c.cache.reused.set(bn.get(n.text),2),this.tile=c.run(e,n),FS(a,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Ve.chrome||Ve.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||i.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof pb&&r.push(o.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is($N)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,o=r==i,a=!o&&!(this.view.state.facet(Hs)||i.tabIndex>-1)&&mf(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(o||n||a))return;let c=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,h,m;if(f.empty?m=h=this.inlineDOMNearPos(f.anchor,f.assoc||1):(m=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),h=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Ve.gecko&&f.empty&&!this.hasComposition&&n7(h)){let y=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(y,h.node.childNodes[h.offset]||null)),h=m=new Or(y,0),c=!0}let p=this.view.observer.selectionRange;(c||!p.focusNode||(!yf(h.node,h.offset,p.anchorNode,p.anchorOffset)||!yf(m.node,m.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,f))&&(this.view.observer.ignore(()=>{Ve.android&&Ve.chrome&&i.contains(p.focusNode)&&u7(p.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let y=Bf(this.view.root);if(y)if(f.empty){if(Ve.gecko){let b=r7(h.node,h.offset);if(b&&b!=3){let x=(b==1?NN:LN)(h.node,h.offset);x&&(h=new Or(x.node,x.offset))}}y.collapse(h.node,h.offset),f.bidiLevel!=null&&y.caretBidiLevel!==void 0&&(y.caretBidiLevel=f.bidiLevel)}else if(y.extend){y.collapse(h.node,h.offset);try{y.extend(m.node,m.offset)}catch{}}else{let b=document.createRange();f.anchor>f.head&&([h,m]=[m,h]),b.setEnd(m.node,m.offset),b.setStart(h.node,h.offset),y.removeAllRanges(),y.addRange(b)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,m)),this.impreciseAnchor=h.precise?null:new Or(p.anchorNode,p.anchorOffset),this.impreciseHead=m.precise?null:new Or(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&yf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=Bf(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let c=a.posAtStart;if(n.head==c||n.head==c+a.length)return;let f=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!f||!h||f.bottom>h.top)return;let m=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(m.node,m.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&i.collapse(r,o)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let o;if(e==i.dom)o=i.dom.childNodes[n];else{let a=Qs(e)==0?0:n==0?-1:1;for(;;){let c=e.parentNode;if(c==i.dom)break;a==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?a=-1:a=1),e=c}a<0?o=e:o=e.nextSibling}if(o==i.dom.firstChild)return r;for(;o&&!bn.get(o);)o=o.nextSibling;if(!o)return r+i.length;for(let a=0,c=r;;a++){let f=i.children[a];if(f.dom==o)return c;c+=f.length+f.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,o=!1,a,c=-1,f=!1;return this.tile.blockTiles((h,m)=>{if(h.isWidget()){if(h.flags&32&&m>=e)return!0;h.flags&16&&(o=!0)}else{let p=m+h.length;if(m<=e&&(i=h,r=e-m,o=p<e),p>=e&&!a&&(a=h,c=e-m,f=m>e),m>e&&a)return!0}}),!i&&!a?this.domAtPos(e,n):(o&&a?i=null:f&&i&&(a=null),i&&n<0||!a?i.domIn(r,n):a.domIn(c,n))}coordsAt(e,n,i){let{tile:r,offset:o}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof pb?null:r.coordsInWidget(o,n,!0):r.coordsIn(o,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(o,a){if(o.isComposite())for(let c of o.children){if(c.length>=a){let f=r(c,a);if(f)return f}if(a-=c.length,a<0)break}else if(o.isText()&&a<o.length){let c=li(o.text,a);if(c==a)return null;let f=zf(o.dom,a,c).getClientRects();for(let h=0;h<f.length;h++){let m=f[h];if(h==f.length-1||m.top<m.bottom&&m.left<m.right)return m}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,o=this.view.contentDOM.clientWidth,a=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,f=this.view.textDirection==an.LTR,h=0,m=(p,y,b)=>{for(let x=0;x<p.children.length&&!(y>r);x++){let w=p.children[x],C=y+w.length,E=w.dom.getBoundingClientRect(),{height:O}=E;if(b&&!x&&(h+=E.top-b.top),w instanceof qs)C>i&&m(w,y,E);else if(y>=i&&(h>0&&n.push(-h),n.push(O+h),h=0,a)){let T=w.dom.lastChild,A=T?gf(T):[];if(A.length){let D=A[A.length-1],k=f?D.right-E.left:E.right-D.left;k>c&&(c=k,this.minWidth=o,this.minWidthFrom=y,this.minWidthTo=C)}}b&&x==p.children.length-1&&(h+=b.bottom-E.bottom),y=C+w.breakAfter}};return m(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?an.RTL:an.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let c=0,f;for(let h of a.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let m=gf(h.dom);if(m.length!=1)return;c+=m[0].width,f=m[0].height}if(c)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:c/a.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),i,r,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=gf(n.firstChild)[0];i=n.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,o=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:o}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let o=r==n.viewports.length?null:n.viewports[r],a=o?o.from-1:this.view.state.doc.length;if(a>i){let c=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(on.replace({widget:new pb(c),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!o)break;i=o.to+1}return on.set(e)}updateDeco(){let e=1,n=this.view.state.facet(jg).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),i=!1,r=this.view.state.facet(Zw).map((o,a)=>{let c=typeof o=="function";return c&&(i=!0),c?o(this.view):o});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(Mt.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(ZN).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(XN))try{if(h(this.view,e.range,e))return!0}catch(m){as(this.view.state,m,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let o=nL(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:c,offsetHeight:f}=this.view.scrollDOM;if(D9(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==an.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(n.head,1);if(h){let m=DN(h.dom);h.dom.scrollIntoView({block:"nearest"}),kN(m,!1)}}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){FS(this.tile)}}function FS(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)FS(i,e)}}function n7(t){return Yn(t.node)&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function rL(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=NN(n.focusNode,n.focusOffset),r=LN(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let c=bn.get(r.node);if(!c||c.isText()&&c.text!=r.node.nodeValue)o=r;else if(t.docView.lastCompositionAfterCursor){let f=bn.get(i.node);!f||f.isText()&&f.text!=i.node.nodeValue||(o=r)}}if(t.docView.lastCompositionAfterCursor=o!=i,!o)return null;let a=e-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}function i7(t,e,n){let i=rL(t,n);if(!i)return null;let{node:r,from:o,to:a}=i,c=r.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(i.from,i.to)!=c)return null;let f=e.invertedDesc;return{range:new lr(f.mapPos(o),f.mapPos(a),o,a),text:r}}function r7(t,e){return Yn(t)?(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0):0}let s7=class{constructor(){this.changes=[]}compareRange(e,n){bu(e,n,this.changes)}comparePoint(e,n){bu(e,n,this.changes)}boundChange(e){bu(e,e,this.changes)}};function o7(t,e,n){let i=new s7;return Mt.compare(t,e,n,i),i.changes}class l7{constructor(){this.changes=[]}compareRange(e,n){bu(e,n,this.changes)}comparePoint(){}boundChange(e){bu(e,e,this.changes)}}function a7(t,e,n){let i=new l7;return Mt.compare(t,e,n,i),i.changes}function u7(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(Yn(n)&&n.contentEditable=="false")return!0;return!1}function c7(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}class pb extends na{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function f7(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),o=e-r.from;if(r.length==0)return xe.cursor(e);o==0?n=1:o==r.length&&(n=-1);let a=o,c=o;n<0?a=li(r.text,o,!1):c=li(r.text,o);let f=i(r.text.slice(a,c));for(;a>0;){let h=li(r.text,a,!1);if(i(r.text.slice(h,a))!=f)break;a=h}for(;c<r.length;){let h=li(r.text,c);if(i(r.text.slice(c,h))!=f)break;c=h}return xe.undirectionalRange(a+r.from,c+r.from)}function d7(t,e,n,i,r){let o=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,f=Math.floor((r-n.top-(t.defaultLineHeight-c)*.5)/c);o+=f*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+x9(a,o,t.state.tabSize)}function US(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let o of i.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!r||o.type==ii.Text&&(r.type!=o.type||(n<0?o.from<e:o.to>e)))&&(r=o)}}return r||i}return i}function h7(t,e,n,i){let r=US(t,e.head,e.assoc||-1),o=!i||r.type!=ii.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(o){let a=t.dom.getBoundingClientRect(),c=t.textDirectionAt(r.from),f=t.posAndSideAtCoords({x:n==(c==an.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(f)return xe.cursor(f.pos,f.assoc)}return xe.cursor(n?r.to:r.from,n?1:-1)}function JO(t,e,n,i){let r=t.state.doc.lineAt(e.head),o=t.bidiSpans(r),a=t.textDirectionAt(r.from);for(let c=e,f=null;;){let h=F9(r,o,a,c,n),m=HN;if(!h){if(r.number==(n?t.state.doc.lines:1))return c;m=`
17
+ `,r=t.state.doc.line(r.number+(n?1:-1)),o=t.bidiSpans(r),h=n?xe.cursor(r.from,-1):xe.cursor(r.to,1)}if(f){if(!f(m))return c}else{if(!i)return h;f=i(m)}c=h}}function p7(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return o=>{let a=i(o);return r==Us.Space&&(r=a),r==a}}function m7(t,e,n,i){let r=e.head,o=n?1:-1;if(r==(n?t.state.doc.length:0))return xe.cursor(r,e.assoc);let a=e.goalColumn,c,f=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),m=t.documentTop;if(h)a==null&&(a=h.left-f.left),c=o<0?h.top:h.bottom;else{let x=t.viewState.lineBlockAt(r);a==null&&(a=Math.min(f.right-f.left,t.defaultCharacterWidth*(r-x.from))),c=(o<0?x.top:x.bottom)+m}let p=f.left+a,y=t.viewState.heightOracle.textHeight>>1,b=i??y;for(let x=0;;x+=y){let w=c+(b+x)*o,C=jS(t,{x:p,y:w},!1,o);if(n?w>f.bottom:w<f.top)return xe.cursor(C.pos,C.assoc);let E=t.coordsAtPos(C.pos,C.assoc),O=E?(E.top+E.bottom)/2:0;if(!E||(n?O>c:O<c))return xe.cursor(C.pos,C.assoc,void 0,a)}}function vf(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(o,a,c)=>{if(e>o&&e<a){let f=i||n||(e-o<a-e?-1:1);e=f<0?o:a,i=f}});if(!i)return e}}function sL(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],o=null;if(r.empty){let a=vf(t,r.from,0);a!=r.from&&(o=xe.cursor(a,-1))}else{let a=vf(t,r.from,-1),c=vf(t,r.to,1);(a!=r.from||c!=r.to)&&(r.undirectional?o=xe.undirectionalRange(r.from,r.to):o=xe.range(r.from==r.anchor?a:c,r.from==r.head?a:c))}o&&(n||(n=e.ranges.slice()),n[i]=o)}return n?xe.create(n,e.mainIndex):e}function mb(t,e,n){let i=vf(t.state.facet(pd).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:xe.cursor(i,i<n.from?1:-1)}class ss{constructor(e,n){this.pos=e,this.assoc=n}}function jS(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),o=r.top+t.viewState.paddingTop,{x:a,y:c}=e,f=c-o,h;for(;;){if(f<0)return new ss(0,1);if(f>t.viewState.docHeight)return new ss(t.state.doc.length,-1);if(h=t.elementAtHeight(f),i==null)break;if(h.type==ii.Text){if(i<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let y=t.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(y&&(i<0?y.top<=f+o:y.bottom>=f+o))break}let p=t.viewState.heightOracle.textHeight/2;f=i>0?h.bottom+p:h.top-p}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(n)return null;if(h.type==ii.Text){let p=d7(t,r,h,a,c);return new ss(p,p==h.from?1:-1)}}if(h.type!=ii.Text)return f<(h.top+h.bottom)/2?new ss(h.from,1):new ss(h.to,-1);let m=t.docView.lineAt(h.from,2);return(!m||m.length!=h.length)&&(m=t.docView.lineAt(h.from,-2)),new g7(t,a,c,t.textDirectionAt(h.from)).scanTile(m,h.from)}class g7{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[ls.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[ls.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,o=e.length-1,a=new Set,c=this.bidiIn(e[0],e[o]),f,h,m=-1,p=1e9,y;e:for(;r<o;){let x=o-r,w=r+o>>1;t:if(a.has(w)){for(let O=1;O<x;O++){let T=w+O;if(T>=o&&(T-=x),!a.has(T)){w=T;break t}}break e}a.add(w);let C=n(w),E=0;if(C)for(let O=0;O<C.length;O++){let T=C[O];if(!(T.width==0&&C.length>1))if(T.bottom<this.y)(!f||f.bottom<T.bottom)&&(f=T),E=1;else if(T.top>this.y)(!h||h.top>T.top)&&(h=T),E=-1;else{let A=T.left>this.x?this.x-T.left:T.right<this.x?this.x-T.right:0,D=Math.abs(A);D<p&&(m=w,p=D,y=T),A&&(E=A<0==(this.baseDir==an.LTR)?-1:1)}}E==-1&&(!c||this.baseDirAt(e[w],1))?o=w:E==1&&(!c||this.baseDirAt(e[w+1],-1))&&(r=w+1)}if(!y){if(!h&&!f)return{i:0,after:!1};let x=f&&(!h||this.y-f.bottom<h.top-this.y)?f:h;return this.y=(x.top+x.bottom)/2,this.scan(e,n,!0)}if(p&&!i){let{top:x,bottom:w}=y;if(f&&f.bottom>(x+x+w)/3)return this.y=f.bottom-1,this.scan(e,n,!0);if(h&&h.top<(x+w+w)/3)return this.y=h.top+1,this.scan(e,n,!0)}let b=(c?this.dirAt(e[m],1):this.baseDir)==an.LTR;return{i:m,after:this.x>(y.left+y.right)/2==b}}scanText(e,n){let i=[];for(let o=0;o<e.length;o=li(e.text,o))i.push(n+o);i.push(n+e.length);let r=this.scan(i,o=>{let a=i[o]-n,c=i[o+1]-n;return zf(e.dom,a,c).getClientRects()});return r.after?new ss(i[r.i+1],-1):new ss(i[r.i],1)}scanTile(e,n){if(!e.length)return new ss(n,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,n);if(c.isComposite())return this.scanTile(c,n)}let i=[n];for(let c=0,f=n;c<e.children.length;c++)i.push(f+=e.children[c].length);let r=this.scan(i,c=>{let f=e.children[c];return f.flags&48?null:(Yn(f.dom)?f.dom:zf(f.dom,0,f.length)).getClientRects()}),o=e.children[r.i],a=i[r.i];return o.isText()?this.scanText(o,a):o.isComposite()?this.scanTile(o,a):r.after?new ss(i[r.i+1],-1):new ss(a,1)}}const nu="￿";class y7{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ut.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=nu}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let o=this.text.length;this.readNode(r);let a=bn.get(r),c=r.nextSibling;if(c==n){a?.breakAfter&&!c&&i!=this.view.contentDOM&&this.lineBreak();break}let f=bn.get(c);(a&&f?a.breakAfter:(a?a.breakAfter:Tm(r))||Tm(c)&&(r.nodeName!="BR"||a?.isWidget())&&this.text.length>o)&&!b7(c,n)&&this.lineBreak(),r=c}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,c;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(c=r.exec(n))&&(o=c.index,a=c[0].length),this.append(n.slice(i,o<0?n.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=a-1);i=o+a}}readNode(e){let n=bn.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else Mu(e)?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():Yn(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(Mu(e)?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(v7(e,i.node,i.offset)?n:0))}}function v7(t,e,n){for(;;){if(!e||n<Qs(e))return!1;if(e==t)return!0;n=Uo(e)+1,e=e.parentNode}}function b7(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=bn.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}class eM{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class S7{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView,c=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=oL(e.docView.tile,n,i,0))){let f=o||a?[]:w7(e),h=new y7(f,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=C7(f,this.bounds.from)}else{let f=e.observer.selectionRange,h=o&&o.node==f.focusNode&&o.offset==f.focusOffset||!BS(e.contentDOM,f.focusNode)?c.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),m=a&&a.node==f.anchorNode&&a.offset==f.anchorOffset||!BS(e.contentDOM,f.anchorNode)?c.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),p=e.viewport;if((Ve.ios||Ve.chrome)&&h!=m&&Math.min(h,m)<=c.main.from&&Math.max(h,m)>=c.main.to&&(p.from>0||p.to<e.state.doc.length)){let y=Math.min(h,m),b=Math.max(h,m),x=p.from-y,w=p.to-b;(x==0||x==1||y==0)&&(w==0||w==-1||b==e.state.doc.length)&&(h=0,m=e.state.doc.length)}if(e.inputState.composing>-1&&c.ranges.length>1)this.newSel=c.replaceRange(xe.range(m,h));else if(e.lineWrapping&&m==h&&!(c.main.empty&&c.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let y=e.coordsAtPos(h,-1),b=0;y&&(b=e.inputState.lastTouchY<=y.bottom?-1:1),this.newSel=xe.create([xe.cursor(h,b)])}else this.newSel=xe.single(m,h)}}}function oL(t,e,n,i){if(t.isComposite()){let r=-1,o=-1,a=-1,c=-1;for(let f=0,h=i,m=i;f<t.children.length;f++){let p=t.children[f],y=h+p.length;if(h<e&&y>n)return oL(p,e,n,h);if(y>=e&&r==-1&&(r=f,o=h),h>n&&p.dom.parentNode==t.dom){a=f,c=m;break}m=y,h=y+p.breakAfter}return{from:o,to:c<0?i+t.length:c,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function lL(t,e){let n,{newSel:i}=e,{state:r}=t,o=r.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:f}=e.bounds,h=o.from,m=null;(a===8||Ve.android&&e.text.length<f-c)&&(h=o.to,m="end");let p=r.doc.sliceString(c,f,nu),y,b;!o.empty&&o.from>=c&&o.to<=f&&(e.typeOver||p!=e.text)&&p.slice(0,o.from-c)==e.text.slice(0,o.from-c)&&p.slice(o.to-c)==e.text.slice(y=e.text.length-(p.length-(o.to-c)))?n={from:o.from,to:o.to,insert:kt.of(e.text.slice(o.from-c,y).split(nu))}:(b=aL(p,e.text,h-c,m))&&(Ve.chrome&&a==13&&b.toB==b.from+2&&e.text.slice(b.from,b.toB)==nu+nu&&b.toB--,n={from:c+b.from,to:c+b.toA,insert:kt.of(e.text.slice(b.from,b.toB).split(nu))})}else i&&(!t.hasFocus&&r.facet(Hs)||KS(i,o))&&(i=null);if(!n&&!i)return!1;if((Ve.mac||Ve.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=xe.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:kt.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&t.docView.lineHasWidget(o.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:r.toText(t.inputState.insertingText)}:Ve.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==`
18
+ `&&t.lineWrapping&&(i&&(i=xe.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:kt.of([" "])}),n)return Jw(t,n,i,a);if(i&&!KS(i,o)){let c=!1,f="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(c=!0),f=t.inputState.lastSelectionOrigin,f=="select.pointer"&&(i=sL(r.facet(pd).map(h=>h(t)),i))),t.dispatch({selection:i,scrollIntoView:c,userEvent:f}),!0}else return!1}function Jw(t,e,n,i=-1){if(Ve.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(Ve.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Su(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Su(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Su(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,c=()=>a||(a=x7(t,e,n));return t.state.facet(YN).some(f=>f(t,e.from,e.to,o,c))||t.dispatch(c()),!0}function x7(t,e,n){let i,r=t.state,o=r.selection.main,a=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let f=e.from<o.from?-1:1,h=f<0?o.from:o.to,m=vf(r.facet(pd).map(p=>p(t)),h,f);e.from==m&&(a=m)}if(a>-1)i={changes:e,selection:xe.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=o.from<e.from?r.sliceDoc(o.from,e.from):"",h=o.to>e.to?r.sliceDoc(e.to,o.to):"";i=r.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let f=r.changes(e),h=n&&n.main.to<=f.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let m=t.state.sliceDoc(e.from,e.to),p,y=n&&rL(t,n.main.head);if(y){let x=e.insert.length-(e.to-e.from);p={from:y.from,to:y.to-x}}else p=t.state.doc.lineAt(o.head);let b=o.to-e.to;i=r.changeByRange(x=>{if(x.from==o.from&&x.to==o.to)return{changes:f,range:h||x.map(f)};let w=x.to-b,C=w-m.length;if(t.state.sliceDoc(C,w)!=m||w>=p.from&&C<=p.to)return{range:x};let E=r.changes({from:C,to:w,insert:e.insert}),O=x.to-o.to;return{changes:E,range:h?xe.range(Math.max(0,h.anchor+O),Math.max(0,h.head+O)):x.map(E)}})}else i={changes:f,selection:h&&r.selection.replaceRange(h)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:c,scrollIntoView:!0})}function aL(t,e,n,i){let r=Math.min(t.length,e.length),o=0;for(;o<r&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==r&&t.length==e.length)return null;let a=t.length,c=e.length;for(;a>0&&c>0&&t.charCodeAt(a-1)==e.charCodeAt(c-1);)a--,c--;if(i=="end"){let f=Math.max(0,o-Math.min(a,c));n-=a+f-o}if(a<o&&t.length<e.length){let f=n<=o&&n>=a?o-n:0;o-=f,c=o+(c-a),a=o}else if(c<o){let f=n<=o&&n>=c?o-n:0;o-=f,a=o+(a-c),c=o}return{from:o,toA:a,toB:c}}function w7(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new eM(n,i)),(r!=n||o!=i)&&e.push(new eM(r,o))),e}function C7(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n<0||i<0?null:n==i?xe.create([xe.cursor(i+e,-1)]):xe.single(n+e,i+e)}function KS(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class E7{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ve.safari&&e.contentDOM.addEventListener("input",()=>null),Ve.gecko&&H7(e.contentDOM.ownerDocument)}handleEvent(e){!I7(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=R7(e),i=this.handlers,r=this.view.contentDOM;for(let o in n)if(o!="scroll"){let a=!n[o].handlers.length,c=i[o];c&&a!=!c.handlers.length&&(r.removeEventListener(o,this.handleEvent),c=null),c||r.addEventListener(o,this.handleEvent,{passive:a})}for(let o in i)o!="scroll"&&!n[o]&&r.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&cL.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ve.android&&Ve.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Ve.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(uL.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||A7.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};n.shiftKey&&Ve.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&T7(this.view.win)&&(n.shiftKey=!1);let i=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n};return setTimeout(()=>{this.pendingIOSKey==i&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||this.view.observer.pendingRecords().length||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Su(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ve.safari&&!Ve.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function T7(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function tM(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){as(n.state,r)}}}function R7(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,o=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(o)for(let c in o){let f=o[c];f&&n(c).handlers.push(tM(i.value,f))}if(a)for(let c in a){let f=a[c];f&&n(c).observers.push(tM(i.value,f))}}for(let i in Pr)n(i).handlers.push(Pr[i]);for(let i in bi)n(i).observers.push(bi[i]);return e}const uL=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],A7="dthko",cL=[16,17,18,20,91,92,224,225],dp=6;function hp(t){return Math.max(0,t)*.7+8}function O7(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class M7{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=MN(e.contentDOM),this.atoms=e.state.facet(pd).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ut.allowMultipleSelections)&&D7(e,n),this.dragging=P7(e,n)&&hL(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&O7(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,o=0,a=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:c}=this.scrollParents.y.getBoundingClientRect());let f=nL(this.view);e.clientX-f.left<=r+dp?n=-hp(r-e.clientX):e.clientX+f.right>=a-dp&&(n=hp(e.clientX-a)),e.clientY-f.top<=o+dp?i=-hp(o-e.clientY):e.clientY+f.bottom>=c-dp&&(i=hp(e.clientY-c)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=sL(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function D7(t,e){let n=t.state.facet(FN);return n.length?n[0](e):Ve.mac?e.metaKey:e.ctrlKey}function k7(t,e){let n=t.state.facet(UN);return n.length?n[0](e):Ve.mac?!e.altKey:!e.ctrlKey}function P7(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Bf(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let o=0;o<r.length;o++){let a=r[o];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function I7(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=bn.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const Pr=Object.create(null),bi=Object.create(null),fL=Ve.ie&&Ve.ie_version<15||Ve.ios&&Ve.webkit_version<604;function N7(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),dL(t,n.value)},50)}function qg(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function dL(t,e){e=qg(t.state,Xw,e);let{state:n}=t,i,r=1,o=n.toText(e),a=o.lines==n.selection.ranges.length;if(YS!=null&&n.selection.ranges.every(f=>f.empty)&&YS==o.toString()){let f=-1;i=n.changeByRange(h=>{let m=n.doc.lineAt(h.from);if(m.from==f)return{range:h};f=m.from;let p=n.toText((a?o.line(r++).text:e)+n.lineBreak);return{changes:{from:m.from,insert:p},range:xe.cursor(h.from+p.length,-1)}})}else a?i=n.changeByRange(f=>{let h=o.line(r++);return{changes:{from:f.from,to:f.to,insert:h.text},range:xe.cursor(f.from+h.length,-1)}}):i=n.replaceSelection(o);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}bi.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,Ve.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};bi.wheel=bi.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Pr.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);bi.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};bi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};bi.touchend=(t,e)=>{t.inputState.touchActive=!1};Pr.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(jN))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=B7(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new M7(t,e,n,i)),i&&t.observer.ignore(()=>{PN(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function nM(t,e,n,i){if(i==1)return xe.cursor(e,n);if(i==2)return f7(t.state,e,n);{let r=t.docView.lineAt(e,n),o=t.state.doc.lineAt(r?r.posAtEnd:e),a=r?r.posAtStart:o.from,c=r?r.posAtEnd:o.to;return c<t.state.doc.length&&c==o.to&&c++,xe.undirectionalRange(a,c)}}const L7=Ve.ie&&Ve.ie_version<=11;let iM=null,rM=0,sM=0;function hL(t){if(!L7)return t.detail;let e=iM,n=sM;return iM=t,sM=Date.now(),rM=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(rM+1)%3:1}function B7(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=hL(e),r=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),r=r.map(o.changes))},get(o,a,c){let f=t.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),h,m=nM(t,f.pos,f.assoc,i);if(n.pos!=f.pos&&!a){let p=nM(t,n.pos,n.assoc,i),y=Math.min(p.from,m.from),b=Math.max(p.to,m.to);m=y<m.from?xe.range(y,b,m.assoc):xe.range(b,y,m.assoc)}return a?r.replaceRange(r.main.extend(m.from,m.to,m.assoc)):c&&i==1&&r.ranges.length>1&&(h=V7(r,f.pos))?h:c?r.addRange(m):xe.create([m])}}}function V7(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return xe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Pr.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let o=r.posAtStart,a=o+r.length;(o>=n.to||a<=n.from)&&(n=xe.undirectionalRange(o,a))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",qg(t.state,$w,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Pr.dragend=t=>(t.inputState.draggedContent=null,!1);function oM(t,e,n,i){if(n=qg(t.state,Xw,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,a=i&&o&&k7(t,e)?{from:o.from,to:o.to}:null,c={from:r,insert:n},f=t.state.changes(a?[a,c]:c);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(r,-1),head:f.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Pr.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&oM(t,e,i.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let c=new FileReader;c.onerror=o,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(i[a]=c.result),o()},c.readAsText(n[a])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return oM(t,e,i,!0),!0}return!1};Pr.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=fL?null:e.clipboardData;return n?(dL(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(N7(t),!1)};function z7(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function _7(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:o}of t.selection.ranges){let a=t.doc.lineAt(o);a.number>r&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),r=a.number}i=!0}return{text:qg(t,$w,e.join(t.lineBreak)),ranges:n,linewise:i}}let YS=null;Pr.copy=Pr.cut=(t,e)=>{if(!mf(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=_7(t.state);if(!n&&!r)return!1;YS=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=fL?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(z7(t,n),!1)};const pL=Zo.define();function mL(t,e){let n=[];for(let i of t.facet(qN)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:pL.of(!0)}):null}function gL(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=mL(t.state,e);n?t.dispatch(n):t.update([])}},10)}bi.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),gL(t)};bi.blur=t=>{t.observer.clearSelectionRange(),gL(t)};bi.compositionstart=bi.compositionupdate=(t,e)=>{if(!t.observer.editContext&&(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0)){let{main:n}=t.state.selection;!n.empty&&t.lineBlockAt(n.from).from!=t.lineBlockAt(n.to).from&&!t.state.readOnly&&t.dispatch({changes:t.state.selection.ranges.filter(i=>!i.empty).map(i=>({from:i.from,to:i.to})),userEvent:"input"}),t.inputState.composing=0}};bi.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ve.chrome&&Ve.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};bi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Pr.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let c=a[0],f=t.posAtDOM(c.startContainer,c.startOffset),h=t.posAtDOM(c.endContainer,c.endOffset);return Jw(t,{from:f,to:h,insert:t.state.toText(o)},null),!0}}let r;if(Ve.chrome&&Ve.android&&(r=uL.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let o=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ve.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ve.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>bi.compositionend(t,e),20),!1};const lM=new Set;function H7(t){lM.has(t)||(lM.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const aM=["pre-wrap","normal","pre-line","break-spaces"];let Iu=!1;function uM(){Iu=!1}class F7{constructor(e){this.lineWrapping=e,this.doc=kt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return aM.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,o,a){let c=aM.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=c;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=o,f){this.heightSamples={};for(let h=0;h<a.length;h++){let m=a[h];m<0?h++:this.heightSamples[Math.floor(m*10)]=!0}}return f}}class U7{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Ar{constructor(e,n,i,r,o){this.from=e,this.length=n,this.top=i,this.height=r,this._content=o}get type(){return typeof this._content=="number"?ii.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Yl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ar(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var sn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(sn||(sn={}));const Yp=.001;class yi{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Yp&&(Iu=!0),this.height=e)}replace(e,n,i){return yi.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let o=this,a=i.doc;for(let c=r.length-1;c>=0;c--){let{fromA:f,toA:h,fromB:m,toB:p}=r[c],y=o.lineAt(f,sn.ByPosNoHeight,i.setDoc(n),0,0),b=y.to>=h?y:o.lineAt(h,sn.ByPosNoHeight,i,0,0);for(p+=b.to-h,h=b.to;c>0&&y.from<=r[c-1].toA;)f=r[c-1].fromA,m=r[c-1].fromB,c--,f<y.from&&(y=o.lineAt(f,sn.ByPosNoHeight,i,0,0));m+=y.from-f,f=y.from;let x=e1.build(i.setDoc(a),e,m,p);o=Mm(o,o.replace(f,h,x))}return o.updateHeight(i,0)}static empty(){return new Ui(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,o=0;for(;;)if(n==i)if(r>o*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),i+=1+c.break,r-=c.size}else if(o>r*2){let c=e[i];c.break?e.splice(i,1,c.left,null,c.right):e.splice(i,1,c.left,c.right),i+=2+c.break,o-=c.size}else break;else if(r<o){let c=e[n++];c&&(r+=c.size)}else{let c=e[--i];c&&(o+=c.size)}let a=!1;return e[n-1]==null?(a=!0,n--):e[n]==null&&(a=!0,i++),new K7(yi.of(e.slice(0,n)),a,yi.of(e.slice(i)))}}function Mm(t,e){return t==e?t:(t.constructor!=e.constructor&&(Iu=!0),e)}yi.prototype.size=1;const j7=on.replace({});class yL extends yi{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new Ar(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new Ar(r,0,i,this.spaceAbove,j7):this.mainBlock(i,r)}lineAt(e,n,i,r,o){let a=this.mainBlock(r,o);return this.spaceAbove?this.blockAt(0,i,r,o).join(a):a}forEachLine(e,n,i,r,o,a){e<=o+this.length&&n>=o&&a(this.lineAt(0,sn.ByPos,i,r,o))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ui extends yL{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new Ar(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof Ui||r instanceof ti&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof ti?r=new Ui(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):yi.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ti extends yi{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,o=r-i+1,a,c=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*o);a=f/o,this.length>o+1&&(c=(this.height-f)/(this.length-o-1))}else a=this.height/o;return{firstLine:i,lastLine:r,perLine:a,perChar:c}}blockAt(e,n,i,r){let{firstLine:o,lastLine:a,perLine:c,perChar:f}=this.heightMetrics(n,r);if(n.lineWrapping){let h=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),m=n.doc.lineAt(h),p=c+m.length*f,y=Math.max(i,e-p/2);return new Ar(m.from,m.length,y,p,0)}else{let h=Math.max(0,Math.min(a-o,Math.floor((e-i)/c))),{from:m,length:p}=n.doc.line(o+h);return new Ar(m,p,i+c*h,c,0)}}lineAt(e,n,i,r,o){if(n==sn.ByHeight)return this.blockAt(e,i,r,o);if(n==sn.ByPosNoHeight){let{from:b,to:x}=i.doc.lineAt(e);return new Ar(b,x-b,0,0,0)}let{firstLine:a,perLine:c,perChar:f}=this.heightMetrics(i,o),h=i.doc.lineAt(e),m=c+h.length*f,p=h.number-a,y=r+c*p+f*(h.from-o-p);return new Ar(h.from,h.length,Math.max(r,Math.min(y,r+this.height-m)),m,0)}forEachLine(e,n,i,r,o,a){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:c,perLine:f,perChar:h}=this.heightMetrics(i,o);for(let m=e,p=r;m<=n;){let y=i.doc.lineAt(m);if(m==e){let x=y.number-c;p+=f*x+h*(e-o-x)}let b=f+h*y.length;a(new Ar(y.from,y.length,p,b,0)),p+=b,m=y.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let o=i[i.length-1];o instanceof ti?i[i.length-1]=new ti(o.length+r):i.push(null,new ti(r-1))}if(e>0){let o=i[0];o instanceof ti?i[0]=new ti(e+o.length):i.unshift(new ti(e-1),null)}return yi.of(i)}decomposeLeft(e,n){n.push(new ti(e-1),null)}decomposeRight(e,n){n.push(null,new ti(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let o=n+this.length;if(r&&r.from<=n+this.length&&r.more){let a=[],c=Math.max(n,r.from),f=-1;for(r.from>n&&a.push(new ti(r.from-n-1).updateHeight(e,n));c<=o&&r.more;){let m=e.doc.lineAt(c).length;a.length&&a.push(null);let p=r.heights[r.index++],y=0;p<0&&(y=-p,p=r.heights[r.index++]),f==-1?f=p:Math.abs(p-f)>=Yp&&(f=-2);let b=new Ui(m,p,y);b.outdated=!1,a.push(b),c+=m+1}c<=o&&a.push(null,new ti(o-c).updateHeight(e,c));let h=yi.of(a);return(f<0||Math.abs(h.height-this.height)>=Yp||Math.abs(f-this.heightMetrics(e,n).perLine)>=Yp)&&(Iu=!0),Mm(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class K7 extends yi{constructor(e,n,i){super(e.length+(n?1:0)+i.length,e.height+i.height,(n?1:0)|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let o=i+this.left.height;return e<o?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,o,r+this.left.length+this.break)}lineAt(e,n,i,r,o){let a=r+this.left.height,c=o+this.left.length+this.break,f=n==sn.ByHeight?e<a:e<c,h=f?this.left.lineAt(e,n,i,r,o):this.right.lineAt(e,n,i,a,c);if(this.break||(f?h.to<c:h.from>c))return h;let m=n==sn.ByPosNoHeight?sn.ByPosNoHeight:sn.ByPos;return f?h.join(this.right.lineAt(c,m,i,a,c)):this.left.lineAt(c,m,i,r,o).join(h)}forEachLine(e,n,i,r,o,a){let c=r+this.left.height,f=o+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,i,r,o,a),n>=f&&this.right.forEachLine(e,n,i,c,f,a);else{let h=this.lineAt(f,sn.ByPos,i,r,o);e<h.from&&this.left.forEachLine(e,Math.min(n,h.from-1),i,r,o,a),h.to>=e&&h.from<=n&&a(h),n>h.to&&this.right.forEachLine(Math.max(e,h.to+1),n,i,c,f,a)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let c of i)o.push(c);if(e>0&&cM(o,a-1),n<this.length){let c=o.length;this.decomposeRight(n,o),cM(o,c)}return yi.of(o)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?yi.of(this.break?[e,null,n]:[e,n]):(this.left=Mm(this.left,e),this.right=Mm(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,r){let{left:o,right:a}=this,c=n+o.length+this.break,f=null;return r&&r.from<=n+o.length&&r.more?f=o=o.updateHeight(e,n,i,r):o.updateHeight(e,n,i),r&&r.from<=c+a.length&&r.more?f=a=a.updateHeight(e,c,i,r):a.updateHeight(e,c,i),f?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function cM(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof ti&&(i=t[e+1])instanceof ti&&t.splice(e-1,3,new ti(n.length+1+i.length))}const Y7=5;class e1{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Ui?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ui(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=n-e;i.block?this.addBlock(new yL(a,r,i)):(a||o||r>=Y7)&&this.addLineDeco(r,o,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ui(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new ti(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ui)return e;let n=new Ui(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Ui)&&!this.isCovered?this.nodes.push(new Ui(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof Ui&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let o=new e1(i,e);return Mt.spans(n,i,r,o,0),o.finish(i)}}function q7(t,e,n){let i=new G7;return Mt.compare(t,e,n,i,0),i.changes}class G7{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&bu(e,n,this.changes,5)}}function W7(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),a=Math.min(r.innerWidth,n.right),c=Math.max(0,n.top),f=Math.min(r.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=i.body;)if(Yn(h)){let m=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let p=h.getBoundingClientRect();o=Math.max(o,p.left),a=Math.min(a,p.right),c=Math.max(c,p.top),f=Math.min(h==t.parentNode?r.innerHeight:f,p.bottom)}h=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:c-(n.top+e),bottom:Math.max(c,f)-(n.top+e)}}function X7(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function $7(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class gb{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],o=n[i];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,n){return on.replace({widget:new Q7(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class Q7 extends na{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class fM{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=qS,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=an.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(Qw).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new F7(i),this.stateDeco=dM(n),this.heightMap=yi.empty().applyChanges(this.stateDeco,kt.empty,this.heightOracle.setDoc(n.doc),[new lr(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=on.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:o,to:a})=>r>=o&&r<=a)){let{from:o,to:a}=this.lineBlockAt(r);e.push(new pp(o,a))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?qS:Dm.get(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(lf(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=dM(this.state);let r=e.changedRanges,o=lr.extendWithRanges(r,q7(i,this.stateDeco,e?e.changes:In.empty(this.state.doc.length))),a=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);uM(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||Iu)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let f=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<f.from||n.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,n));let h=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(WN)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?an.RTL:an.LTR;let a=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",c=n.getBoundingClientRect(),f=a||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let h=0,m=0;if(c.width&&c.height){let{scaleX:D,scaleY:k}=ON(n,c);(D>.005&&Math.abs(this.scaleX-D)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=D,this.scaleY=k,h|=16,a=f=!0)}let p=(parseInt(i.paddingTop)||0)*this.scaleY,y=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=y)&&(this.paddingTop=p,this.paddingBottom=y,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let b=MN(this.view.contentDOM,!1).y;b!=this.scrollParent&&(this.scrollParent=b,this.scrollAnchorHeight=-1,this.scrollOffset=0);let x=this.getScrollOffset();this.scrollOffset!=x&&(this.scrollAnchorHeight=-1,this.scrollOffset=x),this.scrolledToBottom=IN(this.scrollParent||e.win);let w=(this.printing?$7:W7)(n,this.paddingTop),C=w.top-this.pixelViewport.top,E=w.bottom-this.pixelViewport.bottom;this.pixelViewport=w;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(f=!0)),!this.inView&&!this.scrollTarget&&!X7(e.dom))return 0;let T=c.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),f){let D=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(D)&&(a=!0),a||r.lineWrapping&&Math.abs(T-this.contentDOMWidth)>r.charWidth){let{lineHeight:k,charWidth:M,textHeight:I}=e.docView.measureTextSize();a=k>0&&r.refresh(o,k,M,I,Math.max(5,T/M),D),a&&(e.docView.minWidth=0,h|=16)}C>0&&E>0?m=Math.max(C,E):C<0&&E<0&&(m=Math.min(C,E)),uM();for(let k of this.viewports){let M=k.from==this.viewport.from?D:e.docView.measureVisibleLineHeights(k);this.heightMap=(a?yi.empty().applyChanges(this.stateDeco,kt.empty,this.heightOracle,[new lr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new U7(k.from,M))}Iu&&(h|=2)}let A=!this.viewportIsAppropriate(this.viewport,m)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return A&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(m,this.scrollTarget),h|=this.updateForViewport()),(h&2||A)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:c}=this,f=new pp(r.lineAt(a-i*1e3,sn.ByHeight,o,0,0).from,r.lineAt(c+(1-i)*1e3,sn.ByHeight,o,0,0).to);if(n){let{head:h}=n.range;if(h<f.from||h>f.to){let m=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(h,sn.ByPos,o,0,0),y;n.y=="center"?y=(p.top+p.bottom)/2-m/2:n.y=="start"||n.y=="nearest"&&h<f.from?y=p.top:y=p.bottom-m,f=new pp(r.lineAt(y-1e3/2,sn.ByHeight,o,0,0).from,r.lineAt(y+m+1e3/2,sn.ByHeight,o,0,0).to)}}return f}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new pp(this.heightMap.lineAt(i,sn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,sn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,sn.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,sn.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:c}=this;return(e==0||r<=a-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||o>=c+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&o<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new gb(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,o=r>>1,a=r<<1;if(this.defaultTextDirection!=an.LTR&&!i)return[];let c=[],f=(m,p,y,b)=>{if(p-m<o)return;let x=this.state.selection.main,w=[x.from];x.empty||w.push(x.to);for(let E of w)if(E>m&&E<p){f(m,E-10,y,b),f(E+10,p,y,b);return}let C=J7(e,E=>E.from>=y.from&&E.to<=y.to&&Math.abs(E.from-m)<o&&Math.abs(E.to-p)<o&&!w.some(O=>E.from<O&&E.to>O));if(!C){if(p<y.to&&n&&i&&n.visibleRanges.some(T=>T.from<=p&&T.to>=p)){let T=n.moveToLineBoundary(xe.cursor(p),!1,!0).head;T>m&&(p=T)}let E=this.gapSize(y,m,p,b),O=i||E<2e6?E:2e6;C=new gb(m,p,E,O)}c.push(C)},h=m=>{if(m.length<a||m.type!=ii.Text)return;let p=Z7(m.from,m.to,this.stateDeco);if(p.total<a)return;let y=this.scrollTarget?this.scrollTarget.range.head:null,b,x;if(i){let w=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,C,E;if(y!=null){let O=gp(p,y),T=((this.visibleBottom-this.visibleTop)/2+w)/m.height;C=O-T,E=O+T}else C=(this.visibleTop-m.top-w)/m.height,E=(this.visibleBottom-m.top+w)/m.height;b=mp(p,C),x=mp(p,E)}else{let w=p.total*this.heightOracle.charWidth,C=r*this.heightOracle.charWidth,E=0;if(w>2e6)for(let k of e)k.from>=m.from&&k.from<m.to&&k.size!=k.displaySize&&k.from*this.heightOracle.charWidth+E<this.pixelViewport.left&&(E=k.size-k.displaySize);let O=this.pixelViewport.left+E,T=this.pixelViewport.right+E,A,D;if(y!=null){let k=gp(p,y),M=((T-O)/2+C)/w;A=k-M,D=k+M}else A=(O-C)/w,D=(T+C)/w;b=mp(p,A),x=mp(p,D)}b>m.from&&f(m.from,b,m,p),x<m.to&&f(x,m.to,m,p)};for(let m of this.viewportLines)Array.isArray(m.type)?m.type.forEach(h):h(m);return c}gapSize(e,n,i,r){let o=gp(r,i)-gp(r,n);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){gb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=on.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Mt.spans(n,this.viewport.from,this.viewport.to,{span(o,a){i.push({from:o,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let o=0;o<i.length&&!(r&8);o++){let a=this.visibleRanges[o],c=i[o];(a.from!=c.from||a.to!=c.to)&&(r|=4,e&&e.mapPos(a.from,-1)==c.from&&e.mapPos(a.to,1)==c.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||lf(this.heightMap.lineAt(e,sn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||lf(this.heightMap.lineAt(this.scaler.fromDOM(e),sn.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+12-this.paddingTop);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return lf(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class pp{constructor(e,n){this.from=e,this.to=n}}function Z7(t,e,n){let i=[],r=t,o=0;return Mt.spans(n,t,e,{span(){},point(a,c){a>r&&(i.push({from:r,to:a}),o+=a-r),r=c}},20),r<e&&(i.push({from:r,to:e}),o+=e-r),{total:o,ranges:i}}function mp({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:o,to:a}=e[r],c=a-o;if(i<=c)return o+i;i-=c}}function gp(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function J7(t,e){for(let n of t)if(e(n))return n}const qS={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function dM(t){let e=t.facet(jg).filter(i=>typeof i!="function"),n=t.facet(Zw).filter(i=>typeof i!="function");return n.length&&e.push(Mt.join(n)),e}class Dm{constructor(e,n){this.scale=e,this.viewports=n}static get(e,n,i){let r=0,o=0,a=0,c=i.map(({from:h,to:m})=>{let p=n.lineAt(h,sn.ByPos,e,0,0).top,y=n.lineAt(m,sn.ByPos,e,0,0).bottom;return r+=y-p,{from:h,to:m,top:p,bottom:y,domTop:0,domBottom:0}});if(n.height-r<10)return qS;let f=(7e6-r)/(n.height-r);for(let h of c)h.domTop=a+(h.top-o)*f,a=h.domBottom=h.domTop+(h.bottom-h.top),o=h.bottom;return new Dm(f,c)}toDOM(e){for(let n=0,i=0,r=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return r+(e-i)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);i=o.bottom,r=o.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return i+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);i=o.bottom,r=o.domBottom}}eq(e){return e instanceof Dm?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}}function lf(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new Ar(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>lf(r,e)):t._content)}const yp=We.define({combine:t=>t.join(" ")}),GS=We.define({combine:t=>t.indexOf(!0)>-1}),WS=Ho.newName(),vL=Ho.newName(),bL=Ho.newName(),SL={"&light":"."+vL,"&dark":"."+bL};function XS(t,e,n){return new Ho(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}const eK=XS("."+WS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"baseline",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},SL),tK={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},yb=Ve.ie&&Ve.ie_version<=11;class nK{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new k9,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Ve.ie&&Ve.ie_version<=11||Ve.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ve.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ve.chrome&&Ve.chrome_version<126)&&(this.editContext=new rK(e),e.state.facet(Hs)&&(e.contentDOM.editContext=this.editContext.editContext)),yb&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(this.pendingRecords().length>0),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(Hs)?i.root.activeElement!=this.dom:!mf(this.dom,r))return;let o=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ve.ie&&Ve.ie_version<=11||Ve.android&&Ve.chrome)&&!i.state.selection.main.empty&&r.focusNode&&yf(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Bf(e.root);if(!n)return!1;let i=Ve.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&iK(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=mf(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&I9(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(Yn(i))!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,tK),yb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),yb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Su(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(r=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&mf(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new S7(this.view,e,n,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.selectionChanged,i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let r=this.view.state,o=lL(this.view,i);return this.view.state==r&&(i.domChanged||n)&&this.view.update([]),o}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=hM(n,e.previousSibling||e.target.previousSibling,-1),r=hM(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Hs)!=e.state.facet(Hs)&&(e.view.contentDOM.editContext=e.state.facet(Hs)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function hM(t,e,n){for(;e;){let i=bn.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function pM(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return yf(a.node,a.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function iK(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return pM(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?pM(t,n):null}class rK{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:o,head:a}=r,c=this.toEditorPos(i.updateRangeStart),f=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:c,drifted:!1});let h=f-c>i.text.length;c==this.from&&o<this.from?c=o:f==this.to&&o>this.to&&(f=o);let m=aL(e.state.sliceDoc(c,f),i.text,(h?r.from:r.to)-c,h?"end":null);if(!m){let y=xe.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));KS(y,r)||e.dispatch({selection:y,userEvent:"select"});return}let p={from:m.from+c,to:m.toA+c,insert:kt.of(i.text.slice(m.from,m.toB).split(`
19
+ `))};if((Ve.mac||Ve.android)&&p.from==a-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:c,to:f,insert:kt.of([i.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let y=this.to-this.from+(p.to-p.from+p.insert.length);Jw(e,p,xe.single(this.toEditorPos(i.selectionStart,y),this.toEditorPos(i.selectionEnd,y)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],o=null;for(let a=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);a<c;a++){let f=e.coordsForChar(a);o=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||o||new DOMRect,r.push(o)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let o of i.getTextFormats()){let a=o.underlineStyle,c=o.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(c)){let f=this.toEditorPos(o.rangeStart),h=this.toEditorPos(o.rangeEnd);if(f<h){let m=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;r.push(on.mark({attributes:{style:m}}).range(f,h))}}}e.dispatch({effects:$N.of(on.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Bf(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((o,a,c,f,h)=>{if(i)return;let m=h.length-(a-o);if(r&&a>=r.to)if(r.from==o&&r.to==a&&r.insert.eq(h)){r=this.pendingContextChange=null,n+=m,this.to+=m;return}else r=null,this.revertPending(e.state);if(o+=n,a+=n,a<=this.from)this.from+=m,this.to+=m;else if(o<this.to){if(o<this.from||a>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),h.toString()),this.to+=m}n+=m}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class nt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(o=>i(o,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||P9(e.parent)||document,this.viewState=new fM(this,e.state||Ut.create(e)),e.scrollTo&&e.scrollTo.is(fp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(lu).map(r=>new fb(r));for(let r of this.plugins)r.update(this);this.observer=new nK(this),this.inputState=new E7(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ZO(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Bn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,o=this.state;for(let y of e){if(y.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=y.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,c=0,f=null;e.some(y=>y.annotation(pL))?(this.inputState.notifiedFocused=a,c=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,f=mL(o,a),f||(c=1));let h=this.observer.delayedAndroidKey,m=null;if(h?(this.observer.clearDelayedAndroidKey(),m=this.observer.readChange(),(m&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(m=null)):this.observer.clear(),o.facet(Ut.phrases)!=this.state.facet(Ut.phrases))return this.setState(o);r=Rm.create(this,o,e),r.flags|=c;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let y of e){if(p&&(p=p.map(y.changes)),y.scrollIntoView){let{main:b}=y.state.selection,{x,y:w}=this.state.facet(nt.cursorScrollMargin);p=new xu(b.empty?b:xe.cursor(b.head,b.head>b.anchor?-1:1),"nearest","nearest",w,x)}for(let b of y.effects)b.is(fp)&&(p=b.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=km.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(of)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(y=>y.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(yp)!=r.state.facet(yp)&&(this.viewState.mustMeasureContent=!0),(n||i||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let y of this.state.facet(HS))try{y(r)}catch(b){as(this.state,b,"update listener")}(f||m)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),m&&!lL(this,m)&&h.force&&Su(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new fM(this,e),this.plugins=e.facet(lu).map(i=>new fb(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new ZO(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(lu),i=e.state.facet(lu);if(n!=i){let r=[];for(let o of i){let a=n.indexOf(o);if(a<0)r.push(new fb(o));else{let c=this.plugins[a];c.mustUpdate=e,r.push(c)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){as(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:a,scaleY:c}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let f=0;;f++){if(a<0){if(IN(i||this.win))o=-1,a=this.viewState.heightMap.height/this.viewState.scaleY;else{let x=this.viewState.scrollAnchorAt(r);o=x.from,a=x.top}c=this.viewState.scaleY}this.updateState=1;let h=this.viewState.measure();if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(f>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let m=[];h&4||([this.measureRequests,m]=[m,this.measureRequests]);let p=m.map(x=>{try{return x.read(this)}catch(w){return as(this.state,w),mM}}),y=Rm.create(this,this.state,[]),b=!1;y.flags|=h,n?n.flags|=h:n=y,this.updateState=2,y.empty||(this.updatePlugins(y),this.inputState.update(y),this.updateAttrs(),b=this.docView.update(y),b&&this.docViewUpdate());for(let x=0;x<m.length;x++)if(p[x]!=mM)try{let w=m[x];w.write&&w.write(p[x],this)}catch(w){as(this.state,w)}if(b&&this.docView.updateSelection(!0),!y.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let w=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)/this.viewState.scaleY-a/c;if((w>1||w<-1)&&!(Ve.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+w,i?o<0?i.scrollTop=i.scrollHeight:i.scrollTop+=w:this.win.scrollBy(0,w),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let f of this.state.facet(HS))f(n)}get themeClasses(){return WS+" "+(this.state.facet(GS)?bL:vL)+" "+this.state.facet(yp)}updateAttrs(){let e=gM(this,QN,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Hs)?"true":"false",class:"cm-content",style:`${Ve.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),gM(this,Qw,n);let i=this.observer.ignore(()=>{let r=qO(this.contentDOM,this.contentAttrs,n),o=qO(this.dom,this.editorAttrs,e);return r||o});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(nt.announce)){n&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),n=!1);let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(of);let e=this.state.facet(nt.cspNonce);Ho.mount(this.root,this.styleModules.concat(eK).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return mb(this,e,JO(this,e,n,i))}moveByGroup(e,n){return mb(this,e,JO(this,e,n,i=>p7(this,e.head,i)))}visualLineSide(e,n){return n?xe.cursor(e.to,1):xe.cursor(e.from,-1)}moveToLineBoundary(e,n,i=!0){return h7(this,e,n,i)}moveVertically(e,n,i){return mb(this,e,m7(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=jS(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),jS(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),o=r[ls.find(r,e-i.from,-1,n)];return i.length&&(e==i.from&&n<0||e==i.to&&n>0)&&o.dir!=this.textDirectionAt(i.from)&&(e==i.to?(e=i.from+o.from,n=1):(e=i.from+o.to,n=-1)),this.docView.coordsAt(e,n,o.dir==an.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(GN)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>sK)return _N(e.length);let n=this.textDirectionAt(e.from),i;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||zN(o.isolates,i=XO(this,e))))return o.order;i||(i=XO(this,e));let r=H9(e.text,n,i);return this.bidiCache.push(new km(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ve.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{PN(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var i,r,o,a;return fp.of(new xu(typeof e=="number"?xe.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(o=n.yMargin)!==null&&o!==void 0?o:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return fp.of(new xu(xe.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return kr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return kr.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Ho.newName(),r=[yp.of(i),of.of(XS(`.${i}`,e))];return n&&n.dark&&r.push(GS.of(!0)),r}static baseTheme(e){return zg.lowest(of.of(XS("."+WS,e,SL)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&bn.get(i)||bn.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}}nt.styleModule=of;nt.inputHandler=YN;nt.clipboardInputFilter=Xw;nt.clipboardOutputFilter=$w;nt.scrollHandler=XN;nt.focusChangeEffect=qN;nt.perLineTextDirection=GN;nt.exceptionSink=KN;nt.updateListener=HS;nt.editable=Hs;nt.mouseSelectionStyle=jN;nt.dragMovesSelection=UN;nt.clickAddsSelectionRange=FN;nt.decorations=jg;nt.blockWrappers=ZN;nt.outerDecorations=Zw;nt.atomicRanges=pd;nt.bidiIsolatedRanges=JN;nt.cursorScrollMargin=We.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});nt.scrollMargins=tL;nt.darkTheme=GS;nt.cspNonce=We.define({combine:t=>t.length?t[0]:""});nt.contentAttributes=Qw;nt.editorAttributes=QN;nt.lineWrapping=nt.contentAttributes.of({class:"cm-lineWrapping"});nt.announce=$t.define();const sK=4096,mM={};class km{constructor(e,n,i,r,o,a){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=o,this.order=a}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:an.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let a=e[o];a.dir==r&&!n.touchesRange(a.from,a.to)&&i.push(new km(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return i}}function gM(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let o=i[r],a=typeof o=="function"?o(t):o;a&&qw(a,n)}return n}const oK=Ve.mac?"mac":Ve.windows?"win":Ve.linux?"linux":"key";function lK(t,e){const n=t.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,o,a,c;for(let f=0;f<n.length-1;++f){const h=n[f];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))r=!0;else if(/^(c|ctrl|control)$/i.test(h))o=!0;else if(/^s(hift)?$/i.test(h))a=!0;else if(/^mod$/i.test(h))e=="mac"?c=!0:o=!0;else throw new Error("Unrecognized modifier name: "+h)}return r&&(i="Alt-"+i),o&&(i="Ctrl-"+i),c&&(i="Meta-"+i),a&&(i="Shift-"+i),i}function vp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const aK=zg.default(nt.domEventHandlers({keydown(t,e){return wL(xL(e.state),t,e,"editor")}})),uK=We.define({enables:aK}),yM=new WeakMap;function xL(t){let e=t.facet(uK),n=yM.get(e);return n||yM.set(e,n=fK(e.reduce((i,r)=>i.concat(r),[]))),n}function Dne(t,e,n){return wL(xL(t.state),e,t,n)}let Po=null;const cK=4e3;function fK(t,e=oK){let n=Object.create(null),i=Object.create(null),r=(a,c)=>{let f=i[a];if(f==null)i[a]=c;else if(f!=c)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,c,f,h,m)=>{var p,y;let b=n[a]||(n[a]=Object.create(null)),x=c.split(/ (?!$)/).map(E=>lK(E,e));for(let E=1;E<x.length;E++){let O=x.slice(0,E).join(" ");r(O,!0),b[O]||(b[O]={preventDefault:!0,stopPropagation:!1,run:[T=>{let A=Po={view:T,prefix:O,scope:a};return setTimeout(()=>{Po==A&&(Po=null)},cK),!0}]})}let w=x.join(" ");r(w,!1);let C=b[w]||(b[w]={preventDefault:!1,stopPropagation:!1,run:((y=(p=b._any)===null||p===void 0?void 0:p.run)===null||y===void 0?void 0:y.slice())||[]});f&&C.run.push(f),h&&(C.preventDefault=!0),m&&(C.stopPropagation=!0)};for(let a of t){let c=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let h of c){let m=n[h]||(n[h]=Object.create(null));m._any||(m._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=a;for(let y in m)m[y].run.push(b=>p(b,$S))}let f=a[e]||a.key;if(f)for(let h of c)o(h,f,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(h,"Shift-"+f,a.shift,a.preventDefault,a.stopPropagation)}return n}let $S=null;function wL(t,e,n,i){$S=e;let r=T9(e),o=l9(r,0),a=a9(o)==r.length&&r!=" ",c="",f=!1,h=!1,m=!1;Po&&Po.view==n&&Po.scope==i&&(c=Po.prefix+" ",cL.indexOf(e.keyCode)<0&&(h=!0,Po=null));let p=new Set,y=C=>{if(C){for(let E of C.run)if(!p.has(E)&&(p.add(E),E(n)))return C.stopPropagation&&(m=!0),!0;C.preventDefault&&(C.stopPropagation&&(m=!0),h=!0)}return!1},b=t[i],x,w;return b&&(y(b[c+vp(r,e,!a)])?f=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ve.windows&&e.ctrlKey&&e.altKey)&&!(Ve.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(x=Fo[e.keyCode])&&x!=r?(y(b[c+vp(x,e,!0)])||e.shiftKey&&(w=Nf[e.keyCode])!=r&&w!=x&&y(b[c+vp(w,e,!1)]))&&(f=!0):a&&e.shiftKey&&y(b[c+vp(r,e,!0)])&&(f=!0),!f&&y(b._any)&&(f=!0)),h&&(f=!0),f&&m&&e.stopPropagation(),$S=null,f}class Ll{constructor(e,n,i,r,o){this.className=e,this.left=n,this.top=i,this.width=r,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let o=CL(e);return[new Ll(n,r.left-o.left,r.top-o.top,null,r.bottom-r.top)]}else return dK(e,n,i)}}function CL(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==an.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function vM(t,e,n,i){let r=t.coordsAtPos(e,n*2);if(!r)return i;let o=t.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,c=t.posAtCoords({x:o.left+1,y:a}),f=t.posAtCoords({x:o.right-1,y:a});return c==null||f==null?i:{from:Math.max(i.from,Math.min(c,f)),to:Math.min(i.to,Math.max(c,f))}}function dK(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),r=Math.min(n.to,t.viewport.to),o=t.textDirection==an.LTR,a=t.contentDOM,c=a.getBoundingClientRect(),f=CL(t),h=a.querySelector(".cm-line"),m=h&&window.getComputedStyle(h),p=c.left+(m?parseInt(m.paddingLeft)+Math.min(0,parseInt(m.textIndent)):0),y=c.right-(m?parseInt(m.paddingRight):0),b=US(t,i,1),x=US(t,r,-1),w=b.type==ii.Text?b:null,C=x.type==ii.Text?x:null;if(w&&(t.lineWrapping||b.widgetLineBreaks)&&(w=vM(t,i,1,w)),C&&(t.lineWrapping||x.widgetLineBreaks)&&(C=vM(t,r,-1,C)),w&&C&&w.from==C.from&&w.to==C.to)return O(T(n.from,n.to,w));{let D=w?T(n.from,null,w):A(b,!1),k=C?T(null,n.to,C):A(x,!0),M=[];return(w||b).to<(C||x).from-(w&&C?1:0)||b.widgetLineBreaks>1&&D.bottom+t.defaultLineHeight/2<k.top?M.push(E(p,D.bottom,y,k.top)):D.bottom<k.top&&t.elementAtHeight((D.bottom+k.top)/2).type==ii.Text&&(D.bottom=k.top=(D.bottom+k.top)/2),O(D).concat(M).concat(O(k))}function E(D,k,M,I){return new Ll(e,D-f.left,k-f.top,Math.max(0,M-D),I-k)}function O({top:D,bottom:k,horizontal:M}){let I=[];for(let L=0;L<M.length;L+=2)I.push(E(M[L],D,M[L+1],k));return I}function T(D,k,M){let I=1e9,L=-1e9,B=[];function H(K,z,V,X,j){let Y=t.coordsAtPos(K,K==M.to?-2:2),$=t.coordsAtPos(V,V==M.from?2:-2);!Y||!$||(I=Math.min(Y.top,$.top,I),L=Math.max(Y.bottom,$.bottom,L),j==an.LTR?B.push(o&&z?p:Y.left,o&&X?y:$.right):B.push(!o&&X?p:$.left,!o&&z?y:Y.right))}let U=D??M.from,F=k??M.to;for(let K of t.visibleRanges)if(K.to>U&&K.from<F)for(let z=Math.max(K.from,U),V=Math.min(K.to,F);;){let X=t.state.doc.lineAt(z);for(let j of t.bidiSpans(X)){let Y=j.from+X.from,$=j.to+X.from;if(Y>=V)break;$>z&&H(Math.max(Y,z),D==null&&Y<=U,Math.min($,V),k==null&&$>=F,j.dir)}if(z=X.to+1,z>=V)break}return B.length==0&&H(U,D==null,F,k==null,t.textDirection),{top:I,bottom:L,horizontal:B}}function A(D,k){let M=c.top+(k?D.top:D.bottom);return{top:M,bottom:M,horizontal:[]}}}function hK(t,e){return t.constructor==e.constructor&&t.eq(e)}class pK{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(qp)!=e.state.facet(qp)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,i=e.facet(qp);for(;n<i.length&&i[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,i)=>!hK(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of e)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=e,Ve.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const qp=We.define();function EL(t){return[kr.define(e=>new pK(e,t)),qp.of(t)]}const QS=!Ve.ios,Gl=We.define({combine(t){return Hg(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function kne(t={}){return[Gl.of(t),mK,gK,vK,WN.of(!0)]}function Pne(t){return t.facet(Gl)}function TL(t){return t.startState.facet(Gl)!=t.state.facet(Gl)}const mK=EL({above:!0,markers(t){let{state:e}=t,n=e.facet(Gl),i=[];for(let r of e.selection.ranges){let o=r==e.selection.main;if(r.empty||n.drawRangeCursor&&!(o&&Ve.ios&&n.iosSelectionHandles)){let a=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=r.empty?r:xe.cursor(r.head,r.assoc);for(let f of Ll.forRange(t,a,c))i.push(f)}}return i},update(t,e){t.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=TL(t);return n&&bM(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){bM(e.state,t)},class:"cm-cursorLayer"});function bM(t,e){e.style.animationDuration=t.facet(Gl).cursorBlinkRate+"ms"}const gK=EL({above:!1,markers(t){let e=[],{main:n,ranges:i}=t.state.selection;for(let r of i)if(!r.empty&&(QS||r!=n))for(let o of Ll.forRange(t,"cm-selectionBackground",r))e.push(o);if(Ve.ios&&!n.empty&&t.state.facet(Gl).iosSelectionHandles){for(let r of Ll.forRange(t,"cm-selectionHandle cm-selectionHandle-start",xe.cursor(n.from,1)))e.push(r);for(let r of Ll.forRange(t,"cm-selectionHandle cm-selectionHandle-end",xe.cursor(n.to,1)))e.push(r)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||TL(t)},class:"cm-selectionLayer"}),yK=Ve.gecko&&Ve.gecko_version==153?"#ffffff01":"transparent",vK=zg.highest(nt.theme({".cm-line":{...QS?{"& ::selection, &::selection":{backgroundColor:`${yK} !important`}}:{},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important",...QS?{"&::selection, & ::selection":{backgroundColor:"Highlight !important"}}:{}}}}));class bK extends na{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?gf(e.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(e.parentNode),r=Vf(n[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return r.bottom-r.top>o*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+o}:r}ignoreEvent(){return!1}}function Ine(t){let e=kr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?on.set([on.widget({widget:new bK(t),side:1}).range(0)]):on.none}get decorations(){return this.view.state.doc.length?on.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,nt.contentAttributes.of({"aria-placeholder":t})]:e}const SM=We.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});function SK(t,e){let n=t.plugin(RL),i=n?n.specs.indexOf(e):-1;return i>-1?n.panels[i]:null}const RL=kr.fromClass(class{constructor(t){this.input=t.state.facet(ZS),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(SM);this.top=new bp(t,!0,e.topContainer),this.bottom=new bp(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(SM);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new bp(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new bp(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(ZS);if(n!=this.input){let i=n.filter(f=>f),r=[],o=[],a=[],c=[];for(let f of i){let h=this.specs.indexOf(f),m;h<0?(m=f(t.view),c.push(m)):(m=this.panels[h],m.update&&m.update(t)),r.push(m),(m.top?o:a).push(m)}this.specs=i,this.panels=r,this.top.sync(o),this.bottom.sync(a);for(let f of c)f.dom.classList.add("cm-panel"),f.mount&&f.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>nt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class bp{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=xM(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=xM(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function xM(t){let e=t.nextSibling;return t.remove(),e}const ZS=We.define({enables:RL});function Nne(t,e){let n,i=new Promise(a=>n=a),r=a=>xK(a,e,n);t.state.field(Gp,!1)?t.dispatch({effects:AL.of(r)}):t.dispatch({effects:$t.appendConfig.of(Gp.init(()=>[r]))});let o=OL.of(r);return{close:o,result:i.then(a=>((t.win.queueMicrotask||(f=>t.win.setTimeout(f,10)))(()=>{t.state.field(Gp).indexOf(r)>-1&&t.dispatch({effects:o})}),a))}}function Lne(t,e){let n=t.state.field(Gp,!1)||[];for(let i of n){let r=SK(t,i);if(r&&r.dom.classList.contains(e))return r}return null}const Gp=bs.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(AL)?t=[n.value].concat(t):n.is(OL)&&(t=t.filter(i=>i!=n.value));return t},provide:t=>ZS.computeN([t],e=>e.field(t))}),AL=$t.define(),OL=$t.define();function xK(t,e,n){let i=e.content?e.content(t,()=>c(null)):null;if(!i){if(i=Wa("form"),e.input){let f=Wa("input",e.input);/^(text|password|number|email|tel|url)$/.test(f.type)&&f.classList.add("cm-textfield"),f.name||(f.name="input"),i.appendChild(Wa("label",(e.label||"")+": ",f))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Wa("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let f=0;f<r.length;f++){let h=r[f];h.addEventListener("keydown",m=>{m.keyCode==27?(m.preventDefault(),c(null)):m.keyCode==13&&(m.preventDefault(),c(h))}),h.addEventListener("submit",m=>{m.preventDefault(),c(h)})}let o=Wa("div",i,Wa("button",{onclick:()=>c(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(o.className=e.class),o.classList.add("cm-dialog");let a=typeof e.focus=="string"?i.querySelector(e.focus):e.focus?i.querySelector("input")||i.querySelector("button"):null;function c(f){o.contains(o.ownerDocument.activeElement)&&t.focus(),n(f)}return{dom:o,top:e.top,mount:()=>{a&&("select"in a?a.select():"focus"in a&&a.focus())},destroy:()=>n(null)}}class Wl extends Kl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Wl.prototype.elementClass="";Wl.prototype.toDOM=void 0;Wl.prototype.mapMode=ji.TrackBefore;Wl.prototype.startSide=Wl.prototype.endSide=-1;Wl.prototype.point=!0;const vb=We.define(),wK=We.define(),Wp=We.define(),JS=We.define({combine:t=>t.some(e=>e)});function CK(t){let e=[EK];return t&&t.fixed===!1&&e.push(JS.of(!0)),e}const EK=kr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Wp).map(e=>new CM(t,e)),this.fixed=!t.state.facet(JS);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(JS)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Mt.iter(this.view.state.facet(vb),this.view.viewport.from),i=[],r=this.gutters.map(o=>new TK(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(o.type)){let a=!0;for(let c of o.type)if(c.type==ii.Text&&a){ex(n,i,c.from);for(let f of r)f.line(this.view,c,i);a=!1}else if(c.widget)for(let f of r)f.widget(this.view,c)}else if(o.type==ii.Text){ex(n,i,o.from);for(let a of r)a.line(this.view,o,i)}else if(o.widget)for(let a of r)a.widget(this.view,o);for(let o of r)o.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Wp),n=t.state.facet(Wp),i=t.docChanged||t.heightChanged||t.viewportChanged||!Mt.eq(t.startState.facet(vb),t.state.facet(vb),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let o of n){let a=e.indexOf(o);a<0?r.push(new CM(this.view,o)):(this.gutters[a].update(t),r.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),r.indexOf(o)<0&&o.destroy();for(let o of r)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>nt.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==an.LTR?{left:i,right:r}:{right:i,left:r}})});function wM(t){return Array.isArray(t)?t:[t]}function ex(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class TK{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=Mt.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,o=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==r.elements.length){let c=new ML(e,a,o,i);r.elements.push(c),r.dom.appendChild(c.dom)}else r.elements[this.i].update(e,a,o,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];ex(this.cursor,r,n.from),i.length&&(r=r.concat(i));let o=this.gutter.config.lineMarker(e,n,r);o&&r.unshift(o);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let o of e.state.facet(wK)){let a=o(e,n.widget,n);a&&(r||(r=[])).push(a)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class CM{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let o=r.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let f=o.getBoundingClientRect();a=(f.top+f.bottom)/2}else a=r.clientY;let c=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[i](e,c,r)&&r.preventDefault()});this.markers=wM(n.markers(e)),n.initialSpacer&&(this.spacer=new ML(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=wM(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!Mt.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class ML{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),RK(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let o=0,a=0;;){let c=a,f=o<n.length?n[o++]:null,h=!1;if(f){let m=f.elementClass;m&&(i+=" "+m);for(let p=a;p<this.markers.length;p++)if(this.markers[p].compare(f)){c=p,h=!0;break}}else c=this.markers.length;for(;a<c;){let m=this.markers[a++];if(m.toDOM){m.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!f)break;f.toDOM&&(h?r=r.nextSibling:this.dom.insertBefore(f.toDOM(e),r)),h&&a++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}}function RK(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const AK=We.define(),OK=We.define(),au=We.define({combine(t){return Hg(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let o=i[r],a=n[r];i[r]=o?(c,f,h)=>o(c,f,h)||a(c,f,h):a}return i}})}});class bb extends Wl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Sb(t,e){return t.state.facet(au).formatNumber(e,t.state)}const MK=Wp.compute([au],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(AK)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new bb(Sb(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(OK)){let o=r(e,n,i);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(au)!=e.state.facet(au),initialSpacer(e){return new bb(Sb(e,EM(e.state.doc.lines)))},updateSpacer(e,n){let i=Sb(n.view,EM(n.view.state.doc.lines));return i==e.number?e:new bb(i)},domEventHandlers:t.facet(au).domEventHandlers,side:"before"}));function Bne(t={}){return[au.of(t),CK(),MK]}function EM(t){let e=9;for(;e<t;)e=e*10+9;return e}const TM=t=>Symbol.iterator in t,RM=t=>"entries"in t,AM=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),i=e instanceof Map?e:new Map(e.entries());if(n.size!==i.size)return!1;for(const[r,o]of n)if(!i.has(r)||!Object.is(o,i.get(r)))return!1;return!0},DK=(t,e)=>{const n=t[Symbol.iterator](),i=e[Symbol.iterator]();let r=n.next(),o=i.next();for(;!r.done&&!o.done;){if(!Object.is(r.value,o.value))return!1;r=n.next(),o=i.next()}return!!r.done&&!!o.done};function kK(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:TM(t)&&TM(e)?RM(t)&&RM(e)?AM(t,e):DK(t,e):AM({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Vne(t){const e=be.useRef(void 0);return n=>{const i=t(n);return kK(e.current,i)?e.current:e.current=i}}function PK(t){const e=S.useRef(!0);e.current&&(e.current=!1,t())}const DL=S.createContext(void 0),kL=S.createContext(void 0);function Jo(){const t=S.useContext(DL);if(t===void 0)throw new Error(en(60));return t}function PL(){const t=S.useContext(kL);if(t===void 0)throw new Error(en(61));return t}function IK(t,e,n=Object.is){const{length:i}=t;if(i!==e.length)return!1;for(let r=0;r<i;r+=1)if(!n(t[r],e[r]))return!1;return!0}const IL=(t,e)=>Object.is(t,e);function Xl(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function NK(t,e,n){return Array.isArray(t)&&Array.isArray(e)?!IK(t,e,(i,r)=>Xl(i,r,n)):t!==e}function tx(t,e,n){return t?t.some(i=>i===void 0?!1:Xl(e,i,n)):!1}function Xp(t,e,n){return t?t.findIndex(i=>i===void 0?!1:Xl(i,e,n)):-1}function LK(t,e){if(e!==IL)return i=>tx(t,i,e);const n=new Set(t);return n.delete(void 0),i=>n.has(i)&&(i!==0||t.some(r=>Object.is(i,r)))}function NL(t,e,n,i){const r=i&&Array.isArray(e)?t.findIndex(LK(e,n)):Xp(t,e,n);return r===-1?null:r}function BK(t,e,n,i,r,o){return tx(i,e,r)?o!=null&&t>o&&tx(i,n[o],r)?o:t:t===o?NL(n,i,r,!0):o}function VK(t,e,n){return t.filter(i=>!Xl(e,i,n))}const zK={id:t=>t.id,labelId:t=>t.labelId,modal:t=>t.modal,multiple:t=>t.multiple,disabled:t=>t.disabled,readOnly:t=>t.readOnly,required:t=>t.required,highlightItemOnHover:t=>t.highlightItemOnHover,items:t=>t.items,itemToStringLabel:t=>t.itemToStringLabel,isItemEqualToValue:t=>t.isItemEqualToValue,value:t=>t.value,hasSelectedValue:t=>{const{value:e,multiple:n,itemToStringValue:i}=t;return e==null?!1:n&&Array.isArray(e)?e.length>0:eu(e,i)!==""},hasNullItemLabel:(t,e)=>e?Hj(t.items):!1,open:t=>t.open,mounted:t=>t.mounted,forceMount:t=>t.forceMount,transitionStatus:t=>t.transitionStatus,openMethod:t=>t.openMethod,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,i=t.value;return t.multiple?Array.isArray(i)&&i.some(r=>Xl(e,r,n)):Xl(e,i,n)},isSelectedByFocus:(t,e)=>t.selectedIndex===e,popupProps:t=>t.popupProps,triggerProps:t=>t.triggerProps,itemRoot:t=>t.itemRoot,triggerElement:t=>t.triggerElement,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,popupSide:t=>t.popupSide,scrollUpArrowVisible:t=>t.scrollUpArrowVisible,scrollDownArrowVisible:t=>t.scrollDownArrowVisible,hasScrollArrows:t=>t.hasScrollArrows};function af(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const zs=1;function LL(t,e){return Math.max(0,t-e)}function _K(t,e){if(e<=0)return 0;const n=af(t,0,e),i=n,r=e-n,o=i<=zs,a=r<=zs;return o&&a?i<=r?0:e:o?0:a?e:n}function zne(t){const{id:e,value:n,defaultValue:i=null,onValueChange:r,open:o,defaultOpen:a=!1,onOpenChange:c,name:f,form:h,autoComplete:m,disabled:p=!1,readOnly:y=!1,required:b=!1,modal:x=!0,actionsRef:w,inputRef:C,onOpenChangeComplete:E,items:O,multiple:T=!1,itemToStringLabel:A,itemToStringValue:D,isItemEqualToValue:k=IL,highlightItemOnHover:M=!0,children:I}=t,{clearErrors:L}=XI(),{setDirty:B,setTouched:H,setFocused:U,validityData:F,setFilled:K,name:z,disabled:V,validation:X,validationMode:j}=cd(),Y=Hw({id:e}),$=V||p,te=z??f,[N,ne]=bm({controlled:n,default:T?i??Hl:i,name:"Select",state:"value"}),[q,G]=bm({controlled:o,default:a,name:"Select",state:"open"}),Z=S.useRef([]),ae=S.useRef([]),Se=S.useRef(null),le=S.useRef(null),ge=S.useRef(0),ce=S.useRef(null),ue=S.useRef([]),Te=S.useRef(!1),ye=S.useRef(null),Pe=S.useRef(null),Ee=S.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Me=S.useRef(!1),Be=S.useRef(N),{openMethod:ve,triggerProps:Ie}=SI(q),de=kn(()=>new ju({id:Y,labelId:void 0,modal:x,multiple:T,disabled:$,readOnly:y,required:b,highlightItemOnHover:M,itemToStringLabel:A,itemToStringValue:D,isItemEqualToValue:k,value:N,open:q,mounted:q,transitionStatus:void 0,items:O,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:At,triggerProps:At,itemRoot:{props:At,multiple:T,disabled:$,readOnly:y,isItemEqualToValue:k},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:ln,setOpen:ln,handleScrollArrowVisibility:ln,onOpenChangeComplete:ln,listRef:Z,popupRef:Se,scrollHandlerRef:le,scrollArrowsMountedCountRef:ge,valueRef:ce,valuesRef:ue,labelsRef:ae,typingRef:Te,selectionRef:Ee,firstItemTextRef:ye,selectedItemTextRef:Pe,alignItemWithTriggerActiveRef:Me,initialValueRef:Be},zK)).current,[ke,it]=S.useState(!1),{mounted:tt,transitionStatus:se,forceUnmount:me}=ZP({open:q,ref:Se,preventUnmountOnClose:ke,setPreventUnmountOnClose:it,onUnmount(){de.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),E?.(!1)}}),_e=de.useState("activeIndex"),we=de.useState("selectedIndex"),Re=de.useState("triggerElement"),gt=de.useState("positionerElement"),Je=Nj(ve),rt=ve??Je,Et=S.useMemo(()=>T?"":eu(N,D),[T,N,D]),yt=S.useMemo(()=>T&&Array.isArray(N)?N.map(Ge=>eu(Ge,D)):eu(N,D),[T,N,D]),hn=dn(Re),qt=He(()=>yt);WI(hn,Y,N,qt,!$,f);const tn=T?Array.isArray(N)&&N.length>0:N!=null&&Et!=="";De(()=>{K(tn)},[tn,K]),De(function(){const at=NL(ue.current,N,k,T);at===null&&(Pe.current=null),!q&&de.set("selectedIndex",at)},[T,q,N,k,de]),Dw(N,()=>{L(te),B(NK(N,F.initialValue,k)),X.change(N)});const qe=He((Ge,at)=>{const pt=at,zt=vg(pt);c?.(Ge,pt),!at.isCanceled&&(Ge||it(zt()),G(Ge),!Ge&&(at.reason===$s||at.reason===sg)&&(H(!0),U(!1),j==="onBlur"&&X.commit(N)))});S.useImperativeHandle(w,()=>({unmount:me,close:()=>{de.state.open&&qe(!1,Ze(td))}}),[me,qe,de]);const st=He((Ge,at)=>{r?.(Ge,at),!at.isCanceled&&ne(Ge)}),Lt=He(Ge=>{const at=LL(Ge.scrollHeight,Ge.clientHeight),pt=_K(Ge.scrollTop,at),zt=pt>0,pn=pt<at;de.set("scrollUpArrowVisible",zt),de.set("scrollDownArrowVisible",pn)}),ot=SU({open:q,onOpenChange:qe,elements:{reference:Re,floating:gt}}),lt=id(ot,{enabled:!$,event:"mousedown"}),vt=rd(ot),Tt=aI(ot,{enabled:!$,listRef:Z,activeIndex:_e,selectedIndex:we,disabledIndices:Hl,onNavigate(Ge){Ge===null&&!q||de.set("activeIndex",Ge)},focusItemOnHover:M}),un=uI(ot,{enabled:!$&&(q||!y&&!T),listRef:ae,activeIndex:_e,selectedIndex:we,disabledIndices:Ge=>Lj(Z.current[Ge]),onMatch(Ge){q?de.set("activeIndex",Ge):st(ue.current[Ge],Ze(dr))},onTyping(Ge){Te.current=Ge}}),Ce=S.useMemo(()=>Pi(un.reference,Tt.reference,vt.reference,lt.reference,Ie),[lt.reference,un.reference,Tt.reference,vt.reference,Ie]),Qe=S.useMemo(()=>Pi(sd,un.floating,Tt.floating,vt.floating),[un.floating,Tt.floating,vt.floating]),Ae=Tt.item??At,Oe=S.useMemo(()=>({props:Ae,multiple:T,disabled:$,readOnly:y,isItemEqualToValue:k}),[Ae,T,$,y,k]);de.useContextCallback("setValue",st),de.useContextCallback("setOpen",qe),de.useContextCallback("handleScrollArrowVisibility",Lt),de.useContextCallback("onOpenChangeComplete",E),PK(()=>{de.update({popupProps:Qe,triggerProps:Ce,itemRoot:Oe})}),de.useSyncedValues({id:Y,modal:x,multiple:T,disabled:$,readOnly:y,required:b,highlightItemOnHover:M,value:N,open:q,mounted:tt,transitionStatus:se,popupProps:Qe,triggerProps:Ce,itemRoot:Oe,items:O,itemToStringLabel:A,itemToStringValue:D,isItemEqualToValue:k,openMethod:rt});const Ke=Ws(C,X.inputRef),Xe=T?void 0:te,dt=S.useMemo(()=>!T||!Array.isArray(N)||!te?null:N.map(Ge=>{const at=eu(Ge,D);return fe.jsx("input",{type:"hidden",form:h,name:te,value:at,disabled:$},at)}),[T,N,h,te,D,$]);return fe.jsxs(DL.Provider,{value:de,children:[fe.jsx(kL.Provider,{value:ot,children:I}),fe.jsx("input",{...X.getValidationProps($,{onFocus(){de.state.triggerElement?.focus({focusVisible:!0})},onChange(Ge){if(Ge.nativeEvent.defaultPrevented||$||y)return;const at=Ge.currentTarget.value,pt=Ze(dr,Ge.nativeEvent);function zt(){if(T)return;const pn=at.toLowerCase();let Cn=ue.current.findIndex(yr=>eu(yr,D).toLowerCase()===pn||jI(yr,A).toLowerCase()===pn);Cn===-1&&(Cn=ue.current.findIndex((yr,ra)=>{const Ad=ae.current[ra];return Ad!=null&&Ad.toLowerCase()===pn}));const gr=ue.current[Cn];gr!=null&&st(gr,pt)}de.set("forceMount",!0),queueMicrotask(zt)}}),id:Y&&Xe==null?`${Y}-hidden-input`:void 0,form:h,name:Xe,autoComplete:m,value:Et,disabled:$,required:b&&!(T&&tn),readOnly:y,ref:Ke,style:te?AP:fw,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),dt]})}function HK(t,e){return t??e}const FK="data-popup-side",UK=400,jK={...Rf,...YI,popupSide:t=>t?{[FK]:t}:null,value:()=>null},_ne=S.forwardRef(function(e,n){const{render:i,className:r,id:o,disabled:a=!1,nativeButton:c=!0,style:f,...h}=e,{setTouched:m,validationMode:p,validation:y,state:b,disabled:x}=cd(),{labelId:w}=_w(),C=Jo(),E=C.useState("readOnly"),O=C.useState("required"),T=C.useState("disabled"),A=x||T||a,D=C.useState("open"),k=C.useState("mounted"),M=C.useState("value"),I=C.useState("triggerProps"),L=C.useState("positionerElement"),B=C.useState("listElement"),H=C.useState("popupSide"),U=C.useState("id"),F=C.useState("labelId"),K=C.useState("hasSelectedValue"),z=k&&L?H:null,V=o??U,X=HK(w,F);Hw({id:o});const j=dn(L),Y=S.useRef(null),$=GI(A,Y),{getButtonProps:te,buttonRef:N}=Xo({disabled:A,native:c}),ne=C.useStateSetter("triggerElement"),q=wn(),G=wn(),Z=wn();S.useEffect(()=>{if(D)return Z.start(UK,()=>{C.context.selectionRef.current.allowUnselectedMouseUp=!0,C.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{Z.clear()};C.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},G.clear()},[D,C,G,Z]);const ae=Pi(I,{id:V,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-controls":D?B?.id??dm(L)?.id:void 0,"aria-labelledby":X,"aria-readonly":E||void 0,"aria-required":O||void 0,tabIndex:A?-1:0,onFocus(ge){$(!0),D&&C.context.alignItemWithTriggerActiveRef.current&&C.context.setOpen(!1,Ze(dr,ge.nativeEvent)),q.start(0,()=>{C.set("forceMount",!0)})},onBlur(ge){Ye(L,ge.relatedTarget)||(m(!0),$(!1),p==="onBlur"&&y.commit(M))},onMouseDown(ge){if(D)return;const ce=xt(ge.currentTarget);function ue(Te){if(!Y.current)return;const ye=Te.target;Ye(Y.current,ye)||Ye(j.current,ye)||HI(Te,Y.current)||C.context.setOpen(!1,Ze(sw,Te))}G.start(0,()=>{ce.addEventListener("mouseup",ue,{once:!0})})}},h,te),Se=y.getValidationProps(A,ae);Se.role="combobox";const le={...b,open:D,disabled:A,value:M,readOnly:E,popupSide:z,placeholder:!K};return Ot("button",e,{ref:[n,Y,N,ne],state:le,stateAttributesMapping:jK,props:Se})}),KK={value:()=>null},Hne=S.forwardRef(function(e,n){const{className:i,render:r,children:o,placeholder:a,style:c,...f}=e,h=Jo(),m=h.useState("value"),p=h.useState("items"),y=h.useState("itemToStringLabel"),b=h.useState("hasSelectedValue"),x=!b&&a!=null&&o==null,w=h.useState("hasNullItemLabel",x),C={value:m,placeholder:!b};let E=null;return typeof o=="function"?E=o(m):o!=null?E=o:x&&!w?E=a:Array.isArray(m)?E=Fj(m,p,y):E=KI(m,p,y),Ot("span",e,{state:C,ref:[n,h.context.valueRef],props:[{children:E},f],stateAttributesMapping:KK})}),Fne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,h={open:Jo().useState("open")};return Ot("span",e,{state:h,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:Qf})}),Une=S.forwardRef(function(e,n){const i=Jo(),r=i.useState("mounted"),o=i.useState("forceMount");return r||o?fe.jsx(hg,{ref:n,...e}):null}),BL=S.createContext(void 0);function YK(){const t=S.useContext(BL);if(!t)throw new Error(en(59));return t}function Pm(t,e){t&&Object.assign(t.style,e)}const qK={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},GK={position:"fixed"},jne=S.forwardRef(function(e,n){const{anchor:i,className:r,render:o,positionMethod:a,side:c,align:f,sideOffset:h,alignOffset:m,collisionBoundary:p="clipping-ancestors",collisionPadding:y,arrowPadding:b,sticky:x,disableAnchorTracking:w,alignItemWithTrigger:C=!0,collisionAvoidance:E=UP,style:O,...T}=e,A=Jo(),D=PL(),k=A.useState("open"),M=A.useState("mounted"),I=A.useState("modal"),L=A.useState("value"),B=A.useState("openMethod"),H=A.useState("positionerElement"),U=A.useState("triggerElement"),F=A.useState("isItemEqualToValue"),K=A.useState("transitionStatus"),z=S.useRef(null),V=S.useRef(null),[X,j]=S.useState(C),Y=M&&X&&B!=="touch";!M&&X!==C&&j(C),S.useImperativeHandle(A.context.alignItemWithTriggerActiveRef,()=>Y),Vw((Y||I)&&k,B==="touch",H,U);const $=Bg({anchor:i,floatingRootContext:D,positionMethod:a,mounted:M,side:c,sideOffset:h,align:f,alignOffset:m,arrowPadding:b,collisionBoundary:p,collisionPadding:y,sticky:x,disableAnchorTracking:w??Y,collisionAvoidance:E,keepMounted:!0}),te=Y?"none":$.side,N=Y?GK:$.positionerStyles,ne={open:k,side:te,align:$.align,anchorHidden:$.anchorHidden};De(()=>{A.set("popupSide",$.side)},[A,$.side]);const q=A.useStateSetter("positionerElement"),G=Vg(e,ne,{styles:N,transitionStatus:K,props:T,refs:[n,q],hidden:!M,inert:!k}),Z=S.useRef(0),ae=He(le=>{if(A.context.valuesRef.current.length===0)return;const ge=Z.current;Z.current=le.size;const ce=Ze(dr);if(ge!==0&&!A.state.multiple&&L!==null&&Xp(A.context.valuesRef.current,L,F)===-1){const Te=A.context.initialValueRef.current,Pe=Te!=null&&Xp(A.context.valuesRef.current,Te,F)!==-1?Te:null;A.context.setValue(Pe,ce),Pe===null&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null)}if(ge!==0&&A.state.multiple&&Array.isArray(L)){const ue=L.filter(Te=>Xp(A.context.valuesRef.current,Te,F)!==-1);ue.length!==L.length&&(A.context.setValue(ue,ce),ue.length===0&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null))}if(k&&Y){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ue={height:""};Pm(H,ue),Pm(A.context.popupRef.current,ue)}}),Se=S.useMemo(()=>({...$,side:te,alignItemWithTriggerActive:Y,setControlledAlignItemWithTrigger:j,scrollUpArrowRef:z,scrollDownArrowRef:V}),[$,te,Y,j]);return fe.jsx(PI,{elementsRef:A.context.listRef,labelsRef:A.context.labelsRef,onMapChange:ae,children:fe.jsxs(BL.Provider,{value:Se,children:[M&&I&&fe.jsx(Pg,{inert:kg(!k),cutout:U}),G]})})}),Sp="base-ui-disable-scrollbar",OM={className:Sp,getElement(t){return fe.jsx("style",{nonce:t,href:Sp,precedence:"base-ui:low",children:`.${Sp}{scrollbar-width:none}.${Sp}::-webkit-scrollbar{display:none}`})}},WK=S.createContext(void 0),XK={disableStyleElements:!1};function $K(){return S.useContext(WK)??XK}const MM="--transform-origin",QK={...Zf,...Fu},Kne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,finalFocus:a,...c}=e,f=Jo(),h=f.useState("multiple"),m=f.useState("readOnly"),p=f.useState("highlightItemOnHover"),y=PL(),{side:b,align:x,alignItemWithTriggerActive:w,isPositioned:C,setControlledAlignItemWithTrigger:E}=YK(),O=Lw()!=null,T=Bw(),{nonce:A,disableStyleElements:D}=$K(),k=f.useState("id"),M=f.useState("open"),I=f.useState("openMethod"),L=f.useState("mounted"),B=f.useState("popupProps"),H=f.useState("transitionStatus"),U=f.useState("triggerElement"),F=f.useState("positionerElement"),K=f.useState("listElement"),z=S.useRef(!1),V=S.useRef(!1),X=S.useRef({}),j=Ru(),Y=He(ne=>{if(!F||!f.context.popupRef.current||!V.current)return;const q=F.style.top==="0px",G=F.style.bottom==="0px";if(z.current||!w||!q&&!G){f.context.handleScrollArrowVisibility(ne);return}const Z=kM(F),ae=uf(F.getBoundingClientRect().height,"y",Z),Se=xt(F),le=Jt(F),ge=le.getComputedStyle(F),ce=parseFloat(ge.marginTop),ue=parseFloat(ge.marginBottom),Te=DM(le.getComputedStyle(f.context.popupRef.current)),ye=Math.min(Se.documentElement.clientHeight-ce-ue,Te),Pe=ne.scrollTop,Ee=xp(ne);let Me=null;const Be=ke=>{F.style.height=`${ke}px`},ve=q?Ee-Pe:Pe,Ie=Math.min(ae+ve,ye);if(ve<=zs){const ke=af(ve,0,ye-ae);ke>0&&Be(ae+ke),ne.scrollTop=q?Ee:0,ye-(ae+ke)<=zs&&(z.current=!0),f.context.handleScrollArrowVisibility(ne);return}if(ye-Ie>zs)Me=q?1/0:0;else if(G&&Pe<Ee){const ke=ae+ve-ye;Me=Pe-(ve-ke)}const de=Math.ceil(Ie);if(de!==0&&Be(de),Me!=null){const ke=af(Me,0,xp(ne));Math.abs(ne.scrollTop-ke)>zs&&(ne.scrollTop=ke)}de>=ye-zs&&(z.current=!0),f.context.handleScrollArrowVisibility(ne)});S.useImperativeHandle(f.context.scrollHandlerRef,()=>Y,[Y]),eo({open:M,ref:f.context.popupRef,onComplete(){M&&f.context.onOpenChangeComplete(!0)}});const $={open:M,transitionStatus:H,side:b,align:x};De(()=>{!F||!f.context.popupRef.current||Object.keys(X.current).length||(X.current={top:F.style.top||"0",left:F.style.left||"0",right:F.style.right,height:F.style.height,bottom:F.style.bottom,minHeight:F.style.minHeight,maxHeight:F.style.maxHeight,marginTop:F.style.marginTop,marginBottom:F.style.marginBottom})},[f,F]),De(()=>{M||w||(V.current=!1,z.current=!1,Pm(F,X.current))},[M,w,F]),De(()=>{const ne=f.context.popupRef.current;if(!M||!U||!F||!ne||w&&!C||f.state.transitionStatus==="ending")return;if(V.current=!0,ne.style.removeProperty(MM),!w){j.request(()=>f.context.handleScrollArrowVisibility(K||ne));return}const q=ZK(ne);try{let G=f.context.selectedItemTextRef.current;G?.isConnected||(G=!f.select("hasSelectedValue")&&f.context.firstItemTextRef.current?.isConnected?f.context.firstItemTextRef.current:null);const Z=f.context.valueRef.current,ae=Jt(F),Se=ae.getComputedStyle(F),le=ae.getComputedStyle(ne),ge=xt(U),ce=kM(U),ue=wp(U.getBoundingClientRect(),ce),Te=wp(F.getBoundingClientRect(),ce),ye=ue.height,Pe=K||ne,Ee=Pe.scrollHeight,Me=parseFloat(le.borderBottomWidth),Be=parseFloat(Se.marginTop)||10,ve=parseFloat(Se.marginBottom)||10,Ie=parseFloat(Se.minHeight)||100,de=DM(le),ke=5,it=5,tt=20,se=ge.documentElement.clientHeight-Be-ve,me=ge.documentElement.clientWidth,_e=se-ue.bottom+ye;let we,Re=T==="rtl"?ue.right-Te.width:ue.left,gt=0;if(G&&Z){const ot=wp(Z.getBoundingClientRect(),ce);we=wp(G.getBoundingClientRect(),ce),Re=Te.left+(T==="rtl"?ot.right-we.right:ot.left-we.left);const lt=ot.top-ue.top+ot.height/2;gt=we.top-Te.top+we.height/2-lt}const Je=_e+gt+ve+Me;let rt=Math.min(se,Je);const Et=se-Be-ve,yt=Je-rt,hn=me-it;F.style.left=`${af(Re,ke,hn-Te.width)}px`,F.style.height=`${rt}px`,F.style.maxHeight="none",F.style.marginTop=`${Be}px`,F.style.marginBottom=`${ve}px`,ne.style.height="100%";const qt=xp(Pe),tn=yt>=qt-zs;tn&&(rt=Math.min(se,Te.height)-(yt-qt));const qe=ue.top<tt||ue.bottom>se-tt||Math.ceil(rt)+zs<Math.min(Ee,Ie),st=(ae.visualViewport?.scale??1)!==1&&vs;if(qe||st){Pm(F,X.current),E(!1);return}const Lt=Math.max(Ie,rt);if(tn){const ot=Math.max(0,se-Je);F.style.top=Te.height>=Et?"0":`${ot}px`,F.style.height=`${rt}px`,Pe.scrollTop=xp(Pe)}else F.style.bottom="0",Pe.scrollTop=yt;if(we){const ot=Te.top,lt=Te.height,vt=we.top+we.height/2,Tt=af(lt>0?(vt-ot)/lt*100:50,0,100);ne.style.setProperty(MM,`50% ${Tt}%`)}(Lt===se||rt>=de)&&(z.current=!0),f.context.handleScrollArrowVisibility(Pe),p&&f.state.selectedIndex===null&&f.state.activeIndex===null&&f.context.listRef.current[0]!=null&&f.set("activeIndex",0)}finally{q()}},[f,M,F,U,w,E,j,K,p,T,C]),S.useEffect(()=>{if(!w||!F||!M)return;const ne=Jt(F);function q(G){f.context.setOpen(!1,Ze(cF,G))}return ft(ne,"resize",q)},[f,w,F,M]);const te={...K?{role:"presentation"}:{role:"listbox","aria-multiselectable":h||void 0,"aria-readonly":m||void 0,id:`${k}-list`},onKeyDown(ne){O&&Dg.has(ne.key)&&ne.stopPropagation()},onScroll(ne){K||Y(ne.currentTarget)},...w&&{style:K?{height:"100%"}:qK},className:!K&&w?OM.className:void 0},N=Ot("div",e,{ref:[n,f.context.popupRef],state:$,stateAttributesMapping:QK,props:[B,te,ud(H),c]});return fe.jsxs(S.Fragment,{children:[!D&&OM.getElement(A),fe.jsx(pg,{context:y,modal:!1,disabled:!L,openInteractionType:I,returnFocus:a,restoreFocus:!0,children:N})]})});function DM(t){const e=t.maxHeight;return e.endsWith("px")&&parseFloat(e)||1/0}function xp(t){return LL(t.scrollHeight,t.clientHeight)}function kM(t){return mI.getScale(t)}function uf(t,e,n){return t/n[e]}function wp(t,e){return kf({x:uf(t.x,"x",e),y:uf(t.y,"y",e),width:uf(t.width,"x",e),height:uf(t.height,"y",e)})}const PM=[["transform","none"],["scale","1"],["translate","0 0"]];function ZK(t){const{style:e}=t,n={};for(const[i,r]of PM)n[i]=e.getPropertyValue(i),e.setProperty(i,r,"important");return()=>{for(const[i]of PM){const r=n[i];r?e.setProperty(i,r):e.removeProperty(i)}}}const VL=S.createContext(void 0);function zL(){const t=S.useContext(VL);if(!t)throw new Error(en(57));return t}const Yne=S.memo(S.forwardRef(function(e,n){const{render:i,className:r,style:o,value:a=null,label:c,disabled:f=!1,nativeButton:h=!1,...m}=e,p=S.useRef(null),y=ad({guess:!0,label:c,textRef:p}),b=Jo(),{props:x,multiple:w,disabled:C,readOnly:E,isItemEqualToValue:O}=b.useState("itemRoot"),T=C||f,A=b.useState("isActive",y.index),D=b.useState("open"),k=b.useState("isSelected",a),M=b.useState("isSelectedByFocus",y.index),I=y.index,L=S.useRef(null);De(()=>{const $=b.context.valuesRef.current;return $[I]=a,()=>{delete $[I]}},[I,a,b]),De(()=>{const $=b.state.value,te=b.state.selectedIndex;let N=te,ne;w&&Array.isArray($)?(N=BK(I,a,b.context.valuesRef.current,$,O,te),ne=N===I,I===te&&!ne&&(b.context.selectedItemTextRef.current=null)):(ne=$!==void 0&&Xl(a,$,O),ne&&(N=I)),b.set("selectedIndex",N),ne&&p.current&&(b.context.selectedItemTextRef.current=p.current)},[I,w,O,b,a]);const B=S.useRef("mouse"),H=S.useRef(!1),{getButtonProps:U,buttonRef:F}=Xo({disabled:T,focusableWhenDisabled:!0,native:h,composite:!0}),K={disabled:T,selected:k,highlighted:A};function z($){if(C||E)return;const te=b.state.value;if(w){const N=Array.isArray(te)?te:[],ne=k?VK(N,a,O):[...N,a];b.context.setValue(ne,Ze(Nl,$))}else b.context.setValue(a,Ze(Nl,$)),b.context.setOpen(!1,Ze(Nl,$))}function V(){b.context.selectionRef.current.dragY=0}const X={role:"option","aria-selected":k,tabIndex:D&&A?0:-1,onKeyDown($){b.set("activeIndex",I),$.key===" "&&b.context.typingRef.current&&$.preventDefault()},onClick($){const te=B.current!=="touch",N=$.nativeEvent.pointerType,ne=te&&Tu($.nativeEvent)&&(N!==void 0||A),q=te&&!ne&&!H.current;H.current=!1,!(T||q)&&z($.nativeEvent)},onPointerEnter($){B.current=$.pointerType},onPointerMove($){if($.pointerType==="mouse"&&$.buttons===1){const te=b.context.selectionRef.current;te.dragY+=$.movementY,te.dragY**2>=64&&(te.allowUnselectedMouseUp=!0)}},onPointerDown($){B.current=$.pointerType,H.current=!0,V()},onMouseUp(){if(V(),T||B.current==="touch"||H.current)return;const $=!b.context.selectionRef.current.allowSelectedMouseUp&&k,te=!b.context.selectionRef.current.allowUnselectedMouseUp&&!k;$||te||(H.current=!0,L.current?.click(),H.current=!1)}},j=Ot("div",e,{ref:[F,n,y.ref,L],state:K,props:[x,X,m,U]}),Y=S.useMemo(()=>({selected:k,index:I,textRef:p,selectedByFocus:M}),[k,I,p,M]);return fe.jsx(VL.Provider,{value:Y,children:j})})),JK=S.memo(S.forwardRef(function(e,n){const{render:i,className:r,style:o,keepMounted:a,selected:c,...f}=e,h=S.useRef(null),{transitionStatus:m,setMounted:p}=mg(c),b=Ot("span",e,{ref:[n,h],state:{selected:c,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},f],stateAttributesMapping:Fu});return eo({batch:!0,enabled:!c,open:c,ref:h,onComplete(){c||p(!1)}}),b})),qne=S.forwardRef(function(e,n){const{selected:i}=zL();return e.keepMounted||i?fe.jsx(JK,{...e,selected:i,ref:n}):null}),Gne=S.memo(S.forwardRef(function(e,n){const{index:i,textRef:r,selectedByFocus:o}=zL(),a=Jo(),{render:c,className:f,style:h,...m}=e,p=S.useCallback(b=>{b&&(i===0&&(a.context.firstItemTextRef.current=b),o&&(a.context.selectedItemTextRef.current=b))},[a,i,o]);return Ot("div",e,{ref:[p,n,r],props:m})})),_L=S.createContext(void 0);function eY(){const t=S.useContext(_L);if(t===void 0)throw new Error(en(56));return t}const Wne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,[c,f]=S.useState(),h=S.useMemo(()=>({labelId:c,setLabelId:f}),[c,f]),m=Ot("div",e,{ref:n,props:[{role:"group","aria-labelledby":c},a]});return fe.jsx(_L.Provider,{value:h,children:m})}),Xne=S.forwardRef(function(e,n){const{render:i,className:r,style:o,id:a,...c}=e,{setLabelId:f}=eY(),h=vi(a);return De(()=>(f(h),()=>{f(p=>p===h?void 0:p)}),[h,f]),Ot("div",e,{ref:n,props:[{id:h,"aria-hidden":!0},c]})});function tY(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S.useMemo(()=>i=>{e.forEach(r=>r(i))},e)}const Gg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ku(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function t1(t){return"nodeType"in t}function xi(t){var e,n;return t?Ku(t)?t:t1(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function n1(t){const{Document:e}=xi(t);return t instanceof e}function md(t){return Ku(t)?!1:t instanceof xi(t).HTMLElement}function HL(t){return t instanceof xi(t).SVGElement}function Yu(t){return t?Ku(t)?t.document:t1(t)?n1(t)?t:md(t)||HL(t)?t.ownerDocument:document:document:document}const Ir=Gg?S.useLayoutEffect:S.useEffect;function Wg(t){const e=S.useRef(t);return Ir(()=>{e.current=t}),S.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.current==null?void 0:e.current(...i)},[])}function nY(){const t=S.useRef(null),e=S.useCallback((i,r)=>{t.current=setInterval(i,r)},[]),n=S.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function _f(t,e){e===void 0&&(e=[t]);const n=S.useRef(t);return Ir(()=>{n.current!==t&&(n.current=t)},e),n}function gd(t,e){const n=S.useRef();return S.useMemo(()=>{const i=t(n.current);return n.current=i,i},[...e])}function Im(t){const e=Wg(t),n=S.useRef(null),i=S.useCallback(r=>{r!==n.current&&e?.(r,n.current),n.current=r},[]);return[n,i]}function Nm(t){const e=S.useRef();return S.useEffect(()=>{e.current=t},[t]),e.current}let xb={};function yd(t,e){return S.useMemo(()=>{if(e)return e;const n=xb[t]==null?0:xb[t]+1;return xb[t]=n,t+"-"+n},[t,e])}function FL(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.reduce((o,a)=>{const c=Object.entries(a);for(const[f,h]of c){const m=o[f];m!=null&&(o[f]=m+t*h)}return o},{...e})}}const wu=FL(1),Lm=FL(-1);function iY(t){return"clientX"in t&&"clientY"in t}function Xg(t){if(!t)return!1;const{KeyboardEvent:e}=xi(t.target);return e&&t instanceof e}function rY(t){if(!t)return!1;const{TouchEvent:e}=xi(t.target);return e&&t instanceof e}function Bm(t){if(rY(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return iY(t)?{x:t.clientX,y:t.clientY}:null}const $l=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[$l.Translate.toString(t),$l.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:i}=t;return e+" "+n+"ms "+i}}}),IM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function sY(t){return t.matches(IM)?t:t.querySelector(IM)}const oY={display:"none"};function lY(t){let{id:e,value:n}=t;return be.createElement("div",{id:e,style:oY},n)}function aY(t){let{id:e,announcement:n,ariaLiveType:i="assertive"}=t;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return be.createElement("div",{id:e,style:r,role:"status","aria-live":i,"aria-atomic":!0},n)}function uY(){const[t,e]=S.useState("");return{announce:S.useCallback(i=>{i!=null&&e(i)},[]),announcement:t}}const UL=S.createContext(null);function cY(t){const e=S.useContext(UL);S.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function fY(){const[t]=S.useState(()=>new Set),e=S.useCallback(i=>(t.add(i),()=>t.delete(i)),[t]);return[S.useCallback(i=>{let{type:r,event:o}=i;t.forEach(a=>{var c;return(c=a[r])==null?void 0:c.call(a,o)})},[t]),e]}const dY={draggable:`
20
+ To pick up a draggable item, press the space bar.
21
+ While dragging, use the arrow keys to move the item.
22
+ Press space again to drop the item in its new position, or press escape to cancel.
23
+ `},hY={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function pY(t){let{announcements:e=hY,container:n,hiddenTextDescribedById:i,screenReaderInstructions:r=dY}=t;const{announce:o,announcement:a}=uY(),c=yd("DndLiveRegion"),[f,h]=S.useState(!1);if(S.useEffect(()=>{h(!0)},[]),cY(S.useMemo(()=>({onDragStart(p){let{active:y}=p;o(e.onDragStart({active:y}))},onDragMove(p){let{active:y,over:b}=p;e.onDragMove&&o(e.onDragMove({active:y,over:b}))},onDragOver(p){let{active:y,over:b}=p;o(e.onDragOver({active:y,over:b}))},onDragEnd(p){let{active:y,over:b}=p;o(e.onDragEnd({active:y,over:b}))},onDragCancel(p){let{active:y,over:b}=p;o(e.onDragCancel({active:y,over:b}))}}),[o,e])),!f)return null;const m=be.createElement(be.Fragment,null,be.createElement(lY,{id:i,value:r.draggable}),be.createElement(aY,{id:c,announcement:a}));return n?Ln.createPortal(m,n):m}var Nn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Nn||(Nn={}));function Vm(){}function $ne(t,e){return S.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Qne(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S.useMemo(()=>[...e].filter(i=>i!=null),[...e])}const Nr=Object.freeze({x:0,y:0});function mY(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function gY(t,e){const n=Bm(t);if(!n)return"0 0";const i={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return i.x+"% "+i.y+"%"}function yY(t,e){let{data:{value:n}}=t,{data:{value:i}}=e;return n-i}function vY(t,e){let{data:{value:n}}=t,{data:{value:i}}=e;return i-n}function bY(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function NM(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Zne=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:i}=t;const r=NM(e,e.left,e.top),o=[];for(const a of i){const{id:c}=a,f=n.get(c);if(f){const h=mY(NM(f),r);o.push({id:c,data:{droppableContainer:a,value:h}})}}return o.sort(yY)};function SY(t,e){const n=Math.max(e.top,t.top),i=Math.max(e.left,t.left),r=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),a=r-i,c=o-n;if(i<r&&n<o){const f=e.width*e.height,h=t.width*t.height,m=a*c,p=m/(f+h-m);return Number(p.toFixed(4))}return 0}const xY=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:i}=t;const r=[];for(const o of i){const{id:a}=o,c=n.get(a);if(c){const f=SY(c,e);f>0&&r.push({id:a,data:{droppableContainer:o,value:f}})}}return r.sort(vY)};function wY(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function jL(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Nr}function CY(t){return function(n){for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return r.reduce((a,c)=>({...a,top:a.top+t*c.y,bottom:a.bottom+t*c.y,left:a.left+t*c.x,right:a.right+t*c.x}),{...n})}}const EY=CY(1);function KL(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function TY(t,e,n){const i=KL(e);if(!i)return t;const{scaleX:r,scaleY:o,x:a,y:c}=i,f=t.left-a-(1-r)*parseFloat(n),h=t.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),m=r?t.width/r:t.width,p=o?t.height/o:t.height;return{width:m,height:p,top:h,right:f+m,bottom:h+p,left:f}}const RY={ignoreTransform:!1};function qu(t,e){e===void 0&&(e=RY);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:h,transformOrigin:m}=xi(t).getComputedStyle(t);h&&(n=TY(n,h,m))}const{top:i,left:r,width:o,height:a,bottom:c,right:f}=n;return{top:i,left:r,width:o,height:a,bottom:c,right:f}}function LM(t){return qu(t,{ignoreTransform:!0})}function AY(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function OY(t,e){return e===void 0&&(e=xi(t).getComputedStyle(t)),e.position==="fixed"}function MY(t,e){e===void 0&&(e=xi(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const o=e[r];return typeof o=="string"?n.test(o):!1})}function i1(t,e){const n=[];function i(r){if(e!=null&&n.length>=e||!r)return n;if(n1(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!md(r)||HL(r)||n.includes(r))return n;const o=xi(t).getComputedStyle(r);return r!==t&&MY(r,o)&&n.push(r),OY(r,o)?n:i(r.parentNode)}return t?i(t):n}function YL(t){const[e]=i1(t,1);return e??null}function wb(t){return!Gg||!t?null:Ku(t)?t:t1(t)?n1(t)||t===Yu(t).scrollingElement?window:md(t)?t:null:null}function qL(t){return Ku(t)?t.scrollX:t.scrollLeft}function GL(t){return Ku(t)?t.scrollY:t.scrollTop}function nx(t){return{x:qL(t),y:GL(t)}}var jn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(jn||(jn={}));function WL(t){return!Gg||!t?!1:t===document.scrollingElement}function XL(t){const e={x:0,y:0},n=WL(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},r=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,a=t.scrollTop>=i.y,c=t.scrollLeft>=i.x;return{isTop:r,isLeft:o,isBottom:a,isRight:c,maxScroll:i,minScroll:e}}const DY={x:.2,y:.2};function kY(t,e,n,i,r){let{top:o,left:a,right:c,bottom:f}=n;i===void 0&&(i=10),r===void 0&&(r=DY);const{isTop:h,isBottom:m,isLeft:p,isRight:y}=XL(t),b={x:0,y:0},x={x:0,y:0},w={height:e.height*r.y,width:e.width*r.x};return!h&&o<=e.top+w.height?(b.y=jn.Backward,x.y=i*Math.abs((e.top+w.height-o)/w.height)):!m&&f>=e.bottom-w.height&&(b.y=jn.Forward,x.y=i*Math.abs((e.bottom-w.height-f)/w.height)),!y&&c>=e.right-w.width?(b.x=jn.Forward,x.x=i*Math.abs((e.right-w.width-c)/w.width)):!p&&a<=e.left+w.width&&(b.x=jn.Backward,x.x=i*Math.abs((e.left+w.width-a)/w.width)),{direction:b,speed:x}}function PY(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:e,left:n,right:i,bottom:r}=t.getBoundingClientRect();return{top:e,left:n,right:i,bottom:r,width:t.clientWidth,height:t.clientHeight}}function $L(t){return t.reduce((e,n)=>wu(e,nx(n)),Nr)}function IY(t){return t.reduce((e,n)=>e+qL(n),0)}function NY(t){return t.reduce((e,n)=>e+GL(n),0)}function QL(t,e){if(e===void 0&&(e=qu),!t)return;const{top:n,left:i,bottom:r,right:o}=e(t);YL(t)&&(r<=0||o<=0||n>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const LY=[["x",["left","right"],IY],["y",["top","bottom"],NY]];class r1{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=i1(n),r=$L(i);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,a,c]of LY)for(const f of a)Object.defineProperty(this,f,{get:()=>{const h=c(i),m=r[o]-h;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class bf{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=e}add(e,n,i){var r;(r=this.target)==null||r.addEventListener(e,n,i),this.listeners.push([e,n,i])}}function BY(t){const{EventTarget:e}=xi(t);return t instanceof e?t:Yu(t)}function Cb(t,e){const n=Math.abs(t.x),i=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+i**2)>e:"x"in e&&"y"in e?n>e.x&&i>e.y:"x"in e?n>e.x:"y"in e?i>e.y:!1}var ir;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(ir||(ir={}));function BM(t){t.preventDefault()}function VY(t){t.stopPropagation()}var Nt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Nt||(Nt={}));const ZL={start:[Nt.Space,Nt.Enter],cancel:[Nt.Esc],end:[Nt.Space,Nt.Enter,Nt.Tab]},zY=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Nt.Right:return{...n,x:n.x+25};case Nt.Left:return{...n,x:n.x-25};case Nt.Down:return{...n,y:n.y+25};case Nt.Up:return{...n,y:n.y-25}}};class JL{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new bf(Yu(n)),this.windowListeners=new bf(xi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ir.Resize,this.handleCancel),this.windowListeners.add(ir.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ir.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,i=e.node.current;i&&QL(i),n(Nr)}handleKeyDown(e){if(Xg(e)){const{active:n,context:i,options:r}=this.props,{keyboardCodes:o=ZL,coordinateGetter:a=zY,scrollBehavior:c="smooth"}=r,{code:f}=e;if(o.end.includes(f)){this.handleEnd(e);return}if(o.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:h}=i.current,m=h?{x:h.left,y:h.top}:Nr;this.referenceCoordinates||(this.referenceCoordinates=m);const p=a(e,{active:n,context:i.current,currentCoordinates:m});if(p){const y=Lm(p,m),b={x:0,y:0},{scrollableAncestors:x}=i.current;for(const w of x){const C=e.code,{isTop:E,isRight:O,isLeft:T,isBottom:A,maxScroll:D,minScroll:k}=XL(w),M=PY(w),I={x:Math.min(C===Nt.Right?M.right-M.width/2:M.right,Math.max(C===Nt.Right?M.left:M.left+M.width/2,p.x)),y:Math.min(C===Nt.Down?M.bottom-M.height/2:M.bottom,Math.max(C===Nt.Down?M.top:M.top+M.height/2,p.y))},L=C===Nt.Right&&!O||C===Nt.Left&&!T,B=C===Nt.Down&&!A||C===Nt.Up&&!E;if(L&&I.x!==p.x){const H=w.scrollLeft+y.x,U=C===Nt.Right&&H<=D.x||C===Nt.Left&&H>=k.x;if(U&&!y.y){w.scrollTo({left:H,behavior:c});return}U?b.x=w.scrollLeft-H:b.x=C===Nt.Right?w.scrollLeft-D.x:w.scrollLeft-k.x,b.x&&w.scrollBy({left:-b.x,behavior:c});break}else if(B&&I.y!==p.y){const H=w.scrollTop+y.y,U=C===Nt.Down&&H<=D.y||C===Nt.Up&&H>=k.y;if(U&&!y.x){w.scrollTo({top:H,behavior:c});return}U?b.y=w.scrollTop-H:b.y=C===Nt.Down?w.scrollTop-D.y:w.scrollTop-k.y,b.y&&w.scrollBy({top:-b.y,behavior:c});break}}this.handleMove(e,wu(Lm(p,this.referenceCoordinates),b))}}}handleMove(e,n){const{onMove:i}=this.props;e.preventDefault(),i(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}JL.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:i=ZL,onActivation:r}=e,{active:o}=n;const{code:a}=t.nativeEvent;if(i.start.includes(a)){const c=o.activatorNode.current;return c&&t.target!==c?!1:(t.preventDefault(),r?.({event:t.nativeEvent}),!0)}return!1}}];function VM(t){return!!(t&&"distance"in t)}function zM(t){return!!(t&&"delay"in t)}class s1{constructor(e,n,i){var r;i===void 0&&(i=BY(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:o}=e,{target:a}=o;this.props=e,this.events=n,this.document=Yu(a),this.documentListeners=new bf(this.document),this.listeners=new bf(i),this.windowListeners=new bf(xi(a)),this.initialCoordinates=(r=Bm(o))!=null?r:Nr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(ir.Resize,this.handleCancel),this.windowListeners.add(ir.DragStart,BM),this.windowListeners.add(ir.VisibilityChange,this.handleCancel),this.windowListeners.add(ir.ContextMenu,BM),this.documentListeners.add(ir.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(VM(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:i,onPending:r}=this.props;r(i,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(ir.Click,VY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ir.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:i,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:c}}=o;if(!r)return;const f=(n=Bm(e))!=null?n:Nr,h=Lm(r,f);if(!i&&c){if(VM(c)){if(c.tolerance!=null&&Cb(h,c.tolerance))return this.handleCancel();if(Cb(h,c.distance))return this.handleStart()}if(zM(c)&&Cb(h,c.tolerance))return this.handleCancel();this.handlePending(c,h);return}e.cancelable&&e.preventDefault(),a(f)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Nt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const _Y={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eB extends s1{constructor(e){const{event:n}=e,i=Yu(n.target);super(e,_Y,i)}}eB.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;return!n.isPrimary||n.button!==0?!1:(i?.({event:n}),!0)}}];const HY={move:{name:"mousemove"},end:{name:"mouseup"}};var ix;(function(t){t[t.RightClick=2]="RightClick"})(ix||(ix={}));class FY extends s1{constructor(e){super(e,HY,Yu(e.event.target))}}FY.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;return n.button===ix.RightClick?!1:(i?.({event:n}),!0)}}];const Eb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class UY extends s1{constructor(e){super(e,Eb)}static setup(){return window.addEventListener(Eb.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Eb.move.name,e)};function e(){}}}UY.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;const{touches:r}=n;return r.length>1?!1:(i?.({event:n}),!0)}}];var Sf;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Sf||(Sf={}));var zm;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(zm||(zm={}));function jY(t){let{acceleration:e,activator:n=Sf.Pointer,canScroll:i,draggingRect:r,enabled:o,interval:a=5,order:c=zm.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:m,delta:p,threshold:y}=t;const b=YY({delta:p,disabled:!o}),[x,w]=nY(),C=S.useRef({x:0,y:0}),E=S.useRef({x:0,y:0}),O=S.useMemo(()=>{switch(n){case Sf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Sf.DraggableRect:return r}},[n,r,f]),T=S.useRef(null),A=S.useCallback(()=>{const k=T.current;if(!k)return;const M=C.current.x*E.current.x,I=C.current.y*E.current.y;k.scrollBy(M,I)},[]),D=S.useMemo(()=>c===zm.TreeOrder?[...h].reverse():h,[c,h]);S.useEffect(()=>{if(!o||!h.length||!O){w();return}for(const k of D){if(i?.(k)===!1)continue;const M=h.indexOf(k),I=m[M];if(!I)continue;const{direction:L,speed:B}=kY(k,I,O,e,y);for(const H of["x","y"])b[H][L[H]]||(B[H]=0,L[H]=0);if(B.x>0||B.y>0){w(),T.current=k,x(A,a),C.current=B,E.current=L;return}}C.current={x:0,y:0},E.current={x:0,y:0},w()},[e,A,i,w,o,a,JSON.stringify(O),JSON.stringify(b),x,h,D,m,JSON.stringify(y)])}const KY={x:{[jn.Backward]:!1,[jn.Forward]:!1},y:{[jn.Backward]:!1,[jn.Forward]:!1}};function YY(t){let{delta:e,disabled:n}=t;const i=Nm(e);return gd(r=>{if(n||!i||!r)return KY;const o={x:Math.sign(e.x-i.x),y:Math.sign(e.y-i.y)};return{x:{[jn.Backward]:r.x[jn.Backward]||o.x===-1,[jn.Forward]:r.x[jn.Forward]||o.x===1},y:{[jn.Backward]:r.y[jn.Backward]||o.y===-1,[jn.Forward]:r.y[jn.Forward]||o.y===1}}},[n,e,i])}function qY(t,e){const n=e!=null?t.get(e):void 0,i=n?n.node.current:null;return gd(r=>{var o;return e==null?null:(o=i??r)!=null?o:null},[i,e])}function GY(t,e){return S.useMemo(()=>t.reduce((n,i)=>{const{sensor:r}=i,o=r.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,i)}));return[...n,...o]},[]),[t,e])}var Hf;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Hf||(Hf={}));var rx;(function(t){t.Optimized="optimized"})(rx||(rx={}));const _M=new Map;function WY(t,e){let{dragging:n,dependencies:i,config:r}=e;const[o,a]=S.useState(null),{frequency:c,measure:f,strategy:h}=r,m=S.useRef(t),p=C(),y=_f(p),b=S.useCallback(function(E){E===void 0&&(E=[]),!y.current&&a(O=>O===null?E:O.concat(E.filter(T=>!O.includes(T))))},[y]),x=S.useRef(null),w=gd(E=>{if(p&&!n)return _M;if(!E||E===_M||m.current!==t||o!=null){const O=new Map;for(let T of t){if(!T)continue;if(o&&o.length>0&&!o.includes(T.id)&&T.rect.current){O.set(T.id,T.rect.current);continue}const A=T.node.current,D=A?new r1(f(A),A):null;T.rect.current=D,D&&O.set(T.id,D)}return O}return E},[t,o,n,p,f]);return S.useEffect(()=>{m.current=t},[t]),S.useEffect(()=>{p||b()},[n,p]),S.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),S.useEffect(()=>{p||typeof c!="number"||x.current!==null||(x.current=setTimeout(()=>{b(),x.current=null},c))},[c,p,b,...i]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:o!=null};function C(){switch(h){case Hf.Always:return!1;case Hf.BeforeDragging:return n;default:return!n}}}function o1(t,e){return gd(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function XY(t,e){return o1(t,e)}function $Y(t){let{callback:e,disabled:n}=t;const i=Wg(e),r=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,n]);return S.useEffect(()=>()=>r?.disconnect(),[r]),r}function $g(t){let{callback:e,disabled:n}=t;const i=Wg(e),r=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[n]);return S.useEffect(()=>()=>r?.disconnect(),[r]),r}function QY(t){return new r1(qu(t),t)}function HM(t,e,n){e===void 0&&(e=QY);const[i,r]=S.useState(null);function o(){r(f=>{if(!t)return null;if(t.isConnected===!1){var h;return(h=f??n)!=null?h:null}const m=e(t);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const a=$Y({callback(f){if(t)for(const h of f){const{type:m,target:p}=h;if(m==="childList"&&p instanceof HTMLElement&&p.contains(t)){o();break}}}}),c=$g({callback:o});return Ir(()=>{o(),t?(c?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),a?.disconnect())},[t]),i}function ZY(t){const e=o1(t);return jL(t,e)}const FM=[];function JY(t){const e=S.useRef(t),n=gd(i=>t?i&&i!==FM&&t&&e.current&&t.parentNode===e.current.parentNode?i:i1(t):FM,[t]);return S.useEffect(()=>{e.current=t},[t]),n}function eq(t){const[e,n]=S.useState(null),i=S.useRef(t),r=S.useCallback(o=>{const a=wb(o.target);a&&n(c=>c?(c.set(a,nx(a)),new Map(c)):null)},[]);return S.useEffect(()=>{const o=i.current;if(t!==o){a(o);const c=t.map(f=>{const h=wb(f);return h?(h.addEventListener("scroll",r,{passive:!0}),[h,nx(h)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),i.current=t}return()=>{a(t),a(o)};function a(c){c.forEach(f=>{const h=wb(f);h?.removeEventListener("scroll",r)})}},[r,t]),S.useMemo(()=>t.length?e?Array.from(e.values()).reduce((o,a)=>wu(o,a),Nr):$L(t):Nr,[t,e])}function UM(t,e){e===void 0&&(e=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},e),S.useEffect(()=>{const i=t!==Nr;i&&!n.current&&(n.current=t),!i&&n.current&&(n.current=null)},[t]),n.current?Lm(t,n.current):Nr}function tq(t){S.useEffect(()=>{if(!Gg)return;const e=t.map(n=>{let{sensor:i}=n;return i.setup==null?void 0:i.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function nq(t,e){return S.useMemo(()=>t.reduce((n,i)=>{let{eventName:r,handler:o}=i;return n[r]=a=>{o(a,e)},n},{}),[t,e])}function tB(t){return S.useMemo(()=>t?AY(t):null,[t])}const jM=[];function iq(t,e){e===void 0&&(e=qu);const[n]=t,i=tB(n?xi(n):null),[r,o]=S.useState(jM);function a(){o(()=>t.length?t.map(f=>WL(f)?i:new r1(e(f),f)):jM)}const c=$g({callback:a});return Ir(()=>{c?.disconnect(),a(),t.forEach(f=>c?.observe(f))},[t]),r}function nB(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return md(e)?e:t}function rq(t){let{measure:e}=t;const[n,i]=S.useState(null),r=S.useCallback(h=>{for(const{target:m}of h)if(md(m)){i(p=>{const y=e(m);return p?{...p,width:y.width,height:y.height}:y});break}},[e]),o=$g({callback:r}),a=S.useCallback(h=>{const m=nB(h);o?.disconnect(),m&&o?.observe(m),i(m?e(m):null)},[e,o]),[c,f]=Im(a);return S.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const sq=[{sensor:eB,options:{}},{sensor:JL,options:{}}],oq={current:{}},$p={draggable:{measure:LM},droppable:{measure:LM,strategy:Hf.WhileDragging,frequency:rx.Optimized},dragOverlay:{measure:qu}};class xf extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,i;return(n=(i=this.get(e))==null?void 0:i.node.current)!=null?n:void 0}}const lq={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:$p,measureDroppableContainers:Vm,windowRect:null,measuringScheduled:!1},iB={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vm,draggableNodes:new Map,over:null,measureDroppableContainers:Vm},vd=S.createContext(iB),rB=S.createContext(lq);function aq(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xf}}}function uq(t,e){switch(e.type){case Nn.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Nn.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Nn.DragEnd:case Nn.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Nn.RegisterDroppable:{const{element:n}=e,{id:i}=n,r=new xf(t.droppable.containers);return r.set(i,n),{...t,droppable:{...t.droppable,containers:r}}}case Nn.SetDroppableDisabled:{const{id:n,key:i,disabled:r}=e,o=t.droppable.containers.get(n);if(!o||i!==o.key)return t;const a=new xf(t.droppable.containers);return a.set(n,{...o,disabled:r}),{...t,droppable:{...t.droppable,containers:a}}}case Nn.UnregisterDroppable:{const{id:n,key:i}=e,r=t.droppable.containers.get(n);if(!r||i!==r.key)return t;const o=new xf(t.droppable.containers);return o.delete(n),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function cq(t){let{disabled:e}=t;const{active:n,activatorEvent:i,draggableNodes:r}=S.useContext(vd),o=Nm(i),a=Nm(n?.id);return S.useEffect(()=>{if(!e&&!i&&o&&a!=null){if(!Xg(o)||document.activeElement===o.target)return;const c=r.get(a);if(!c)return;const{activatorNode:f,node:h}=c;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const m of[f.current,h.current]){if(!m)continue;const p=sY(m);if(p){p.focus();break}}})}},[i,e,r,a,o]),null}function sB(t,e){let{transform:n,...i}=e;return t!=null&&t.length?t.reduce((r,o)=>o({transform:r,...i}),n):n}function fq(t){return S.useMemo(()=>({draggable:{...$p.draggable,...t?.draggable},droppable:{...$p.droppable,...t?.droppable},dragOverlay:{...$p.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function dq(t){let{activeNode:e,measure:n,initialRect:i,config:r=!0}=t;const o=S.useRef(!1),{x:a,y:c}=typeof r=="boolean"?{x:r,y:r}:r;Ir(()=>{if(!a&&!c||!e){o.current=!1;return}if(o.current||!i)return;const h=e?.node.current;if(!h||h.isConnected===!1)return;const m=n(h),p=jL(m,i);if(a||(p.x=0),c||(p.y=0),o.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const y=YL(h);y&&y.scrollBy({top:p.y,left:p.x})}},[e,a,c,i,n])}const Qg=S.createContext({...Nr,scaleX:1,scaleY:1});var Oo;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Oo||(Oo={}));const Jne=S.memo(function(e){var n,i,r,o;let{id:a,accessibility:c,autoScroll:f=!0,children:h,sensors:m=sq,collisionDetection:p=xY,measuring:y,modifiers:b,...x}=e;const w=S.useReducer(uq,void 0,aq),[C,E]=w,[O,T]=fY(),[A,D]=S.useState(Oo.Uninitialized),k=A===Oo.Initialized,{draggable:{active:M,nodes:I,translate:L},droppable:{containers:B}}=C,H=M!=null?I.get(M):null,U=S.useRef({initial:null,translated:null}),F=S.useMemo(()=>{var lt;return M!=null?{id:M,data:(lt=H?.data)!=null?lt:oq,rect:U}:null},[M,H]),K=S.useRef(null),[z,V]=S.useState(null),[X,j]=S.useState(null),Y=_f(x,Object.values(x)),$=yd("DndDescribedBy",a),te=S.useMemo(()=>B.getEnabled(),[B]),N=fq(y),{droppableRects:ne,measureDroppableContainers:q,measuringScheduled:G}=WY(te,{dragging:k,dependencies:[L.x,L.y],config:N.droppable}),Z=qY(I,M),ae=S.useMemo(()=>X?Bm(X):null,[X]),Se=ot(),le=XY(Z,N.draggable.measure);dq({activeNode:M!=null?I.get(M):null,config:Se.layoutShiftCompensation,initialRect:le,measure:N.draggable.measure});const ge=HM(Z,N.draggable.measure,le),ce=HM(Z?Z.parentElement:null),ue=S.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=B.getNodeFor((n=ue.current.over)==null?void 0:n.id),ye=rq({measure:N.dragOverlay.measure}),Pe=(i=ye.nodeRef.current)!=null?i:Z,Ee=k?(r=ye.rect)!=null?r:ge:null,Me=!!(ye.nodeRef.current&&ye.rect),Be=ZY(Me?null:ge),ve=tB(Pe?xi(Pe):null),Ie=JY(k?Te??Z:null),de=iq(Ie),ke=sB(b,{transform:{x:L.x-Be.x,y:L.y-Be.y,scaleX:1,scaleY:1},activatorEvent:X,active:F,activeNodeRect:ge,containerNodeRect:ce,draggingNodeRect:Ee,over:ue.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ie,scrollableAncestorRects:de,windowRect:ve}),it=ae?wu(ae,L):null,tt=eq(Ie),se=UM(tt),me=UM(tt,[ge]),_e=wu(ke,se),we=Ee?EY(Ee,ke):null,Re=F&&we?p({active:F,collisionRect:we,droppableRects:ne,droppableContainers:te,pointerCoordinates:it}):null,gt=bY(Re,"id"),[Je,rt]=S.useState(null),Et=Me?ke:wu(ke,me),yt=wY(Et,(o=Je?.rect)!=null?o:null,ge),hn=S.useRef(null),qt=S.useCallback((lt,vt)=>{let{sensor:Tt,options:un}=vt;if(K.current==null)return;const Ce=I.get(K.current);if(!Ce)return;const Qe=lt.nativeEvent,Ae=new Tt({active:K.current,activeNode:Ce,event:Qe,options:un,context:ue,onAbort(Ke){if(!I.get(Ke))return;const{onDragAbort:dt}=Y.current,Ge={id:Ke};dt?.(Ge),O({type:"onDragAbort",event:Ge})},onPending(Ke,Xe,dt,Ge){if(!I.get(Ke))return;const{onDragPending:pt}=Y.current,zt={id:Ke,constraint:Xe,initialCoordinates:dt,offset:Ge};pt?.(zt),O({type:"onDragPending",event:zt})},onStart(Ke){const Xe=K.current;if(Xe==null)return;const dt=I.get(Xe);if(!dt)return;const{onDragStart:Ge}=Y.current,at={activatorEvent:Qe,active:{id:Xe,data:dt.data,rect:U}};Ln.unstable_batchedUpdates(()=>{Ge?.(at),D(Oo.Initializing),E({type:Nn.DragStart,initialCoordinates:Ke,active:Xe}),O({type:"onDragStart",event:at}),V(hn.current),j(Qe)})},onMove(Ke){E({type:Nn.DragMove,coordinates:Ke})},onEnd:Oe(Nn.DragEnd),onCancel:Oe(Nn.DragCancel)});hn.current=Ae;function Oe(Ke){return async function(){const{active:dt,collisions:Ge,over:at,scrollAdjustedTranslate:pt}=ue.current;let zt=null;if(dt&&pt){const{cancelDrop:pn}=Y.current;zt={activatorEvent:Qe,active:dt,collisions:Ge,delta:pt,over:at},Ke===Nn.DragEnd&&typeof pn=="function"&&await Promise.resolve(pn(zt))&&(Ke=Nn.DragCancel)}K.current=null,Ln.unstable_batchedUpdates(()=>{E({type:Ke}),D(Oo.Uninitialized),rt(null),V(null),j(null),hn.current=null;const pn=Ke===Nn.DragEnd?"onDragEnd":"onDragCancel";if(zt){const Cn=Y.current[pn];Cn?.(zt),O({type:pn,event:zt})}})}}},[I]),tn=S.useCallback((lt,vt)=>(Tt,un)=>{const Ce=Tt.nativeEvent,Qe=I.get(un);if(K.current!==null||!Qe||Ce.dndKit||Ce.defaultPrevented)return;const Ae={active:Qe};lt(Tt,vt.options,Ae)===!0&&(Ce.dndKit={capturedBy:vt.sensor},K.current=un,qt(Tt,vt))},[I,qt]),qe=GY(m,tn);tq(m),Ir(()=>{ge&&A===Oo.Initializing&&D(Oo.Initialized)},[ge,A]),S.useEffect(()=>{const{onDragMove:lt}=Y.current,{active:vt,activatorEvent:Tt,collisions:un,over:Ce}=ue.current;if(!vt||!Tt)return;const Qe={active:vt,activatorEvent:Tt,collisions:un,delta:{x:_e.x,y:_e.y},over:Ce};Ln.unstable_batchedUpdates(()=>{lt?.(Qe),O({type:"onDragMove",event:Qe})})},[_e.x,_e.y]),S.useEffect(()=>{const{active:lt,activatorEvent:vt,collisions:Tt,droppableContainers:un,scrollAdjustedTranslate:Ce}=ue.current;if(!lt||K.current==null||!vt||!Ce)return;const{onDragOver:Qe}=Y.current,Ae=un.get(gt),Oe=Ae&&Ae.rect.current?{id:Ae.id,rect:Ae.rect.current,data:Ae.data,disabled:Ae.disabled}:null,Ke={active:lt,activatorEvent:vt,collisions:Tt,delta:{x:Ce.x,y:Ce.y},over:Oe};Ln.unstable_batchedUpdates(()=>{rt(Oe),Qe?.(Ke),O({type:"onDragOver",event:Ke})})},[gt]),Ir(()=>{ue.current={activatorEvent:X,active:F,activeNode:Z,collisionRect:we,collisions:Re,droppableRects:ne,draggableNodes:I,draggingNode:Pe,draggingNodeRect:Ee,droppableContainers:B,over:Je,scrollableAncestors:Ie,scrollAdjustedTranslate:_e},U.current={initial:Ee,translated:we}},[F,Z,Re,we,I,Pe,Ee,ne,B,Je,Ie,_e]),jY({...Se,delta:L,draggingRect:we,pointerCoordinates:it,scrollableAncestors:Ie,scrollableAncestorRects:de});const st=S.useMemo(()=>({active:F,activeNode:Z,activeNodeRect:ge,activatorEvent:X,collisions:Re,containerNodeRect:ce,dragOverlay:ye,draggableNodes:I,droppableContainers:B,droppableRects:ne,over:Je,measureDroppableContainers:q,scrollableAncestors:Ie,scrollableAncestorRects:de,measuringConfiguration:N,measuringScheduled:G,windowRect:ve}),[F,Z,ge,X,Re,ce,ye,I,B,ne,Je,q,Ie,de,N,G,ve]),Lt=S.useMemo(()=>({activatorEvent:X,activators:qe,active:F,activeNodeRect:ge,ariaDescribedById:{draggable:$},dispatch:E,draggableNodes:I,over:Je,measureDroppableContainers:q}),[X,qe,F,ge,E,$,I,Je,q]);return be.createElement(UL.Provider,{value:T},be.createElement(vd.Provider,{value:Lt},be.createElement(rB.Provider,{value:st},be.createElement(Qg.Provider,{value:yt},h)),be.createElement(cq,{disabled:c?.restoreFocus===!1})),be.createElement(pY,{...c,hiddenTextDescribedById:$}));function ot(){const lt=z?.autoScrollEnabled===!1,vt=typeof f=="object"?f.enabled===!1:f===!1,Tt=k&&!lt&&!vt;return typeof f=="object"?{...f,enabled:Tt}:{enabled:Tt}}}),hq=S.createContext(null),KM="button",pq="Draggable";function mq(t){let{id:e,data:n,disabled:i=!1,attributes:r}=t;const o=yd(pq),{activators:a,activatorEvent:c,active:f,activeNodeRect:h,ariaDescribedById:m,draggableNodes:p,over:y}=S.useContext(vd),{role:b=KM,roleDescription:x="draggable",tabIndex:w=0}=r??{},C=f?.id===e,E=S.useContext(C?Qg:hq),[O,T]=Im(),[A,D]=Im(),k=nq(a,e),M=_f(n);Ir(()=>(p.set(e,{id:e,key:o,node:O,activatorNode:A,data:M}),()=>{const L=p.get(e);L&&L.key===o&&p.delete(e)}),[p,e]);const I=S.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":i,"aria-pressed":C&&b===KM?!0:void 0,"aria-roledescription":x,"aria-describedby":m.draggable}),[i,b,w,C,x,m.draggable]);return{active:f,activatorEvent:c,activeNodeRect:h,attributes:I,isDragging:C,listeners:i?void 0:k,node:O,over:y,setNodeRef:T,setActivatorNodeRef:D,transform:E}}function oB(){return S.useContext(rB)}const gq="Droppable",yq={timeout:25};function vq(t){let{data:e,disabled:n=!1,id:i,resizeObserverConfig:r}=t;const o=yd(gq),{active:a,dispatch:c,over:f,measureDroppableContainers:h}=S.useContext(vd),m=S.useRef({disabled:n}),p=S.useRef(!1),y=S.useRef(null),b=S.useRef(null),{disabled:x,updateMeasurementsFor:w,timeout:C}={...yq,...r},E=_f(w??i),O=S.useCallback(()=>{if(!p.current){p.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{h(Array.isArray(E.current)?E.current:[E.current]),b.current=null},C)},[C]),T=$g({callback:O,disabled:x||!a}),A=S.useCallback((I,L)=>{T&&(L&&(T.unobserve(L),p.current=!1),I&&T.observe(I))},[T]),[D,k]=Im(A),M=_f(e);return S.useEffect(()=>{!T||!D.current||(T.disconnect(),p.current=!1,T.observe(D.current))},[D,T]),S.useEffect(()=>(c({type:Nn.RegisterDroppable,element:{id:i,key:o,disabled:n,node:D,rect:y,data:M}}),()=>c({type:Nn.UnregisterDroppable,key:o,id:i})),[i]),S.useEffect(()=>{n!==m.current.disabled&&(c({type:Nn.SetDroppableDisabled,id:i,key:o,disabled:n}),m.current.disabled=n)},[i,o,n,c]),{active:a,rect:y,isOver:f?.id===i,node:D,over:f,setNodeRef:k}}function bq(t){let{animation:e,children:n}=t;const[i,r]=S.useState(null),[o,a]=S.useState(null),c=Nm(n);return!n&&!i&&c&&r(c),Ir(()=>{if(!o)return;const f=i?.key,h=i?.props.id;if(f==null||h==null){r(null);return}Promise.resolve(e(h,o)).then(()=>{r(null)})},[e,i,o]),be.createElement(be.Fragment,null,n,i?S.cloneElement(i,{ref:a}):null)}const Sq={x:0,y:0,scaleX:1,scaleY:1};function xq(t){let{children:e}=t;return be.createElement(vd.Provider,{value:iB},be.createElement(Qg.Provider,{value:Sq},e))}const wq={position:"fixed",touchAction:"none"},Cq=t=>Xg(t)?"transform 250ms ease":void 0,Eq=S.forwardRef((t,e)=>{let{as:n,activatorEvent:i,adjustScale:r,children:o,className:a,rect:c,style:f,transform:h,transition:m=Cq}=t;if(!c)return null;const p=r?h:{...h,scaleX:1,scaleY:1},y={...wq,width:c.width,height:c.height,top:c.top,left:c.left,transform:$l.Transform.toString(p),transformOrigin:r&&i?gY(i,c):void 0,transition:typeof m=="function"?m(i):m,...f};return be.createElement(n,{className:a,style:y,ref:e},o)}),Tq=t=>e=>{let{active:n,dragOverlay:i}=e;const r={},{styles:o,className:a}=t;if(o!=null&&o.active)for(const[c,f]of Object.entries(o.active))f!==void 0&&(r[c]=n.node.style.getPropertyValue(c),n.node.style.setProperty(c,f));if(o!=null&&o.dragOverlay)for(const[c,f]of Object.entries(o.dragOverlay))f!==void 0&&i.node.style.setProperty(c,f);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&i.node.classList.add(a.dragOverlay),function(){for(const[f,h]of Object.entries(r))n.node.style.setProperty(f,h);a!=null&&a.active&&n.node.classList.remove(a.active)}},Rq=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:$l.Transform.toString(e)},{transform:$l.Transform.toString(n)}]},Aq={duration:250,easing:"ease",keyframes:Rq,sideEffects:Tq({styles:{active:{opacity:"0"}}})};function Oq(t){let{config:e,draggableNodes:n,droppableContainers:i,measuringConfiguration:r}=t;return Wg((o,a)=>{if(e===null)return;const c=n.get(o);if(!c)return;const f=c.node.current;if(!f)return;const h=nB(a);if(!h)return;const{transform:m}=xi(a).getComputedStyle(a),p=KL(m);if(!p)return;const y=typeof e=="function"?e:Mq(e);return QL(f,r.draggable.measure),y({active:{id:o,data:c.data,node:f,rect:r.draggable.measure(f)},draggableNodes:n,dragOverlay:{node:a,rect:r.dragOverlay.measure(h)},droppableContainers:i,measuringConfiguration:r,transform:p})})}function Mq(t){const{duration:e,easing:n,sideEffects:i,keyframes:r}={...Aq,...t};return o=>{let{active:a,dragOverlay:c,transform:f,...h}=o;if(!e)return;const m={x:c.rect.left-a.rect.left,y:c.rect.top-a.rect.top},p={scaleX:f.scaleX!==1?a.rect.width*f.scaleX/c.rect.width:1,scaleY:f.scaleY!==1?a.rect.height*f.scaleY/c.rect.height:1},y={x:f.x-m.x,y:f.y-m.y,...p},b=r({...h,active:a,dragOverlay:c,transform:{initial:f,final:y}}),[x]=b,w=b[b.length-1];if(JSON.stringify(x)===JSON.stringify(w))return;const C=i?.({active:a,dragOverlay:c,...h}),E=c.node.animate(b,{duration:e,easing:n,fill:"forwards"});return new Promise(O=>{E.onfinish=()=>{C?.(),O()}})}}let YM=0;function Dq(t){return S.useMemo(()=>{if(t!=null)return YM++,YM},[t])}const eie=be.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:i,style:r,transition:o,modifiers:a,wrapperElement:c="div",className:f,zIndex:h=999}=t;const{activatorEvent:m,active:p,activeNodeRect:y,containerNodeRect:b,draggableNodes:x,droppableContainers:w,dragOverlay:C,over:E,measuringConfiguration:O,scrollableAncestors:T,scrollableAncestorRects:A,windowRect:D}=oB(),k=S.useContext(Qg),M=Dq(p?.id),I=sB(a,{activatorEvent:m,active:p,activeNodeRect:y,containerNodeRect:b,draggingNodeRect:C.rect,over:E,overlayNodeRect:C.rect,scrollableAncestors:T,scrollableAncestorRects:A,transform:k,windowRect:D}),L=o1(y),B=Oq({config:i,draggableNodes:x,droppableContainers:w,measuringConfiguration:O}),H=L?C.setRef:void 0;return be.createElement(xq,null,be.createElement(bq,{animation:B},p&&M?be.createElement(Eq,{key:M,id:p.id,ref:H,as:c,activatorEvent:m,adjustScale:e,className:f,transition:o,rect:L,style:{zIndex:h,...r},transform:I},n):null))});function lB(t,e,n){const i=t.slice();return i.splice(n<0?i.length+n:n,0,i.splice(e,1)[0]),i}function kq(t,e){return t.reduce((n,i,r)=>{const o=e.get(i);return o&&(n[r]=o),n},Array(t.length))}function Cp(t){return t!==null&&t>=0}function Pq(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Iq(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ep={scaleX:1,scaleY:1},tie=t=>{var e;let{rects:n,activeNodeRect:i,activeIndex:r,overIndex:o,index:a}=t;const c=(e=n[r])!=null?e:i;if(!c)return null;const f=Nq(n,a,r);if(a===r){const h=n[o];return h?{x:r<o?h.left+h.width-(c.left+c.width):h.left-c.left,y:0,...Ep}:null}return a>r&&a<=o?{x:-c.width-f,y:0,...Ep}:a<r&&a>=o?{x:c.width+f,y:0,...Ep}:{x:0,y:0,...Ep}};function Nq(t,e,n){const i=t[e],r=t[e-1],o=t[e+1];return!i||!r&&!o?0:n<e?r?i.left-(r.left+r.width):o.left-(i.left+i.width):o?o.left-(i.left+i.width):i.left-(r.left+r.width)}const aB=t=>{let{rects:e,activeIndex:n,overIndex:i,index:r}=t;const o=lB(e,i,n),a=e[r],c=o[r];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},Tp={scaleX:1,scaleY:1},nie=t=>{var e;let{activeIndex:n,activeNodeRect:i,index:r,rects:o,overIndex:a}=t;const c=(e=o[n])!=null?e:i;if(!c)return null;if(r===n){const h=o[a];return h?{x:0,y:n<a?h.top+h.height-(c.top+c.height):h.top-c.top,...Tp}:null}const f=Lq(o,r,n);return r>n&&r<=a?{x:0,y:-c.height-f,...Tp}:r<n&&r>=a?{x:0,y:c.height+f,...Tp}:{x:0,y:0,...Tp}};function Lq(t,e,n){const i=t[e],r=t[e-1],o=t[e+1];return i?n<e?r?i.top-(r.top+r.height):o?o.top-(i.top+i.height):0:o?o.top-(i.top+i.height):r?i.top-(r.top+r.height):0:0}const uB="Sortable",cB=be.createContext({activeIndex:-1,containerId:uB,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:aB,disabled:{draggable:!1,droppable:!1}});function iie(t){let{children:e,id:n,items:i,strategy:r=aB,disabled:o=!1}=t;const{active:a,dragOverlay:c,droppableRects:f,over:h,measureDroppableContainers:m}=oB(),p=yd(uB,n),y=c.rect!==null,b=S.useMemo(()=>i.map(k=>typeof k=="object"&&"id"in k?k.id:k),[i]),x=a!=null,w=a?b.indexOf(a.id):-1,C=h?b.indexOf(h.id):-1,E=S.useRef(b),O=!Pq(b,E.current),T=C!==-1&&w===-1||O,A=Iq(o);Ir(()=>{O&&x&&m(b)},[O,b,x,m]),S.useEffect(()=>{E.current=b},[b]);const D=S.useMemo(()=>({activeIndex:w,containerId:p,disabled:A,disableTransforms:T,items:b,overIndex:C,useDragOverlay:y,sortedRects:kq(b,f),strategy:r}),[w,p,A.draggable,A.droppable,T,b,C,f,y,r]);return be.createElement(cB.Provider,{value:D},e)}const Bq=t=>{let{id:e,items:n,activeIndex:i,overIndex:r}=t;return lB(n,i,r).indexOf(e)},Vq=t=>{let{containerId:e,isSorting:n,wasDragging:i,index:r,items:o,newIndex:a,previousItems:c,previousContainerId:f,transition:h}=t;return!h||!i||c!==o&&r===a?!1:n?!0:a!==r&&e===f},zq={duration:200,easing:"ease"},fB="transform",_q=$l.Transition.toString({property:fB,duration:0,easing:"linear"}),Hq={roleDescription:"sortable"};function Fq(t){let{disabled:e,index:n,node:i,rect:r}=t;const[o,a]=S.useState(null),c=S.useRef(n);return Ir(()=>{if(!e&&n!==c.current&&i.current){const f=r.current;if(f){const h=qu(i.current,{ignoreTransform:!0}),m={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(m.x||m.y)&&a(m)}}n!==c.current&&(c.current=n)},[e,n,i,r]),S.useEffect(()=>{o&&a(null)},[o]),o}function rie(t){let{animateLayoutChanges:e=Vq,attributes:n,disabled:i,data:r,getNewIndex:o=Bq,id:a,strategy:c,resizeObserverConfig:f,transition:h=zq}=t;const{items:m,containerId:p,activeIndex:y,disabled:b,disableTransforms:x,sortedRects:w,overIndex:C,useDragOverlay:E,strategy:O}=S.useContext(cB),T=Uq(i,b),A=m.indexOf(a),D=S.useMemo(()=>({sortable:{containerId:p,index:A,items:m},...r}),[p,r,A,m]),k=S.useMemo(()=>m.slice(m.indexOf(a)),[m,a]),{rect:M,node:I,isOver:L,setNodeRef:B}=vq({id:a,data:D,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...f}}),{active:H,activatorEvent:U,activeNodeRect:F,attributes:K,setNodeRef:z,listeners:V,isDragging:X,over:j,setActivatorNodeRef:Y,transform:$}=mq({id:a,data:D,attributes:{...Hq,...n},disabled:T.draggable}),te=tY(B,z),N=!!H,ne=N&&!x&&Cp(y)&&Cp(C),q=!E&&X,G=q&&ne?$:null,ae=ne?G??(c??O)({rects:w,activeNodeRect:F,activeIndex:y,overIndex:C,index:A}):null,Se=Cp(y)&&Cp(C)?o({id:a,items:m,activeIndex:y,overIndex:C}):A,le=H?.id,ge=S.useRef({activeId:le,items:m,newIndex:Se,containerId:p}),ce=m!==ge.current.items,ue=e({active:H,containerId:p,isDragging:X,isSorting:N,id:a,index:A,items:m,newIndex:ge.current.newIndex,previousItems:ge.current.items,previousContainerId:ge.current.containerId,transition:h,wasDragging:ge.current.activeId!=null}),Te=Fq({disabled:!ue,index:A,node:I,rect:M});return S.useEffect(()=>{N&&ge.current.newIndex!==Se&&(ge.current.newIndex=Se),p!==ge.current.containerId&&(ge.current.containerId=p),m!==ge.current.items&&(ge.current.items=m)},[N,Se,p,m]),S.useEffect(()=>{if(le===ge.current.activeId)return;if(le!=null&&ge.current.activeId==null){ge.current.activeId=le;return}const Pe=setTimeout(()=>{ge.current.activeId=le},50);return()=>clearTimeout(Pe)},[le]),{active:H,activeIndex:y,attributes:K,data:D,rect:M,index:A,newIndex:Se,items:m,isOver:L,isSorting:N,isDragging:X,listeners:V,node:I,overIndex:C,over:j,setNodeRef:te,setActivatorNodeRef:Y,setDroppableNodeRef:B,setDraggableNodeRef:z,transform:Te??ae,transition:ye()};function ye(){if(Te||ce&&ge.current.newIndex===A)return _q;if(!(q&&!Xg(U)||!h)&&(N||ue))return $l.Transition.toString({...h,property:fB})}}function Uq(t,e){var n,i;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(i=t?.droppable)!=null?i:e.droppable}}Nt.Down,Nt.Right,Nt.Up,Nt.Left;const dB=S.createContext(void 0);function bd(t){const e=S.useContext(dB);if(e===void 0&&!t)throw new Error(en(47));return e}const jq={...Fs,disabled:t=>t.disabled,instantType:t=>t.instantType==="trigger-change"&&!Fs.open(t)?void 0:t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,isPressOpenedByTrigger:(t,e)=>t.openChangeReason===gs&&Fs.isOpenedByTrigger(t,e),isTouchPressOpen:(t,e)=>e&&t.openMethod==="touch"&&t.openChangeReason===gs,hasTriggerFocusGuards:(t,e)=>Fs.isOpenedByTrigger(t,e)&&!t.focusManagerModal,modal:t=>t.modal,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class Kq extends ju{constructor(e,n,i){const r=new od;super(Yq(e,r,n,i),qq(r),jq)}setOpen=(e,n)=>{const i=n.reason===vn,r=n.reason===gs&&n.event.detail===0,o=!e&&(n.reason===ed||n.reason==null),a=vg(n),c=this.select("activeTriggerId");if(!e&&n.reason===yP&&n.trigger==null&&c!=null&&(n.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const f=()=>{const m=yg(this.state,e,n.trigger,a());m.openChangeReason=n.reason,this.update(m)};i?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(FP,()=>{this.context.stickIfOpen=!1}),Ln.flushSync(f)):f();let h;r?h="click":o?h="dismiss":n.reason===$s&&(h="focus"),this.set("instantType",h)}}function Yq(t,e,n,i=!1){const r={...Eg(e,n,i),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return r.open&&t?.mounted===void 0&&(r.mounted=!0),r}function qq(t){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeTriggerFocusGuardRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new Dr,stickIfOpen:!0,triggerElements:t}}const qM=ld(function({props:e}){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:a,modal:c=!1,handle:f,triggerId:h,defaultTriggerId:m=null}=e,p=Gq(f,{modal:c,open:r,openProp:i,activeTriggerId:m,triggerIdProp:h});p.useControlledProp("openProp",i),p.useControlledProp("triggerIdProp",h);const y=p.useState("open"),b=p.useState("mounted"),x=p.useState("payload");p.useContextCallback("onOpenChange",o),p.useContextCallback("onOpenChangeComplete",a),tI(p,y),Sg(p);const{forceUnmount:w}=xg(y,p,()=>{p.context.stickIfOpen=!0,p.set("openChangeReason",null)});p.useSyncedValues({modal:c}),S.useEffect(()=>{y||p.context.stickIfOpenTimeout.clear()},[p,y]),S.useImperativeHandle(e.actionsRef,()=>({unmount:w,close:()=>p.setOpen(!1,Ze(td))}),[w,p]);const C=y||b||f!=null;return fe.jsxs(dB.Provider,{value:p,children:[f&&fe.jsx(gg,{handle:f,store:p}),C&&fe.jsx(Wq,{store:p,modal:c}),typeof n=="function"?n({payload:x}):n]})});function sie(t){return bd(!0)?fe.jsx(qM,{props:t}):fe.jsx($P,{children:fe.jsx(qM,{props:t})})}function Gq(t,e){const n=Ew((i,r)=>new Kq(e,i,r));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Wq({store:t,modal:e}){const n=t.useState("floatingRootContext"),i=rd(n,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,o=i.floating;return wg(t,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:o}),null}const Xq=300,oie=Cg(function(e,n){const{render:i,className:r,style:o,disabled:a=!1,nativeButton:c=!0,handle:f,payload:h,openOnHover:m=!1,delay:p=Xq,closeDelay:y=0,id:b,...x}=e,w=bd(!0),E=Tg(f)??w;if(!E)throw new Error(en(74));const O=vi(b),T=E.useState("isTriggerActive",O),A=E.useState("floatingRootContext"),D=E.useState("isOpenedByTrigger",O),k=E.useState("triggerPopupId",O),M=S.useRef(null),{registerTrigger:I,isMountedByThisTrigger:L}=bg(O,M,E,{payload:h,disabled:a,openOnHover:m,closeDelay:y}),B=E.useState("isPressOpenedByTrigger",O),H=E.useState("isTouchPressOpen",m),U=E.useState("hasTriggerFocusGuards",O),F=Rg(A,{enabled:!a&&m&&!H,mouseOnly:!0,move:!1,handleClose:Og(),restMs:p,delay:{close:y},triggerElementRef:M,isActiveTrigger:T,isClosing:()=>E.select("transitionStatus")==="ending"}),K=He(()=>E.context.stickIfOpen),z=id(A,{stickIfOpen:K}),V=kw(()=>E.select("open"),Z=>{E.set("openMethod",Z)}),X=E.useState("triggerProps",L),{getButtonProps:j,buttonRef:Y}=Xo({disabled:a,native:c}),$={open(Z){return B?Rf.open(Z):Qf.open(Z)}},{handlePreFocusGuardFocus:te,handleFocusTargetFocus:N}=FI(E,M),q=Ot("button",e,{state:{disabled:a,open:D},ref:[Y,n,I,M],props:[z.reference,F,X,V,{[vw]:"",id:O,"aria-haspopup":"dialog","aria-expanded":D,"aria-controls":k},x,j],stateAttributesMapping:$}),G=fe.jsx(S.Fragment,{children:q},O);return U?fe.jsxs(S.Fragment,{children:[fe.jsx(Vo,{ref:E.context.beforeTriggerFocusGuardRef,onFocus:te}),G,fe.jsx(Vo,{ref:E.context.triggerFocusTargetRef,onFocus:N})]}):G}),hB=S.createContext(void 0);function $q(){const t=S.useContext(hB);if(t===void 0)throw new Error(en(45));return t}const lie=S.forwardRef(function(e,n){const{keepMounted:i=!1,...r}=e;return bd().useState("mounted")||i?fe.jsx(hB.Provider,{value:i,children:fe.jsx(hg,{ref:n,...r})}):null}),pB=S.createContext(void 0);function Qq(){const t=S.useContext(pB);if(!t)throw new Error(en(46));return t}const aie=S.forwardRef(function(e,n){const{render:i,className:r,style:o,anchor:a,positionMethod:c,side:f,align:h,sideOffset:m,alignOffset:p,collisionBoundary:y="clipping-ancestors",collisionPadding:b,arrowPadding:x,sticky:w,disableAnchorTracking:C=!1,collisionAvoidance:E=bw,...O}=e,T=bd(),A=$q(),D=xw(),k=T.useState("floatingRootContext"),M=T.useState("mounted"),I=T.useState("open"),L=T.useState("openChangeReason"),B=T.useState("activeTriggerElement"),H=T.useState("modal"),U=T.useState("openMethod"),F=T.useState("positionerElement"),K=T.useState("instantType"),z=T.useState("transitionStatus"),V=T.useState("adaptiveOrigin"),X=Bg({anchor:a,floatingRootContext:k,positionMethod:c,mounted:M,side:f,sideOffset:m,align:h,alignOffset:p,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:w,disableAnchorTracking:C,keepMounted:A,nodeId:D,collisionAvoidance:E,adaptiveOrigin:V}),j=k.useState("domReferenceElement");NI({store:T,domReference:j,positionerElement:F,open:I});const Y=H===!0&&L!==vn;Vw(I&&Y,U==="touch",F,B);const $=T.useStateSetter("positionerElement"),te={open:I,side:X.side,align:X.align,anchorHidden:X.anchorHidden,instant:K},N=Vg(e,te,{styles:X.positionerStyles,transitionStatus:z,props:O,refs:[n,$],hidden:!M,inert:!I});return fe.jsxs(pB.Provider,{value:X,children:[M&&Y&&fe.jsx(Pg,{inert:kg(!I),cutout:B}),fe.jsx(XP,{id:D,children:N})]})}),Zq=S.createContext(void 0);function Jq(){const[t,e]=S.useState(0),n=He(()=>(e(r=>r+1),()=>{e(r=>Math.max(0,r-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:t>0}}const uie=S.forwardRef(function(e,n){const{render:i,className:r,style:o,initialFocus:a,finalFocus:c,...f}=e,h=bd(),m=Qq(),p=Lw()!=null,{context:y,hasClosePart:b}=Jq(),x=h.useState("open"),w=h.useState("openMethod"),C=h.useState("instantType"),E=h.useState("transitionStatus"),O=h.useState("popupProps"),T=h.useState("titleElementId"),A=h.useState("descriptionElementId"),D=h.useState("modal"),k=h.useState("mounted"),M=h.useState("openChangeReason"),I=h.useState("activeTriggerElement"),L=h.useState("floatingRootContext"),B=L.useState("floatingId"),H=h.useState("disabled"),U=h.useState("openOnHover"),F=h.useState("closeDelay");eo({open:x,ref:h.context.popupRef,onComplete(){x&&h.context.onOpenChangeComplete?.(!0)}}),Ow(L,{enabled:U&&!H,closeDelay:F});const K=a===void 0?JP(h.context.popupRef):a,z=D!==!1&&b;h.useSyncedValue("focusManagerModal",z);const V=h.useStateSetter("popupElement"),X={open:x,side:m.side,align:m.align,instant:C,transitionStatus:E},j=Ot("div",e,{state:X,ref:[n,h.context.popupRef,V],props:[O,{id:B,role:"dialog",...sd,"aria-labelledby":T,"aria-describedby":A,onKeyDown(Y){p&&Dg.has(Y.key)&&Y.stopPropagation()}},ud(E),f],stateAttributesMapping:tg});return fe.jsx(pg,{context:L,openInteractionType:w,modal:z,disabled:!k||M===vn,initialFocus:K,returnFocus:c,restoreFocus:"popup",getInsideElements:()=>[h.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:Xt(I)?I:void 0,nextFocusableElement:h.context.triggerFocusTargetRef,beforeContentFocusGuardRef:h.context.beforeContentFocusGuardRef,children:fe.jsx(Zq.Provider,{value:y,children:j})})});var GM=1,eG=.9,tG=.8,nG=.17,Tb=.1,Rb=.999,iG=.9999,rG=.99,sG=/[\\\/_+.#"@\[\(\{&]/,oG=/[\\\/_+.#"@\[\(\{&]/g,lG=/[\s-]/,mB=/[\s-]/g;function sx(t,e,n,i,r,o,a){if(o===e.length)return r===t.length?GM:rG;var c=`${r},${o}`;if(a[c]!==void 0)return a[c];for(var f=i.charAt(o),h=n.indexOf(f,r),m=0,p,y,b,x;h>=0;)p=sx(t,e,n,i,h+1,o+1,a),p>m&&(h===r?p*=GM:sG.test(t.charAt(h-1))?(p*=tG,b=t.slice(r,h-1).match(oG),b&&r>0&&(p*=Math.pow(Rb,b.length))):lG.test(t.charAt(h-1))?(p*=eG,x=t.slice(r,h-1).match(mB),x&&r>0&&(p*=Math.pow(Rb,x.length))):(p*=nG,r>0&&(p*=Math.pow(Rb,h-r))),t.charAt(h)!==e.charAt(o)&&(p*=iG)),(p<Tb&&n.charAt(h-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&n.charAt(h-1)!==i.charAt(o))&&(y=sx(t,e,n,i,h+1,o+2,a),y*Tb>p&&(p=y*Tb)),p>m&&(m=p),h=n.indexOf(f,h+1);return a[c]=m,m}function WM(t){return t.toLowerCase().replace(mB," ")}function aG(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,sx(t,e,WM(t),WM(e),0,0,{})}var uG=Object.defineProperty,Gu=(t,e)=>uG(t,"name",{value:e,configurable:!0}),gB=!!(typeof window<"u"&&window.document&&window.document.createElement);function Bl(t,e,{checkForDefaultPrevented:n=!0}={}){return Gu(function(r){if(t?.(r),n===!1||!r||!r.defaultPrevented)return e?.(r)},"handleEvent")}Gu(Bl,"composeEventHandlers");function cG(t){if(!gB)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}Gu(cG,"getOwnerWindow");function ox(t){if(!gB)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}Gu(ox,"getOwnerDocument");function yB(t,e=!1){const{activeElement:n}=ox(t);if(!n?.nodeName)return null;if(vB(n)&&n.contentDocument)return yB(n.contentDocument.body,e);if(e){const i=n.getAttribute("aria-activedescendant");if(i){const r=ox(n).getElementById(i);if(r)return r}}return n}Gu(yB,"getActiveElement");function vB(t){return t.tagName==="IFRAME"}Gu(vB,"isFrame");var fG=Object.defineProperty,l1=(t,e)=>fG(t,"name",{value:e,configurable:!0});function lx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}l1(lx,"setRef");function Ql(...t){return e=>{let n=!1;const i=t.map(r=>{const o=lx(r,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<i.length;r++){const o=i[r];typeof o=="function"?o():lx(t[r],null)}}}}l1(Ql,"composeRefs");function Wu(...t){return S.useCallback(Ql(...t),t)}l1(Wu,"useComposedRefs");var dG=Object.defineProperty,sr=(t,e)=>dG(t,"name",{value:e,configurable:!0});function hG(t,e){const n=S.createContext(e);n.displayName=t+"Context";const i=sr(o=>{const{children:a,...c}=o,f=S.useMemo(()=>c,Object.values(c));return fe.jsx(n.Provider,{value:f,children:a})},"Provider");i.displayName=t+"Provider";function r(o,a={}){const{optional:c=!1}=a,f=S.useContext(n);if(f)return f;if(e!==void 0)return e;if(!c)throw new Error(`\`${o}\` must be used within \`${t}\``)}return sr(r,"useContext"),[i,r]}sr(hG,"createContext");function bB(t,e=[]){let n=[];function i(o,a){const c=S.createContext(a);c.displayName=o+"Context";const f=n.length;n=[...n,a];const h=sr(p=>{const{scope:y,children:b,...x}=p,w=y?.[t]?.[f]||c,C=S.useMemo(()=>x,Object.values(x));return fe.jsx(w.Provider,{value:C,children:b})},"Provider");h.displayName=o+"Provider";function m(p,y,b={}){const{optional:x=!1}=b,w=y?.[t]?.[f]||c,C=S.useContext(w);if(C)return C;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${o}\``)}return sr(m,"useContext"),[h,m]}sr(i,"createContext");const r=sr(()=>{const o=n.map(a=>S.createContext(a));return sr(function(c){const f=c?.[t]||o;return S.useMemo(()=>({[`__scope${t}`]:{...c,[t]:f}}),[c,f])},"useScope")},"createScope");return r.scopeName=t,[i,SB(r,...e)]}sr(bB,"createContextScope");function SB(...t){const e=t[0];if(t.length===1)return e;const n=sr(()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return sr(function(o){const a=i.reduce((c,{useScope:f,scopeName:h})=>{const p=f(o)[`__scope${h}`];return{...c,...p}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}sr(SB,"composeContextScopes");var Zl=globalThis?.document?S.useLayoutEffect:()=>{},pG=Object.defineProperty,mG=(t,e)=>pG(t,"name",{value:e,configurable:!0}),gG=ta[" useId ".trim().toString()]||(()=>{}),yG=0;function ps(t){const[e,n]=S.useState(gG());return Zl(()=>{t||n(i=>i??String(yG++))},[t]),t||(e?`radix-${e}`:"")}mG(ps,"useId");var vG=Object.defineProperty,bG=(t,e)=>vG(t,"name",{value:e,configurable:!0}),XM=ta[" useEffectEvent ".trim().toString()],$M=ta[" useInsertionEffect ".trim().toString()];function xB(t){if(typeof XM=="function")return XM(t);const e=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof $M=="function"?$M(()=>{e.current=t}):Zl(()=>{e.current=t}),S.useMemo(()=>((...n)=>e.current?.(...n)),[])}bG(xB,"useEffectEvent");var SG=Object.defineProperty,Sd=(t,e)=>SG(t,"name",{value:e,configurable:!0}),xG=ta[" useInsertionEffect ".trim().toString()]||Zl;function wB({prop:t,defaultProp:e,onChange:n=Sd(()=>{},"onChange"),caller:i}){const[r,o,a]=CB({defaultProp:e,onChange:n}),c=t!==void 0,f=c?t:r,h=S.useCallback(m=>{if(c){const p=EB(m)?m(t):m;p!==t&&a.current?.(p)}else o(m)},[c,t,o,a]);return[f,h]}Sd(wB,"useControllableState");function CB({defaultProp:t,onChange:e}){const[n,i]=S.useState(t),r=S.useRef(n),o=S.useRef(e);return xG(()=>{o.current=e},[e]),S.useEffect(()=>{r.current!==n&&(o.current?.(n),r.current=n)},[n,r]),[n,i,o]}Sd(CB,"useUncontrolledState");function EB(t){return typeof t=="function"}Sd(EB,"isFunction");var QM=Symbol("RADIX:SYNC_STATE");function wG(t,e,n,i){const{prop:r,defaultProp:o,onChange:a,caller:c}=e,f=r!==void 0,h=xB(a),m=[{...n,state:o}];i&&m.push(i);const[p,y]=S.useReducer((C,E)=>{if(E.type===QM)return{...C,state:E.state};const O=t(C,E);return f&&!Object.is(O.state,C.state)&&h(O.state),O},...m),b=p.state,x=S.useRef(b);S.useEffect(()=>{x.current!==b&&(x.current=b,f||h(b))},[b,x,f]);const w=S.useMemo(()=>r!==void 0?{...p,state:r}:p,[p,r]);return S.useEffect(()=>{f&&!Object.is(r,p.state)&&y({type:QM,state:r})},[r,p.state,f]),[w,y]}Sd(wG,"useControllableStateReducer");var CG=Object.defineProperty,Gi=(t,e)=>CG(t,"name",{value:e,configurable:!0});function a1(t){const e=S.forwardRef((n,i)=>{let{children:r,...o}=n,a=null,c=!1;const f=[];r=DB(r),S.Children.forEach(r,y=>{if(OB(y)){c=!0;const b=y;let x="child"in b.props?b.props.child:b.props.children;for(;u1(x)&&typeof _m=="function";)x=_m(x._payload);a=TG(b,x),f.push(a?.props?.children)}else f.push(y)}),a?a=S.cloneElement(a,void 0,f):!c&&S.Children.count(r)===1&&S.isValidElement(r)&&(a=r);const h=a?AB(a):void 0,m=Wu(i,h);if(!a){if(r||r===0)throw new Error(c?OG(t):AG(t));return r}const p=RB(o,a.props??{});return a.type!==S.Fragment&&(p.ref=i?m:h),S.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Gi(a1,"createSlot");var TB=Symbol.for("radix.slottable");function EG(t){const e=Gi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=TB,e}Gi(EG,"createSlottable");var TG=Gi((t,e)=>"child"in t.props?S.isValidElement(e)?S.cloneElement(e,void 0,t.props.children(e.props.children)):null:S.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function RB(t,e){const n={...e};for(const i in e){const r=t[i],o=e[i];/^on[A-Z]/.test(i)?r&&o?n[i]=(...c)=>{const f=o(...c);return r(...c),f}:r&&(n[i]=r):i==="style"?n[i]={...r,...o}:i==="className"?n[i]=[r,o].filter(Boolean).join(" "):i==="aria-describedby"&&(n[i]=kB(o,r))}return{...t,...n}}Gi(RB,"mergeProps");function AB(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Gi(AB,"getElementRef");function OB(t){return S.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===TB}Gi(OB,"isSlottable");var RG=Symbol.for("react.lazy");function u1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===RG&&"_payload"in t&&MB(t._payload)}Gi(u1,"isLazyComponent");function MB(t){return typeof t=="object"&&t!==null&&"then"in t}Gi(MB,"isPromiseLike");function DB(t){let e=t;for(;u1(e)&&typeof _m=="function";)e=_m(e._payload);return e}Gi(DB,"useUnwrappedLazy");function kB(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const i of String(n).trim().split(/\s+/))i&&e.add(i);return e.size>0?Array.from(e).join(" "):void 0}Gi(kB,"concatAriaDescribedby");var AG=Gi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),OG=Gi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),_m=ta[" use ".trim().toString()],MG=Object.defineProperty,DG=(t,e)=>MG(t,"name",{value:e,configurable:!0}),kG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pr=kG.reduce((t,e)=>{const n=a1(`Primitive.${e}`),i=S.forwardRef((r,o)=>{const{asChild:a,...c}=r,f=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),fe.jsx(f,{...c,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function PB(t,e){t&&Ln.flushSync(()=>t.dispatchEvent(e))}DG(PB,"dispatchDiscreteCustomEvent");var PG=Object.defineProperty,IG=(t,e)=>PG(t,"name",{value:e,configurable:!0}),ZM=ta[" useInsertionEffect ".trim().toString()];function Nu(t){const e=S.useRef(t);return typeof ZM=="function"?ZM(()=>{e.current=t}):Zl(()=>{e.current=t}),S.useMemo(()=>((...n)=>e.current?.(...n)),[])}IG(Nu,"useCallbackRef");var NG=Object.defineProperty,Kn=(t,e)=>NG(t,"name",{value:e,configurable:!0}),ax="dismissableLayer.update",LG="dismissableLayer.pointerDownOutside",BG="dismissableLayer.focusOutside",JM,IB=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),VG=S.forwardRef(Kn(function(e,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,onDismiss:h,...m}=e,p=S.useContext(IB),[y,b]=S.useState(null),x=y?.ownerDocument??globalThis?.document,[,w]=S.useState({}),C=Wu(n,b),E=Array.from(p.layers),[O]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=O?E.indexOf(O):-1,A=y?E.indexOf(y):-1,D=p.layersWithOutsidePointerEventsDisabled.size>0,k=A>=T,M=S.useRef(!1),I=LB(U=>{a?.(U),f?.(U),U.defaultPrevented||h?.()},{ownerDocument:x,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(U=>{if(!(U instanceof Node))return!1;const F=[...p.branches].some(K=>K.contains(U));return k&&!F},[p.branches,k])}),L=BB(U=>{if(r&&M.current)return;const F=U.target;[...p.branches].some(z=>z.contains(F))||(c?.(U),f?.(U),U.defaultPrevented||h?.())},x),B=y?A===E.length-1:!1,H=Nu(U=>{U.key==="Escape"&&(o?.(U),!U.defaultPrevented&&h&&(U.preventDefault(),h()))});return S.useEffect(()=>{if(B)return x.addEventListener("keydown",H,{capture:!0}),()=>x.removeEventListener("keydown",H,{capture:!0})},[x,B,H]),S.useEffect(()=>{if(y)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(JM=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),ux(),()=>{i&&(p.layersWithOutsidePointerEventsDisabled.delete(y),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=JM))}},[y,x,i,p]),S.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),ux())},[y,p]),S.useEffect(()=>{const U=Kn(()=>w({}),"handleUpdate");return document.addEventListener(ax,U),()=>document.removeEventListener(ax,U)},[]),fe.jsx(pr.div,{...m,ref:C,style:{pointerEvents:D?k?"auto":"none":void 0,...e.style},onFocusCapture:Bl(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Bl(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Bl(e.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function NB(){const t=S.useContext(IB),[e,n]=S.useState(null);return S.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Kn(NB,"useDismissableLayerSurface");var zG=Kn(()=>!0,"IS_TRUE");function LB(t,e){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:o,shouldHandlePointerDownOutside:a=zG}=e,c=Nu(t),f=S.useRef(!1),h=S.useRef(!1),m=S.useRef(new Map),p=S.useRef(()=>{});return S.useEffect(()=>{function y(){h.current=!1,r.current=!1,m.current.clear()}Kn(y,"resetOutsideInteraction");function b(){return Array.from(m.current.values()).some(Boolean)}Kn(b,"isOutsideInteractionIntercepted");function x(T){if(!h.current)return;const A=T.target;A instanceof Node&&[...o].some(k=>k.contains(A))||m.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{h.current&&p.current()},0)}Kn(x,"handleInteractionCapture");function w(T){h.current&&m.current.set(T.type,!1)}Kn(w,"handleInteractionBubble");const C=Kn(T=>{if(T.target&&!f.current){let A=function(){n.removeEventListener("click",p.current);const k=b();y(),k||c1(LG,c,D,{discrete:!0})};if(Kn(A,"handleAndDispatchPointerDownOutsideEvent"),!a(T.target)){n.removeEventListener("click",p.current),y(),f.current=!1;return}const D={originalEvent:T};h.current=!0,r.current=i&&T.button===0,m.current.clear(),!i||T.button!==0?A():(n.removeEventListener("click",p.current),p.current=A,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),y();f.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)n.addEventListener(T,x,!0),n.addEventListener(T,w);const O=window.setTimeout(()=>{n.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(O),n.removeEventListener("pointerdown",C),n.removeEventListener("click",p.current);for(const T of E)n.removeEventListener(T,x,!0),n.removeEventListener(T,w)}},[n,c,i,r,o,a]),{onPointerDownCapture:Kn(()=>f.current=!0,"onPointerDownCapture")}}Kn(LB,"usePointerDownOutside");function BB(t,e=globalThis?.document){const n=Nu(t),i=S.useRef(!1);return S.useEffect(()=>{const r=Kn(o=>{o.target&&!i.current&&c1(BG,n,{originalEvent:o},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:Kn(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Kn(()=>i.current=!1,"onBlurCapture")}}Kn(BB,"useFocusOutside");function ux(){const t=new CustomEvent(ax);document.dispatchEvent(t)}Kn(ux,"dispatchUpdate");function c1(t,e,n,{discrete:i}){const r=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?PB(r,o):r.dispatchEvent(o)}Kn(c1,"handleAndDispatchCustomEvent");var _G=Object.defineProperty,Dn=(t,e)=>_G(t,"name",{value:e,configurable:!0}),Ab="focusScope.autoFocusOnMount",Ob="focusScope.autoFocusOnUnmount",eD={bubbles:!1,cancelable:!0},HG=S.forwardRef(Dn(function(e,n){const{loop:i=!1,trapped:r=!1,branches:o,onMountAutoFocus:a,onUnmountAutoFocus:c,...f}=e,[h,m]=S.useState(null),p=Nu(a),y=Nu(c),b=S.useRef(null),x=Wu(n,m),w=S.useRef(o);S.useEffect(()=>{w.current=o});const C=S.useCallback(T=>T?h?.contains(T)?!0:!!w.current?.some(A=>A.contains(T)):!1,[h]),E=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let T=function(M){if(E.paused||!h)return;const I=M.target;C(I)?b.current=I:_s(b.current,{select:!0})},A=function(M){if(E.paused||!h)return;const I=M.relatedTarget;I!==null&&(C(I)||_s(b.current,{select:!0}))},D=function(M){if(document.activeElement===document.body)for(const L of M)L.removedNodes.length>0&&_s(h)};Dn(T,"handleFocusIn"),Dn(A,"handleFocusOut"),Dn(D,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",A);const k=new MutationObserver(D);return h&&k.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",A),k.disconnect()}}},[r,h,E.paused,C]),S.useEffect(()=>{if(h){tD.add(E);const T=document.activeElement;if(!h.contains(T)){const D=new CustomEvent(Ab,eD);h.addEventListener(Ab,p),h.dispatchEvent(D),D.defaultPrevented||(HB(YB(f1(h)),{select:!0}),document.activeElement===T&&_s(h))}return()=>{h.removeEventListener(Ab,p);const D=h.ownerDocument,k=CustomEvent;setTimeout(()=>{const M=new k(Ob,eD);h.addEventListener(Ob,y),h.dispatchEvent(M),M.defaultPrevented||_s(T??D.body,{select:!0}),h.removeEventListener(Ob,y),tD.remove(E)},0)}}},[h,p,y,E]);const O=S.useCallback(T=>{if(!i&&!r||E.paused)return;const A=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,D=document.activeElement;if(A&&D){const k=T.currentTarget,[M,I]=FB(k);M&&I?!T.shiftKey&&D===I?(T.preventDefault(),i&&_s(M,{select:!0})):T.shiftKey&&D===M&&(T.preventDefault(),i&&_s(I,{select:!0})):D===k&&T.preventDefault()}},[i,r,E.paused]);return fe.jsx(pr.div,{tabIndex:-1,...f,ref:x,onKeyDown:O})},"FocusScope")),VB=S.createContext(null);function zB({registry:t,children:e}){return t?fe.jsx(VB.Provider,{value:t,children:e}):e}Dn(zB,"FocusScopeBranchProvider");function _B(){const[t,e]=S.useState([]),n=S.useMemo(()=>({add:Dn(i=>e(r=>r.includes(i)?r:[...r,i]),"add"),remove:Dn(i=>e(r=>r.filter(o=>o!==i)),"remove")}),[]);return{nodes:t,registry:n}}Dn(_B,"useFocusScopeBranchRegistry");function FG(t){const e=S.useContext(VB);S.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}Dn(FG,"useFocusScopeBranch");function HB(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(_s(i,{select:e}),document.activeElement!==n)return}Dn(HB,"focusFirst");function FB(t){const e=f1(t),n=cx(e,t),i=cx(e.reverse(),t);return[n,i]}Dn(FB,"getTabbableEdges");function f1(t){const e=[],i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Dn(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;i.nextNode();)e.push(i.currentNode);return e}Dn(f1,"getTabbableCandidates");function cx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const i of t)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):UB(i,{upTo:e})))return i}Dn(cx,"findVisible");function UB(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Dn(UB,"isHidden");function jB(t){return t.tagName==="INPUT"&&typeof t.select=="function"}Dn(jB,"isSelectableInput");function _s(t,{select:e=!1}={}){if(t&&t.focus){const i=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==i&&jB(t)&&e&&t.select()}}Dn(_s,"focus");var tD=KB();function KB(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=fx(t,e),t.unshift(e)},remove(e){t=fx(t,e),t[0]?.resume()}}}Dn(KB,"createFocusScopesStack");function fx(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}Dn(fx,"arrayRemove");function YB(t){return t.filter(e=>e.tagName!=="A")}Dn(YB,"removeLinks");var UG=Object.defineProperty,jG=(t,e)=>UG(t,"name",{value:e,configurable:!0}),KG=S.forwardRef(jG(function(e,n){const{container:i,...r}=e,[o,a]=S.useState(!1);Zl(()=>a(!0),[]);const c=i||o&&globalThis?.document?.body;return c?Ln.createPortal(fe.jsx(pr.div,{...r,ref:n}),c):null},"Portal")),YG=Object.defineProperty,Zs=(t,e)=>YG(t,"name",{value:e,configurable:!0});function qB(t,e){return S.useReducer((n,i)=>e[n][i]??n,t)}Zs(qB,"useStateMachine");var d1=Zs(t=>{const{present:e,children:n}=t,i=GB(e),r=typeof n=="function"?n({present:i.isPresent}):S.Children.only(n),o=WB(i.ref,XB(r));return typeof n=="function"||i.isPresent?S.cloneElement(r,{ref:o}):null},"Presence");function GB(t){const[e,n]=S.useState(),i=S.useRef(null),r=S.useRef(t),o=S.useRef("none"),a=S.useRef(void 0),c=t?"mounted":"unmounted",[f,h]=qB(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{f==="mounted"?(o.current=a.current??iu(i.current),a.current=void 0):o.current="none"},[f]),Zl(()=>{const m=i.current,p=r.current;if(p!==t){const b=o.current,x=iu(m);t?(a.current=x,h("MOUNT")):x==="none"||m?.display==="none"?h("UNMOUNT"):h(p&&b!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,h]),Zl(()=>{if(e){let m;const p=e.ownerDocument.defaultView??window,y=Zs(x=>{const C=iu(i.current).includes(CSS.escape(x.animationName));if(x.target===e&&C&&(h("ANIMATION_END"),!r.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",m=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),b=Zs(x=>{x.target===e&&(o.current=iu(i.current))},"handleAnimationStart");return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",y),e.addEventListener("animationend",y),()=>{p.clearTimeout(m),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",y),e.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[e,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(m=>{if(m){const p=getComputedStyle(m);i.current=p,a.current=iu(p)}else i.current=null;n(m)},[])}}Zs(GB,"usePresence");function dx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Zs(dx,"setRef");function WB(...t){const e=S.useRef(t);return e.current=t,S.useCallback(n=>{const i=e.current;let r=!1;const o=i.map(a=>{const c=dx(a,n);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let a=0;a<o.length;a++){const c=o[a];typeof c=="function"?c():dx(i[a],null)}}},[])}Zs(WB,"useStableComposedRefs");function iu(t){return t?.animationName||"none"}Zs(iu,"getAnimationName");function XB(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Zs(XB,"getElementRef");var qG=Object.defineProperty,h1=(t,e)=>qG(t,"name",{value:e,configurable:!0}),Rp=0,Xa=null;function GG(t){return p1(),t.children}h1(GG,"FocusGuards");function p1(){S.useEffect(()=>{Xa||(Xa={start:hx(),end:hx()});const{start:t,end:e}=Xa;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Rp++,()=>{Rp===1&&(Xa?.start.remove(),Xa?.end.remove(),Xa=null),Rp=Math.max(0,Rp-1)}},[])}h1(p1,"useFocusGuards");function hx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}h1(hx,"createFocusGuard");var os=function(){return os=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},os.apply(this,arguments)};function $B(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function WG(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}var Qp="right-scroll-bar-position",Zp="width-before-scroll-bar",XG="with-scroll-bars-hidden",$G="--removed-body-scroll-bar-size";function Mb(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function QG(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var ZG=typeof window<"u"?S.useLayoutEffect:S.useEffect,nD=new WeakMap;function JG(t,e){var n=QG(null,function(i){return t.forEach(function(r){return Mb(r,i)})});return ZG(function(){var i=nD.get(n);if(i){var r=new Set(i),o=new Set(t),a=n.current;r.forEach(function(c){o.has(c)||Mb(c,null)}),o.forEach(function(c){r.has(c)||Mb(c,a)})}nD.set(n,t)},[t]),n}function eW(t){return t}function tW(t,e){e===void 0&&(e=eW);var n=[],i=!1,r={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var a=e(o,i);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(o){for(i=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){i=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(o),a=n}var f=function(){var m=a;a=[],m.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){a.push(m),h()},filter:function(m){return a=a.filter(m),n}}}};return r}function nW(t){t===void 0&&(t={});var e=tW(null);return e.options=os({async:!0,ssr:!1},t),e}var QB=function(t){var e=t.sideCar,n=$B(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return S.createElement(i,os({},n))};QB.isSideCarExport=!0;function iW(t,e){return t.useMedium(e),QB}var ZB=nW(),Db=function(){},Zg=S.forwardRef(function(t,e){var n=S.useRef(null),i=S.useState({onScrollCapture:Db,onWheelCapture:Db,onTouchMoveCapture:Db}),r=i[0],o=i[1],a=t.forwardProps,c=t.children,f=t.className,h=t.removeScrollBar,m=t.enabled,p=t.shards,y=t.sideCar,b=t.noRelative,x=t.noIsolation,w=t.inert,C=t.allowPinchZoom,E=t.as,O=E===void 0?"div":E,T=t.gapMode,A=$B(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=y,k=JG([n,e]),M=os(os({},A),r);return S.createElement(S.Fragment,null,m&&S.createElement(D,{sideCar:ZB,removeScrollBar:h,shards:p,noRelative:b,noIsolation:x,inert:w,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:T}),a?S.cloneElement(S.Children.only(c),os(os({},M),{ref:k})):S.createElement(O,os({},M,{className:f,ref:k}),c))});Zg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zg.classNames={fullWidth:Zp,zeroRight:Qp};var rW=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sW(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=rW();return e&&t.setAttribute("nonce",e),t}function oW(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function lW(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var aW=function(){var t=0,e=null;return{add:function(n){t==0&&(e=sW())&&(oW(e,n),lW(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},uW=function(){var t=aW();return function(e,n){S.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},JB=function(){var t=uW(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},cW={left:0,top:0,right:0,gap:0},kb=function(t){return parseInt(t||"",10)||0},fW=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[kb(n),kb(i),kb(r)]},dW=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return cW;var e=fW(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},hW=JB(),Cu="data-scroll-locked",pW=function(t,e,n,i){var r=t.left,o=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
24
+ .`.concat(XG,` {
25
+ overflow: hidden `).concat(i,`;
26
+ padding-right: `).concat(c,"px ").concat(i,`;
27
+ }
28
+ body[`).concat(Cu,`] {
29
+ overflow: hidden `).concat(i,`;
30
+ overscroll-behavior: contain;
31
+ `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
32
+ padding-left: `.concat(r,`px;
33
+ padding-top: `).concat(o,`px;
34
+ padding-right: `).concat(a,`px;
35
+ margin-left:0;
36
+ margin-top:0;
37
+ margin-right: `).concat(c,"px ").concat(i,`;
38
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
39
+ }
40
+
41
+ .`).concat(Qp,` {
42
+ right: `).concat(c,"px ").concat(i,`;
43
+ }
44
+
45
+ .`).concat(Zp,` {
46
+ margin-right: `).concat(c,"px ").concat(i,`;
47
+ }
48
+
49
+ .`).concat(Qp," .").concat(Qp,` {
50
+ right: 0 `).concat(i,`;
51
+ }
52
+
53
+ .`).concat(Zp," .").concat(Zp,` {
54
+ margin-right: 0 `).concat(i,`;
55
+ }
56
+
57
+ body[`).concat(Cu,`] {
58
+ `).concat($G,": ").concat(c,`px;
59
+ }
60
+ `)},iD=function(){var t=parseInt(document.body.getAttribute(Cu)||"0",10);return isFinite(t)?t:0},mW=function(){S.useEffect(function(){return document.body.setAttribute(Cu,(iD()+1).toString()),function(){var t=iD()-1;t<=0?document.body.removeAttribute(Cu):document.body.setAttribute(Cu,t.toString())}},[])},gW=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;mW();var o=S.useMemo(function(){return dW(r)},[r]);return S.createElement(hW,{styles:pW(o,!e,r,n?"":"!important")})},px=!1;if(typeof window<"u")try{var Ap=Object.defineProperty({},"passive",{get:function(){return px=!0,!0}});window.addEventListener("test",Ap,Ap),window.removeEventListener("test",Ap,Ap)}catch{px=!1}var $a=px?{passive:!1}:!1,yW=function(t){return t.tagName==="TEXTAREA"},eV=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!yW(t)&&n[e]==="visible")},vW=function(t){return eV(t,"overflowY")},bW=function(t){return eV(t,"overflowX")},rD=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=tV(t,i);if(r){var o=nV(t,i),a=o[1],c=o[2];if(a>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},SW=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},xW=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},tV=function(t,e){return t==="v"?vW(e):bW(e)},nV=function(t,e){return t==="v"?SW(e):xW(e)},wW=function(t,e){return t==="h"&&e==="rtl"?-1:1},CW=function(t,e,n,i,r){var o=wW(t,window.getComputedStyle(e).direction),a=o*i,c=n.target,f=e.contains(c),h=!1,m=a>0,p=0,y=0;do{if(!c)break;var b=nV(t,c),x=b[0],w=b[1],C=b[2],E=w-C-o*x;(x||E)&&tV(t,c)&&(p+=E,y+=x);var O=c.parentNode;c=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&c!==document.body||f&&(e.contains(c)||e===c));return(m&&Math.abs(p)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Op=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},sD=function(t){return[t.deltaX,t.deltaY]},oD=function(t){return t&&"current"in t?t.current:t},EW=function(t,e){return t[0]===e[0]&&t[1]===e[1]},TW=function(t){return`
61
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
62
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
63
+ `)},RW=0,Qa=[];function AW(t){var e=S.useRef([]),n=S.useRef([0,0]),i=S.useRef(),r=S.useState(RW++)[0],o=S.useState(JB)[0],a=S.useRef(t);S.useEffect(function(){a.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var w=WG([t.lockRef.current],(t.shards||[]).map(oD),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var c=S.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var E=Op(w),O=n.current,T="deltaX"in w?w.deltaX:O[0]-E[0],A="deltaY"in w?w.deltaY:O[1]-E[1],D,k=w.target,M=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in w&&M==="h"&&k.type==="range")return!1;var I=window.getSelection(),L=I&&I.anchorNode,B=L?L===k||L.contains(k):!1;if(B)return!1;var H=rD(M,k);if(!H)return!0;if(H?D=M:(D=M==="v"?"h":"v",H=rD(M,k)),!H)return!1;if(!i.current&&"changedTouches"in w&&(T||A)&&(i.current=D),!D)return!0;var U=i.current||D;return CW(U,C,w,U==="h"?T:A)},[]),f=S.useCallback(function(w){var C=w;if(!(!Qa.length||Qa[Qa.length-1]!==o)){var E="deltaY"in C?sD(C):Op(C),O=e.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&EW(D.delta,E)})[0];if(O&&O.should){C.cancelable&&C.preventDefault();return}if(!O){var T=(a.current.shards||[]).map(oD).filter(Boolean).filter(function(D){return D.contains(C.target)}),A=T.length>0?c(C,T[0]):!a.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),h=S.useCallback(function(w,C,E,O){var T={name:w,delta:C,target:E,should:O,shadowParent:OW(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(A){return A!==T})},1)},[]),m=S.useCallback(function(w){n.current=Op(w),i.current=void 0},[]),p=S.useCallback(function(w){h(w.type,sD(w),w.target,c(w,t.lockRef.current))},[]),y=S.useCallback(function(w){h(w.type,Op(w),w.target,c(w,t.lockRef.current))},[]);S.useEffect(function(){return Qa.push(o),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",f,$a),document.addEventListener("touchmove",f,$a),document.addEventListener("touchstart",m,$a),function(){Qa=Qa.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,$a),document.removeEventListener("touchmove",f,$a),document.removeEventListener("touchstart",m,$a)}},[]);var b=t.removeScrollBar,x=t.inert;return S.createElement(S.Fragment,null,x?S.createElement(o,{styles:TW(r)}):null,b?S.createElement(gW,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function OW(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const MW=iW(ZB,AW);var iV=S.forwardRef(function(t,e){return S.createElement(Zg,os({},t,{ref:e,sideCar:MW}))});iV.classNames=Zg.classNames;var DW=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Za=new WeakMap,Mp=new WeakMap,Dp={},Pb=0,rV=function(t){return t&&(t.host||rV(t.parentNode))},kW=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=rV(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},PW=function(t,e,n,i){var r=kW(e,Array.isArray(t)?t:[t]);Dp[n]||(Dp[n]=new WeakMap);var o=Dp[n],a=[],c=new Set,f=new Set(r),h=function(p){!p||c.has(p)||(c.add(p),h(p.parentNode))};r.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(y){if(c.has(y))m(y);else try{var b=y.getAttribute(i),x=b!==null&&b!=="false",w=(Za.get(y)||0)+1,C=(o.get(y)||0)+1;Za.set(y,w),o.set(y,C),a.push(y),w===1&&x&&Mp.set(y,!0),C===1&&y.setAttribute(n,"true"),x||y.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",y,E)}})};return m(e),c.clear(),Pb++,function(){a.forEach(function(p){var y=Za.get(p)-1,b=o.get(p)-1;Za.set(p,y),o.set(p,b),y||(Mp.has(p)||p.removeAttribute(i),Mp.delete(p)),b||p.removeAttribute(n)}),Pb--,Pb||(Za=new WeakMap,Za=new WeakMap,Mp=new WeakMap,Dp={})}},IW=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=DW(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),PW(i,r,n,"aria-hidden")):function(){return null}},NW=Object.defineProperty,Ss=(t,e)=>NW(t,"name",{value:e,configurable:!0}),m1="Dialog",[sV,cie]=bB(m1),[LW,ia]=sV(m1),BW=Ss(t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:r,onOpenChange:o,modal:a=!0}=t,c=S.useRef(null),f=S.useRef(null),{nodes:h,registry:m}=_B(),[p,y]=wB({prop:i,defaultProp:r??!1,onChange:o,caller:m1}),[b,x]=S.useState(0),[w,C]=S.useState(0);return fe.jsx(LW,{scope:e,triggerRef:c,contentRef:f,contentId:ps(),titleId:ps(),descriptionId:ps(),titlePresent:b>0,descriptionPresent:w>0,setTitleCount:x,setDescriptionCount:C,open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(E=>!E),[y]),modal:a,branchNodes:h,branchRegistry:m,children:n})},"Dialog"),oV="DialogPortal",[VW,lV]=sV(oV,{forceMount:void 0}),zW=Ss(t=>{const{__scopeDialog:e,forceMount:n,children:i,container:r}=t,o=ia(oV,e);return fe.jsx(VW,{scope:e,forceMount:n,children:S.Children.map(i,a=>fe.jsx(d1,{present:n||o.open,children:fe.jsx(KG,{asChild:!0,container:r,children:a})}))})},"DialogPortal"),mx="DialogOverlay",_W=S.forwardRef(Ss(function(e,n){const i=lV(mx,e.__scopeDialog),{forceMount:r=i.forceMount,...o}=e,a=ia(mx,e.__scopeDialog);return a.modal?fe.jsx(d1,{present:r||a.open,children:fe.jsx(FW,{...o,ref:n})}):null},"DialogOverlay")),HW=a1("DialogOverlay.RemoveScroll"),FW=S.forwardRef(Ss(function(e,n){const{__scopeDialog:i,...r}=e,o=ia(mx,i),a=NB(),c=Wu(n,a);return fe.jsx(iV,{as:HW,allowPinchZoom:!0,shards:S.useMemo(()=>[o.contentRef,...o.branchNodes.map(f=>({current:f}))],[o.contentRef,o.branchNodes]),children:fe.jsx(pr.div,{"data-state":g1(o.open),...r,ref:c,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),Ff="DialogContent",UW=S.forwardRef(Ss(function(e,n){const i=lV(Ff,e.__scopeDialog),{forceMount:r=i.forceMount,...o}=e,a=ia(Ff,e.__scopeDialog);return fe.jsx(d1,{present:r||a.open,children:a.modal?fe.jsx(jW,{...o,ref:n}):fe.jsx(KW,{...o,ref:n})})},"DialogContent")),jW=S.forwardRef(Ss(function(e,n){const i=ia(Ff,e.__scopeDialog),r=S.useRef(null),o=Wu(n,i.contentRef,r);return S.useEffect(()=>{const a=r.current;if(a)return IW(a)},[]),fe.jsx(aV,{...e,ref:o,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Bl(e.onCloseAutoFocus,a=>{a.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:Bl(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&a.preventDefault()}),onFocusOutside:Bl(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),KW=S.forwardRef(Ss(function(e,n){const i=ia(Ff,e.__scopeDialog),r=S.useRef(!1),o=S.useRef(!1);return fe.jsx(aV,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||i.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;i.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})},"DialogContentNonModal")),aV=S.forwardRef(Ss(function(e,n){const{__scopeDialog:i,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,"aria-describedby":c,children:f,...h}=e,m=ia(Ff,i);return p1(),fe.jsx(zB,{registry:m.branchRegistry,children:fe.jsx(HG,{asChild:!0,loop:!0,trapped:r,branches:m.branchNodes,onMountAutoFocus:o,onUnmountAutoFocus:a,children:fe.jsx(VG,{role:"dialog",id:m.contentId,"aria-labelledby":m.titlePresent?m.titleId:void 0,"aria-describedby":m.descriptionPresent?uV(c,m.descriptionId):c,"data-state":g1(m.open),...h,ref:n,deferPointerDownOutside:!0,onDismiss:()=>m.onOpenChange(!1),children:f})})})},"DialogContentImpl"));function uV(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const i of String(n).trim().split(/\s+/))i&&e.add(i);return e.size>0?Array.from(e).join(" "):void 0}Ss(uV,"concatAriaDescribedby");function g1(t){return t?"open":"closed"}Ss(g1,"getState");var Qc='[cmdk-group=""]',Ib='[cmdk-group-items=""]',YW='[cmdk-group-heading=""]',cV='[cmdk-item=""]',lD=`${cV}:not([aria-disabled="true"])`,gx="cmdk-item-select",ru="data-value",qW=(t,e,n)=>aG(t,e,n),fV=S.createContext(void 0),xd=()=>S.useContext(fV),dV=S.createContext(void 0),y1=()=>S.useContext(dV),hV=S.createContext(void 0),pV=S.forwardRef((t,e)=>{let n=su(()=>{var N,ne;return{search:"",value:(ne=(N=t.value)!=null?N:t.defaultValue)!=null?ne:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=su(()=>new Set),r=su(()=>new Map),o=su(()=>new Map),a=su(()=>new Set),c=mV(t),{label:f,children:h,value:m,onValueChange:p,filter:y,shouldFilter:b,loop:x,disablePointerSelection:w=!1,vimBindings:C=!0,...E}=t,O=ps(),T=ps(),A=ps(),D=S.useRef(null),k=iX();Jl(()=>{if(m!==void 0){let N=m.trim();n.current.value=N,M.emit()}},[m]),Jl(()=>{k(6,F)},[]);let M=S.useMemo(()=>({subscribe:N=>(a.current.add(N),()=>a.current.delete(N)),snapshot:()=>n.current,setState:(N,ne,q)=>{var G,Z,ae,Se;if(!Object.is(n.current[N],ne)){if(n.current[N]=ne,N==="search")U(),B(),k(1,H);else if(N==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(A);le?le.focus():(G=document.getElementById(O))==null||G.focus()}if(k(7,()=>{var le;n.current.selectedItemId=(le=K())==null?void 0:le.id,M.emit()}),q||k(5,F),((Z=c.current)==null?void 0:Z.value)!==void 0){let le=ne??"";(Se=(ae=c.current).onValueChange)==null||Se.call(ae,le);return}}M.emit()}},emit:()=>{a.current.forEach(N=>N())}}),[]),I=S.useMemo(()=>({value:(N,ne,q)=>{var G;ne!==((G=o.current.get(N))==null?void 0:G.value)&&(o.current.set(N,{value:ne,keywords:q}),n.current.filtered.items.set(N,L(ne,q)),k(2,()=>{B(),M.emit()}))},item:(N,ne)=>(i.current.add(N),ne&&(r.current.has(ne)?r.current.get(ne).add(N):r.current.set(ne,new Set([N]))),k(3,()=>{U(),B(),n.current.value||H(),M.emit()}),()=>{o.current.delete(N),i.current.delete(N),n.current.filtered.items.delete(N);let q=K();k(4,()=>{U(),q?.getAttribute("id")===N&&H(),M.emit()})}),group:N=>(r.current.has(N)||r.current.set(N,new Set),()=>{o.current.delete(N),r.current.delete(N)}),filter:()=>c.current.shouldFilter,label:f||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:O,inputId:A,labelId:T,listInnerRef:D}),[]);function L(N,ne){var q,G;let Z=(G=(q=c.current)==null?void 0:q.filter)!=null?G:qW;return N?Z(N,n.current.search,ne):0}function B(){if(!n.current.search||c.current.shouldFilter===!1)return;let N=n.current.filtered.items,ne=[];n.current.filtered.groups.forEach(G=>{let Z=r.current.get(G),ae=0;Z.forEach(Se=>{let le=N.get(Se);ae=Math.max(le,ae)}),ne.push([G,ae])});let q=D.current;z().sort((G,Z)=>{var ae,Se;let le=G.getAttribute("id"),ge=Z.getAttribute("id");return((ae=N.get(ge))!=null?ae:0)-((Se=N.get(le))!=null?Se:0)}).forEach(G=>{let Z=G.closest(Ib);Z?Z.appendChild(G.parentElement===Z?G:G.closest(`${Ib} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${Ib} > *`))}),ne.sort((G,Z)=>Z[1]-G[1]).forEach(G=>{var Z;let ae=(Z=D.current)==null?void 0:Z.querySelector(`${Qc}[${ru}="${encodeURIComponent(G[0])}"]`);ae?.parentElement.appendChild(ae)})}function H(){let N=z().find(q=>q.getAttribute("aria-disabled")!=="true"),ne=N?.getAttribute(ru);M.setState("value",ne||void 0)}function U(){var N,ne,q,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let Z=0;for(let ae of i.current){let Se=(ne=(N=o.current.get(ae))==null?void 0:N.value)!=null?ne:"",le=(G=(q=o.current.get(ae))==null?void 0:q.keywords)!=null?G:[],ge=L(Se,le);n.current.filtered.items.set(ae,ge),ge>0&&Z++}for(let[ae,Se]of r.current)for(let le of Se)if(n.current.filtered.items.get(le)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=Z}function F(){var N,ne,q;let G=K();G&&(((N=G.parentElement)==null?void 0:N.firstChild)===G&&((q=(ne=G.closest(Qc))==null?void 0:ne.querySelector(YW))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function K(){var N;return(N=D.current)==null?void 0:N.querySelector(`${cV}[aria-selected="true"]`)}function z(){var N;return Array.from(((N=D.current)==null?void 0:N.querySelectorAll(lD))||[])}function V(N){let ne=z()[N];ne&&M.setState("value",ne.getAttribute(ru))}function X(N){var ne;let q=K(),G=z(),Z=G.findIndex(Se=>Se===q),ae=G[Z+N];(ne=c.current)!=null&&ne.loop&&(ae=Z+N<0?G[G.length-1]:Z+N===G.length?G[0]:G[Z+N]),ae&&M.setState("value",ae.getAttribute(ru))}function j(N){let ne=K(),q=ne?.closest(Qc),G;for(;q&&!G;)q=N>0?tX(q,Qc):nX(q,Qc),G=q?.querySelector(lD);G?M.setState("value",G.getAttribute(ru)):X(N)}let Y=()=>V(z().length-1),$=N=>{N.preventDefault(),N.metaKey?Y():N.altKey?j(1):X(1)},te=N=>{N.preventDefault(),N.metaKey?V(0):N.altKey?j(-1):X(-1)};return S.createElement(pr.div,{ref:e,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:N=>{var ne;(ne=E.onKeyDown)==null||ne.call(E,N);let q=N.nativeEvent.isComposing||N.keyCode===229;if(!(N.defaultPrevented||q))switch(N.key){case"n":case"j":{C&&N.ctrlKey&&$(N);break}case"ArrowDown":{$(N);break}case"p":case"k":{C&&N.ctrlKey&&te(N);break}case"ArrowUp":{te(N);break}case"Home":{N.preventDefault(),V(0);break}case"End":{N.preventDefault(),Y();break}case"Enter":{N.preventDefault();let G=K();if(G){let Z=new Event(gx);G.dispatchEvent(Z)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:sX},f),Jg(t,N=>S.createElement(dV.Provider,{value:M},S.createElement(fV.Provider,{value:I},N))))}),GW=S.forwardRef((t,e)=>{var n,i;let r=ps(),o=S.useRef(null),a=S.useContext(hV),c=xd(),f=mV(t),h=(i=(n=f.current)==null?void 0:n.forceMount)!=null?i:a?.forceMount;Jl(()=>{if(!h)return c.item(r,a?.id)},[h]);let m=gV(r,o,[t.value,t.children,o],t.keywords),p=y1(),y=jo(k=>k.value&&k.value===m.current),b=jo(k=>h||c.filter()===!1?!0:k.search?k.filtered.items.get(r)>0:!0);S.useEffect(()=>{let k=o.current;if(!(!k||t.disabled))return k.addEventListener(gx,x),()=>k.removeEventListener(gx,x)},[b,t.onSelect,t.disabled]);function x(){var k,M;w(),(M=(k=f.current).onSelect)==null||M.call(k,m.current)}function w(){p.setState("value",m.current,!0)}if(!b)return null;let{disabled:C,value:E,onSelect:O,forceMount:T,keywords:A,...D}=t;return S.createElement(pr.div,{ref:Ql(o,e),...D,id:r,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!y,"data-disabled":!!C,"data-selected":!!y,onPointerMove:C||c.getDisablePointerSelection()?void 0:w,onClick:C?void 0:x},t.children)}),WW=S.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:r,...o}=t,a=ps(),c=S.useRef(null),f=S.useRef(null),h=ps(),m=xd(),p=jo(b=>r||m.filter()===!1?!0:b.search?b.filtered.groups.has(a):!0);Jl(()=>m.group(a),[]),gV(a,c,[t.value,t.heading,f]);let y=S.useMemo(()=>({id:a,forceMount:r}),[r]);return S.createElement(pr.div,{ref:Ql(c,e),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&S.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Jg(t,b=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(hV.Provider,{value:y},b))))}),XW=S.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,r=S.useRef(null),o=jo(a=>!a.search);return!n&&!o?null:S.createElement(pr.div,{ref:Ql(r,e),...i,"cmdk-separator":"",role:"separator"})}),$W=S.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,r=t.value!=null,o=y1(),a=jo(h=>h.search),c=jo(h=>h.selectedItemId),f=xd();return S.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),S.createElement(pr.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:r?t.value:a,onChange:h=>{r||o.setState("search",h.target.value),n?.(h.target.value)}})}),QW=S.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...r}=t,o=S.useRef(null),a=S.useRef(null),c=jo(h=>h.selectedItemId),f=xd();return S.useEffect(()=>{if(a.current&&o.current){let h=a.current,m=o.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=h.offsetHeight;m.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return y.observe(h),()=>{cancelAnimationFrame(p),y.unobserve(h)}}},[]),S.createElement(pr.div,{ref:Ql(o,e),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:f.listId},Jg(t,h=>S.createElement("div",{ref:Ql(a,f.listInnerRef),"cmdk-list-sizer":""},h)))}),ZW=S.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:r,contentClassName:o,container:a,...c}=t;return S.createElement(BW,{open:n,onOpenChange:i},S.createElement(zW,{container:a},S.createElement(_W,{"cmdk-overlay":"",className:r}),S.createElement(UW,{"aria-label":t.label,"cmdk-dialog":"",className:o},S.createElement(pV,{ref:e,...c}))))}),JW=S.forwardRef((t,e)=>jo(n=>n.filtered.count===0)?S.createElement(pr.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),eX=S.forwardRef((t,e)=>{let{progress:n,children:i,label:r="Loading...",...o}=t;return S.createElement(pr.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},Jg(t,a=>S.createElement("div",{"aria-hidden":!0},a)))}),fie=Object.assign(pV,{List:QW,Item:GW,Input:$W,Group:WW,Separator:XW,Dialog:ZW,Empty:JW,Loading:eX});function tX(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function nX(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function mV(t){let e=S.useRef(t);return Jl(()=>{e.current=t}),e}var Jl=typeof window>"u"?S.useEffect:S.useLayoutEffect;function su(t){let e=S.useRef();return e.current===void 0&&(e.current=t()),e}function jo(t){let e=y1(),n=()=>t(e.snapshot());return S.useSyncExternalStore(e.subscribe,n,n)}function gV(t,e,n,i=[]){let r=S.useRef(),o=xd();return Jl(()=>{var a;let c=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():r.current}})(),f=i.map(h=>h.trim());o.value(t,c,f),(a=e.current)==null||a.setAttribute(ru,c),r.current=c}),r}var iX=()=>{let[t,e]=S.useState(),n=su(()=>new Map);return Jl(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,r)=>{n.current.set(i,r),e({})}};function rX(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Jg({asChild:t,children:e},n){return t&&S.isValidElement(e)?S.cloneElement(rX(e),{ref:e.ref},n(e.props.children)):n(e)}var sX={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const oX=1024;let lX=0;class ar{constructor(e,n){this.from=e,this.to=n}}class mt{constructor(e={}){this.id=lX++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Si.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}mt.closedBy=new mt({deserialize:t=>t.split(" ")});mt.openedBy=new mt({deserialize:t=>t.split(" ")});mt.group=new mt({deserialize:t=>t.split(" ")});mt.isolate=new mt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});mt.contextHash=new mt({perNode:!0});mt.lookAhead=new mt({perNode:!0});mt.mounted=new mt({perNode:!0});class Eu{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[mt.mounted.id]}}const aX=Object.create(null);class Si{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):aX,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Si(e.name||"",n,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(r)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(mt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(mt.group),o=-1;o<(r?r.length:0);o++){let a=n[o<0?i.name:r[o]];if(a)return a}}}}Si.none=new Si("",Object.create(null),0,8);class v1{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let o of e){let a=o(i);if(a){r||(r=Object.assign({},i.props));let c=a[1],f=a[0];f.combine&&f.id in r&&(c=f.combine(r[f.id],c)),r[f.id]=c}}n.push(r?new Si(i.name,r,i.id,i.flags):i)}return new v1(n)}}const kp=new WeakMap,aD=new WeakMap;var Vt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Vt||(Vt={}));class Qt{constructor(e,n,i,r,o){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[a,c]of o)this.props[typeof a=="number"?a:a.id]=c}}toString(){let e=Eu.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Hm(this.topNode,e)}cursorAt(e,n=0,i=0){let r=kp.get(this)||this.topNode,o=new Hm(r);return o.moveTo(e,n),kp.set(this,o._tree),o}get topNode(){return new ai(this,0,0,null)}resolve(e,n=0){let i=Uf(kp.get(this)||this.topNode,e,n,!1);return kp.set(this,i),i}resolveInner(e,n=0){let i=Uf(aD.get(this)||this.topNode,e,n,!0);return aD.set(this,i),i}resolveStack(e,n=0){return fX(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:o=this.length}=e,a=e.mode||0,c=(a&Vt.IncludeAnonymous)>0;for(let f=this.cursor(a|Vt.IncludeAnonymous);;){let h=!1;if(f.from<=o&&f.to>=r&&(!c&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;h=!0}for(;h&&i&&(c||!f.type.isAnonymous)&&i(f),!f.nextSibling();){if(!f.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:x1(Si.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Qt(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new Qt(Si.none,n,i,r)))}static build(e){return dX(e)}}Qt.empty=new Qt(Si.none,[],[],0);class b1{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new b1(this.buffer,this.index)}}class Ko{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Si.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let a=[];for(;e<i;)a.push(this.childString(e)),e=this.buffer[e+3];return o+"("+a.join(",")+")"}findChild(e,n,i,r,o){let{buffer:a}=this,c=-1;for(let f=e;f!=n&&!(yV(o,r,a[f+1],a[f+2])&&(c=f,i>0));f=a[f+3]);return c}slice(e,n,i){let r=this.buffer,o=new Uint16Array(n-e),a=0;for(let c=e,f=0;c<n;){o[f++]=r[c++],o[f++]=r[c++]-i;let h=o[f++]=r[c++]-i;o[f++]=r[c++]-e,a=Math.max(a,h)}return new Ko(o,a,this.set)}}function yV(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function Uf(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!i&&t instanceof ai&&t.index<0?null:t.parent;if(!a)return t;t=a}let o=i?0:Vt.IgnoreOverlays;if(i)for(let a=t,c=a.parent;c;a=c,c=a.parent)a instanceof ai&&a.index<0&&((r=c.enter(e,n,o))===null||r===void 0?void 0:r.from)!=a.from&&(t=c);for(;;){let a=t.enter(e,n,o);if(!a)return t;t=a}}class vV{cursor(e=0){return new Hm(this,e)}getChild(e,n=null,i=null){let r=uD(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return uD(this,e,n,i)}resolve(e,n=0){return Uf(this,e,n,!1)}resolveInner(e,n=0){return Uf(this,e,n,!0)}matchContext(e){return yx(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}}class ai extends vV{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,o=0){for(let a=this;;){for(let{children:c,positions:f}=a._tree,h=n>0?c.length:-1;e!=h;e+=n){let m=c[e],p=f[e]+a.from,y;if(!(!(o&Vt.EnterBracketed&&m instanceof Qt&&(y=Eu.get(m))&&!y.overlay&&y.bracketed&&i>=p&&i<=p+m.length)&&!yV(r,i,p,p+m.length))){if(m instanceof Ko){if(o&Vt.ExcludeBuffers)continue;let b=m.findChild(0,m.buffer.length,n,i-p,r);if(b>-1)return new us(new uX(a,m,e,p),null,b)}else if(o&Vt.IncludeAnonymous||!m.type.isAnonymous||S1(m)){let b;if(!(o&Vt.IgnoreMounts)&&(b=Eu.get(m))&&!b.overlay)return new ai(b.tree,p,e,a);let x=new ai(m,p,e,a);return o&Vt.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?m.children.length-1:0,n,i,r,o)}}}if(o&Vt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&Vt.IgnoreOverlays)&&(r=Eu.get(this._tree))&&r.overlay){let o=e-this.from,a=i&Vt.EnterBracketed&&r.bracketed;for(let{from:c,to:f}of r.overlay)if((n>0||a?c<=o:c<o)&&(n<0||a?f>=o:f>o))return new ai(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function uD(t,e,n,i){let r=t.cursor(),o=[];if(!r.firstChild())return o;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return o}for(;;){if(i!=null&&r.type.is(i))return o;if(r.type.is(e)&&o.push(r.node),!r.nextSibling())return i==null?o:[]}}function yx(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class uX{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}}class us extends vV{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return o<0?null:new us(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&Vt.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new us(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new us(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new us(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,o=i.buffer[this.index+3];if(o>r){let a=i.buffer[this.index+1];e.push(i.slice(r,o,a)),n.push(0)}return new Qt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function bV(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let a=t[o];(a.from>n.from||a.to<n.to)&&(n=a,e=o)}let i=n instanceof ai&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new cX(r,n)}class cX{constructor(e,n){this.heads=e,this.node=n}get next(){return bV(this.heads)}}function fX(t,e,n){let i=t.resolveInner(e,n),r=null;for(let o=i instanceof ai?i:i.context.parent;o;o=o.parent)if(o.index<0){let a=o.parent;(r||(r=[i])).push(a.resolve(e,n)),o=a}else{let a=Eu.get(o.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let c=new ai(a.tree,a.overlay[0].from+o.from,-1,o);(r||(r=[i])).push(Uf(c,e,n,!1))}}return r?bV(r):i}class Hm{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Vt.EnterBracketed,e instanceof ai)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof ai?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&Vt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Vt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Vt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(r.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let o=n+e,a=e<0?-1:i._tree.children.length;o!=a;o+=e){let c=i._tree.children[o];if(this.mode&Vt.IncludeAnonymous||c instanceof Ko||!c.type.isAnonymous||S1(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=o+1;break e}r=this.stack[--o]}for(let r=i;r<this.stack.length;r++)n=new us(this.buffer,n,this.stack[r]);return this.bufferNode=new us(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return yx(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return yx(this._tree,e,r);let a=i[n.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}}function S1(t){return t.children.some(e=>e instanceof Ko||!e.type.isAnonymous||S1(e))}function dX(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=oX,reused:o=[],minRepeatType:a=i.types.length}=t,c=Array.isArray(n)?new b1(n,n.length):n,f=i.types,h=0,m=0;function p(D,k,M,I,L,B){let{id:H,start:U,end:F,size:K}=c,z=m,V=h;if(K<0)if(c.next(),K==-1){let te=o[H];M.push(te),I.push(U-D);return}else if(K==-3){h=H;return}else if(K==-4){m=H;return}else throw new RangeError(`Unrecognized record size: ${K}`);let X=f[H],j,Y,$=U-D;if(F-U<=r&&(Y=C(c.pos-k,L))){let te=new Uint16Array(Y.size-Y.skip),N=c.pos-Y.size,ne=te.length;for(;c.pos>N;)ne=E(Y.start,te,ne);j=new Ko(te,F-Y.start,i),$=Y.start-D}else{let te=c.pos-K;c.next();let N=[],ne=[],q=H>=a?H:-1,G=0,Z=F,ae=z;for(;c.pos>te;)q>=0&&c.id==q&&c.size>=0?(c.end<=Z-r&&(x(N,ne,U,G,c.end,Z,q,ae,V),G=N.length,Z=c.end,ae=m),c.next()):B>2500?y(U,te,N,ne):(q>=0&&c.size==-1&&o[c.id].type==i.types[q]&&(G<N.length&&x(N,ne,U,G,c.end,Z,q,ae,V),G=N.length+1,Z=c.start,ae=m),p(U,te,N,ne,q,B+1));if(q>=0&&G>0&&G<N.length&&x(N,ne,U,G,U,Z,q,ae,V),N.reverse(),ne.reverse(),q>-1&&G>0){let Se=b(X,V);j=x1(X,N,ne,0,N.length,0,F-U,Se,Se)}else j=w(X,N,ne,F-U,z-F,V)}M.push(j),I.push($)}function y(D,k,M,I){let L=[],B=0,H=-1;for(;c.pos>k;){let{id:U,start:F,end:K,size:z}=c;if(z>4)c.next();else{if(H>-1&&F<H)break;H<0&&(H=K-r),L.push(U,F,K),B++,c.next()}}if(B){let U=new Uint16Array(B*4),F=L[L.length-2];for(let K=L.length-3,z=0;K>=0;K-=3)U[z++]=L[K],U[z++]=L[K+1]-F,U[z++]=L[K+2]-F,U[z++]=z;M.push(new Ko(U,L[2]-F,i)),I.push(F-D)}}function b(D,k){return(M,I,L)=>{let B=0,H=M.length-1,U,F;if(H>=0&&(U=M[H])instanceof Qt){if(!H&&U.type==D&&U.length==L)return U;(F=U.prop(mt.lookAhead))&&(B=I[H]+U.length+F-L)}return w(D,M,I,L,B,k)}}function x(D,k,M,I,L,B,H,U,F){let K=[],z=[];for(;D.length>I;)K.push(D.pop()),z.push(k.pop()+M-L);D.push(w(i.types[H],K,z,B-L,U-B,F)),k.push(L-M)}function w(D,k,M,I,L,B,H){if(B){let U=[mt.contextHash,B];H=H?[U].concat(H):[U]}if(L>25){let U=[mt.lookAhead,L];H=H?[U].concat(H):[U]}return new Qt(D,k,M,I,H)}function C(D,k){let M=c.fork(),I=0,L=0,B=0,H=M.end-r,U={size:0,start:0,skip:0};e:for(let F=M.pos-D;M.pos>F;){let K=M.size;if(M.id==k&&K>=0){U.size=I,U.start=L,U.skip=B,B+=4,I+=4,M.next();continue}let z=M.pos-K;if(K<0||z<F||M.start<H)break;let V=M.id>=a?4:0,X=M.start;for(M.next();M.pos>z;){if(M.size<0)if(M.size==-3||M.size==-4)V+=4;else break e;else M.id>=a&&(V+=4);M.next()}L=X,I+=K,B+=V}return(k<0||I==D)&&(U.size=I,U.start=L,U.skip=B),U.size>4?U:void 0}function E(D,k,M){let{id:I,start:L,end:B,size:H}=c;if(c.next(),H>=0&&I<a){let U=M;if(H>4){let F=c.pos-(H-4);for(;c.pos>F;)M=E(D,k,M)}k[--M]=U,k[--M]=B-D,k[--M]=L-D,k[--M]=I}else H==-3?h=I:H==-4&&(m=I);return M}let O=[],T=[];for(;c.pos>0;)p(t.start||0,t.bufferStart||0,O,T,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:O.length?T[0]+O[0].length:0;return new Qt(f[t.topID],O.reverse(),T.reverse(),A)}const cD=new WeakMap;function Jp(t,e){if(!t.isAnonymous||e instanceof Ko||e.type!=t)return 1;let n=cD.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Qt)){n=1;break}n+=Jp(t,i)}cD.set(e,n)}return n}function x1(t,e,n,i,r,o,a,c,f){let h=0;for(let x=i;x<r;x++)h+=Jp(t,e[x]);let m=Math.ceil(h*1.5/8),p=[],y=[];function b(x,w,C,E,O){for(let T=C;T<E;){let A=T,D=w[T],k=Jp(t,x[T]);for(T++;T<E;T++){let M=Jp(t,x[T]);if(k+M>=m)break;k+=M}if(T==A+1){if(k>m){let M=x[A];b(M.children,M.positions,0,M.children.length,w[A]+O);continue}p.push(x[A])}else{let M=w[T-1]+x[T-1].length-D;p.push(x1(t,x,w,A,T,D,M,null,f))}y.push(D+O-o)}}return b(e,n,i,r,0),(c||f)(p,y,a)}class die{constructor(){this.map=new WeakMap}setBuffer(e,n,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(n,i)}getBuffer(e,n){let i=this.map.get(e);return i&&i.get(n)}set(e,n){e instanceof us?this.setBuffer(e.context.buffer,e.index,n):e instanceof ai&&this.map.set(e.tree,n)}get(e){return e instanceof us?this.getBuffer(e.context.buffer,e.index):e instanceof ai?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Gs{constructor(e,n,i,r,o=!1,a=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new Gs(0,e.length,e,0,!1,i)];for(let o of n)o.to>e.length&&r.push(o);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],o=1,a=e.length?e[0]:null;for(let c=0,f=0,h=0;;c++){let m=c<n.length?n[c]:null,p=m?m.fromA:1e9;if(p-f>=i)for(;a&&a.from<p;){let y=a;if(f>=y.from||p<=y.to||h){let b=Math.max(y.from,f)-h,x=Math.min(y.to,p)-h;y=b>=x?null:new Gs(b,x,y.tree,y.offset+h,c>0,!!m)}if(y&&r.push(y),a.to>p)break;a=o<e.length?e[o++]:null}if(!m)break;f=m.toA,h=m.toA-m.toB}return r}}class SV{startParse(e,n,i){return typeof e=="string"&&(e=new hX(e)),i=i?i.length?i.map(r=>new ar(r.from,r.to)):[new ar(0,0)]:[new ar(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let o=r.advance();if(o)return o}}}class hX{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function hie(t){return(e,n,i,r)=>new mX(e,t,n,i,r)}class fD{constructor(e,n,i,r,o,a){this.parser=e,this.parse=n,this.overlay=i,this.bracketed=r,this.target=o,this.from=a}}function dD(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class pX{constructor(e,n,i,r,o,a,c,f){this.parser=e,this.predicate=n,this.mounts=i,this.index=r,this.start=o,this.bracketed=a,this.target=c,this.prev=f,this.depth=0,this.ranges=[]}}const xV=new mt({perNode:!0});class mX{constructor(e,n,i,r,o){this.nest=n,this.input=i,this.fragments=r,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Qt(i.type,i.children,i.positions,i.length,i.propValues.concat([[xV,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[mt.mounted.id]=new Eu(n,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new vX(this.fragments),n=null,i=null,r=new Hm(new ai(this.baseTree,this.ranges[0].from,0,null),Vt.IncludeAnonymous|Vt.IgnoreMounts);e:for(let o,a;;){let c=!0,f;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)c=!1;else if(e.hasNode(r)){if(n){let h=n.mounts.find(m=>m.frag.from<=r.from&&m.frag.to>=r.to&&m.mount.overlay);if(h)for(let m of h.mount.overlay){let p=m.from+h.pos,y=m.to+h.pos;p>=r.from&&y<=r.to&&!n.ranges.some(b=>b.from<y&&b.to>p)&&n.ranges.push({from:p,to:y})}}c=!1}else if(i&&(a=gX(i.ranges,r.from,r.to)))c=a!=2;else if(!r.type.isAnonymous&&(o=this.nest(r,this.input))&&(r.from<r.to||!o.overlay)){r.tree||(yX(r),n&&n.depth++,i&&i.depth++);let h=e.findMounts(r.from,o.parser);if(typeof o.overlay=="function")n=new pX(o.parser,o.overlay,h,this.inner.length,r.from,!!o.bracketed,r.tree,n);else{let m=gD(this.ranges,o.overlay||(r.from<r.to?[new ar(r.from,r.to)]:[]));m.length&&dD(m),(m.length||!o.overlay)&&this.inner.push(new fD(o.parser,m.length?o.parser.startParse(this.input,yD(h,m),m):o.parser.startParse(""),o.overlay?o.overlay.map(p=>new ar(p.from-r.from,p.to-r.from)):null,!!o.bracketed,r.tree,m.length?m[0].from:r.from)),o.overlay?m.length&&(i={ranges:m,depth:0,prev:i}):c=!1}}else if(n&&(f=n.predicate(r))&&(f===!0&&(f=new ar(r.from,r.to)),f.from<f.to)){let h=n.ranges.length-1;h>=0&&n.ranges[h].to==f.from?n.ranges[h]={from:n.ranges[h].from,to:f.to}:n.ranges.push(f)}if(c&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let h=gD(this.ranges,n.ranges);h.length&&(dD(h),this.inner.splice(n.index,0,new fD(n.parser,n.parser.startParse(this.input,yD(n.mounts,h),h),n.ranges.map(m=>new ar(m.from-n.start,m.to-n.start)),n.bracketed,n.target,h[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function gX(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}function hD(t,e,n,i,r,o){if(e<n){let a=t.buffer[e+1];i.push(t.slice(e,n,a)),r.push(a-o)}}function yX(t){let{node:e}=t,n=[],i=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let r=t.tree,o=r.children.indexOf(i),a=r.children[o],c=a.buffer,f=[o];function h(m,p,y,b,x,w){let C=n[w],E=[],O=[];hD(a,m,C,E,O,b);let T=c[C+1],A=c[C+2];f.push(E.length);let D=w?h(C+4,c[C+3],a.set.types[c[C]],T,A-T,w-1):e.toTree();return E.push(D),O.push(T-b),hD(a,c[C+3],p,E,O,b),new Qt(y,E,O,x)}r.children[o]=h(0,c.length,Si.none,0,a.length,n.length-1);for(let m of f){let p=t.tree.children[m],y=t.tree.positions[m];t.yield(new ai(p,y+t.from,m,t._tree))}}class pD{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Vt.IncludeAnonymous|Vt.IgnoreMounts|Vt.ExcludeBuffers)}moveTo(e){let{cursor:n}=this,i=e-this.offset;for(;!this.done&&n.from<i;)if(!(n.to>=i&&n.enter(i,1,Vt.IncludeAnonymous|Vt.IgnoreMounts|Vt.IgnoreOverlays|Vt.ExcludeBuffers)))if(n.to<=i)n.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Qt)n=n.children[0];else break}return!1}}function mD(t){let e=t.tree.prop(xV);return e==null?t.to:Math.min(t.to,e-t.offset)}class vX{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=mD(n),this.inner=new pD(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=mD(e),this.inner=new pD(e.tree,-e.offset)}}findMounts(e,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let a=(i=o.tree)===null||i===void 0?void 0:i.prop(mt.mounted);if(a&&a.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let f=this.fragments[c];if(f.from>=o.to)break;f.tree==this.curFrag.tree&&r.push({frag:f,pos:o.from-f.offset,mount:a})}}}return r}}function gD(t,e){let n=null,i=e;for(let r=1,o=0;r<t.length;r++){let a=t[r-1].to,c=t[r].from;for(;o<i.length;o++){let f=i[o];if(f.from>=c)break;f.to<=a||(n||(i=n=e.slice()),f.from<a?(n[o]=new ar(f.from,a),f.to>c&&n.splice(o+1,0,new ar(c,f.to))):f.to>c?n[o--]=new ar(c,f.to):n.splice(o--,1))}}return i}function bX(t,e,n,i){let r=0,o=0,a=!1,c=!1,f=-1e9,h=[];for(;;){let m=r==t.length?1e9:a?t[r].to:t[r].from,p=o==e.length?1e9:c?e[o].to:e[o].from;if(a!=c){let y=Math.max(f,n),b=Math.min(m,p,i);y<b&&h.push(new ar(y,b))}if(f=Math.min(m,p),f==1e9)break;m==f&&(a?(a=!1,r++):a=!0),p==f&&(c?(c=!1,o++):c=!0)}return h}function yD(t,e){let n=[];for(let{pos:i,mount:r,frag:o}of t){let a=i+(r.overlay?r.overlay[0].from:0),c=a+r.tree.length,f=Math.max(o.from,a),h=Math.min(o.to,c);if(r.overlay){let m=r.overlay.map(y=>new ar(y.from+i,y.to+i)),p=bX(e,m,f,h);for(let y=0,b=f;;y++){let x=y==p.length,w=x?h:p[y].from;if(w>b&&n.push(new Gs(b,w,r.tree,-a,o.from>=b||o.openStart,o.to<=w||o.openEnd)),x)break;b=p[y].to}}else n.push(new Gs(f,h,r.tree,-a,o.from>=a||o.openStart,o.to<=c||o.openEnd))}return n}let SX=0;class rr{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=SX++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof rr&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new rr(i,[],null,[]);if(r.set.push(r),n)for(let o of n.set)r.set.push(o);return r}static defineModifier(e){let n=new Fm(e);return i=>i.modified.indexOf(n)>-1?i:Fm.get(i.base||i,i.modified.concat(n).sort((r,o)=>r.id-o.id))}}let xX=0;class Fm{constructor(e){this.name=e,this.instances=[],this.id=xX++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(c=>c.base==e&&wX(n,c.modified));if(i)return i;let r=[],o=new rr(e.name,r,e,n);for(let c of n)c.instances.push(o);let a=CX(n);for(let c of e.set)if(!c.modified.length)for(let f of a)r.push(Fm.get(c,f));return o}}function wX(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function CX(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function EX(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let o=[],a=2,c=r;for(let p=0;;){if(c=="..."&&p>0&&p+3==r.length){a=1;break}let y=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!y)throw new RangeError("Invalid path: "+r);if(o.push(y[0]=="*"?"":y[0][0]=='"'?JSON.parse(y[0]):y[0]),p+=y[0].length,p==r.length)break;let b=r[p++];if(p==r.length&&b=="!"){a=0;break}if(b!="/")throw new RangeError("Invalid path: "+r);c=r.slice(p)}let f=o.length-1,h=o[f];if(!h)throw new RangeError("Invalid path: "+r);let m=new jf(i,a,f>0?o.slice(0,f):null);e[h]=m.sort(e[h])}}return wV.add(e)}const wV=new mt({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth<=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let o=new jf(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class jf{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}jf.empty=new jf([],2,null);function CV(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let a of o.tag)n[a.id]=o.class;let{scope:i,all:r=null}=e||{};return{style:o=>{let a=r;for(let c of o)for(let f of c.set){let h=n[f.id];if(h){a=a?a+" "+h:h;break}}return a},scope:i}}function TX(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function RX(t,e,n,i=0,r=t.length){let o=new AX(i,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),i,r,"",o.highlighters),o.flush(r)}class AX{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,r,o){let{type:a,from:c,to:f}=e;if(c>=i||f<=n)return;a.isTop&&(o=this.highlighters.filter(b=>!b.scope||b.scope(a)));let h=r,m=OX(e)||jf.empty,p=TX(o,m.tags);if(p&&(h&&(h+=" "),h+=p,m.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(n,c),h),m.opaque)return;let y=e.tree&&e.tree.prop(mt.mounted);if(y&&y.overlay){let b=e.node.enter(y.overlay[0].from+c,1),x=this.highlighters.filter(C=>!C.scope||C.scope(y.tree.type)),w=e.firstChild();for(let C=0,E=c;;C++){let O=C<y.overlay.length?y.overlay[C]:null,T=O?O.from+c:f,A=Math.max(n,E),D=Math.min(i,T);if(A<D&&w)for(;e.from<D&&(this.highlightRange(e,A,D,r,o),this.startSpan(Math.min(D,e.to),h),!(e.to>=T||!e.nextSibling())););if(!O||T>i)break;E=O.to+c,E>n&&(this.highlightRange(b.cursor(),Math.max(n,O.from+c),Math.min(i,E),"",x),this.startSpan(Math.min(i,E),h))}w&&e.parent()}else if(e.firstChild()){y&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,o),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function OX(t){let e=t.type.prop(wV);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Le=rr.define,Pp=Le(),Mo=Le(),vD=Le(Mo),bD=Le(Mo),Do=Le(),Ip=Le(Do),Nb=Le(Do),Jr=Le(),Tl=Le(Jr),Qr=Le(),Zr=Le(),vx=Le(),Zc=Le(vx),Np=Le(),ze={comment:Pp,lineComment:Le(Pp),blockComment:Le(Pp),docComment:Le(Pp),name:Mo,variableName:Le(Mo),typeName:vD,tagName:Le(vD),propertyName:bD,attributeName:Le(bD),className:Le(Mo),labelName:Le(Mo),namespace:Le(Mo),macroName:Le(Mo),literal:Do,string:Ip,docString:Le(Ip),character:Le(Ip),attributeValue:Le(Ip),number:Nb,integer:Le(Nb),float:Le(Nb),bool:Le(Do),regexp:Le(Do),escape:Le(Do),color:Le(Do),url:Le(Do),keyword:Qr,self:Le(Qr),null:Le(Qr),atom:Le(Qr),unit:Le(Qr),modifier:Le(Qr),operatorKeyword:Le(Qr),controlKeyword:Le(Qr),definitionKeyword:Le(Qr),moduleKeyword:Le(Qr),operator:Zr,derefOperator:Le(Zr),arithmeticOperator:Le(Zr),logicOperator:Le(Zr),bitwiseOperator:Le(Zr),compareOperator:Le(Zr),updateOperator:Le(Zr),definitionOperator:Le(Zr),typeOperator:Le(Zr),controlOperator:Le(Zr),punctuation:vx,separator:Le(vx),bracket:Zc,angleBracket:Le(Zc),squareBracket:Le(Zc),paren:Le(Zc),brace:Le(Zc),content:Jr,heading:Tl,heading1:Le(Tl),heading2:Le(Tl),heading3:Le(Tl),heading4:Le(Tl),heading5:Le(Tl),heading6:Le(Tl),contentSeparator:Le(Jr),list:Le(Jr),quote:Le(Jr),emphasis:Le(Jr),strong:Le(Jr),link:Le(Jr),monospace:Le(Jr),strikethrough:Le(Jr),inserted:Le(),deleted:Le(),changed:Le(),invalid:Le(),meta:Np,documentMeta:Le(Np),annotation:Le(Np),processingInstruction:Le(Np),definition:rr.defineModifier("definition"),constant:rr.defineModifier("constant"),function:rr.defineModifier("function"),standard:rr.defineModifier("standard"),local:rr.defineModifier("local"),special:rr.defineModifier("special")};for(let t in ze){let e=ze[t];e instanceof rr&&(e.name=t)}const pie=CV([{tag:ze.link,class:"tok-link"},{tag:ze.heading,class:"tok-heading"},{tag:ze.emphasis,class:"tok-emphasis"},{tag:ze.strong,class:"tok-strong"},{tag:ze.keyword,class:"tok-keyword"},{tag:ze.atom,class:"tok-atom"},{tag:ze.bool,class:"tok-bool"},{tag:ze.url,class:"tok-url"},{tag:ze.labelName,class:"tok-labelName"},{tag:ze.inserted,class:"tok-inserted"},{tag:ze.deleted,class:"tok-deleted"},{tag:ze.literal,class:"tok-literal"},{tag:ze.string,class:"tok-string"},{tag:ze.number,class:"tok-number"},{tag:[ze.regexp,ze.escape,ze.special(ze.string)],class:"tok-string2"},{tag:ze.variableName,class:"tok-variableName"},{tag:ze.local(ze.variableName),class:"tok-variableName tok-local"},{tag:ze.definition(ze.variableName),class:"tok-variableName tok-definition"},{tag:ze.special(ze.variableName),class:"tok-variableName2"},{tag:ze.definition(ze.propertyName),class:"tok-propertyName tok-definition"},{tag:ze.typeName,class:"tok-typeName"},{tag:ze.namespace,class:"tok-namespace"},{tag:ze.className,class:"tok-className"},{tag:ze.macroName,class:"tok-macroName"},{tag:ze.propertyName,class:"tok-propertyName"},{tag:ze.operator,class:"tok-operator"},{tag:ze.comment,class:"tok-comment"},{tag:ze.meta,class:"tok-meta"},{tag:ze.invalid,class:"tok-invalid"},{tag:ze.punctuation,class:"tok-punctuation"}]);function SD(t,e,n,i=0,r=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=r;for(let a=i;a<e;a++)t.charCodeAt(a)==9?o+=n-o%n:o++;return o}class EV{constructor(e,n,i,r){this.string=e,this.tabSize=n,this.indentUnit=i,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),i;if(typeof e=="string"?i=n==e:i=n&&(e instanceof RegExp?e.test(n):e(n)),i)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=SD(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:SD(this.string,null,this.tabSize)}match(e,n,i){if(typeof e=="string"){let r=a=>i?a.toLowerCase():a,o=this.string.substr(this.pos,e.length);return r(o)==r(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}var Lb;const kl=new mt;function TV(t){return We.define({combine:t?e=>e.concat(t):void 0})}const MX=new mt;class Yi{constructor(e,n,i=[],r=""){this.data=e,this.name=r,Ut.prototype.hasOwnProperty("tree")||Object.defineProperty(Ut.prototype,"tree",{get(){return hr(this)}}),this.parser=n,this.extension=[Vu.of(this),Ut.languageData.of((o,a,c)=>{let f=xD(o,a,c),h=f.type.prop(kl);if(!h)return[];let m=o.facet(h),p=f.type.prop(MX);if(p){let y=f.resolve(a-f.from,c);for(let b of p)if(b.test(y,o)){let x=o.facet(b.facet);return b.type=="replace"?x:x.concat(m)}}return m})].concat(i)}isActiveAt(e,n,i=-1){return xD(e,n,i).type.prop(kl)==this.data}findRegions(e){let n=e.facet(Vu);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(o,a)=>{if(o.prop(kl)==this.data){i.push({from:a,to:a+o.length});return}let c=o.prop(mt.mounted);if(c){if(c.tree.prop(kl)==this.data){if(c.overlay)for(let f of c.overlay)i.push({from:f.from+a,to:f.to+a});else i.push({from:a,to:a+o.length});return}else if(c.overlay){let f=i.length;if(r(c.tree,c.overlay[0].from+a),i.length>f)return}}for(let f=0;f<o.children.length;f++){let h=o.children[f];h instanceof Qt&&r(h,o.positions[f]+a)}};return r(hr(e),0),i}get allowsNesting(){return!0}}Yi.setState=$t.define();function xD(t,e,n){let i=t.facet(Vu),r=hr(t).topNode;if(!i||i.allowsNesting)for(let o=r;o;o=o.enter(e,n,Vt.ExcludeBuffers|Vt.EnterBracketed))o.type.isTop&&(r=o);return r}class bx extends Yi{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=TV(e.languageData);return new bx(n,e.parser.configure({props:[kl.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new bx(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function hr(t){let e=t.field(Yi.state,!1);return e?e.tree:Qt.empty}function DX(t,e,n=50){var i;let r=(i=t.field(Yi.state,!1))===null||i===void 0?void 0:i.context;if(!r)return null;let o=r.viewport;r.updateViewport({from:0,to:e});let a=r.isDone(e)||r.work(n,e)?r.tree:null;return r.updateViewport(o),a}function mie(t,e=t.viewport.to,n=100){let i=DX(t.state,e,n);return i!=hr(t.state)&&t.dispatch({}),!!i}class kX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let Jc=null;class Lu{constructor(e,n,i=[],r,o,a,c,f){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=o,this.viewport=a,this.skipped=c,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new Lu(e,n,[],Qt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new kX(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Qt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Gs.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Gs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Jc;Jc=this;try{return e()}finally{Jc=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=wD(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:o,viewport:a,skipped:c}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((h,m,p,y)=>f.push({fromA:h,toA:m,fromB:p,toB:y})),i=Gs.applyChanges(i,f),r=Qt.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){c=[];for(let h of this.skipped){let m=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);m<p&&c.push({from:m,to:p})}}}return new Lu(this.parser,n,i,r,o,a,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:o}=this.skipped[i];r<e.to&&o>e.from&&(this.fragments=wD(this.fragments,r,o),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends SV{createParse(n,i,r){let o=r[0].from,a=r[r.length-1].to;return{parsedPos:o,advance(){let f=Jc;if(f){for(let h of r)f.tempSkipped.push(h);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new Qt(Si.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Jc}}function wD(t,e,n){return Gs.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Bu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new Bu(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=Lu.create(e.facet(Vu).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new Bu(i)}}Yi.state=bs.define({create:Bu.init,update(t,e){for(let n of e.effects)if(n.is(Yi.setState))return n.value;return e.startState.facet(Vu)!=e.state.facet(Vu)?Bu.init(e.state):t.apply(e)}});let RV=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(RV=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Bb=typeof navigator<"u"&&(!((Lb=navigator.scheduling)===null||Lb===void 0)&&Lb.isInputPending)?()=>navigator.scheduling.isInputPending():null,PX=kr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Yi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Yi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=RV(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,o=i.field(Yi.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Bb?Math.max(25,e.timeRemaining()-5):1e9),c=o.context.treeLen<r&&i.doc.length>r+1e3,f=o.context.work(()=>Bb&&Bb()||Date.now()>a,r+(c?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Yi.setState.of(new Bu(o.context))})),this.chunkBudget>0&&!(f&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>as(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Vu=We.define({combine(t){return t.length?t[0]:null},enables:t=>[Yi.state,PX,nt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class yie{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class AV{constructor(e,n,i,r,o,a=void 0){this.name=e,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=o,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:i}=e;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new AV(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,n,i)}static matchFilename(e,n){for(let r of e)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,n,i=!0){n=n.toLowerCase();for(let r of e)if(r.alias.some(o=>o==n))return r;if(i)for(let r of e)for(let o of r.alias){let a=n.indexOf(o);if(a>-1&&(o.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+o.length])))return r}return null}}const IX=We.define(),w1=We.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function ea(t){let e=t.facet(w1);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Um(t,e){let n="",i=t.tabSize,r=t.facet(w1)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let o=0;o<e;o++)n+=r;return n}function OV(t,e){t instanceof Ut&&(t=new ey(t));for(let i of t.state.facet(IX)){let r=i(t,e);if(r!==void 0)return r}let n=hr(t.state);return n.length>=e?NX(t,n,e):null}class ey{constructor(e,n={}){this.state=e,this.options=n,this.unit=ea(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return r!=null&&r>=i.from&&r<=i.to?o&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),o=this.countColumn(i,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(o+=a-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,n=e.length){return Fg(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let a=o(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const MV=new mt;function NX(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let o=[];for(let a=r;a&&!(a.from<i.node.from||a.to>i.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)i={node:o[a],next:i}}return DV(i,t,n)}function DV(t,e,n){for(let i=t;i;i=i.next){let r=BX(i.node);if(r)return r(C1.create(e,n,i))}return 0}function LX(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function BX(t){let e=t.type.prop(MV);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(mt.closedBy))){let r=t.lastChild,o=r&&i.indexOf(r.name)>-1;return a=>kV(a,!0,1,void 0,o&&!LX(a)?r.from:void 0)}return t.parent==null?VX:null}function VX(){return 0}class C1 extends ey{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new C1(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(zX(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return DV(this.context.next,this.base,this.pos)}}function zX(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function _X(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=r==null||r<=o.from?o.to:Math.min(o.to,r);for(let c=n.to;;){let f=e.childAfter(c);if(!f||f==i)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let h=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+h}}c=f.to}}function vie({closing:t,align:e=!0,units:n=1}){return i=>kV(i,e,n,t)}function kV(t,e,n,i,r){let o=t.textAfter,a=o.match(/^\s*/)[0].length,c=i&&o.slice(a,a+i.length)==i||r==t.pos+a,f=e?_X(t):null;return f?c?t.column(f.from):t.column(f.to):t.baseIndent+(c?0:t.unit*n)}const bie=t=>t.baseIndent;function Sie({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const HX=We.define(),FX=new mt;function xie(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function UX(t,e,n){let i=hr(t);if(i.length<n)return null;let r=i.resolveStack(n,1),o=null;for(let a=r;a;a=a.next){let c=a.node;if(c.to<=n||c.from>n)continue;if(o&&c.from<e)break;let f=c.type.prop(FX);if(f&&(c.to<i.length-50||i.length==t.doc.length||!jX(c))){let h=f(c,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(o=h)}}return o}function jX(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function KX(t,e,n){for(let i of t.facet(HX)){let r=i(t,e,n);if(r)return r}return UX(t,e,n)}function PV(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const IV=$t.define({map:PV}),NV=$t.define({map:PV});function YX(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(i=>i.from<=n&&i.to>=n)||e.push(t.lineBlockAt(n));return e}const E1=bs.define({create(){return on.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,r)=>t=CD(t,i,r)),t=t.map(e.changes);let n=[];for(let i of e.effects)i.is(IV)&&!GX(t,i.value.from,i.value.to)?n.push(i.value):i.is(NV)&&(t=t.update({filter:(r,o)=>i.value.from!=r||i.value.to!=o,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=e.state.facet(LV),r=n.map(o=>(i?on.replace({widget:new ZX(i(e.state,o))}):ED).range(o.from,o.to));t=t.update({add:r})}return e.selection&&(t=CD(t,e.selection.main.head)),t},provide:t=>nt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let i=t[n++],r=t[n++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(ED.range(i,r))}return on.set(e,!0)}});function CD(t,e,n=e){let i=!1;return t.between(e,n,(r,o)=>{r<n&&o>e&&(i=!0)}),i?t.update({filterFrom:e,filterTo:n,filter:(r,o)=>r>=n||o<=e}):t}function qX(t,e,n){var i;let r=null;return(i=t.field(E1,!1))===null||i===void 0||i.between(e,n,(o,a)=>{(!r||r.from>o)&&(r={from:o,to:a})}),r}function GX(t,e,n){let i=!1;return t.between(e,e,(r,o)=>{r==e&&o==n&&(i=!0)}),i}function WX(t,e){return t.field(E1,!1)?e:e.concat($t.appendConfig.of(QX()))}const wie=t=>{for(let e of YX(t)){let n=KX(t.state,e.from,e.to);if(n)return t.dispatch({effects:WX(t.state,[IV.of(n),XX(t,n)])}),!0}return!1};function XX(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return nt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${r}.`)}const $X={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},LV=We.define({combine(t){return Hg(t,$X)}});function QX(t){return[E1,JX]}function BV(t,e){let{state:n}=t,i=n.facet(LV),r=a=>{let c=t.lineBlockAt(t.posAtDOM(a.target)),f=qX(t.state,c.from,c.to);f&&t.dispatch({effects:NV.of(f)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,r,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}const ED=on.replace({widget:new class extends na{toDOM(t){return BV(t,null)}}});class ZX extends na{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return BV(e,this.value)}}const JX=nt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ty{constructor(e,n){this.specs=e;let i;function r(c){let f=Ho.newName();return(i||(i=Object.create(null)))["."+f]=c,f}const o=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof Yi?c=>c.prop(kl)==a.data:a?c=>c==a:void 0,this.style=CV(e.map(c=>({tag:c.tag,class:c.class||r(Object.assign({},c,{tag:null}))})),{all:o}).style,this.module=i?new Ho(i):null,this.themeType=n.themeType}static define(e,n){return new ty(e,n||{})}}const Sx=We.define(),VV=We.define({combine(t){return t.length?[t[0]]:null}});function Vb(t){let e=t.facet(Sx);return e.length?e:t.facet(VV)}function Cie(t,e){let n=[t2],i;return t instanceof ty&&(t.module&&n.push(nt.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(VV.of(t)):i?n.push(Sx.computeN([nt.darkTheme],r=>r.facet(nt.darkTheme)==(i=="dark")?[t]:[])):n.push(Sx.of(t)),n}class e2{constructor(e){this.markCache=Object.create(null),this.tree=hr(e.state),this.decorations=this.buildDeco(e,Vb(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=hr(e.state),i=Vb(e.state),r=i!=Vb(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!r&&n.type==this.tree.type&&a>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return on.none;let i=new vu;for(let{from:r,to:o}of e.visibleRanges)RX(this.tree,n,(a,c,f)=>{i.add(a,c,this.markCache[f]||(this.markCache[f]=on.mark({class:f})))},r,o);return i.finish()}}const t2=zg.high(kr.fromClass(e2,{decorations:t=>t.decorations})),Eie=ty.define([{tag:ze.meta,color:"#404740"},{tag:ze.link,textDecoration:"underline"},{tag:ze.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ze.emphasis,fontStyle:"italic"},{tag:ze.strong,fontWeight:"bold"},{tag:ze.strikethrough,textDecoration:"line-through"},{tag:ze.keyword,color:"#708"},{tag:[ze.atom,ze.bool,ze.url,ze.contentSeparator,ze.labelName],color:"#219"},{tag:[ze.literal,ze.inserted],color:"#164"},{tag:[ze.string,ze.deleted],color:"#a11"},{tag:[ze.regexp,ze.escape,ze.special(ze.string)],color:"#e40"},{tag:ze.definition(ze.variableName),color:"#00f"},{tag:ze.local(ze.variableName),color:"#30a"},{tag:[ze.typeName,ze.namespace],color:"#085"},{tag:ze.className,color:"#167"},{tag:[ze.special(ze.variableName),ze.macroName],color:"#256"},{tag:ze.definition(ze.propertyName),color:"#00c"},{tag:ze.comment,color:"#940"},{tag:ze.invalid,color:"#f00"}]),n2=1e4,i2="()[]{}",r2=new mt;function xx(t,e,n){let i=t.prop(e<0?mt.openedBy:mt.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function wx(t){let e=t.type.prop(r2);return e?e(t.node):t}function uu(t,e,n,i={}){let r=i.maxScanDistance||n2,o=i.brackets||i2,a=hr(t),c=a.resolveInner(e,n);for(let f=c;f;f=f.parent){let h=xx(f.type,n,o);if(h&&f.from<f.to){let m=wx(f);if(m&&(n>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return s2(t,e,n,f,m,h,o)}}return o2(t,e,n,a,c.type,r,o)}function s2(t,e,n,i,r,o,a){let c=i.parent,f={from:r.from,to:r.to},h=0,m=c?.cursor();if(m&&(n<0?m.childBefore(i.from):m.childAfter(i.to)))do if(n<0?m.to<=i.from:m.from>=i.to){if(h==0&&o.indexOf(m.type.name)>-1&&m.from<m.to){let p=wx(m);return{start:f,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(xx(m.type,n,a))h++;else if(xx(m.type,-n,a)){if(h==0){let p=wx(m);return{start:f,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(n<0?m.prevSibling():m.nextSibling());return{start:f,matched:!1}}function o2(t,e,n,i,r,o,a){if(n<0?!e:e==t.doc.length)return null;let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=a.indexOf(c);if(f<0||f%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},m=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let y=0;!m.next().done&&y<=o;){let b=m.value;n<0&&(y+=b.length);let x=e+y*n;for(let w=n>0?0:b.length-1,C=n>0?b.length:-1;w!=C;w+=n){let E=a.indexOf(b[w]);if(!(E<0||i.resolveInner(x+w,1).type!=r))if(E%2==0==n>0)p++;else{if(p==1)return{start:h,end:{from:x+w,to:x+w+1},matched:E>>1==f>>1};p--}}n>0&&(y+=b.length)}return m.done?{start:h,matched:!1}:null}function l2(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||a2,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||R1,mergeTokens:t.mergeTokens!==!1}}function a2(t){if(typeof t!="object")return t;let e={};for(let n in t){let i=t[n];e[n]=i instanceof Array?i.slice():i}return e}const TD=new WeakMap;class zV extends Yi{constructor(e){let n=TV(e.languageData),i=l2(e),r,o=new class extends SV{createParse(a,c,f){return new c2(r,a,c,f)}};super(n,o,[],e.name),this.topNode=h2(n,this),r=this,this.streamParser=i,this.stateAfter=new mt({perNode:!0}),this.tokenTable=e.tokenTable?new UV(i.tokenTable):d2}static define(e){return new zV(e)}getIndent(e){let n,{overrideIndentation:i}=e.options;i&&(n=TD.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let r=T1(this,e.node.tree,e.node.from,e.node.from,n??e.pos),o,a;if(r?(a=r.state,o=r.pos+1):(a=this.streamParser.startState(e.unit),o=e.node.from),e.pos-o>1e4)return null;for(;o<e.pos;){let f=e.state.doc.lineAt(o),h=Math.min(e.pos,f.to);if(f.length){let m=i?i(f.from):-1,p=new EV(f.text,e.state.tabSize,e.unit,m<0?void 0:m);for(;p.pos<h-f.from;)HV(this.streamParser.token,p,a)}else this.streamParser.blankLine(a,e.unit);if(h==e.pos)break;o=f.to+1}let c=e.lineAt(e.pos);return i&&n==null&&TD.set(e.state,c.from),this.streamParser.indent(a,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function T1(t,e,n,i,r){let o=n>=i&&n+e.length<=r&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let c=e.children[a],f=n+e.positions[a],h=c instanceof Qt&&f<r&&T1(t,c,f,i,r);if(h)return h}return null}function _V(t,e,n,i,r){if(r&&n<=0&&i>=e.length)return e;!r&&n==0&&e.type==t.topNode&&(r=!0);for(let o=e.children.length-1;o>=0;o--){let a=e.positions[o],c=e.children[o],f;if(a<i&&c instanceof Qt){if(!(f=_V(t,c,n-a,i-a,r)))break;return r?new Qt(e.type,e.children.slice(0,o).concat(f),e.positions.slice(0,o+1),a+f.length):f}}return null}function u2(t,e,n,i,r){for(let o of e){let a=o.from+(o.openStart?25:0),c=o.to-(o.openEnd?25:0),f=a<=n&&c>n&&T1(t,o.tree,0-o.offset,n,c),h;if(f&&f.pos<=i&&(h=_V(t,o.tree,n+o.offset,f.pos+o.offset,!1)))return{state:f.state,tree:h}}return{state:t.streamParser.startState(r?ea(r):4),tree:Qt.empty}}class c2{constructor(e,n,i,r){this.lang=e,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let o=Lu.get(),a=r[0].from,{state:c,tree:f}=u2(e,i,a,this.to,o?.state);this.state=c,this.parsedPos=this.chunkStart=a+f.length;for(let h=0;h<f.children.length;h++)this.chunks.push(f.children[h]),this.chunkPos.push(f.positions[h]);o&&this.parsedPos<o.viewport.from-1e5&&r.some(h=>h.from<=o.viewport.from&&h.to>=o.viewport.from)&&(this.state=this.lang.streamParser.startState(ea(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=Lu.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
64
+ `&&(n="");else{let i=n.indexOf(`
65
+ `);i>-1&&(n=n.slice(0,i))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),i=e+n.length;for(let r=this.rangeIndex;;){let o=this.ranges[r].to;if(o>=i||(n=n.slice(0,o-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,c=this.lineAfter(a);n+=c,i=a+c.length}return{line:n,end:i}}skipGapsTo(e,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,o=e+n;if(i>0?r>o:r>=o)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,i,r){let o=4;if(this.ranges.length>1){r=this.skipGapsTo(n,r,1),n+=r;let c=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,o+=this.chunk.length-c}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&o==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(e,n,i,o),r}parseLine(e){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:o}=this.lang,a=new EV(n,e?e.state.tabSize:4,e?ea(e.state):2);if(a.eol())o.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let c=HV(o.token,a,this.state);if(c&&(r=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Qt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:f2,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Qt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Qt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function HV(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const R1=Object.create(null),Kf=[Si.none],f2=new v1(Kf),RD=[],AD=Object.create(null),FV=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])FV[t]=jV(R1,e);class UV{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),FV)}resolve(e){return e?this.table[e]||(this.table[e]=jV(this.extra,e)):0}}const d2=new UV(R1);function zb(t,e){RD.indexOf(t)>-1||(RD.push(t),console.warn(e))}function jV(t,e){let n=[];for(let c of e.split(" ")){let f=[];for(let h of c.split(".")){let m=t[h]||ze[h];m?typeof m=="function"?f.length?f=f.map(m):zb(h,`Modifier ${h} used at start of tag`):f.length?zb(h,`Tag ${h} used as modifier`):f=Array.isArray(m)?m:[m]:zb(h,`Unknown highlighting tag ${h}`)}for(let h of f)n.push(h)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(c=>c.id),o=AD[r];if(o)return o.id;let a=AD[r]=Si.define({id:Kf.length,name:i,props:[EX({[i]:n})]});return Kf.push(a),a.id}function h2(t,e){let n=Si.define({id:Kf.length,name:"Document",props:[kl.add(()=>t),MV.add(()=>i=>e.getIndent(i))],top:!0});return Kf.push(n),n}an.RTL,an.LTR;const p2=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=O1(t.state,n.from);return i.line?m2(t):i.block?y2(t):!1};function A1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}const m2=A1(S2,0),g2=A1(KV,0),y2=A1((t,e)=>KV(t,e,b2(e)),0);function O1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const ef=50;function v2(t,{open:e,close:n},i,r){let o=t.sliceDoc(i-ef,i),a=t.sliceDoc(r,r+ef),c=/\s*$/.exec(o)[0].length,f=/^\s*/.exec(a)[0].length,h=o.length-c;if(o.slice(h-e.length,h)==e&&a.slice(f,f+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:r+f,margin:f&&1}};let m,p;r-i<=2*ef?m=p=t.sliceDoc(i,r):(m=t.sliceDoc(i,i+ef),p=t.sliceDoc(r-ef,r));let y=/^\s*/.exec(m)[0].length,b=/\s*$/.exec(p)[0].length,x=p.length-b-n.length;return m.slice(y,y+e.length)==e&&p.slice(x,x+n.length)==n?{open:{pos:i+y+e.length,margin:/\s/.test(m.charAt(y+e.length))?1:0},close:{pos:r-b-n.length,margin:/\s/.test(p.charAt(x-1))?1:0}}:null}function b2(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function KV(t,e,n=e.selection.ranges){let i=n.map(o=>O1(e,o.from).block);if(!i.every(o=>o))return null;let r=n.map((o,a)=>v2(e,i[a],o.from,o.to));if(t!=2&&!r.every(o=>o))return{changes:e.changes(n.map((o,a)=>r[a]?[]:[{from:o.from,insert:i[a].open+" "},{from:o.to,insert:" "+i[a].close}]))};if(t!=1&&r.some(o=>o)){let o=[];for(let a=0,c;a<r.length;a++)if(c=r[a]){let f=i[a],{open:h,close:m}=c;o.push({from:h.pos-f.open.length,to:h.pos+h.margin},{from:m.pos-m.margin,to:m.pos+f.close.length})}return{changes:o}}return null}function S2(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:o,to:a}of n){let c=i.length,f=1e9,h;for(let m=o;m<=a;){let p=e.doc.lineAt(m);if(h==null&&(h=O1(e,p.from).line,!h))continue e;if(p.from>r&&(o==a||a>p.from)){r=p.from;let y=/^\s*/.exec(p.text)[0].length,b=y==p.length,x=p.text.slice(y,y+h.length)==h?y:-1;y<p.text.length&&y<f&&(f=y),i.push({line:p,comment:x,token:h,indent:y,empty:b,single:!1})}m=p.to+1}if(f<1e9)for(let m=c;m<i.length;m++)i[m].indent<i[m].line.text.length&&(i[m].indent=f);i.length==c+1&&(i[c].single=!0)}if(t!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:f,indent:h,empty:m,single:p}of i)(p||!m)&&o.push({from:c.from+h,insert:f+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:c,token:f}of i)if(c>=0){let h=a.from+c,m=h+f.length;a.text[m-a.from]==" "&&m++,o.push({from:h,to:m})}return{changes:o}}return null}const Cx=Zo.define(),x2=Zo.define(),w2=We.define(),YV=We.define({combine(t){return Hg(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),qV=bs.define({create(){return cs.empty},update(t,e){let n=e.state.facet(YV),i=e.annotation(Cx);if(i){let f=ki.fromTransaction(e,i.selection),h=i.side,m=h==0?t.undone:t.done;return f?m=jm(m,m.length,n.minDepth,f):m=XV(m,e.startState.selection),new cs(h==0?i.rest:m,h==0?m:i.rest)}let r=e.annotation(x2);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Bn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=ki.fromTransaction(e),a=e.annotation(Bn.time),c=e.annotation(Bn.userEvent);return o?t=t.addChanges(o,a,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,c,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new cs(t.done.map(ki.fromJSON),t.undone.map(ki.fromJSON))}});function Tie(t={}){return[qV,YV.of(t),nt.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?GV:e.inputType=="historyRedo"?Ex:null;return i?(e.preventDefault(),i(n)):!1}})]}function ny(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(qV,!1);if(!r)return!1;let o=r.pop(t,n,e);return o?(i(o),!0):!1}}const GV=ny(0,!1),Ex=ny(1,!1),C2=ny(0,!0),E2=ny(1,!0);class ki{constructor(e,n,i,r,o){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new ki(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new ki(e.changes&&In.fromJSON(e.changes),[],e.mapped&&hs.fromJSON(e.mapped),e.startSelection&&xe.fromJSON(e.startSelection),e.selectionsAfter.map(xe.fromJSON))}static fromTransaction(e,n){let i=ur;for(let r of e.startState.facet(w2)){let o=r(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new ki(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,ur)}static selection(e){return new ki(void 0,ur,void 0,void 0,e)}}function jm(t,e,n,i){let r=e+1>n+20?e-n-1:0,o=t.slice(r,e);return o.push(i),o}function T2(t,e){let n=[],i=!1;return t.iterChangedRanges((r,o)=>n.push(r,o)),e.iterChangedRanges((r,o,a,c)=>{for(let f=0;f<n.length;){let h=n[f++],m=n[f++];c>=h&&a<=m&&(i=!0)}}),i}function R2(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function WV(t,e){return t.length?e.length?t.concat(e):t:e}const ur=[],A2=200;function XV(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-A2));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),jm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[ki.selection([e])]}function O2(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function _b(t,e){if(!t.length)return t;let n=t.length,i=ur;for(;n;){let r=M2(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let o=t.slice(0,n);return o[n-1]=r,o}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[ki.selection(i)]:ur}function M2(t,e,n){let i=WV(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):ur,n);if(!t.changes)return ki.selection(i);let r=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new ki(r,$t.mapEffects(t.effects,e),a,t.startSelection.map(o),i)}const D2=/^(input\.type|delete)($|\.)/;class cs{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new cs(this.done,this.undone):this}addChanges(e,n,i,r,o){let a=this.done,c=a[a.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||D2.test(i))&&(!c.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,T2(c.changes,e.changes))||i=="input.type.compose")?a=jm(a,a.length-1,r.minDepth,new ki(e.changes.compose(c.changes),WV($t.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,ur)):a=jm(a,a.length,r.minDepth,e),new cs(a,ur,n,i)}addSelection(e,n,i,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:ur;return o.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&R2(o[o.length-1],e)?this:new cs(XV(this.done,e),this.undone,n,i)}addMapping(e){return new cs(_b(this.done,e),_b(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let o=r[r.length-1],a=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(i&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Cx.of({side:e,rest:O2(r),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=r.length==1?ur:r.slice(0,r.length-1);return o.mapped&&(c=_b(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Cx.of({side:e,rest:c,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}cs.empty=new cs(ur,ur);const Rie=[{key:"Mod-z",run:GV,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Ex,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Ex,preventDefault:!0},{key:"Mod-u",run:C2,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:E2,preventDefault:!0}];function Xu(t,e){return xe.create(t.ranges.map(e),t.mainIndex)}function Br(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Vr({state:t,dispatch:e},n){let i=Xu(t.selection,n);return i.eq(t.selection,!0)?!1:(e(Br(t,i)),!0)}function iy(t,e){return xe.cursor(e?t.to:t.from)}function M1(t,e){return Vr(t,n=>n.empty?t.moveByChar(n,e):iy(n,e))}function ui(t){return t.textDirectionAt(t.state.selection.main.head)==an.LTR}const $V=t=>M1(t,!ui(t)),QV=t=>M1(t,ui(t)),Aie=t=>M1(t,!1);function ZV(t,e){return Vr(t,n=>n.empty?t.moveByGroup(n,e):iy(n,e))}const k2=t=>ZV(t,!ui(t)),P2=t=>ZV(t,ui(t));function I2(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ry(t,e,n){let i=hr(t).resolveInner(e.head),r=n?mt.closedBy:mt.openedBy;for(let f=e.head;;){let h=n?i.childAfter(f):i.childBefore(f);if(!h)break;I2(t,h,r)?i=h:f=n?h.to:h.from}let o=i.type.prop(r),a,c;return o&&(a=n?uu(t,i.from,1):uu(t,i.to,-1))&&a.matched?c=n?a.end.to:a.end.from:c=n?i.to:i.from,xe.cursor(c,n?-1:1)}const N2=t=>Vr(t,e=>ry(t.state,e,!ui(t))),L2=t=>Vr(t,e=>ry(t.state,e,ui(t)));function JV(t,e){return Vr(t,n=>{if(!n.empty)return iy(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const e3=t=>JV(t,!1),t3=t=>JV(t,!0);function n3(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let o of t.state.facet(nt.scrollMargins)){let a=o(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(i=Math.max(a?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function i3(t,e){let n=n3(t),{state:i}=t,r=Xu(i.selection,a=>a.empty?t.moveVertically(a,e,n.height):iy(a,e));if(r.eq(i.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(i.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),f=c.top+n.marginTop,h=c.bottom-n.marginBottom;a&&a.top>f&&a.bottom<h&&(o=nt.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-f}))}return t.dispatch(Br(i,r),{effects:o}),!0}const OD=t=>i3(t,!1),Tx=t=>i3(t,!0);function el(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let o=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(r=xe.cursor(i.from+o))}return r}const B2=t=>Vr(t,e=>el(t,e,!0)),V2=t=>Vr(t,e=>el(t,e,!1)),z2=t=>Vr(t,e=>el(t,e,!ui(t))),_2=t=>Vr(t,e=>el(t,e,ui(t))),H2=t=>Vr(t,e=>t.moveToLineBoundary(e,!1,!1)),F2=t=>Vr(t,e=>t.moveToLineBoundary(e,!0,!1));function U2(t,e,n){let i=!1,r=Xu(t.selection,o=>{let a=uu(t,o.head,-1)||uu(t,o.head,1)||o.head>0&&uu(t,o.head-1,1)||o.head<t.doc.length&&uu(t,o.head+1,-1);if(!a||!a.end)return o;i=!0;let c=a.start.from==o.head?a.end.to:a.end.from;return xe.cursor(c)});return i?(e(Br(t,r)),!0):!1}const j2=({state:t,dispatch:e})=>U2(t,e);function mr(t,e,n){let i=Xu(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=xe.range(r.head,r.anchor));let o=n(r);return xe.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(Br(t.state,i)),!0)}function r3(t,e){return mr(t,e,n=>t.moveByChar(n,e))}const s3=t=>r3(t,!ui(t)),o3=t=>r3(t,ui(t));function l3(t,e){return mr(t,e,n=>t.moveByGroup(n,e))}const K2=t=>l3(t,!ui(t)),Y2=t=>l3(t,ui(t)),q2=t=>{let e=!ui(t);return mr(t,e,n=>ry(t.state,n,e))},G2=t=>{let e=ui(t);return mr(t,e,n=>ry(t.state,n,e))};function a3(t,e){return mr(t,e,n=>t.moveVertically(n,e))}const u3=t=>a3(t,!1),c3=t=>a3(t,!0);function f3(t,e){return mr(t,e,n=>t.moveVertically(n,e,n3(t).height))}const MD=t=>f3(t,!1),DD=t=>f3(t,!0),W2=t=>mr(t,!0,e=>el(t,e,!0)),X2=t=>mr(t,!1,e=>el(t,e,!1)),$2=t=>{let e=!ui(t);return mr(t,e,n=>el(t,n,e))},Q2=t=>{let e=ui(t);return mr(t,e,n=>el(t,n,e))},Z2=t=>mr(t,!1,e=>xe.cursor(t.lineBlockAt(e.head).from)),J2=t=>mr(t,!0,e=>xe.cursor(t.lineBlockAt(e.head).to)),kD=({state:t,dispatch:e})=>(e(Br(t,{anchor:0})),!0),PD=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.doc.length})),!0),ID=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.selection.main.anchor,head:0})),!0),ND=({state:t,dispatch:e})=>(e(Br(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),e$=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),t$=({state:t,dispatch:e})=>{let n=sy(t).map(({from:i,to:r})=>xe.undirectionalRange(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:xe.create(n),userEvent:"select"})),!0},n$=({state:t,dispatch:e})=>{let n=Xu(t.selection,i=>{let r=hr(t),o=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=o.node.from&&a.node.to<=o.node.to&&(o=a)}for(let a=o;a;a=a.next){let{node:c}=a;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&a.next)return xe.undirectionalRange(c.from,c.to)}return i});return n.eq(t.selection)?!1:(e(Br(t,n)),!0)};function d3(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let o of n.selection.ranges){let a=n.doc.lineAt(o.head);if(e?a.to<t.state.doc.length:a.from>0)for(let c=o;;){let f=t.moveVertically(c,e);if(f.head<a.from||f.head>a.to){r.some(h=>h.head==f.head)||r.push(f);break}else{if(f.head==c.head)break;c=f}}}return r.length==i.ranges.length?!1:(t.dispatch(Br(n,xe.create(r,r.length-1))),!0)}const i$=t=>d3(t,!1),r$=t=>d3(t,!0),s$=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=xe.create([n.main]):n.main.empty||(i=xe.create([xe.cursor(n.main.head)])),i?(e(Br(t,i)),!0):!1};function wd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(o=>{let{from:a,to:c}=o;if(a==c){let f=e(o);f<a?(n="delete.backward",f=Lp(t,f,!1)):f>a&&(n="delete.forward",f=Lp(t,f,!0)),a=Math.min(a,f),c=Math.max(c,f)}else a=Lp(t,a,!1),c=Lp(t,c,!0);return a==c?{range:o}:{changes:{from:a,to:c},range:xe.cursor(a,a<o.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?nt.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Lp(t,e,n){if(t instanceof nt)for(let i of t.state.facet(nt.atomicRanges).map(r=>r(t)))i.between(e,e,(r,o)=>{r<e&&o>e&&(e=n?o:r)});return e}const h3=(t,e,n)=>wd(t,i=>{let r=i.from,{state:o}=t,a=o.doc.lineAt(r),c,f;if(n&&!e&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(c=a.text.slice(0,r-a.from))){if(c[c.length-1]==" ")return r-1;let h=Fg(c,o.tabSize),m=h%ea(o)||ea(o);for(let p=0;p<m&&c[c.length-1-p]==" ";p++)r--;f=r}else f=li(a.text,r-a.from,e,e)+a.from,f==r&&a.number!=(e?o.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,r-a.from))&&(f=li(a.text,f-a.from,!1,!1)+a.from);return f}),Rx=t=>h3(t,!1,!0),p3=t=>h3(t,!0,!1),m3=(t,e)=>wd(t,n=>{let i=n.head,{state:r}=t,o=r.doc.lineAt(i),a=r.charCategorizer(i);for(let c=null;;){if(i==(e?o.to:o.from)){i==n.head&&o.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let f=li(o.text,i-o.from,e)+o.from,h=o.text.slice(Math.min(i,f)-o.from,Math.max(i,f)-o.from),m=a(h);if(c!=null&&m!=c)break;(h!=" "||i!=n.head)&&(c=m),i=f}return i}),g3=t=>m3(t,!1),o$=t=>m3(t,!0),l$=t=>wd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),a$=t=>wd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),u$=t=>wd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),c$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:kt.of(["",""])},range:xe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},f$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,o=t.doc.lineAt(r),a=r==o.from?r-1:li(o.text,r-o.from,!1)+o.from,c=r==o.to?r+1:li(o.text,r-o.from,!0)+o.from;return{changes:{from:a,to:c,insert:t.doc.slice(r,c).append(t.doc.slice(a,r))},range:xe.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sy(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=t.doc.lineAt(i.to-1)),n>=r.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(i)}else e.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return e}function y3(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let o of sy(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),c=a.length+1;if(n){i.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let f of o.ranges)r.push(xe.range(Math.min(t.doc.length,f.anchor+c),Math.min(t.doc.length,f.head+c)))}else{i.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let f of o.ranges)r.push(xe.range(f.anchor-c,f.head-c))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:xe.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const d$=({state:t,dispatch:e})=>y3(t,e,!1),h$=({state:t,dispatch:e})=>y3(t,e,!0);function v3(t,e,n){if(t.readOnly)return!1;let i=[];for(let o of sy(t))n?i.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):i.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const p$=({state:t,dispatch:e})=>v3(t,e,!1),m$=({state:t,dispatch:e})=>v3(t,e,!0),g$=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(sy(e).map(({from:r,to:o})=>(r>0?r--:o<e.doc.length&&o++,{from:r,to:o}))),i=Xu(e.selection,r=>{let o;if(t.lineWrapping){let a=t.lineBlockAt(r.head),c=t.coordsAtPos(r.head,r.assoc||1);c&&(o=a.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,o)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function y$(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=hr(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),o;return i&&r&&i.to<=e&&r.from>=e&&(o=i.type.prop(mt.closedBy))&&o.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const LD=b3(!1),v$=b3(!0);function b3(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:o,to:a}=r,c=e.doc.lineAt(o),f=!t&&o==a&&y$(e,o);t&&(o=a=(a<=c.to?c:e.doc.lineAt(a)).to);let h=new ey(e,{simulateBreak:o,simulateDoubleBreak:!!f}),m=OV(h,o);for(m==null&&(m=Fg(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));a<c.to&&/\s/.test(c.text[a-c.from]);)a++;f?{from:o,to:a}=f:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let p=["",Um(e,m)];return f&&p.push(Um(e,h.lineIndent(c.from,-1))),{changes:{from:o,to:a,insert:kt.of(p)},range:xe.cursor(o+1+p[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function D1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let a=i.from;a<=i.to;){let c=t.doc.lineAt(a);c.number>n&&(i.empty||i.to>c.from)&&(e(c,r,i),n=c.number),a=c.to+1}let o=t.changes(r);return{changes:r,range:xe.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const b$=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new ey(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),r=D1(t,(o,a,c)=>{let f=OV(i,o.from);if(f==null)return;/\S/.test(o.text)||(f=0);let h=/^\s*/.exec(o.text)[0],m=Um(t,f);(h!=m||c.from<o.from+h.length)&&(n[o.from]=f,a.push({from:o.from,to:o.from+h.length,insert:m}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},S3=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(D1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(w1)})}),{userEvent:"input.indent"})),!0),x3=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(D1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let o=Fg(r,t.tabSize),a=0,c=Um(t,Math.max(0,o-ea(t)));for(;a<r.length&&a<c.length&&r.charCodeAt(a)==c.charCodeAt(a);)a++;i.push({from:n.from+a,to:n.from+r.length,insert:c.slice(a)})}),{userEvent:"delete.dedent"})),!0),S$=t=>(t.setTabFocusMode(),!0),x$=[{key:"Ctrl-b",run:$V,shift:s3,preventDefault:!0},{key:"Ctrl-f",run:QV,shift:o3},{key:"Ctrl-p",run:e3,shift:u3},{key:"Ctrl-n",run:t3,shift:c3},{key:"Ctrl-a",run:H2,shift:Z2},{key:"Ctrl-e",run:F2,shift:J2},{key:"Ctrl-d",run:p3},{key:"Ctrl-h",run:Rx},{key:"Ctrl-k",run:l$},{key:"Ctrl-Alt-h",run:g3},{key:"Ctrl-o",run:c$},{key:"Ctrl-t",run:f$},{key:"Ctrl-v",run:Tx}],w$=[{key:"ArrowLeft",run:$V,shift:s3,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:k2,shift:K2,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:z2,shift:$2,preventDefault:!0},{key:"ArrowRight",run:QV,shift:o3,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:P2,shift:Y2,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_2,shift:Q2,preventDefault:!0},{key:"ArrowUp",run:e3,shift:u3,preventDefault:!0},{mac:"Cmd-ArrowUp",run:kD,shift:ID},{mac:"Ctrl-ArrowUp",run:OD,shift:MD},{key:"ArrowDown",run:t3,shift:c3,preventDefault:!0},{mac:"Cmd-ArrowDown",run:PD,shift:ND},{mac:"Ctrl-ArrowDown",run:Tx,shift:DD},{key:"PageUp",run:OD,shift:MD},{key:"PageDown",run:Tx,shift:DD},{key:"Home",run:V2,shift:X2,preventDefault:!0},{key:"Mod-Home",run:kD,shift:ID},{key:"End",run:B2,shift:W2,preventDefault:!0},{key:"Mod-End",run:PD,shift:ND},{key:"Enter",run:LD,shift:LD},{key:"Mod-a",run:e$},{key:"Backspace",run:Rx,shift:Rx,preventDefault:!0},{key:"Delete",run:p3,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:g3,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:o$,preventDefault:!0},{mac:"Mod-Backspace",run:a$,preventDefault:!0},{mac:"Mod-Delete",run:u$,preventDefault:!0}].concat(x$.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Oie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:N2,shift:q2},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:L2,shift:G2},{key:"Alt-ArrowUp",run:d$},{key:"Shift-Alt-ArrowUp",run:p$},{key:"Alt-ArrowDown",run:h$},{key:"Shift-Alt-ArrowDown",run:m$},{key:"Mod-Alt-ArrowUp",run:i$},{key:"Mod-Alt-ArrowDown",run:r$},{key:"Escape",run:s$},{key:"Mod-Enter",run:v$},{key:"Alt-l",mac:"Ctrl-l",run:t$},{key:"Mod-i",run:n$,preventDefault:!0},{key:"Mod-[",run:x3},{key:"Mod-]",run:S3},{key:"Mod-Alt-\\",run:b$},{key:"Shift-Mod-k",run:g$},{key:"Shift-Mod-\\",run:j2},{key:"Mod-/",run:p2},{key:"Alt-A",mac:"Ctrl-A",run:g2},{key:"Ctrl-m",mac:"Shift-Alt-m",run:S$}].concat(w$),Mie={key:"Tab",run:S3,shift:x3};function C$(t,e,n){const i=new Array(t);return new Proxy(i,{get(r,o,a){if(typeof o=="string"){const c=o.charCodeAt(0);if(c>=48&&c<=57){const f=+o;if(Number.isInteger(f)&&f>=0&&f<t){let h=r[f];if(!h){const m=e[f*2];h=r[f]={index:f,key:n(f),start:m,size:e[f*2+1],end:m+e[f*2+1],lane:0}}return h}}if(o==="length")return t}return Reflect.get(r,o,a)}})}function Ja(t,e,n){let i=n.initialDeps??[],r,o=!0;function a(){const c=t();return(c.length!==i.length||c.some((h,m)=>i[m]!==h))&&(i=c,r=e(...c),n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(r),o=!1),r}return a.updateDeps=c=>{i=c},a}function BD(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const E$=(t,e)=>Math.abs(t-e)<1.01,T$=(t,e,n)=>{let i;return function(...r){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,r),n)}};let tf;const Hb=()=>{if(tf!==void 0)return tf;if(typeof navigator>"u")return tf=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tf=!0;const t=navigator.maxTouchPoints;return tf=navigator.platform==="MacIntel"&&t!==void 0&&t>0},VD=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},R$=t=>t,A$=t=>{const e=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,r=new Array(i);for(let o=0;o<i;o++)r[o]=e+o;return r},O$=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const r=a=>{const{width:c,height:f}=a;e({width:Math.round(c),height:Math.round(f)})};if(r(VD(n)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(a=>{const c=()=>{const f=a[0];if(f?.borderBoxSize){const h=f.borderBoxSize[0];if(h){r({width:h.inlineSize,height:h.blockSize});return}}r(VD(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Km={passive:!0},M$=typeof window>"u"?!0:"onscrollend"in window,D$=(t,e,n)=>{const i=t.scrollElement;if(!i)return;const r=t.targetWindow;if(!r)return;const o=t.options.useScrollendEvent&&M$;let a=0;const c=o?null:T$(r,()=>e(a,!1),t.options.isScrollingResetDelay),f=p=>()=>{a=n(i),c?.(),e(a,p)},h=f(!0),m=f(!1);return i.addEventListener("scroll",h,Km),o&&i.addEventListener("scrollend",m,Km),()=>{i.removeEventListener("scroll",h),o&&i.removeEventListener("scrollend",m)}},k$=(t,e)=>D$(t,e,n=>{const{horizontal:i,isRtl:r}=t.options;return i?n.scrollLeft*(r&&-1||1):n.scrollTop}),P$=(t,e,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(t),r=n.options.getItemKey(i);return n.itemSizeCache.get(r)??n.options.estimateSize(i)}if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const i=n.indexFromElement(t),r=n.options.getItemKey(i),o=n.itemSizeCache.get(r);if(o!==void 0)return o}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},I$=(t,{adjustments:e=0,behavior:n},i)=>{var r,o;(o=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[i.options.horizontal?"left":"top"]:t+e,behavior:n})},N$=I$;class L${constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,i,r;return((r=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:r.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{const a=()=>{const c=o.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[h,m]of this.elementsCache)if(m===c){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),n=null},observe:r=>{var o;return(o=i())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=i())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{var i,r;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:R$,rangeExtractor:A$,onChange:()=>{},measureElement:P$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in n){const b=n[y];b!==void 0&&(o[y]=b)}const a=this.options;let c=null,f=null,h=!1;if(a!==void 0&&a.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const y=a.count,b=o.count,x=this.getMeasurements(),w=y>0?((i=x[0])==null?void 0:i.key)??a.getItemKey(0):null,C=y>0?((r=x[y-1])==null?void 0:r.key)??a.getItemKey(y-1):null;if(b!==y||y>0&&b>0&&(o.getItemKey(0)!==w||o.getItemKey(b-1)!==C)){h=!0;const T=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;T&&(c=[T.key,this.getScrollOffset()-T.start]);const A=o.followOnAppend===!0?"auto":o.followOnAppend||null;A&&b>y&&this.isAtEnd(a.scrollEndThreshold)&&(y===0||o.getItemKey(b-1)!==C)&&(f=A)}}this.options=o,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let m=!1,p=0;if(c&&this.scrollOffset!==null){const[y,b]=c,x=this.getMeasurements(),{count:w,getItemKey:C}=this.options;let E=0;for(;E<w&&C(E)!==y;)E++;if(E<w){const O=x[E];if(O){const T=O.start+b;T!==this.scrollOffset&&(p=T-this.scrollOffset,this.scrollOffset=T,m=!0)}}}(m||f)&&(this.pendingScrollAnchor=[m?c[0]:null,m?c[1]:0,f,p])},this.notify=n=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,n)},this.maybeNotify=Ja(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,a)=>{if(a&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=a?c===o?this.scrollDirection:c<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Hb()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",a,Km),o.addEventListener("touchend",c,Km),this.unsubs.push(()=>{o.removeEventListener("touchstart",a),o.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const r=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,r&&this.scrollElement&&this.options.enabled){const[o,a,c,f]=r;o!==null&&!c&&(Hb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;const r=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=r,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,i)=>{const r=new Map,o=new Map;for(let a=i-1;a>=0;a--){const c=n[a];if(r.has(c.lane))continue;const f=o.get(c.lane);if(f==null||c.end>f.end?o.set(c.lane,c):c.end<f.end&&r.set(c.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=Ja(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,i,r,o,a,c,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f}),{key:!1}),this.getMeasurements=Ja(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:r,getItemKey:o,enabled:a,lanes:c,laneAssignmentMode:f},h)=>{const m=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const x=this.options.gap,w=n*2;let C=this._flatMeasurements;if(!C||C.length<w){const T=new Float64Array(w);C&&p>0&&T.set(C.subarray(0,p*2)),C=T,this._flatMeasurements=C}let E;if(p===0)E=i+r;else{const T=p-1;E=C[T*2]+C[T*2+1]+x}for(let T=p;T<n;T++){const A=o(T),D=m.get(A),k=typeof D=="number"?D:this.options.estimateSize(T);C[T*2]=E,C[T*2+1]=k,E+=k+x}const O=C$(n,C,o);return this.measurementsCache=O,O}const y=this.measurementsCache.slice(0,p),b=new Array(c).fill(void 0);for(let x=0;x<p;x++){const w=y[x];w&&(b[w.lane]=x)}for(let x=p;x<n;x++){const w=o(x),C=this.laneAssignments.get(x);let E,O;const T=f==="estimate"||m.has(w);if(C!==void 0&&this.options.lanes>1){E=C;const M=b[E],I=M!==void 0?y[M]:void 0;O=I?I.end+this.options.gap:i+r}else{const M=this.options.lanes===1?y[x-1]:this.getFurthestMeasurement(y,x);O=M?M.end+this.options.gap:i+r,E=M?M.lane:x%this.options.lanes,this.options.lanes>1&&T&&this.laneAssignments.set(x,E)}const A=m.get(w),D=typeof A=="number"?A:this.options.estimateSize(x),k=O+D;y[x]={index:x,start:O,size:D,end:k,key:w,lane:E},b[E]=x}return this.measurementsCache=y,y},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ja(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,r,o)=>{if(n.length===0||i===0)return this.range=null,null;const a=Math.max(this.getTotalSize()-i,0),c=Math.min(Math.max(r,0),a);return this.range=V$(n,i,c,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ja(()=>{let n=null,i=null;const r=this.calculateRange();return r&&(n=r.startIndex,i=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,r,o,a)=>o===null||a===null?[]:n({startIndex:o,endIndex:a,overscan:i,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,r=n.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const r=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(r!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,r-o),c=Math.min(this.options.count-1,r+o);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n),r=this.options.getItemKey(i),o=this.elementsCache.get(r);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(r,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var r,o;if(n<0||n>=this.options.count)return;let a,c,f;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)f=this.options.getItemKey(n),c=h[n*2],a=h[n*2+1];else{const y=this.measurementsCache[n];if(!y)return;f=y.key,c=y.start,a=y.size}const m=this.itemSizeCache.get(f)??a,p=i-m;if(p!==0){const y=this.options.anchorTo==="end"&&((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=y?this.getTotalSize():0,x=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:a,end:c+a,lane:0},p,this):c<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(f)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++,y?this.applyScrollAdjustment(this.getTotalSize()-b):x&&this.applyScrollAdjustment(p),this.notify(!1)}},this.getVirtualItems=Ja(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const r=[];for(let o=0,a=n.length;o<a;o++){const c=n[o],f=i[c];r.push(f)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const r=this._flatMeasurements,o=this.options.lanes===1&&r!=null,a=w3(0,i.length-1,o?c=>r[c*2]:c=>BD(i[c]).start,n);return BD(i[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,r=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=n>=a+o?"end":"start"),i==="center"?n+=(r-o)/2:i==="end"&&(n-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.getSize(),o=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(i==="auto")if(a.end>=o+r-this.options.scrollPaddingEnd)i="end";else if(a.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,a.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:r="auto"}={})=>{const o=this.getOffsetForAlignment(n,i),a=this.now();this.scrollState={index:null,align:i,behavior:r,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:r="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,i);if(!o)return;const[a,c]=o,f=this.now();this.scrollState={index:n,align:c,behavior:r,startedAt:f,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const r=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let r;if(i.length===0)r=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,a=this._flatMeasurements;a!=null?r=a[o*2]+a[o*2+1]:r=((n=i[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let a=i.length-1;for(;a>=0&&o.some(c=>c===null);){const c=i[a];o[c.lane]===null&&(o[c.lane]=c.end),a--}r=Math.max(...o.filter(c=>c!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const r of i)r&&this.itemSizeCache.has(r.key)&&n.push({index:r.index,key:r.key,start:r.start,size:r.size,end:r.end,lane:r.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:r})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:r,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(Hb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,r=i?i[0]:this.scrollState.lastTargetOffset,o=1,a=r!==this.scrollState.lastTargetOffset;if(!a&&E$(r,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==r&&this._scrollToOffset(r,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const c=this.getSize()||600,f=Math.abs(r-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=r,h||(this.scrollState.behavior="auto"),this._scrollToOffset(r,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const w3=(t,e,n,i)=>{for(;t<=e;){const r=(t+e)/2|0,o=n(r);if(o<i)t=r+1;else if(o>i)e=r-1;else return r}return t>0?t-1:0};function B$(t,e,n){let i=0;for(;i<=e;){const r=(i+e)/2|0,o=t[r*2];if(o<n)i=r+1;else if(o>n)e=r-1;else return r}return i>0?i-1:0}function V$(t,e,n,i,r){const o=t.length-1;if(t.length<=i)return{startIndex:0,endIndex:o};if(i===1&&r!==null){const h=B$(r,o,n);let m=h;const p=n+e;for(;m<o&&r[m*2]+r[m*2+1]<p;)m++;return{startIndex:h,endIndex:m}}let c=w3(0,o,h=>t[h].start,n),f=c;if(i===1)for(;f<o&&t[f].end<n+e;)f++;else if(i>1){const h=Array(i).fill(0);for(;f<o&&h.some(p=>p<n+e);){const p=t[f];h[p.lane]=p.end,f++}const m=Array(i).fill(n+e);for(;c>=0&&m.some(p=>p>=n);){const p=t[c];m[p.lane]=p.start,c--}c=Math.max(0,c-c%i),f=Math.min(o,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const Fb=typeof document<"u"?S.useLayoutEffect:S.useEffect;function z$({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...i}){const r=S.useReducer(h=>h+1,0)[1],o=S.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=e,o.current.mode=n;const a=h=>{const m=o.current;if(!m.enabled||!m.container)return;const p=h.getTotalSize();if(p!==m.lastSize){m.lastSize=p;const E=h.options.horizontal?"width":"height";m.container.style[E]=`${p}px`}const y=!!h.options.horizontal,b=m.mode==="transform",x=y?"left":"top",w=h.options.scrollMargin,C=h.getVirtualItems();for(const E of C){const O=E.start-w,T=h.elementsCache.get(E.key);T&&m.lastPositions.get(T)!==O&&(m.lastPositions.set(T,O),b?T.style.transform=y?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:T.style[x]=`${O}px`)}},c={...i,onChange:(h,m)=>{var p;const y=o.current;let b=!0;if(y.enabled){a(h);const x=h.range,w=y.prevRange;b=!w||w.isScrolling!==h.isScrolling||w.startIndex!==x?.startIndex||w.endIndex!==x?.endIndex,b&&(y.prevRange=x?{startIndex:x.startIndex,endIndex:x.endIndex,isScrolling:h.isScrolling}:null)}b&&(t&&m?Ln.flushSync(r):r()),(p=i.onChange)==null||p.call(i,h,m)}},[f]=S.useState(()=>{const h=new L$(c);return Object.assign(h,{containerRef:m=>{const p=o.current;if(p.container=m,p.lastSize=null,m&&p.enabled){const y=h.getTotalSize();p.lastSize=y;const b=h.options.horizontal?"width":"height";m.style[b]=`${y}px`}}})});return f.setOptions(c),Fb(()=>f._didMount(),[]),Fb(()=>f._willUpdate()),Fb(()=>{a(f)}),f}function Die(t){return z$({observeElementRect:O$,observeElementOffset:k$,scrollToFn:N$,...t})}function k1(t,e){t.indexOf(e)===-1&&t.push(e)}function zu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ys=(t,e,n)=>n>e?e:n<t?t:n;let oy=()=>{};const Yo={},C3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),E3=t=>typeof t=="object"&&t!==null,T3=t=>/^0[^.\s]+$/u.test(t);function R3(t){let e;return()=>(e===void 0&&(e=t()),e)}const fr=t=>t,Cd=(...t)=>t.reduce((e,n)=>i=>n(e(i))),_u=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class P1{constructor(){this.subscriptions=[]}add(e){return k1(this.subscriptions,e),()=>zu(this.subscriptions,e)}notify(e,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,i);else for(let o=0;o<r;o++){const a=this.subscriptions[o];a&&a(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ii=t=>t*1e3,cr=t=>t/1e3,A3=(t,e)=>e?t*(1e3/e):0,_$=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},O3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,H$=1e-7,F$=12;function U$(t,e,n,i,r){let o,a,c=0;do a=e+(n-e)/2,o=O3(a,i,r)-t,o>0?n=a:e=a;while(Math.abs(o)>H$&&++c<F$);return a}function Ed(t,e,n,i){if(t===e&&n===i)return fr;const r=o=>U$(o,0,1,t,n);return o=>o===0||o===1?o:O3(r(o),e,i)}const M3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I1=t=>e=>1-t(1-e),D3=Ed(.33,1.53,.69,.99),N1=I1(D3),k3=M3(N1),P3=t=>t>=1?1:(t*=2)<1?.5*N1(t):.5*(2-Math.pow(2,-10*(t-1))),L1=t=>1-Math.sin(Math.acos(t)),I3=I1(L1),N3=M3(L1),j$=Ed(.42,0,1,1),K$=Ed(0,0,.58,1),L3=Ed(.42,0,.58,1),B3=t=>Array.isArray(t)&&typeof t[0]!="number";function V3(t,e){return B3(t)?t[_$(0,t.length,e)]:t}const z3=t=>Array.isArray(t)&&typeof t[0]=="number",Y$={linear:fr,easeIn:j$,easeInOut:L3,easeOut:K$,circIn:L1,circInOut:N3,circOut:I3,backIn:N1,backInOut:k3,backOut:D3,anticipate:P3},q$=t=>typeof t=="string",zD=t=>{if(z3(t)){oy(t.length===4);const[e,n,i,r]=t;return Ed(e,n,i,r)}else if(q$(t))return Y$[t];return t},Bp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function G$(t){let e=new Set,n=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(h){o.has(h)&&(f.schedule(h),t()),h(a)}const f={schedule:(h,m=!1,p=!1)=>{const b=p&&i?e:n;return m&&o.add(h),b.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(a=h,i){r=!0;return}i=!0;const m=e;e=n,n=m,e.forEach(c),e.clear(),i=!1,r&&(r=!1,f.process(h))}};return f}const W$=40;function _3(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=Bp.reduce((T,A)=>(T[A]=G$(o),T),{}),{setup:c,read:f,resolveKeyframes:h,preUpdate:m,update:p,preRender:y,render:b,postRender:x}=a,w=()=>{const T=Yo.useManualTiming,A=T?r.timestamp:performance.now();n=!1,T||(r.delta=i?1e3/60:Math.max(Math.min(A-r.timestamp,W$),1)),r.timestamp=A,r.isProcessing=!0,c.process(r),f.process(r),h.process(r),m.process(r),p.process(r),y.process(r),b.process(r),x.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(w))},C=()=>{n=!0,i=!0,r.isProcessing||t(w)};return{schedule:Bp.reduce((T,A)=>{const D=a[A];return T[A]=(k,M=!1,I=!1)=>(n||C(),D.schedule(k,M,I)),T},{}),cancel:T=>{for(let A=0;A<Bp.length;A++)a[Bp[A]].cancel(T)},state:r,steps:a}}const{schedule:Zt,cancel:qo,state:ei,steps:Ub}=_3(typeof requestAnimationFrame<"u"?requestAnimationFrame:fr,!0);let em;function X$(){em=void 0}const mi={now:()=>(em===void 0&&mi.set(ei.isProcessing||Yo.useManualTiming?ei.timestamp:performance.now()),em),set:t=>{em=t,queueMicrotask(X$)}},H3=t=>e=>typeof e=="string"&&e.startsWith(t),F3=H3("--"),$$=H3("var(--"),B1=t=>$$(t)?Q$.test(t.split("/*")[0].trim()):!1,Q$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _D(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const $u={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yf={...$u,transform:t=>ys(0,1,t)},Vp={...$u,default:1},wf=t=>Math.round(t*1e5)/1e5,V1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Z$(t){return t==null}const J$=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,z1=(t,e)=>n=>!!(typeof n=="string"&&J$.test(n)&&n.startsWith(t)||e&&!Z$(n)&&Object.prototype.hasOwnProperty.call(n,e)),U3=(t,e,n)=>i=>{if(typeof i!="string")return i;const[r,o,a,c]=i.match(V1);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},eQ=t=>ys(0,255,t),jb={...$u,transform:t=>Math.round(eQ(t))},Pl={test:z1("rgb","red"),parse:U3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+jb.transform(t)+", "+jb.transform(e)+", "+jb.transform(n)+", "+wf(Yf.transform(i))+")"};function tQ(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Ax={test:z1("#"),parse:tQ,transform:Pl.transform},Td=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Vs=Td("deg"),ms=Td("%"),je=Td("px"),nQ=Td("vh"),iQ=Td("vw"),HD={...ms,parse:t=>ms.parse(t)/100,transform:t=>ms.transform(t*100)},cu={test:z1("hsl","hue"),parse:U3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ms.transform(wf(e))+", "+ms.transform(wf(n))+", "+wf(Yf.transform(i))+")"},Mn={test:t=>Pl.test(t)||Ax.test(t)||cu.test(t),parse:t=>Pl.test(t)?Pl.parse(t):cu.test(t)?cu.parse(t):Ax.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Pl.transform(t):cu.transform(t),getAnimatableNone:t=>{const e=Mn.parse(t);return e.alpha=0,Mn.transform(e)}},rQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sQ(t){return isNaN(t)&&typeof t=="string"&&(t.match(V1)?.length||0)+(t.match(rQ)?.length||0)>0}const j3="number",K3="color",oQ="var",lQ="var(",FD="${}",aQ=/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 Hu(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const c=e.replace(aQ,f=>(Mn.test(f)?(i.color.push(o),r.push(K3),n.push(Mn.parse(f))):f.startsWith(lQ)?(i.var.push(o),r.push(oQ),n.push(f)):(i.number.push(o),r.push(j3),n.push(parseFloat(f))),++o,FD)).split(FD);return{values:n,split:c,indexes:i,types:r}}function uQ(t){return Hu(t).values}function Y3({split:t,types:e}){const n=t.length;return i=>{let r="";for(let o=0;o<n;o++)if(r+=t[o],i[o]!==void 0){const a=e[o];a===j3?r+=wf(i[o]):a===K3?r+=Mn.transform(i[o]):r+=i[o]}return r}}function cQ(t){return Y3(Hu(t))}const fQ=t=>typeof t=="number"?0:Mn.test(t)?Mn.getAnimatableNone(t):t,dQ=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:fQ(t);function hQ(t){const e=Hu(t);return Y3(e)(e.values.map((i,r)=>dQ(i,e.split[r])))}const Mr={test:sQ,parse:uQ,createTransformer:cQ,getAnimatableNone:hQ};function Kb(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 pQ({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let r=0,o=0,a=0;if(!e)r=o=a=n;else{const c=n<.5?n*(1+e):n+e-n*e,f=2*n-c;r=Kb(f,c,t+1/3),o=Kb(f,c,t),a=Kb(f,c,t-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:i}}function Ym(t,e){return n=>n>0?e:t}const Yt=(t,e,n)=>t+(e-t)*n,Yb=(t,e,n)=>{const i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},mQ=[Ax,Pl,cu],gQ=t=>mQ.find(e=>e.test(t));function UD(t){const e=gQ(t);if(!e)return!1;let n=e.parse(t);return e===cu&&(n=pQ(n)),n}const jD=(t,e)=>{const n=UD(t),i=UD(e);if(!n||!i)return Ym(t,e);const r={...n};return o=>(r.red=Yb(n.red,i.red,o),r.green=Yb(n.green,i.green,o),r.blue=Yb(n.blue,i.blue,o),r.alpha=Yt(n.alpha,i.alpha,o),Pl.transform(r))},Ox=new Set(["none","hidden"]);function yQ(t,e){return Ox.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function vQ(t,e){return n=>Yt(t,e,n)}function _1(t){return typeof t=="number"?vQ:typeof t=="string"?B1(t)?Ym:Mn.test(t)?jD:xQ:Array.isArray(t)?q3:typeof t=="object"?Mn.test(t)?jD:bQ:Ym}function q3(t,e){const n=[...t],i=n.length,r=t.map((o,a)=>_1(o)(o,e[a]));return o=>{for(let a=0;a<i;a++)n[a]=r[a](o);return n}}function bQ(t,e){const n={...t,...e},i={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(i[r]=_1(t[r])(t[r],e[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function SQ(t,e){const n=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],c=t.values[a]??0;n[r]=c,i[o]++}return n}const xQ=(t,e)=>{const n=Mr.createTransformer(e),i=Hu(t),r=Hu(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Ox.has(t)&&!r.values.length||Ox.has(e)&&!i.values.length?yQ(t,e):Cd(q3(SQ(i,r),r.values),n):Ym(t,e)};function G3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Yt(t,e,n):_1(t)(t,e)}const wQ=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Zt.update(e,n),stop:()=>qo(e),now:()=>ei.isProcessing?ei.timestamp:mi.now()}},W3=(t,e,n=10)=>{let i="";const r=Math.max(Math.round(e/n),2);for(let o=0;o<r;o++)i+=Math.round(t(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},qm=2e4;function H1(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<qm;)e+=n,i=t.next(e);return e>=qm?1/0:e}function X3(t,e=100,n){const i=n({...t,keyframes:[0,e]}),r=Math.min(H1(i),qm);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:cr(r)}}const yn={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 Mx(t,e){return t*Math.sqrt(1-e*e)}const CQ=12;function EQ(t,e,n){let i=n;for(let r=1;r<CQ;r++)i=i-t(i)/e(i);return i}const qb=.001;function TQ({duration:t=yn.duration,bounce:e=yn.bounce,velocity:n=yn.velocity,mass:i=yn.mass}){let r,o,a=1-e;a=ys(yn.minDamping,yn.maxDamping,a),t=ys(yn.minDuration,yn.maxDuration,cr(t)),a<1?(r=h=>{const m=h*a,p=m*t,y=m-n,b=Mx(h,a),x=Math.exp(-p);return qb-y/b*x},o=h=>{const p=h*a*t,y=p*n+n,b=Math.pow(a,2)*Math.pow(h,2)*t,x=Math.exp(-p),w=Mx(Math.pow(h,2),a);return(-r(h)+qb>0?-1:1)*((y-b)*x)/w}):(r=h=>{const m=Math.exp(-h*t),p=(h-n)*t+1;return-qb+m*p},o=h=>{const m=Math.exp(-h*t),p=(n-h)*(t*t);return m*p});const c=5/t,f=EQ(r,o,c);if(t=Ii(t),isNaN(f))return{stiffness:yn.stiffness,damping:yn.damping,duration:t};{const h=Math.pow(f,2)*i;return{stiffness:h,damping:a*2*Math.sqrt(i*h),duration:t}}}const RQ=["duration","bounce"],AQ=["stiffness","damping","mass"];function KD(t,e){return e.some(n=>t[n]!==void 0)}function OQ(t){let e={velocity:yn.velocity,stiffness:yn.stiffness,damping:yn.damping,mass:yn.mass,isResolvedFromDuration:!1,...t};if(!KD(t,AQ)&&KD(t,RQ))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ys(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:yn.mass,stiffness:r,damping:o}}else{const n=TQ({...t,velocity:0});e={...e,...n,mass:yn.mass},e.isResolvedFromDuration=!0}return e}function qf(t=yn.visualDuration,e=yn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:f,damping:h,mass:m,duration:p,velocity:y,isResolvedFromDuration:b}=OQ({...n,velocity:-cr(n.velocity||0)}),x=y||0,w=h/(2*Math.sqrt(f*m)),C=a-o,E=cr(Math.sqrt(f/m)),O=Math.abs(C)<5;i||(i=O?yn.restSpeed.granular:yn.restSpeed.default),r||(r=O?yn.restDelta.granular:yn.restDelta.default);let T,A,D,k,M,I;if(w<1)D=Mx(E,w),k=(x+w*E*C)/D,T=B=>{const H=Math.exp(-w*E*B);return a-H*(k*Math.sin(D*B)+C*Math.cos(D*B))},M=w*E*k+C*D,I=w*E*C-k*D,A=B=>Math.exp(-w*E*B)*(M*Math.sin(D*B)+I*Math.cos(D*B));else if(w===1){T=H=>a-Math.exp(-E*H)*(C+(x+E*C)*H);const B=x+E*C;A=H=>Math.exp(-E*H)*(E*B*H-x)}else{const B=E*Math.sqrt(w*w-1);T=K=>{const z=Math.exp(-w*E*K),V=Math.min(B*K,300);return a-z*((x+w*E*C)*Math.sinh(V)+B*C*Math.cosh(V))/B};const H=(x+w*E*C)/B,U=w*E*H-C*B,F=w*E*C-H*B;A=K=>{const z=Math.exp(-w*E*K),V=Math.min(B*K,300);return z*(U*Math.sinh(V)+F*Math.cosh(V))}}const L={calculatedDuration:b&&p||null,velocity:B=>Ii(A(B)),next:B=>{if(!b&&w<1){const U=Math.exp(-w*E*B),F=Math.sin(D*B),K=Math.cos(D*B),z=a-U*(k*F+C*K),V=Ii(U*(M*F+I*K));return c.done=Math.abs(V)<=i&&Math.abs(a-z)<=r,c.value=c.done?a:z,c}const H=T(B);if(b)c.done=B>=p;else{const U=Ii(A(B));c.done=Math.abs(U)<=i&&Math.abs(a-H)<=r}return c.value=c.done?a:H,c},toString:()=>{const B=Math.min(H1(L),qm),H=W3(U=>L.next(B*U).value,B,30);return B+"ms "+H},toTransition:()=>{}};return L}qf.applyToOptions=t=>{const e=X3(t,100,qf);return t.ease=e.ease,t.duration=Ii(e.duration),t.type="keyframes",t};const MQ=5;function $3(t,e,n){const i=Math.max(e-MQ,0);return A3(n-t(i),e-i)}function Dx({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:a,min:c,max:f,restDelta:h=.5,restSpeed:m}){const p=t[0],y={done:!1,value:p},b=I=>c!==void 0&&I<c||f!==void 0&&I>f,x=I=>c===void 0?f:f===void 0||Math.abs(c-I)<Math.abs(f-I)?c:f;let w=n*e;const C=p+w,E=a===void 0?C:a(C);E!==C&&(w=E-p);const O=I=>-w*Math.exp(-I/i),T=I=>E+O(I),A=I=>{const L=O(I),B=T(I);y.done=Math.abs(L)<=h,y.value=y.done?E:B};let D,k;const M=I=>{b(y.value)&&(D=I,k=qf({keyframes:[y.value,x(y.value)],velocity:$3(T,I,y.value),damping:r,stiffness:o,restDelta:h,restSpeed:m}))};return M(0),{calculatedDuration:null,next:I=>{let L=!1;return!k&&D===void 0&&(L=!0,A(I),M(I)),D!==void 0&&I>=D?k.next(I-D):(!L&&A(I),y)}}}function DQ(t,e,n){const i=[],r=n||Yo.mix||G3,o=t.length-1;for(let a=0;a<o;a++){let c=r(t[a],t[a+1]);if(e){const f=Array.isArray(e)?e[a]||fr:e;c=Cd(f,c)}i.push(c)}return i}function kQ(t,e,{clamp:n=!0,ease:i,mixer:r}={}){const o=t.length;if(oy(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=DQ(e,i,r),f=c.length,h=m=>{if(a&&m<t[0])return e[0];let p=0;if(f>1)for(;p<t.length-2&&!(m<t[p+1]);p++);const y=_u(t[p],t[p+1],m);return c[p](y)};return n?m=>h(ys(t[0],t[o-1],m)):h}function Q3(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=_u(0,e,i);t.push(Yt(n,1,r))}}function Z3(t){const e=[0];return Q3(e,t.length-1),e}function PQ(t,e){return t.map(n=>n*e)}function IQ(t,e){return t.map(()=>e||L3).splice(0,t.length-1)}function Cf({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const r=B3(i)?i.map(zD):zD(i),o={done:!1,value:e[0]},a=PQ(n&&n.length===e.length?n:Z3(e),t),c=kQ(a,e,{ease:Array.isArray(r)?r:IQ(e,r)});return{calculatedDuration:t,next:f=>(o.value=c(f),o.done=f>=t,o)}}const NQ=t=>t!==null;function ly(t,{repeat:e,repeatType:n="loop"},i,r=1){const o=t.filter(NQ),c=r<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!c||i===void 0?o[c]:i}const LQ={decay:Dx,inertia:Dx,tween:Cf,keyframes:Cf,spring:qf};function J3(t){typeof t.type=="string"&&(t.type=LQ[t.type])}class F1{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 BQ=t=>t/100;class Gm extends F1{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!==mi.now()&&this.tick(mi.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;J3(e);const{type:n=Cf,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=e;let{keyframes:c}=e;const f=n||Cf;f!==Cf&&typeof c[0]!="number"&&(this.mixKeyframes=Cd(BQ,G3(c[0],c[1])),c=[0,100]);const h=f({...e,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=H1(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=h}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:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:h=0,keyframes:m,repeat:p,repeatType:y,repeatDelay:b,type:x,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-h*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?E<0:E>r;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let T=this.currentTime,A=i;if(p){const I=Math.min(this.currentTime,r)/c;let L=Math.floor(I),B=I%1;!B&&I>=1&&(B=1),B===1&&L--,L=Math.min(L,p+1),L%2&&(y==="reverse"?(B=1-B,b&&(B-=b/c)):y==="mirror"&&(A=a)),T=ys(0,1,B)*c}let D;O?(this.delayState.value=m[0],D=this.delayState):D=A.next(T),o&&!O&&(D.value=o(D.value));let{done:k}=D;!O&&f!==null&&(k=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return M&&x!==Dx&&(D.value=ly(m,this.options,C,this.speed)),w&&w(D.value),M&&this.finish(),D}then(e,n){return this.finished.then(e,n)}get duration(){return cr(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+cr(e)}get time(){return cr(this.currentTime)}set time(e){e=Ii(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 $3(i=>this.generator.next(i).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(mi.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=cr(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=wQ,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(mi.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 VQ(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Il=t=>t*180/Math.PI,kx=t=>{const e=Il(Math.atan2(t[1],t[0]));return Px(e)},zQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:kx,rotateZ:kx,skewX:t=>Il(Math.atan(t[1])),skewY:t=>Il(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Px=t=>(t=t%360,t<0&&(t+=360),t),YD=kx,qD=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),GD=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),_Q={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qD,scaleY:GD,scale:t=>(qD(t)+GD(t))/2,rotateX:t=>Px(Il(Math.atan2(t[6],t[5]))),rotateY:t=>Px(Il(Math.atan2(-t[2],t[0]))),rotateZ:YD,rotate:YD,skewX:t=>Il(Math.atan(t[4])),skewY:t=>Il(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ix(t){return t.includes("scale")?1:0}function Nx(t,e){if(!t||t==="none")return Ix(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=_Q,r=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=zQ,r=c}if(!r)return Ix(e);const o=i[e],a=r[1].split(",").map(FQ);return typeof o=="function"?o(a):a[o]}const HQ=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Nx(n,e)};function FQ(t){return parseFloat(t.trim())}const Qu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zu=new Set([...Qu,"pathRotation"]),WD=t=>t===$u||t===je,UQ=new Set(["x","y","z"]),jQ=Qu.filter(t=>!UQ.has(t));function KQ(t){const e=[];return jQ.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const Lo={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const r=t.max-t.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const r=t.max-t.min;return i==="border-box"?r:r-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})=>Nx(e,"x"),y:(t,{transform:e})=>Nx(e,"y")};Lo.translateX=Lo.x;Lo.translateY=Lo.y;const Vl=new Set;let Lx=!1,Bx=!1,Vx=!1;function ez(){if(Bx){const t=Array.from(Vl).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const r=KQ(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,a])=>{i.getValue(o)?.set(a)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Bx=!1,Lx=!1,Vl.forEach(t=>t.complete(Vx)),Vl.clear()}function tz(){Vl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bx=!0)})}function YQ(){Vx=!0,tz(),ez(),Vx=!1}class U1{constructor(e,n,i,r,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Vl.add(this),Lx||(Lx=!0,Zt.read(tz),Zt.resolveKeyframes(ez))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const c=i.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),r&&o===void 0&&r.set(e[0])}VQ(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vl.delete(this)}cancel(){this.state==="scheduled"&&(Vl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qQ=t=>t.startsWith("--");function nz(t,e,n){qQ(e)?t.style.setProperty(e,n):t.style[e]=n}const GQ={};function iz(t,e){const n=R3(t);return()=>GQ[e]??n()}const WQ=iz(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),rz=iz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cf=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,XD={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cf([0,.65,.55,1]),circOut:cf([.55,0,1,.45]),backIn:cf([.31,.01,.66,-.59]),backOut:cf([.33,1.53,.69,.99])};function sz(t,e){if(t)return typeof t=="function"?rz()?W3(t,e):"ease-out":z3(t)?cf(t):Array.isArray(t)?t.map(n=>sz(n,e)||XD.easeOut):XD[t]}function XQ(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:a="loop",ease:c="easeOut",times:f}={},h=void 0){const m={[e]:n};f&&(m.offset=f);const p=sz(c,r);Array.isArray(p)&&(m.easing=p);const y={delay:i,duration:r,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return h&&(y.pseudoElement=h),t.animate(m,y)}function j1(t){return typeof t=="function"&&"applyToOptions"in t}function $Q({type:t,...e}){return j1(t)&&rz()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class oz extends F1{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=e,oy(typeof e.type!="string");const h=$Q(e);this.animation=XQ(n,i,r,h,o),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=ly(r,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),nz(n,i,m),this.animation.cancel()}f?.(),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 cr(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+cr(e)}get time(){return cr(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ii(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:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&WQ()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),fr):r(this)}}const lz={anticipate:P3,backInOut:k3,circInOut:N3};function QQ(t){return t in lz}function ZQ(t){typeof t.ease=="string"&&QQ(t.ease)&&(t.ease=lz[t.ease])}const Gb=10;class JQ extends oz{constructor(e){ZQ(e),J3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new Gm({...a,autoplay:!1}),f=Math.max(Gb,mi.now()-this.startTime),h=ys(0,Gb,f-Gb),m=c.sample(f).value,{name:p}=this.options;o&&p&&nz(o,p,m),n.setWithVelocity(c.sample(Math.max(0,f-h)).value,m,h),c.stop()}}const $D=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Mr.test(t)||t==="0")&&!t.startsWith("url("));function eZ(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 tZ(t,e,n,i){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],a=$D(r,e),c=$D(o,e);return!a||!c?!1:eZ(t)||(n==="spring"||j1(n))&&i}function zx(t){t.duration=0,t.type="keyframes"}const az=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),nZ=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function iZ(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&nZ.test(t[e]))return!0;return!1}const rZ=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),sZ=R3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oZ(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:a,keyframes:c}=t,f=e?.owner?.current;if(!(f instanceof HTMLElement)&&!(f instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:m}=e.owner.getProps();return sZ()&&n&&(az.has(n)||rZ.has(n)&&iZ(c))&&(n!=="transform"||!m)&&!h&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}const lZ=40;class aZ extends F1{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",keyframes:c,name:f,motionValue:h,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=mi.now();const y={autoplay:e,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:a,name:f,motionValue:h,element:m,...p},b=m?.KeyframeResolver||U1;this.keyframeResolver=new b(c,(x,w,C)=>this.onKeyframesResolved(x,w,y,!C),f,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:c,delay:f,isHandoff:h,onUpdate:m}=i;this.resolvedAt=mi.now();let p=!0;tZ(e,o,a,c)||(p=!1,(Yo.instantAnimations||!f)&&m?.(ly(e,i,n)),e[0]=e[e.length-1],zx(i),i.repeat=0);const b={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>lZ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},x=p&&!h&&oZ(b),w=b.motionValue?.owner?.current;let C;if(x)try{C=new JQ({...b,element:w})}catch{C=new Gm(b)}else C=new Gm(b);C.finished.then(()=>{this.notifyFinished()}).catch(fr),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}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(),YQ()),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()}}class uZ{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return QD(this.animations,"duration")}get iterationDuration(){return QD(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function QD(t,e){let n=0;for(let i=0;i<t.length;i++){const r=t[i][e];r!==null&&r>n&&(n=r)}return n}class cZ extends uZ{then(e,n){return this.finished.finally(e).then(()=>{})}}function uz(t,e,n,i=0,r=1){const o=Array.from(t).sort((h,m)=>h.sortNodePosition(m)).indexOf(e),a=t.size,c=(a-1)*i;return typeof n=="function"?n(o,a):r===1?o*i:c-o*i}const ZD=30,fZ=t=>!isNaN(parseFloat(t));class dZ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=mi.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=mi.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fZ(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 P1);const i=this.events[e].add(n);return e==="change"?()=>{i(),Zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}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,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}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=mi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ZD)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ZD);return A3(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 Go(t,e){return new dZ(t,e)}function cz(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function K1(t,e){const n=t?.[e]??t?.default??t;return n!==t?cz(n,t):n}const hZ={type:"spring",stiffness:500,damping:25,restSpeed:10},pZ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mZ={type:"keyframes",duration:.8},gZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yZ=(t,{keyframes:e})=>e.length>2?mZ:Zu.has(t)?t.startsWith("scale")?pZ(e[1]):hZ:gZ,vZ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function bZ(t){for(const e in t)if(!vZ.has(e))return!0;return!1}const Y1=(t,e,n,i={},r,o)=>a=>{const c=K1(i,t)||{},f=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-Ii(f);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-h,onUpdate:y=>{e.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:r};bZ(c)||Object.assign(m,yZ(t,m)),m.duration&&(m.duration=Ii(m.duration)),m.repeatDelay&&(m.repeatDelay=Ii(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(zx(m),m.delay===0&&(p=!0)),(Yo.instantAnimations||Yo.skipAnimations||r?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,zx(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!o&&e.get()!==void 0){const y=ly(m.keyframes,c);if(y!==void 0){Zt.update(()=>{m.onUpdate(y),m.onComplete()});return}}return c.isSync?new Gm(m):new aZ(m)},SZ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xZ(t){const e=SZ.exec(t);if(!e)return[,];const[,n,i,r]=e;return[`--${n??i}`,r]}function fz(t,e,n=1){const[i,r]=xZ(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const a=o.trim();return C3(a)?parseFloat(a):a}return B1(r)?fz(r,e,n+1):r}function JD(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function q1(t,e,n,i){if(typeof e=="function"){const[r,o]=JD(i);e=e(n!==void 0?n:t.custom,r,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,o]=JD(i);e=e(n!==void 0?n:t.custom,r,o)}return e}function zl(t,e,n){const i=t.getProps();return q1(i,e,n!==void 0?n:i.custom,t)}const dz=new Set(["width","height","top","left","right","bottom",...Qu]),_x=t=>Array.isArray(t);function wZ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Go(n))}function CZ(t){return _x(t)?t[t.length-1]||0:t}function EZ(t,e){const n=zl(t,e);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const a in o){const c=CZ(o[a]);wZ(t,a,c)}}const Vn=t=>!!(t&&t.getVelocity);function TZ(t){return!!(Vn(t)&&t.add)}function Hx(t,e){const n=t.getValue("willChange");if(TZ(n))return n.add(e);if(!n&&Yo.WillChange){const i=new Yo.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function G1(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const RZ="framerAppearId",hz="data-"+G1(RZ);function pz(t){return t.props[hz]}function AZ({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function W1(t,e,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:a,...c}=e;const f=t.getDefaultTransition();o=o?cz(o,f):f;const h=o?.reduceMotion,m=o?.skipAnimations;i&&(o=i);const p=[],y=r&&t.animationState&&t.animationState.getState()[r],b=o?.path;b&&b.animateVisualElement(t,c,o,n,p);for(const x in c){const w=t.getValue(x,t.latestValues[x]??null),C=c[x];if(C===void 0||y&&AZ(y,x))continue;const E={delay:n,...K1(o||{},x)};m&&(E.skipAnimations=!0);const O=w.get();if(O!==void 0&&!w.isAnimating()&&!Array.isArray(C)&&C===O&&!E.velocity){Zt.update(()=>w.set(C));continue}let T=!1;if(window.MotionHandoffAnimation){const k=pz(t);if(k){const M=window.MotionHandoffAnimation(k,x,Zt);M!==null&&(E.startTime=M,T=!0)}}Hx(t,x);const A=h??t.shouldReduceMotion;w.start(Y1(x,w,C,A&&dz.has(x)?{type:!1}:E,t,T));const D=w.animation;D&&p.push(D)}if(a){const x=()=>Zt.update(()=>{a&&EZ(t,a)});p.length?Promise.all(p).then(x):x()}return p}function Fx(t,e,n={}){const i=zl(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(W1(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=r;return OZ(t,e,f,h,m,p,n)}:()=>Promise.resolve(),{when:c}=r;if(c){const[f,h]=c==="beforeChildren"?[o,a]:[a,o];return f().then(()=>h())}else return Promise.all([o(),a(n.delay)])}function OZ(t,e,n=0,i=0,r=0,o=1,a){const c=[];for(const f of t.variantChildren)f.notify("AnimationStart",e),c.push(Fx(f,e,{...a,delay:n+(typeof i=="function"?0:i)+uz(t.variantChildren,f,i,r,o)}).then(()=>f.notify("AnimationComplete",e)));return Promise.all(c)}function MZ(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>Fx(t,o,n));i=Promise.all(r)}else if(typeof e=="string")i=Fx(t,e,n);else{const r=typeof e=="function"?zl(t,e,n.custom):e;i=Promise.all(W1(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const DZ={test:t=>t==="auto",parse:t=>t},mz=t=>e=>e.test(t),gz=[$u,je,ms,Vs,iQ,nQ,DZ],ek=t=>gz.find(mz(t));function kZ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||T3(t):!0}const PZ=new Set(["brightness","contrast","saturate","opacity"]);function IZ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(V1)||[];if(!i)return t;const r=n.replace(i,"");let o=PZ.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}const NZ=/\b([a-z-]*)\(.*?\)/gu,Ux={...Mr,getAnimatableNone:t=>{const e=t.match(NZ);return e?e.map(IZ).join(" "):t}},jx={...Mr,getAnimatableNone:t=>{const e=Mr.parse(t);return Mr.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},tk={...$u,transform:Math.round},LZ={rotate:Vs,pathRotation:Vs,rotateX:Vs,rotateY:Vs,rotateZ:Vs,scale:Vp,scaleX:Vp,scaleY:Vp,scaleZ:Vp,skew:Vs,skewX:Vs,skewY:Vs,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:Yf,originX:HD,originY:HD,originZ:je},Wm={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...LZ,zIndex:tk,fillOpacity:Yf,strokeOpacity:Yf,numOctaves:tk},BZ={...Wm,color:Mn,backgroundColor:Mn,outlineColor:Mn,fill:Mn,stroke:Mn,borderColor:Mn,borderTopColor:Mn,borderRightColor:Mn,borderBottomColor:Mn,borderLeftColor:Mn,filter:Ux,WebkitFilter:Ux,mask:jx,WebkitMask:jx},yz=t=>BZ[t],VZ=new Set([Ux,jx]);function vz(t,e){let n=yz(t);return VZ.has(n)||(n=Mr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const zZ=new Set(["auto","none","0"]);function _Z(t,e,n){let i=0,r;for(;i<t.length&&!r;){const o=t[i];typeof o=="string"&&!zZ.has(o)&&Hu(o).values.length&&(r=t[i]),i++}if(r&&n)for(const o of e)t[o]=vz(n,r)}class HZ extends U1{constructor(e,n,i,r,o){super(e,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<e.length;m++){let p=e[m];if(typeof p=="string"&&(p=p.trim(),B1(p))){const y=fz(p,n.current);y!==void 0&&(e[m]=y),m===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!dz.has(i)||e.length!==2)return;const[r,o]=e,a=ek(r),c=ek(o),f=_D(r),h=_D(o);if(f!==h&&Lo[i]){this.needsMeasurement=!0;return}if(a!==c)if(WD(a)&&WD(c))for(let m=0;m<e.length;m++){const p=e[m];typeof p=="string"&&(e[m]=parseFloat(p))}else Lo[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||kZ(e[r]))&&i.push(r);i.length&&_Z(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Lo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Lo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const X1=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function $1(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);const r=n?.[t]??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(i=>i!=null)}const Kx=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function FZ(t){return E3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Q1}=_3(queueMicrotask,!1),Tr={x:!1,y:!1};function bz(){return Tr.x||Tr.y}function UZ(t){return t==="x"||t==="y"?Tr[t]?null:(Tr[t]=!0,()=>{Tr[t]=!1}):Tr.x||Tr.y?null:(Tr.x=Tr.y=!0,()=>{Tr.x=Tr.y=!1})}function Sz(t,e){const n=$1(t),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[n,r,()=>i.abort()]}function jZ(t){return!(t.pointerType==="touch"||bz())}function KZ(t,e,n={}){const[i,r,o]=Sz(t,n);return i.forEach(a=>{let c=!1,f=!1,h;const m=()=>{a.removeEventListener("pointerleave",x)},p=C=>{h&&(h(C),h=void 0),m()},y=C=>{c=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),f&&(f=!1,p(C))},b=()=>{c=!0,window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",y,r)},x=C=>{if(C.pointerType!=="touch"){if(c){f=!0;return}p(C)}},w=C=>{if(!jZ(C))return;f=!1;const E=e(a,C);typeof E=="function"&&(h=E,a.addEventListener("pointerleave",x,r))};a.addEventListener("pointerenter",w,r),a.addEventListener("pointerdown",b,r)}),o}const xz=(t,e)=>e?t===e?!0:xz(t,e.parentElement):!1,Z1=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,YZ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qZ(t){return YZ.has(t.tagName)||t.isContentEditable===!0}const GZ=new Set(["INPUT","SELECT","TEXTAREA"]);function WZ(t){return GZ.has(t.tagName)||t.isContentEditable===!0}const tm=new WeakSet;function nk(t){return e=>{e.key==="Enter"&&t(e)}}function Wb(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const XZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=nk(()=>{if(tm.has(n))return;Wb(n,"down");const r=nk(()=>{Wb(n,"up")}),o=()=>Wb(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function ik(t){return Z1(t)&&!bz()}const rk=new WeakSet;function $Z(t,e,n={}){const[i,r,o]=Sz(t,n),a=c=>{const f=c.currentTarget;if(!ik(c)||rk.has(c))return;tm.add(f),n.stopPropagation&&rk.add(c);const h=e(f,c),m={...r,capture:!0},p=(x,w)=>{window.removeEventListener("pointerup",y,m),window.removeEventListener("pointercancel",b,m),tm.has(f)&&tm.delete(f),ik(x)&&typeof h=="function"&&h(x,{success:w})},y=x=>{p(x,f===window||f===document||n.useGlobalTarget||xz(f,x.target))},b=x=>{p(x,!1)};window.addEventListener("pointerup",y,m),window.addEventListener("pointercancel",b,m)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,r),FZ(c)&&(c.addEventListener("focus",h=>XZ(h,r)),!qZ(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function ay(t){return E3(t)&&"ownerSVGElement"in t}const nm=new WeakMap;let im;const wz=(t,e,n)=>(i,r)=>r&&r[0]?r[0][t+"Size"]:ay(i)&&"getBBox"in i?i.getBBox()[e]:i[n],QZ=wz("inline","width","offsetWidth"),ZZ=wz("block","height","offsetHeight");function JZ({target:t,borderBoxSize:e}){nm.get(t)?.forEach(n=>{n(t,{get width(){return QZ(t,e)},get height(){return ZZ(t,e)}})})}function eJ(t){t.forEach(JZ)}function tJ(){typeof ResizeObserver>"u"||(im=new ResizeObserver(eJ))}function nJ(t,e){im||tJ();const n=$1(t);return n.forEach(i=>{let r=nm.get(i);r||(r=new Set,nm.set(i,r)),r.add(e),im?.observe(i)}),()=>{n.forEach(i=>{const r=nm.get(i);r?.delete(e),r?.size||im?.unobserve(i)})}}const rm=new Set;let fu;function iJ(){fu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};rm.forEach(e=>e(t))},window.addEventListener("resize",fu)}function rJ(t){return rm.add(t),fu||iJ(),()=>{rm.delete(t),!rm.size&&typeof fu=="function"&&(window.removeEventListener("resize",fu),fu=void 0)}}function sk(t,e){return typeof t=="function"?rJ(t):nJ(t,e)}function Cz(t){return ay(t)&&t.tagName==="svg"}const sJ=[...gz,Mn,Mr],oJ=t=>sJ.find(mz(t)),ok=()=>({translate:0,scale:1,origin:0,originPoint:0}),du=()=>({x:ok(),y:ok()}),lk=()=>({min:0,max:0}),On=()=>({x:lk(),y:lk()}),Gf=new WeakMap;function uy(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Wf(t){return typeof t=="string"||Array.isArray(t)}const J1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eC=["initial",...J1];function cy(t){return uy(t.animate)||eC.some(e=>Wf(t[e]))}function Ez(t){return!!(cy(t)||t.variants)}function lJ(t,e,n){for(const i in e){const r=e[i],o=n[i];if(Vn(r))t.addValue(i,r);else if(Vn(o))t.addValue(i,Go(r,{owner:t}));else if(o!==r)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=t.getStaticValue(i);t.addValue(i,Go(a!==void 0?a:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const Yx={current:null},Tz={current:!1},aJ=typeof window<"u";function uJ(){if(Tz.current=!0,!!aJ)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Yx.current=t.matches;t.addEventListener("change",e),e()}else Yx.current=!1}const ak=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xm={};function Rz(t){Xm=t}function cJ(){return Xm}class Az{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:a,visualState:c},f={}){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=U1,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 b=mi.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,Zt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=f,this.blockInitialAnimation=!!a,this.isControllingVariants=cy(n),this.isVariantNode=Ez(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in y){const x=y[b];h[b]!==void 0&&Vn(x)&&x.set(h[b])}}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,Gf.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,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Tz.current||uJ(),this.shouldReduceMotion=Yx.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(),qo(this.notifyUpdate),qo(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&&az.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:f,ease:h,duration:m}=n.accelerate,p=new oz({element:this.current,name:e,keyframes:c,times:f,ease:h,duration:Ii(m)}),y=a(p);this.valueSubscriptions.set(e,()=>{y(),p.cancel()});return}const i=Zu.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Zt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),o&&o()})}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 Xm){const n=Xm[e];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):On()}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 i=0;i<ak.length;i++){const r=ak[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,a=e[o];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=lJ(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 i=this.values.get(e);n!==i&&(i&&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 i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Go(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(C3(i)||T3(i))?i=parseFloat(i):!oJ(i)&&Mr.test(n)&&(i=vz(e,n)),this.setBaseTarget(e,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=q1(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Vn(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new P1),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Q1.render(this.render)}}class Oz extends Az{constructor(){super(...arguments),this.KeyframeResolver=HZ}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Vn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class tl{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Mz({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function fJ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function dJ(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Xb(t){return t===void 0||t===1}function qx({scale:t,scaleX:e,scaleY:n}){return!Xb(t)||!Xb(e)||!Xb(n)}function Ol(t){return qx(t)||Dz(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Dz(t){return uk(t.x)||uk(t.y)}function uk(t){return t&&t!=="0%"}function $m(t,e,n){const i=t-n,r=e*i;return n+r}function ck(t,e,n,i,r){return r!==void 0&&(t=$m(t,r,i)),$m(t,n,i)+e}function Gx(t,e=0,n=1,i,r){t.min=ck(t.min,e,n,i,r),t.max=ck(t.max,e,n,i,r)}function kz(t,{x:e,y:n}){Gx(t.x,e.translate,e.scale,e.originPoint),Gx(t.y,n.translate,n.scale,n.originPoint)}const fk=.999999999999,dk=1.0000000000001;function hJ(t,e,n,i=!1){const r=n.length;if(!r)return;e.x=e.y=1;let o,a;for(let c=0;c<r;c++){o=n[c],a=o.projectionDelta;const{visualElement:f}=o.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(ns(t.x,-o.scroll.offset.x),ns(t.y,-o.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,kz(t,a)),i&&Ol(o.latestValues)&&sm(t,o.latestValues,o.layout?.layoutBox))}e.x<dk&&e.x>fk&&(e.x=1),e.y<dk&&e.y>fk&&(e.y=1)}function ns(t,e){t.min+=e,t.max+=e}function hk(t,e,n,i,r=.5){const o=Yt(t.min,t.max,r);Gx(t,e,n,o,i)}function pk(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function sm(t,e,n){const i=n??t;hk(t.x,pk(e.x,i.x),e.scaleX,e.scale,e.originX),hk(t.y,pk(e.y,i.y),e.scaleY,e.scale,e.originY)}function Pz(t,e){return Mz(dJ(t.getBoundingClientRect(),e))}function pJ(t,e,n){const i=Pz(t,n),{scroll:r}=e;return r&&(ns(i.x,r.offset.x),ns(i.y,r.offset.y)),i}const mJ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gJ=Qu.length;function yJ(t,e,n){let i="",r=!0;for(let a=0;a<gJ;a++){const c=Qu[a],f=t[c];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(c.startsWith("scale")?1:0);else{const m=parseFloat(f);h=c.startsWith("scale")?m===1:m===0}if(!h||n){const m=Kx(f,Wm[c]);if(!h){r=!1;const p=mJ[c]||c;i+=`${p}(${m}) `}n&&(e[c]=m)}}const o=t.pathRotation;return o&&(r=!1,i+=`rotate(${Kx(o,Wm.pathRotation)}) `),i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}function tC(t,e,n){const{style:i,vars:r,transformOrigin:o}=t;let a=!1,c=!1;for(const f in e){const h=e[f];if(Zu.has(f)){a=!0;continue}else if(F3(f)){r[f]=h;continue}else{const m=Kx(h,Wm[f]);f.startsWith("origin")?(c=!0,o[f]=m):i[f]=m}}if(e.transform||(a||n?i.transform=yJ(e,t.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:h="50%",originZ:m=0}=o;i.transformOrigin=`${f} ${h} ${m}`}}function Iz(t,{style:e,vars:n},i,r){const o=t.style;let a;for(a in e)o[a]=e[a];r?.applyProjectionStyles(o,i);for(a in n)o.setProperty(a,n[a])}function mk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const nf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(je.test(t))t=parseFloat(t);else return t;const n=mk(t,e.target.x),i=mk(t,e.target.y);return`${n}% ${i}%`}},vJ={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,r=Mr.parse(t);if(r.length>5)return i;const o=Mr.createTransformer(t),a=typeof r[0]!="number"?1:0,c=n.x.scale*e.x,f=n.y.scale*e.y;r[0+a]/=c,r[1+a]/=f;const h=Yt(c,f,.5);return typeof r[2+a]=="number"&&(r[2+a]/=h),typeof r[3+a]=="number"&&(r[3+a]/=h),o(r)}},Wx={borderRadius:{...nf,applyTo:[...X1]},borderTopLeftRadius:nf,borderTopRightRadius:nf,borderBottomLeftRadius:nf,borderBottomRightRadius:nf,boxShadow:vJ};function Nz(t,{layout:e,layoutId:n}){return Zu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wx[t]||t==="opacity")}function nC(t,e,n){const i=t.style,r=e?.style,o={};if(!i)return o;for(const a in i)(Vn(i[a])||r&&Vn(r[a])||Nz(a,t)||n?.getValue(a)?.liveStyle!==void 0)&&(o[a]=i[a]);return o}function bJ(t){return window.getComputedStyle(t)}class Lz extends Oz{constructor(){super(...arguments),this.type="html",this.renderInstance=Iz}mount(e){oy(!!e.style),super.mount(e)}readValueFromInstance(e,n){if(Zu.has(n))return this.projection?.isProjecting?Ix(n):HQ(e,n);{const i=bJ(e),r=(F3(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Pz(e,n)}build(e,n,i){tC(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return nC(e,n,i)}}function SJ(t,e){return t in e}class xJ extends Az{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(SJ(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return On()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const wJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},CJ={offset:"strokeDashoffset",array:"strokeDasharray"};function EJ(t,e,n=1,i=0,r=!0){t.pathLength=1;const o=r?wJ:CJ;t[o.offset]=`${-i}`,t[o.array]=`${e} ${n}`}const TJ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Bz(t,{attrX:e,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:a=0,...c},f,h,m){if(tC(t,c,h),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:y}=t;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=m?.transformBox??"fill-box",delete p.transformBox);for(const b of TJ)p[b]!==void 0&&(y[b]=p[b],delete p[b]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),i!==void 0&&(p.scale=i),r!==void 0&&EJ(p,r,o,a,!1)}const Vz=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"]),zz=t=>typeof t=="string"&&t.toLowerCase()==="svg";function RJ(t,e,n,i){Iz(t,e,void 0,i);for(const r in e.attrs)t.setAttribute(Vz.has(r)?r:G1(r),e.attrs[r])}function _z(t,e,n){const i=nC(t,e,n);for(const r in t)if(Vn(t[r])||Vn(e[r])){const o=Qu.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=t[r]}return i}class Hz extends Oz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=On}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Zu.has(n)){const i=yz(n);return i&&i.default||0}return n=Vz.has(n)?n:G1(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return _z(e,n,i)}build(e,n,i){Bz(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,r){RJ(e,n,i,r)}mount(e){this.isSVGTag=zz(e.tagName),super.mount(e)}}const AJ=eC.length;function Fz(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Fz(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<AJ;n++){const i=eC[n],r=t.props[i];(Wf(r)||r===!1)&&(e[i]=r)}return e}function Uz(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const OJ=[...J1].reverse(),MJ=J1.length;function DJ(t){return e=>Promise.all(e.map(({animation:n,options:i})=>MZ(t,n,i)))}function kJ(t){let e=DJ(t),n=gk(),i=!0,r=!1;const o=h=>(m,p)=>{const y=zl(t,p,h==="exit"?t.presenceContext?.custom:void 0);if(y){const{transition:b,transitionEnd:x,...w}=y;m={...m,...w,...x}}return m};function a(h){e=h(t)}function c(h){const{props:m}=t,p=Fz(t.parent)||{},y=[],b=new Set;let x={},w=1/0;for(let E=0;E<MJ;E++){const O=OJ[E],T=n[O],A=m[O]!==void 0?m[O]:p[O],D=Wf(A),k=O===h?T.isActive:null;k===!1&&(w=E);let M=A===p[O]&&A!==m[O]&&D;if(M&&(i||r)&&t.manuallyAnimateOnMount&&(M=!1),T.protectedKeys={...x},!T.isActive&&k===null||!A&&!T.prevProp||uy(A)||typeof A=="boolean")continue;if(O==="exit"&&T.isActive&&k!==!0){T.prevResolvedValues&&(x={...x,...T.prevResolvedValues});continue}const I=PJ(T.prevProp,A);let L=I||O===h&&T.isActive&&!M&&D||E>w&&D,B=!1;const H=Array.isArray(A)?A:[A];let U=H.reduce(o(O),{});k===!1&&(U={});const{prevResolvedValues:F={}}=T,K={...F,...U},z=j=>{L=!0,b.has(j)&&(B=!0,b.delete(j)),T.needsAnimating[j]=!0;const Y=t.getValue(j);Y&&(Y.liveStyle=!1)};for(const j in K){const Y=U[j],$=F[j];if(x.hasOwnProperty(j))continue;let te=!1;_x(Y)&&_x($)?te=!Uz(Y,$)||I:te=Y!==$,te?Y!=null?z(j):b.add(j):Y!==void 0&&b.has(j)?z(j):T.protectedKeys[j]=!0}T.prevProp=A,T.prevResolvedValues=U,T.isActive&&(x={...x,...U}),(i||r)&&t.blockInitialAnimation&&(L=!1);const V=M&&I;L&&(!V||B)&&y.push(...H.map(j=>{const Y={type:O};if(typeof j=="string"&&(i||r)&&!V&&t.manuallyAnimateOnMount&&t.parent){const{parent:$}=t,te=zl($,j);if($.enteringChildren&&te){const{delayChildren:N}=te.transition||{};Y.delay=uz($.enteringChildren,t,N)}}return{animation:j,options:Y}}))}if(b.size){const E={};if(typeof m.initial!="boolean"){const O=zl(t,Array.isArray(m.initial)?m.initial[0]:m.initial);O&&O.transition&&(E.transition=O.transition)}b.forEach(O=>{const T=t.getBaseTarget(O),A=t.getValue(O);A&&(A.liveStyle=!0),E[O]=T??null}),y.push({animation:E})}let C=!!y.length;return i&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(C=!1),i=!1,r=!1,C?e(y):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();t.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const p=c(h);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:c,setActive:f,setAnimateFunction:a,getState:()=>n,reset:()=>{n=gk(),r=!0}}}function PJ(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Uz(e,t):!1}function Rl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gk(){return{animate:Rl(!0),whileInView:Rl(),whileHover:Rl(),whileTap:Rl(),whileDrag:Rl(),whileFocus:Rl(),exit:Rl()}}function Xx(t,e){t.min=e.min,t.max=e.max}function Er(t,e){Xx(t.x,e.x),Xx(t.y,e.y)}function yk(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const jz=1e-4,IJ=1-jz,NJ=1+jz,Kz=.01,LJ=0-Kz,BJ=0+Kz;function gi(t){return t.max-t.min}function VJ(t,e,n){return Math.abs(t-e)<=n}function vk(t,e,n,i=.5){t.origin=i,t.originPoint=Yt(e.min,e.max,t.origin),t.scale=gi(n)/gi(e),t.translate=Yt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=IJ&&t.scale<=NJ||isNaN(t.scale))&&(t.scale=1),(t.translate>=LJ&&t.translate<=BJ||isNaN(t.translate))&&(t.translate=0)}function Ef(t,e,n,i){vk(t.x,e.x,n.x,i?i.originX:void 0),vk(t.y,e.y,n.y,i?i.originY:void 0)}function bk(t,e,n,i=0){const r=i?Yt(n.min,n.max,i):n.min;t.min=r+e.min,t.max=t.min+gi(e)}function zJ(t,e,n,i){bk(t.x,e.x,n.x,i?.x),bk(t.y,e.y,n.y,i?.y)}function Sk(t,e,n,i=0){const r=i?Yt(n.min,n.max,i):n.min;t.min=e.min-r,t.max=t.min+gi(e)}function Qm(t,e,n,i){Sk(t.x,e.x,n.x,i?.x),Sk(t.y,e.y,n.y,i?.y)}function xk(t,e,n,i,r){return t-=e,t=$m(t,1/n,i),r!==void 0&&(t=$m(t,1/r,i)),t}function _J(t,e=0,n=1,i=.5,r,o=t,a=t){if(ms.test(e)&&(e=parseFloat(e),e=Yt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let c=Yt(o.min,o.max,i);t===o&&(c-=e),t.min=xk(t.min,e,n,c,r),t.max=xk(t.max,e,n,c,r)}function wk(t,e,[n,i,r],o,a){_J(t,e[n],e[i],e[r],e.scale,o,a)}const HJ=["x","scaleX","originX"],FJ=["y","scaleY","originY"];function Ck(t,e,n,i){wk(t.x,e,HJ,n?n.x:void 0,i?i.x:void 0),wk(t.y,e,FJ,n?n.y:void 0,i?i.y:void 0)}function Ek(t){return t.translate===0&&t.scale===1}function Yz(t){return Ek(t.x)&&Ek(t.y)}function Tk(t,e){return t.min===e.min&&t.max===e.max}function UJ(t,e){return Tk(t.x,e.x)&&Tk(t.y,e.y)}function Rk(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function qz(t,e){return Rk(t.x,e.x)&&Rk(t.y,e.y)}function Ak(t){return gi(t.x)/gi(t.y)}function Ok(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function es(t){return[t("x"),t("y")]}function jJ(t,e,n){let i="";const r=t.x.translate/e.x,o=t.y.translate/e.y,a=n?.z||0;if((r||o||a)&&(i=`translate3d(${r}px, ${o}px, ${a}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:p,rotateX:y,rotateY:b,skewX:x,skewY:w}=n;h&&(i=`perspective(${h}px) ${i}`),m&&(i+=`rotate(${m}deg) `),p&&(i+=`rotate(${p}deg) `),y&&(i+=`rotateX(${y}deg) `),b&&(i+=`rotateY(${b}deg) `),x&&(i+=`skewX(${x}deg) `),w&&(i+=`skewY(${w}deg) `)}const c=t.x.scale*e.x,f=t.y.scale*e.y;return(c!==1||f!==1)&&(i+=`scale(${c}, ${f})`),i||"none"}const KJ=X1.length,Mk=t=>typeof t=="string"?parseFloat(t):t,Dk=t=>typeof t=="number"||je.test(t);function YJ(t,e,n,i,r,o){r?(t.opacity=Yt(0,n.opacity??1,qJ(i)),t.opacityExit=Yt(e.opacity??1,0,GJ(i))):o&&(t.opacity=Yt(e.opacity??1,n.opacity??1,i));for(let a=0;a<KJ;a++){const c=X1[a];let f=kk(e,c),h=kk(n,c);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||Dk(f)===Dk(h)?(t[c]=Math.max(Yt(Mk(f),Mk(h),i),0),(ms.test(h)||ms.test(f))&&(t[c]+="%")):t[c]=h}(e.rotate||n.rotate)&&(t.rotate=Yt(e.rotate||0,n.rotate||0,i))}function kk(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const qJ=Gz(0,.5,I3),GJ=Gz(.5,.95,fr);function Gz(t,e,n){return i=>i<t?0:i>e?1:n(_u(t,e,i))}function Wz(t,e,n){const i=Vn(t)?t:Go(t);return i.start(Y1("",i,e,n)),i.animation}function Xf(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const WJ=(t,e)=>t.depth-e.depth;class XJ{constructor(){this.children=[],this.isDirty=!1}add(e){k1(this.children,e),this.isDirty=!0}remove(e){zu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(WJ),this.isDirty=!1,this.children.forEach(e)}}function $J(t,e){const n=mi.now(),i=({timestamp:r})=>{const o=r-n;o>=e&&(qo(i),t(o-e))};return Zt.setup(i,!0),()=>qo(i)}function om(t){return Vn(t)?t.get():t}class QJ{constructor(){this.members=[]}add(e){k1(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(zu(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(zu(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 i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.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 lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$b=["","X","Y","Z"],ZJ=1e3;let JJ=0;function Qb(t,e,n,i){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Xz(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=pz(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Zt,!(r||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Xz(i)}function $z({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},c=e?.()){this.id=JJ++,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(nee),this.nodes.forEach(aee),this.nodes.forEach(uee),this.nodes.forEach(iee)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new XJ)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new P1),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const f=this.eventHandlers.get(a);f&&f.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=ay(a)&&!Cz(a),this.instance=a;const{layoutId:c,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),t){let m,p=0;const y=()=>this.root.updateBlockedByResize=!1;Zt.read(()=>{p=window.innerWidth}),t(a,()=>{const b=window.innerWidth;b!==p&&(p=b,this.root.updateBlockedByResize=!0,m&&m(),m=$J(y,250),lm.hasAnimatedSinceResize&&(lm.hasAnimatedSinceResize=!1,this.nodes.forEach(Nk)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||h.getDefaultTransition()||pee,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=h.getProps(),E=!this.targetLayout||!qz(this.targetLayout,b),O=!p&&y;if(this.options.layoutRoot||this.resumeFrom||O||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...K1(x,"layout"),onPlay:w,onComplete:C};(h.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(m,O,T.path)}else p||Nk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qo(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(cee),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xz(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const p=this.path[m];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:f}=this.options;if(c===void 0&&!f)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const f=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),f&&this.nodes.forEach(see),this.nodes.forEach(Pk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ik);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(oee),this.nodes.forEach(lee),this.nodes.forEach(eee),this.nodes.forEach(tee)):this.nodes.forEach(Ik),this.clearAllSnapshots();const c=mi.now();ei.delta=ys(0,1e3/60,c-ei.timestamp),ei.timestamp=c,ei.isProcessing=!0,Ub.update.process(ei),Ub.preRender.process(ei),Ub.render.process(ei),ei.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Q1.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ree),this.sharedNodes.forEach(fee)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!gi(this.snapshot.measuredBox.x)&&!gi(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 f=0;f<this.path.length;f++)this.path[f].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=On()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!Yz(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;a&&this.instance&&(c||Ol(this.latestValues)||m)&&(r(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return a&&(f=this.removeTransform(f)),mee(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return On();const c=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gee))){const{scroll:h}=this.root;h&&(ns(c.x,h.offset.x),ns(c.y,h.offset.y))}return c}removeElementScroll(a){const c=On();if(Er(c,a),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Er(c,a),ns(c.x,m.offset.x),ns(c.y,m.offset.y))}return c}applyTransform(a,c=!1,f){const h=f||On();Er(h,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(ns(h.x,-p.scroll.offset.x),ns(h.y,-p.scroll.offset.y)),Ol(p.latestValues)&&sm(h,p.latestValues,p.layout?.layoutBox)}return Ol(this.latestValues)&&sm(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(a){const c=On();Er(c,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!Ol(h.latestValues))continue;let m;h.instance&&(qx(h.latestValues)&&h.updateSnapshot(),m=On(),Er(m,h.measurePageBox())),Ck(c,h.latestValues,h.snapshot?.layoutBox,m)}return Ol(this.latestValues)&&Ck(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==ei.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(a||f&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:p}=this.options;if(!this.layout||!(m||p))return;this.resolvedRelativeTargetAt=ei.timestamp;const y=this.getClosestProjectingParent();y&&this.linkedParentVersion!==y.layoutVersion&&!y.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&y&&y.layout?this.createRelativeTarget(y,this.layout.layoutBox,y.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=On(),this.targetWithTransforms=On()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Er(this.target,this.layout.layoutBox),kz(this.target,this.targetDelta)):Er(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?this.createRelativeTarget(y,this.target,y.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||qx(this.parent.latestValues)||Dz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,f){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=On(),this.relativeTargetOrigin=On(),Qm(this.relativeTargetOrigin,c,f,this.options.layoutAnchor||void 0),Er(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),c=!!this.resumingFrom||this!==a;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===ei.timestamp&&(f=!1),f)return;const{layout:h,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||m))return;Er(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;hJ(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=On());const{target:b}=a;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yk(this.prevProjectionDelta.x,this.projectionDelta.x),yk(this.prevProjectionDelta.y,this.projectionDelta.y)),Ef(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!Ok(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ok(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=du(),this.projectionDelta=du(),this.projectionDeltaWithTransform=du()}setAnimationOrigin(a,c=!1,f){const h=this.snapshot,m=h?h.latestValues:{},p={...this.latestValues},y=du();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const b=On(),x=h?h.source:void 0,w=this.layout?this.layout.source:void 0,C=x!==w,E=this.getStack(),O=!E||E.members.length<=1,T=!!(C&&!O&&this.options.crossfade===!0&&!this.path.some(hee));this.animationProgress=0;let A;const D=f?.interpolateProjection(a);this.mixTargetDelta=k=>{const M=k/1e3,I=D?.(M);I?(y.x.translate=I.x,y.x.scale=Yt(a.x.scale,1,M),y.x.origin=a.x.origin,y.x.originPoint=a.x.originPoint,y.y.translate=I.y,y.y.scale=Yt(a.y.scale,1,M),y.y.origin=a.y.origin,y.y.originPoint=a.y.originPoint):(Lk(y.x,a.x,M),Lk(y.y,a.y,M)),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qm(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),dee(this.relativeTarget,this.relativeTargetOrigin,b,M),A&&UJ(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=On()),Er(A,this.relativeTarget)),C&&(this.animationValues=p,YJ(p,m,this.latestValues,M,T,O)),I&&I.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=I.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Zt.update(()=>{lm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Go(0)),this.motionValue.jump(0,!1),this.currentAnimation=Wz(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ZJ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:f,layout:h,latestValues:m}=a;if(!(!c||!f||!h)){if(this!==a&&this.layout&&h&&Qz(this.options.animationType,this.layout.layoutBox,h.layoutBox)){f=this.target||On();const p=gi(this.layout.layoutBox.x);f.x.min=a.target.x.min,f.x.max=f.x.min+p;const y=gi(this.layout.layoutBox.y);f.y.min=a.target.y.min,f.y.max=f.y.min+y}Er(c,f),sm(c,m),Ef(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new QJ),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:f}={}){const h=this.getStack();h&&h.promote(this,f),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:f}=a;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const h={};f.z&&Qb("z",a,h,this.animationValues);for(let m=0;m<$b.length;m++)Qb(`rotate${$b[m]}`,a,h,this.animationValues),Qb(`skew${$b[m]}`,a,h,this.animationValues);a.render();for(const m in h)a.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=om(c?.pointerEvents)||"",a.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=om(c?.pointerEvents)||""),this.hasProjected&&!Ol(this.latestValues)&&(a.transform=f?f({},""):"none",this.hasProjected=!1);return}a.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=jJ(this.projectionDeltaWithTransform,this.treeScale,m);f&&(p=f(m,p)),a.transform=p;const{x:y,y:b}=this.projectionDelta;a.transformOrigin=`${y.origin*100}% ${b.origin*100}% 0`,h.animationValues?a.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const x in Wx){if(m[x]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:E}=Wx[x],O=p==="none"?m[x]:w(m[x],h);if(C){const T=C.length;for(let A=0;A<T;A++)a[C[A]]=O}else E?this.options.visualElement.renderState.vars[x]=O:a[x]=O}this.options.layoutId&&(a.pointerEvents=h===this?om(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Pk),this.root.sharedNodes.clear()}}}function eee(t){t.updateLayout()}function tee(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")es(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],y=gi(p);p.min=n[m].min,p.max=p.min+y});else if(r==="x"||r==="y"){const m=r==="x"?"y":"x";Xx(o?e.measuredBox[m]:e.layoutBox[m],n[m])}else Qz(r,e.layoutBox,n)&&es(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],y=gi(n[m]);p.max=p.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[m].max=t.relativeTarget[m].min+y)});const a=du();Ef(a,n,e.layoutBox);const c=du();o?Ef(c,t.applyTransform(i,!0),e.measuredBox):Ef(c,n,e.layoutBox);const f=!Yz(a);let h=!1;if(!t.resumeFrom){const m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:y}=m;if(p&&y){const b=t.options.layoutAnchor||void 0,x=On();Qm(x,e.layoutBox,p.layoutBox,b);const w=On();Qm(w,n,y.layoutBox,b),qz(x,w)||(h=!0),m.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=x,t.relativeParent=m)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function nee(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 iee(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ree(t){t.clearSnapshot()}function Pk(t){t.clearMeasurements()}function see(t){t.isLayoutDirty=!0,t.updateLayout()}function Ik(t){t.isLayoutDirty=!1}function oee(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function lee(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Nk(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function aee(t){t.resolveTargetDelta()}function uee(t){t.calcProjection()}function cee(t){t.resetSkewAndRotation()}function fee(t){t.removeLeadSnapshot()}function Lk(t,e,n){t.translate=Yt(e.translate,0,n),t.scale=Yt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Bk(t,e,n,i){t.min=Yt(e.min,n.min,i),t.max=Yt(e.max,n.max,i)}function dee(t,e,n,i){Bk(t.x,e.x,n.x,i),Bk(t.y,e.y,n.y,i)}function hee(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const pee={duration:.45,ease:[.4,0,.1,1]},Vk=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),zk=Vk("applewebkit/")&&!Vk("chrome/")?Math.round:fr;function _k(t){t.min=zk(t.min),t.max=zk(t.max)}function mee(t){_k(t.x),_k(t.y)}function Qz(t,e,n){return t==="position"||t==="preserve-aspect"&&!VJ(Ak(e),Ak(n),.2)}function gee(t){return t!==t.root&&t.scroll?.wasRoot}const yee=$z({attachResizeListener:(t,e)=>Xf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Zb={current:void 0},Zz=$z({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Zb.current){const t=new yee({});t.mount(window),t.setOptions({layoutScroll:!0}),Zb.current=t}return Zb.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function iC(t){return typeof t=="object"&&!Array.isArray(t)}function Jz(t,e,n,i){return t==null?[]:typeof t=="string"&&iC(e)?$1(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(r=>r!=null):[t]}function vee(t,e,n){return t*(e+1)+n*e}function Hk(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function bee(t,e,n){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<n&&(zu(t,r),i--)}}function See(t,e,n,i,r,o){bee(t,r,o);for(let a=0;a<e.length;a++)t.push({value:e[a],at:Yt(r,o,i[a]),easing:V3(n,a)})}function xee(t,e,n=0){const i=e+1+e*n;for(let r=0;r<t.length;r++)t[r]=t[r]/i}function wee(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const Cee="easeInOut",Eee=20;function Tee(t,{defaultTransition:e={},...n}={},i,r){const o=e.duration||.3,a=new Map,c=new Map,f={},h=new Map;let m=0,p=0,y=0;for(let b=0;b<t.length;b++){const x=t[b];if(typeof x=="string"){h.set(x,p);continue}else if(!Array.isArray(x)){h.set(x.name,Hk(p,x.at,m,h));continue}let[w,C,E={}]=x;E.at!==void 0&&(p=Hk(p,E.at,m,h));let O=0;const T=(A,D,k,M=0,I=0)=>{const L=Ree(A),{delay:B=0,times:H=Z3(L),type:U=e.type||"keyframes",repeat:F,repeatType:K,repeatDelay:z=0,...V}=D;let{ease:X=e.ease||"easeOut",duration:j}=D;const Y=typeof B=="function"?B(M,I):B,$=L.length,te=j1(U)?U:r?.[U||"keyframes"];if($<=2&&te){let G=100;if($===2&&Mee(L)){const Se=L[1]-L[0];G=Math.abs(Se)}const Z={...e,...V};j!==void 0&&(Z.duration=Ii(j));const ae=X3(Z,G,te);X=ae.ease,j=ae.duration}j??(j=o);const N=p+Y;H.length===1&&H[0]===0&&(H[1]=1);const ne=H.length-L.length;if(ne>0&&Q3(H,ne),L.length===1&&L.unshift(null),F&&F<Eee){const G=j>0?z/j:0;j=vee(j,F,z);const Z=[...L],ae=[...H];X=Array.isArray(X)?[...X]:[X];const Se=[...X],le=K==="reverse"||K==="mirror";let ge=Z,ce=Se;le&&(ge=[...Z].reverse(),K==="reverse"&&(ce=[...Se].reverse().map(ue=>typeof ue=="function"?I1(ue):ue)));for(let ue=0;ue<F;ue++){const Te=le&&ue%2===0,ye=Te?ge:Z,Pe=Te?ce:Se,Ee=(ue+1)*(1+G);G>0&&(L.push(L[L.length-1]),H.push(Ee),X.push("linear")),L.push(...ye);for(let Me=0;Me<ye.length;Me++)H.push(ae[Me]+Ee),X.push(Me===0?"linear":V3(Pe,Me-1))}xee(H,F,G)}const q=N+j;See(k,L,X,H,N,q),O=Math.max(Y+j,O),y=Math.max(q,y)};if(Vn(w)){const A=Fk(w,c);T(C,E,Uk("default",A))}else{const A=Jz(w,C,i,f),D=A.length;for(let k=0;k<D;k++){C=C,E=E;const M=A[k],I=Fk(M,c);for(const L in C)T(C[L],Aee(E,L),Uk(L,I),k,D)}}m=p,p+=O}return c.forEach((b,x)=>{for(const w in b){const C=b[w];C.sort(wee);const E=[],O=[],T=[];for(let M=0;M<C.length;M++){const{at:I,value:L,easing:B}=C[M];E.push(L),O.push(_u(0,y,I)),T.push(B||"easeOut")}O[0]!==0&&(O.unshift(0),E.unshift(E[0]),T.unshift(Cee)),O[O.length-1]!==1&&(O.push(1),E.push(null)),a.has(x)||a.set(x,{keyframes:{},transition:{}});const A=a.get(x);A.keyframes[w]=E;const{type:D,...k}=e;A.transition[w]={...k,duration:y,ease:T,times:O,...n}}}),a}function Fk(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Uk(t,e){return e[t]||(e[t]=[]),e[t]}function Ree(t){return Array.isArray(t)?t:[t]}function Aee(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Oee=t=>typeof t=="number",Mee=t=>t.every(Oee);function Dee(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ay(t)&&!Cz(t)?new Hz(e):new Lz(e);n.mount(t),Gf.set(t,n)}function kee(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new xJ(e);n.mount(t),Gf.set(t,n)}function Pee(t,e){return Vn(t)||typeof t=="number"||typeof t=="string"&&!iC(e)}function e_(t,e,n,i){const r=[];if(Pee(t,e))r.push(Wz(t,iC(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return r;const o=Jz(t,e,i),a=o.length;for(let c=0;c<a;c++){const f=o[c],h=f instanceof Element?Dee:kee;Gf.has(f)||h(f);const m=Gf.get(f),p={...n};"delay"in p&&typeof p.delay=="function"&&(p.delay=p.delay(c,a)),r.push(...W1(m,{...e,transition:p},{}))}}return r}function Iee(t,e,n){const i=[],r=t.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){const c=a[0],f=Go(0);return f.on("change",c),a.length===1?[f,[0,1]]:a.length===2?[f,[0,1],a[1]]:[f,a[1],a[2]]}return a});return Tee(r,e,n,{spring:qf}).forEach(({keyframes:a,transition:c},f)=>{i.push(...e_(f,a,c))}),i}function Nee(t){return Array.isArray(t)&&t.some(Array.isArray)}function Lee(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;function r(o,a,c){let f=[],h;const m={};if(n!==void 0&&(m.reduceMotion=n),i!==void 0&&(m.skipAnimations=i),Nee(o)){const{onComplete:y,...b}=a||{};typeof y=="function"&&(h=y),f=Iee(o,{...m,...b},e)}else{const{onComplete:y,...b}=c||{};typeof y=="function"&&(h=y),f=e_(o,a,{...m,...b},e)}const p=new cZ(f);return h&&p.finished.then(h),e&&(e.animations.push(p),p.finished.then(()=>{zu(e.animations,p)})),p}return r}const Pie=Lee(),jk=(t,e)=>Math.abs(t-e);function Bee(t,e){const n=jk(t.x,e.x),i=jk(t.y,e.y);return Math.sqrt(n**2+i**2)}const t_=S.createContext({});function n_(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const Vee=typeof window<"u",zee=Vee?S.useLayoutEffect:S.useEffect,rC=S.createContext(null),sC=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function _ee(t=!0){const e=S.useContext(rC);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,o=S.useId();S.useEffect(()=>{if(t)return r(o)},[t]);const a=S.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,a]:[!0]}const i_=S.createContext({strict:!1}),Kk={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 Yk=!1;function Hee(){if(Yk)return;const t={};for(const e in Kk)t[e]={isEnabled:n=>Kk[e].some(i=>!!n[i])};Rz(t),Yk=!0}function r_(){return Hee(),cJ()}function Fee(t){const e=r_();for(const n in t)e[n]={...e[n],...t[n]};Rz(e)}const Uee=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 Zm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Uee.has(t)}let s_=t=>!Zm(t);function jee(t){typeof t=="function"&&(s_=e=>e.startsWith("on")?!Zm(e):t(e))}try{jee(require("@emotion/is-prop-valid").default)}catch{}function Kee(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||Vn(t[r])||(s_(r)||n===!0&&Zm(r)||!e&&!Zm(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const fy=S.createContext({});function Yee(t,e){if(cy(t)){const{initial:n,animate:i}=t;return{initial:n===!1||Wf(n)?n:void 0,animate:Wf(i)?i:void 0}}return t.inherit!==!1?e:{}}function qee(t){const{initial:e,animate:n}=Yee(t,S.useContext(fy));return S.useMemo(()=>({initial:e,animate:n}),[qk(e),qk(n)])}function qk(t){return Array.isArray(t)?t.join(" "):t}const oC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function o_(t,e,n){for(const i in e)!Vn(e[i])&&!Nz(i,n)&&(t[i]=e[i])}function Gee({transformTemplate:t},e){return S.useMemo(()=>{const n=oC();return tC(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Wee(t,e){const n=t.style||{},i={};return o_(i,n,t),Object.assign(i,Gee(t,e)),i}function Xee(t,e){const n={},i=Wee(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const l_=()=>({...oC(),attrs:{}});function $ee(t,e,n,i){const r=S.useMemo(()=>{const o=l_();return Bz(o,e,zz(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};o_(o,t.style,t),r.style={...o,...r.style}}return r}const Qee=["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 lC(t){return typeof t!="string"||t.includes("-")?!1:!!(Qee.indexOf(t)>-1||/[A-Z]/u.test(t))}function Zee(t,e,n,{latestValues:i},r,o=!1,a){const f=(a??lC(t)?$ee:Xee)(e,i,r,t),h=Kee(e,typeof t=="string",o),m=t!==S.Fragment?{...h,...f,ref:n}:{},{children:p}=e,y=S.useMemo(()=>Vn(p)?p.get():p,[p]);return S.createElement(t,{...m,children:y})}function Jee({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:ete(n,i,r,t),renderState:e()}}function ete(t,e,n,i){const r={},o=i(t,{});for(const y in o)r[y]=om(o[y]);let{initial:a,animate:c}=t;const f=cy(t),h=Ez(t);e&&h&&!f&&t.inherit!==!1&&(a===void 0&&(a=e.initial),c===void 0&&(c=e.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const p=m?c:a;if(p&&typeof p!="boolean"&&!uy(p)){const y=Array.isArray(p)?p:[p];for(let b=0;b<y.length;b++){const x=q1(t,y[b]);if(x){const{transitionEnd:w,transition:C,...E}=x;for(const O in E){let T=E[O];if(Array.isArray(T)){const A=m?T.length-1:0;T=T[A]}T!==null&&(r[O]=T)}for(const O in w)r[O]=w[O]}}}return r}const a_=t=>(e,n)=>{const i=S.useContext(fy),r=S.useContext(rC),o=()=>Jee(t,e,i,r);return n?o():n_(o)},tte=a_({scrapeMotionValuesFromProps:nC,createRenderState:oC}),nte=a_({scrapeMotionValuesFromProps:_z,createRenderState:l_}),ite=Symbol.for("motionComponentSymbol");function rte(t,e,n){const i=S.useRef(n);S.useInsertionEffect(()=>{i.current=n});const r=S.useRef(null);return S.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const a=i.current;if(typeof a=="function")if(o){const c=a(o);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o)},[e])}const u_=S.createContext({});function ou(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ste(t,e,n,i,r,o){const{visualElement:a}=S.useContext(fy),c=S.useContext(i_),f=S.useContext(rC),h=S.useContext(sC),m=h.reducedMotion,p=h.skipAnimations,y=S.useRef(null),b=S.useRef(!1);i=i||c.renderer,!y.current&&i&&(y.current=i(t,{visualState:e,parent:a,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:o}),b.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const x=y.current,w=S.useContext(u_);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&ote(y.current,n,r,w);const C=S.useRef(!1);S.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const E=n[hz],O=S.useRef(!!E&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return zee(()=>{b.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),O.current&&x.animationState&&x.animationState.animateChanges())}),S.useEffect(()=>{x&&(!O.current&&x.animationState&&x.animationState.animateChanges(),O.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),O.current=!1),x.enteringChildren=void 0)}),x}function ote(t,e,n,i){const{layoutId:r,layout:o,drag:a,dragConstraints:c,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:c_(t.parent)),t.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!a||c&&ou(c),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function c_(t){if(t)return t.options.allowProjection!==!1?t.projection:c_(t.parent)}function Jb(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&Fee(i);const o=n?n==="svg":lC(t),a=o?nte:tte;function c(h,m){let p;const y={...S.useContext(sC),...h,layoutId:lte(h)},{isStatic:b}=y,x=qee(h),w=a(h,b);if(!b&&typeof window<"u"){ate();const C=ute(y);p=C.MeasureLayout,x.visualElement=ste(t,w,y,r,C.ProjectionNode,o)}return fe.jsxs(fy.Provider,{value:x,children:[p&&x.visualElement?fe.jsx(p,{visualElement:x.visualElement,...y}):null,Zee(t,h,rte(w,x.visualElement,m),w,b,e,o)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const f=S.forwardRef(c);return f[ite]=t,f}function lte({layoutId:t}){const e=S.useContext(t_).id;return e&&t!==void 0?e+"-"+t:t}function ate(t,e){S.useContext(i_).strict}function ute(t){const e=r_(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function cte(t,e){if(typeof Proxy>"u")return Jb;const n=new Map,i=(o,a)=>Jb(o,a,t,e),r=(o,a)=>i(o,a);return new Proxy(r,{get:(o,a)=>a==="create"?i:(n.has(a)||n.set(a,Jb(a,void 0,t,e)),n.get(a))})}const fte=(t,e)=>e.isSVG??lC(t)?new Hz(e):new Lz(e,{allowProjection:t!==S.Fragment});class dte extends tl{constructor(e){super(e),e.animationState||(e.animationState=kJ(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();uy(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 hte=0;class pte extends tl{constructor(){super(...arguments),this.id=hte++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=zl(this.node,o,a);if(c){const{transition:f,transitionEnd:h,...m}=c;for(const p in m)this.node.getValue(p)?.jump(m[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.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 mte={animation:{Feature:dte},exit:{Feature:pte}};function Rd(t){return{point:{x:t.pageX,y:t.pageY}}}const gte=t=>e=>Z1(e)&&t(e,Rd(e));function Tf(t,e,n,i){return Xf(t,e,gte(n),i)}const f_=({current:t})=>t?t.ownerDocument.defaultView:null,Gk=new Set(["auto","scroll"]);class d_{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3,element:c}={}){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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=eS(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,C=Bee(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!C)return;const{point:E}=x,{timestamp:O}=ei;this.history.push({...E,timestamp:O});const{onStart:T,onMove:A}=this.handlers;w||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,x)},this.handlePointerMove=(x,w)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=zp(w,this.transformPagePoint),Zt.update(this.updatePoint,!0)},this.handlePointerUp=(x,w)=>{this.end();const{onEnd:C,onSessionEnd:E,resumeAnimation:O}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&O&&O(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=eS(x.type==="pointercancel"?this.lastMoveEventInfo:zp(w,this.transformPagePoint),this.history);this.startEvent&&C&&C(x,T),E&&E(x,T)},!Z1(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=r||window;const f=Rd(e),h=zp(f,this.transformPagePoint),{point:m}=h,{timestamp:p}=ei;this.history=[{...m,timestamp:p}];const{onSessionStart:y}=n;y&&y(e,eS(h,this.history));const b={passive:!0,capture:!0};this.removeListeners=Cd(Tf(this.contextWindow,"pointermove",this.handlePointerMove,b),Tf(this.contextWindow,"pointerup",this.handlePointerUp,b),Tf(this.contextWindow,"pointercancel",this.handlePointerUp,b)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Gk.has(i.overflowX)||Gk.has(i.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 i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,r),Zt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qo(this.updatePoint)}}function zp(t,e){return e?{point:e(t.point)}:t}function Wk(t,e){return{x:t.x-e.x,y:t.y-e.y}}function eS({point:t},e){return{point:t,delta:Wk(t,h_(e)),offset:Wk(t,yte(e)),velocity:vte(e,.1)}}function yte(t){return t[0]}function h_(t){return t[t.length-1]}function vte(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=h_(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Ii(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Ii(e)*2&&(i=t[1]);const o=cr(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function bte(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Yt(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Yt(n,t,i.max):Math.min(t,n)),t}function Xk(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 Ste(t,{top:e,left:n,bottom:i,right:r}){return{x:Xk(t.x,n,r),y:Xk(t.y,e,i)}}function $k(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function xte(t,e){return{x:$k(t.x,e.x),y:$k(t.y,e.y)}}function wte(t,e){let n=.5;const i=gi(t),r=gi(e);return r>i?n=_u(e.min,e.max-i,t.min):i>r&&(n=_u(t.min,t.max-r,e.min)),ys(0,1,n)}function Cte(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 $x=.35;function Ete(t=$x){return t===!1?t=0:t===!0&&(t=$x),{x:Qk(t,"left","right"),y:Qk(t,"top","bottom")}}function Qk(t,e,n){return{min:Zk(t,e),max:Zk(t,n)}}function Zk(t,e){return typeof t=="number"?t:t[e]||0}const Tte=new WeakMap;class Rte{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=On(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=p=>{n&&this.snapToCursor(Rd(p).point),this.stopAnimation()},a=(p,y)=>{const{drag:b,dragPropagation:x,onDragStart:w}=this.getProps();if(b&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=UZ(b),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),es(E=>{let O=this.getAxisMotionValue(E).get()||0;if(ms.test(O)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[E];A&&(O=gi(A)*(parseFloat(O)/100))}}this.originPoint[E]=O}),w&&Zt.update(()=>w(p,y),!1,!0),Hx(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:b,dragDirectionLock:x,onDirectionLock:w,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=y;if(x&&this.currentDirection===null){this.currentDirection=Ote(E),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",y.point,E),this.updateAxis("y",y.point,E),this.visualElement.render(),C&&Zt.update(()=>C(p,y),!1,!0)},f=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new d_(e,{onSessionStart:o,onStart:a,onMove:c,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:f_(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&Zt.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&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,i){const{drag:r}=this.getProps();if(!i||!_p(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(a=bte(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ou(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=Ste(i.layoutBox,e):this.constraints=!1,this.elastic=Ete(n),r!==this.constraints&&!ou(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&es(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Cte(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ou(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const o=pJ(i,r.root,this.visualElement.getTransformPagePoint());let a=xte(r.layout.layoutBox,o);if(n){const c=n(fJ(a));this.hasMutatedConstraints=!!c,c&&(a=Mz(c))}return a}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},h=es(m=>{if(!_p(m,n,this.currentDirection))return;let p=f&&f[m]||{};(a===!0||a===m)&&(p={min:0,max:0});const y=r?200:1e6,b=r?40:1e7,x={type:"inertia",velocity:i?e[m]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(m,x)});return Promise.all(h).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return Hx(this.visualElement,e),i.start(Y1(e,i,0,n,this.visualElement,!1))}stopAnimation(){es(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps()[n];return r||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){es(n=>{const{drag:i}=this.getProps();if(!_p(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:c}=r.layout.layoutBox[n],f=o.get()||0;o.set(e[n]-Yt(a,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!ou(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};es(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const f=c.get();r[a]=wte({min:f,max:f},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),es(a=>{if(!_p(a,e,null))return;const c=this.getAxisMotionValue(a),{min:f,max:h}=this.constraints[a];c.set(Yt(f,h,r[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Tte.set(this.visualElement,this);const e=this.visualElement.current,n=Tf(e,"pointerdown",h=>{const{drag:m,dragListener:p=!0}=this.getProps(),y=h.target,b=y!==e&&WZ(y);m&&p&&!b&&this.start(h)});let i;const r=()=>{const{dragConstraints:h}=this.getProps();ou(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Ate(e,h.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Zt.read(r);const c=Xf(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(es(p=>{const y=this.getAxisMotionValue(p);y&&(this.originPoint[p]+=h[p].translate,y.set(y.get()+h[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),f&&f(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=$x,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:c}}}function Jk(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Ate(t,e,n){const i=sk(t,Jk(n)),r=sk(e,Jk(n));return()=>{i(),r()}}function _p(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Ote(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Mte extends tl{constructor(e){super(e),this.removeGroupControls=fr,this.removeListeners=fr,this.controls=new Rte(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fr}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 tS=t=>(e,n)=>{t&&Zt.update(()=>t(e,n),!1,!0)};class Dte extends tl{constructor(){super(...arguments),this.removePointerDownListener=fr}onPointerDown(e){this.session=new d_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:f_(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:tS(e),onStart:tS(n),onMove:tS(i),onEnd:(o,a)=>{delete this.session,r&&Zt.postRender(()=>r(o,a))}}}mount(){this.removePointerDownListener=Tf(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 nS=!1;class kte extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),nS&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:a}=i;return a&&(a.isPresent=o,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),nS=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||Zt.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Q1.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;nS=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function p_(t){const[e,n]=_ee(),i=S.useContext(t_);return fe.jsx(kte,{...t,layoutGroup:i,switchLayoutGroup:S.useContext(u_),isPresent:e,safeToRemove:n})}const Pte={pan:{Feature:Dte},drag:{Feature:Mte,ProjectionNode:Zz,MeasureLayout:p_}};function eP(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&Zt.postRender(()=>o(e,Rd(e)))}class Ite extends tl{mount(){const{current:e}=this.node;e&&(this.unmount=KZ(e,(n,i)=>(eP(this.node,i,"Start"),r=>eP(this.node,r,"End"))))}unmount(){}}class Nte extends tl{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=Cd(Xf(this.node.current,"focus",()=>this.onFocus()),Xf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tP(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&Zt.postRender(()=>o(e,Rd(e)))}class Lte extends tl{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=$Z(e,(r,o)=>(tP(this.node,o,"Start"),(a,{success:c})=>tP(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const Qx=new WeakMap,iS=new WeakMap,Bte=t=>{const e=Qx.get(t.target);e&&e(t)},Vte=t=>{t.forEach(Bte)};function zte({root:t,...e}){const n=t||document;iS.has(n)||iS.set(n,{});const i=iS.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(Vte,{root:t,...e})),i[r]}function _te(t,e,n){const i=zte(e);return Qx.set(t,n),i.observe(t),()=>{Qx.delete(t),i.unobserve(t)}}const Hte={some:0,all:1};class Fte extends tl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=e,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Hte[r]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),y=h?m:p;y&&y(f)};this.stopObserver=_te(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ute(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Ute({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const jte={inView:{Feature:Fte},tap:{Feature:Lte},focus:{Feature:Nte},hover:{Feature:Ite}},Kte={layout:{ProjectionNode:Zz,MeasureLayout:p_}},Yte={...mte,...jte,...Pte,...Kte},qte=cte(Yte,fte);function Iie(t){const e=n_(()=>Go(t)),{isStatic:n}=S.useContext(sC);if(n){const[,i]=S.useState(t);S.useEffect(()=>e.on("change",i),[])}return e}const Nie=qte;function Lie(t){const[e,n]=S.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=S.useRef(null),r=S.useRef(null),o=S.useRef(null),a=S.useRef(null),c=S.useRef(!0),f=S.useRef(null),h=Uu(),m=S.useMemo(()=>({anchor:e,setAnchor:n,actionsRef:o,backdropRef:i,internalBackdropRef:r,positionerRef:a,allowMouseUpTriggerRef:c,initialCursorPointRef:f,rootId:h}),[e,h]);return fe.jsx(CI.Provider,{value:m,children:fe.jsx(Ng.Provider,{value:void 0,children:fe.jsx(Rj,{...t})})})}const nP=500,Bie=S.forwardRef(function(e,n){const{render:i,className:r,style:o,...a}=e,{setAnchor:c,actionsRef:f,internalBackdropRef:h,backdropRef:m,positionerRef:p,allowMouseUpTriggerRef:y,initialCursorPointRef:b,rootId:x}=Lg(!1),{store:w}=Lr(!1),C=w.useState("open"),E=w.useState("disabled"),O=S.useRef(null),T=S.useRef(null),A=wn(),D=wn(),k=S.useRef(!1),M=S.useRef(null);function I(z,V,X){const j=X.type.startsWith("touch");b.current={x:z,y:V},c({getBoundingClientRect(){return DOMRect.fromRect({width:j?10:0,height:j?10:0,x:z,y:V})}}),k.current=!1,f.current?.setOpen(!0,Ze(gs,X)),D.start(nP,()=>{k.current=!0})}function L(z){if(E)return;y.current=!0,Rr(z),I(z.clientX,z.clientY,z.nativeEvent);const V=xt(O.current);M.current?.abort();const X=new AbortController;M.current=X,V.addEventListener("mouseup",j=>{if(y.current=!1,!k.current)return;D.clear(),k.current=!1;const Y=zn(j);Ye(p.current,Y)||x&&Y&&zw(Y)===x||f.current?.setOpen(!1,Ze(sw,j))},{once:!0,signal:X.signal})}function B(){A.clear(),T.current=null}function H(z){if(E){B();return}if(y.current=!1,z.touches.length!==1){B();return}z.stopPropagation();const V=z.touches[0],X={x:V.clientX,y:V.clientY};T.current=X,A.start(nP,()=>{I(X.x,X.y,z.nativeEvent)})}function U(z){if(z.touches.length!==1){B();return}if(A.isStarted()&&T.current){const V=z.touches[0],X=10,j=Math.abs(V.clientX-T.current.x),Y=Math.abs(V.clientY-T.current.y);(j>X||Y>X)&&B()}}return S.useEffect(()=>()=>{M.current?.abort()},[]),S.useEffect(()=>{function z(X){if(E)return;const Y=zn(X);(Ye(O.current,Y)||Ye(h.current,Y)||Ye(m.current,Y))&&X.preventDefault()}const V=xt(O.current);return ft(V,"contextmenu",z)},[m,E,h]),Ot("div",e,{state:{open:C},ref:[O,n],props:[{onContextMenu:L,onTouchStart:H,onTouchMove:U,onTouchEnd:B,onTouchCancel:B,style:{WebkitTouchCallout:"none"}},a],stateAttributesMapping:Rf})}),Vie=pj;export{MX as $,ts as A,EX as B,am as C,oX as D,ze as E,hr as F,Bn as G,kt as H,Vt as I,w1 as J,Zo as K,xe as L,on as M,v1 as N,bs as O,SV as P,nt as Q,zg as R,$t as S,Dr as T,uK as U,ji as V,eg as W,na as X,We as Y,Kl as Z,yie as _,Hp as a,eB as a$,bx as a0,MV as a1,bie as a2,Sie as a3,vie as a4,FX as a5,xie as a6,TV as a7,die as a8,hie as a9,S3 as aA,x3 as aB,V2 as aC,B2 as aD,Aie as aE,DX as aF,Pne as aG,an as aH,EV as aI,b$ as aJ,LD as aK,$V as aL,m2 as aM,GV as aN,Ex as aO,Ln as aP,Nie as aQ,$te as aR,nne as aS,tne as aT,Qte as aU,ene as aV,ine as aW,Jte as aX,Zte as aY,Qne as aZ,$ne as a_,r2 as aa,rr as ab,HX as ac,Fg as ad,Yi as ae,Ut as af,kl as ag,AV as ah,Lu as ai,zV as aj,ZS as ak,Hg as al,SK as am,Lne as an,Nne as ao,kr as ap,vu as aq,l9 as ar,a9 as as,One as at,Us as au,li as av,Wa as aw,Dne as ax,wie as ay,uu as az,mg as b,fie as b$,Jne as b0,Zne as b1,eie as b2,mq as b3,vq as b4,Die as b5,Lie as b6,Bie as b7,ane as b8,Vie as b9,Sne as bA,Fw as bB,Ane as bC,xne as bD,wne as bE,Cne as bF,Ene as bG,Tne as bH,Rne as bI,y6 as bJ,zne as bK,_ne as bL,Fne as bM,Hne as bN,Une as bO,jne as bP,Kne as bQ,Yne as bR,qne as bS,Gne as bT,Wne as bU,Xne as bV,sie as bW,oie as bX,lie as bY,aie as bZ,uie as b_,lne as ba,one as bb,pne as bc,iie as bd,nie as be,UY as bf,FY as bg,rie as bh,$l as bi,Vne as bj,rne as bk,sne as bl,Rj as bm,hne as bn,pj as bo,une as bp,cne as bq,fne as br,dne as bs,mne as bt,o6 as bu,yne as bv,vne as bw,JI as bx,bne as by,Jn as bz,vi as c,lB as c0,Hf as c1,aB as c2,RX as c3,CV as c4,Tie as c5,kne as c6,w$ as c7,Rie as c8,_g as c9,Ine as ca,Pie as cb,N$ as cc,tie as cd,Iie as ce,Cie as cf,ty as cg,Eie as ch,pie as ci,CK as cj,Bne as ck,Mie as cl,Oie as cm,mie as cn,Xte as co,gne as cp,He as d,Ze as e,en as f,Fu as g,Ot as h,Xo as i,fe as j,Ws as k,dn as l,Cw as m,De as n,eo as o,ft as p,Jt as q,$f as r,pP as s,gs as t,bm as u,dr as v,MH as w,Si as x,mt as y,Qt as z};