@plebeiantech/lat.md 0.12.3-fork.9 → 0.13.4-fork.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 (340) hide show
  1. package/README.md +27 -3
  2. package/dist/src/cli/agent-invocation.d.ts +6 -0
  3. package/dist/src/cli/agent-invocation.js +23 -0
  4. package/dist/src/cli/checklist-menu.d.ts +2 -1
  5. package/dist/src/cli/checklist-menu.js +3 -2
  6. package/dist/src/cli/fork-instructions.d.ts +1 -0
  7. package/dist/src/cli/fork-instructions.js +8 -32
  8. package/dist/src/cli/fork-scaffold.js +2 -2
  9. package/dist/src/cli/graph.d.ts +1 -1
  10. package/dist/src/cli/hook.d.ts +26 -0
  11. package/dist/src/cli/hook.js +115 -64
  12. package/dist/src/cli/index.js +178 -70
  13. package/dist/src/cli/init-preferences.d.ts +4 -0
  14. package/dist/src/cli/init-preferences.js +36 -0
  15. package/dist/src/cli/init.d.ts +2 -1
  16. package/dist/src/cli/init.js +100 -60
  17. package/dist/src/cli/reindex.d.ts +1 -1
  18. package/dist/src/cli/reindex.js +7 -10
  19. package/dist/src/cli/search.d.ts +14 -4
  20. package/dist/src/cli/search.js +115 -101
  21. package/dist/src/cli/ui-build-server.d.ts +12 -0
  22. package/dist/src/cli/ui-build-server.js +26 -0
  23. package/dist/src/cli/ui-build.d.ts +1 -1
  24. package/dist/src/cli/ui-build.js +1 -1
  25. package/dist/src/cli/ui.d.ts +1 -1
  26. package/dist/src/cli/ui.js +1 -1
  27. package/dist/src/cli/wiki.d.ts +12 -0
  28. package/dist/src/cli/wiki.js +85 -0
  29. package/dist/src/fork/antigravity-hook.d.ts +47 -0
  30. package/dist/src/fork/antigravity-hook.js +424 -0
  31. package/dist/src/fork/antigravity-init.d.ts +17 -0
  32. package/dist/src/fork/antigravity-init.js +124 -0
  33. package/dist/src/fork/upstream-drift.js +1 -1
  34. package/dist/src/fork/upstream-guard.d.ts +1 -1
  35. package/dist/src/fork/upstream-guard.js +8 -7
  36. package/dist/src/graph-export.js +7 -7
  37. package/dist/src/knowledge/index.js +2 -2
  38. package/dist/src/mcp/server.js +34 -18
  39. package/dist/src/search/cache.d.ts +3 -0
  40. package/dist/src/search/cache.js +104 -0
  41. package/dist/src/search/chunks.d.ts +23 -0
  42. package/dist/src/search/chunks.js +200 -0
  43. package/dist/src/search/db.d.ts +28 -16
  44. package/dist/src/search/db.js +100 -40
  45. package/dist/src/search/embedder.d.ts +2 -1
  46. package/dist/src/search/embedder.js +7 -6
  47. package/dist/src/search/index.d.ts +6 -2
  48. package/dist/src/search/index.js +176 -70
  49. package/dist/src/search/lexical.d.ts +6 -0
  50. package/dist/src/search/lexical.js +36 -0
  51. package/dist/src/search/lock.d.ts +5 -0
  52. package/dist/src/search/lock.js +45 -0
  53. package/dist/src/search/query.d.ts +26 -0
  54. package/dist/src/search/query.js +103 -0
  55. package/dist/src/search/search.d.ts +16 -7
  56. package/dist/src/search/search.js +165 -21
  57. package/dist/src/search/types.d.ts +15 -0
  58. package/dist/src/view/client/assets/GraphView-D_xnk0bP.js +456 -0
  59. package/dist/src/view/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  60. package/dist/src/view/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  61. package/dist/src/view/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  62. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  63. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  64. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  65. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  66. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  67. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  68. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  69. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  70. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  71. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  72. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  73. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  74. package/dist/src/view/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  75. package/dist/src/view/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  76. package/dist/src/view/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  77. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  78. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  79. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  80. package/dist/src/view/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  81. package/dist/src/view/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  82. package/dist/src/view/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  83. package/dist/src/view/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  84. package/dist/src/view/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  85. package/dist/src/view/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  86. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  87. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  88. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  89. package/dist/src/view/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  90. package/dist/src/view/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  91. package/dist/src/view/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  92. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  93. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  94. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  95. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  96. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  97. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  98. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  99. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  100. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  101. package/dist/src/view/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  102. package/dist/src/view/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  103. package/dist/src/view/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  104. package/dist/src/view/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  105. package/dist/src/view/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  106. package/dist/src/view/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  107. package/dist/src/view/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  108. package/dist/src/view/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  109. package/dist/src/view/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  110. package/dist/src/view/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  111. package/dist/src/view/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  112. package/dist/src/view/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  113. package/dist/src/view/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  114. package/dist/src/view/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  115. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  116. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  117. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  118. package/dist/src/view/client/assets/MarkdownEditor-bjqt_FoF.js +28 -0
  119. package/dist/src/view/client/assets/OrbitControls-DwcpQNja.js +1 -0
  120. package/dist/src/view/client/assets/STLLoader-CLWTKt5i.js +1 -0
  121. package/dist/src/view/client/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  122. package/dist/src/view/client/assets/abnfDiagram-VCTEODGH-kWGvtRnL.js +1 -0
  123. package/dist/src/view/client/assets/arc-BPAFd7cP.js +1 -0
  124. package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-CsY39oIR.js +36 -0
  125. package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-DHGBG7BJ.js +129 -0
  126. package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-vywK4eb7.js +38 -0
  127. package/dist/src/view/client/assets/channel-CX71L_qV.js +1 -0
  128. package/dist/src/view/client/assets/chunk-2Q5K7J3B-Do3Hz_ci.js +1 -0
  129. package/dist/src/view/client/assets/chunk-5VM5RSS4-B5R1lSeY.js +15 -0
  130. package/dist/src/view/client/assets/chunk-F27PBJKO-Dm55FM_W.js +1 -0
  131. package/dist/src/view/client/assets/chunk-IMKFNOWR-ChptrvvM.js +231 -0
  132. package/dist/src/view/client/assets/chunk-JWPE2WC7-BRQBjrKS.js +1 -0
  133. package/dist/src/view/client/assets/chunk-POPQ4Y6H-CainVZIL.js +1 -0
  134. package/dist/src/view/client/assets/chunk-SVP7TREG-DsKsNGmM.js +88 -0
  135. package/dist/src/view/client/assets/chunk-TICWLB2K-BctkMcJc.js +206 -0
  136. package/dist/src/view/client/assets/chunk-XXDRQBXY-BN7SgOUT.js +1 -0
  137. package/dist/src/view/client/assets/classDiagram-ZZMXUADV-B1VyU6zO.js +1 -0
  138. package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-B1VyU6zO.js +1 -0
  139. package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-BszzwrMe.js +1 -0
  140. package/dist/src/view/client/assets/cynefin-OW5HDTMX-CdRyAkPs.js +166 -0
  141. package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-BLvKPZ1u.js +62 -0
  142. package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
  143. package/dist/src/view/client/assets/dagre-GXQ25YYZ-V68w_l65.js +4 -0
  144. package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  145. package/dist/src/view/client/assets/diagram-S7CK7UJ4-C2i4eEMg.js +30 -0
  146. package/dist/src/view/client/assets/diagram-UQ7AKVKN-BiwWh5jC.js +41 -0
  147. package/dist/src/view/client/assets/diagram-VSXAHHWV-hkKR_vyS.js +3 -0
  148. package/dist/src/view/client/assets/diagram-VX7I27RA-DzRCSMAc.js +24 -0
  149. package/dist/src/view/client/assets/diagram-Z3DM3KII-fhSFPxyK.js +24 -0
  150. package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-CCEUDKSA.js +1 -0
  151. package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-FJ2IMyTi.js +99 -0
  152. package/dist/src/view/client/assets/flowDiagram-HODETNUW-BvasdLeK.js +168 -0
  153. package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-CiwkBZvY.js +292 -0
  154. package/dist/src/view/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  155. package/dist/src/view/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  156. package/dist/src/view/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  157. package/dist/src/view/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  158. package/dist/src/view/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  159. package/dist/src/view/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  160. package/dist/src/view/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  161. package/dist/src/view/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  162. package/dist/src/view/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  163. package/dist/src/view/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  164. package/dist/src/view/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  165. package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-DYlP2_js.js +106 -0
  166. package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
  167. package/dist/src/view/client/assets/index-CQ7EOox7.css +1 -0
  168. package/dist/src/view/client/assets/index-CynNDkxt.js +13 -0
  169. package/dist/src/view/client/assets/infoDiagram-27XIBGKW-DRPB2c48.js +2 -0
  170. package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
  171. package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-8VV429Cv.js +70 -0
  172. package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-Dzmwnf83.js +139 -0
  173. package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-pYyZZ1i-.js +89 -0
  174. package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
  175. package/dist/src/view/client/assets/layout-GF9k6yGo.js +1 -0
  176. package/dist/src/view/client/assets/linear-Yt2sSOYV.js +1 -0
  177. package/dist/src/view/client/assets/logo-RR_KBOAT.svg +149 -0
  178. package/dist/src/view/client/assets/maplibre-gl-CDX6Zuow.js +800 -0
  179. package/dist/src/view/client/assets/mermaid.core-ChWYCHN0.js +310 -0
  180. package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-Cc4fQvf1.js +96 -0
  181. package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
  182. package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-C0SsB8bZ.js +1 -0
  183. package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-DIJpqERZ.js +39 -0
  184. package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC--d-gl6j-.js +7 -0
  185. package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-BQxwTt7z.js +1 -0
  186. package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-B_oTeD2A.js +84 -0
  187. package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-DLukmE8X.js +40 -0
  188. package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-BNjVB2sc.js +162 -0
  189. package/dist/src/view/client/assets/sizeCapture-INFHLROL-BZecQTOw.js +1 -0
  190. package/dist/src/view/client/assets/stateDiagram-D77RDMKH-Bu1urvXC.js +1 -0
  191. package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-5pc_697G.js +1 -0
  192. package/dist/src/view/client/assets/swimlanes-42K2YHIH-bLAlcepB.js +1 -0
  193. package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-BbOpZjpp.js +8 -0
  194. package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
  195. package/dist/src/view/client/assets/timeline-definition-24CTP7MA-tbwCNvcA.js +120 -0
  196. package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-D8U8Fk0N.js +34 -0
  197. package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-LHBVIeNb.js +78 -0
  198. package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-CN4tfaFV.js +7 -0
  199. package/dist/src/view/client/index.html +2 -2
  200. package/dist/src/view/client-shell.d.ts +2 -0
  201. package/dist/src/view/client-shell.js +5 -0
  202. package/dist/src/view/diagnostics.d.ts +3 -2
  203. package/dist/src/view/diagnostics.js +49 -58
  204. package/dist/src/view/document-edit.d.ts +8 -0
  205. package/dist/src/view/document-edit.js +25 -0
  206. package/dist/src/view/document-route.d.ts +14 -0
  207. package/dist/src/view/document-route.js +137 -0
  208. package/dist/src/view/document-tree.d.ts +18 -0
  209. package/dist/src/view/document-tree.js +139 -0
  210. package/dist/src/view/external-document-tree.d.ts +3 -0
  211. package/dist/src/view/external-document-tree.js +674 -0
  212. package/dist/src/view/git-diff.js +202 -2
  213. package/dist/src/view/git.js +1 -1
  214. package/dist/src/view/graph.d.ts +4 -3
  215. package/dist/src/view/graph.js +100 -9
  216. package/dist/src/view/highlight.d.ts +10 -2
  217. package/dist/src/view/highlight.js +50648 -3166
  218. package/dist/src/view/markdown.d.ts +3 -2
  219. package/dist/src/view/markdown.js +256 -54
  220. package/dist/src/view/preindexed-search.d.ts +15 -0
  221. package/dist/src/view/preindexed-search.js +25 -0
  222. package/dist/src/view/protocol.d.ts +53 -7
  223. package/dist/src/view/publication.d.ts +2 -0
  224. package/dist/src/view/publication.js +78 -0
  225. package/dist/src/view/references.d.ts +11 -26
  226. package/dist/src/view/references.js +121 -112
  227. package/dist/src/view/repository.d.ts +14 -4
  228. package/dist/src/view/repository.js +260 -19
  229. package/dist/src/view/request-security.d.ts +5 -0
  230. package/dist/src/view/request-security.js +46 -0
  231. package/dist/src/view/search-result.d.ts +4 -0
  232. package/dist/src/view/search-result.js +25 -0
  233. package/dist/src/view/search.d.ts +7 -2
  234. package/dist/src/view/search.js +23 -34
  235. package/dist/src/view/server-build.d.ts +21 -0
  236. package/dist/src/view/server-build.js +145 -0
  237. package/dist/src/view/server-deployment.d.ts +31 -0
  238. package/dist/src/view/server-deployment.js +123 -0
  239. package/dist/src/view/server-index-worker.d.ts +6 -0
  240. package/dist/src/view/server-index-worker.js +14 -0
  241. package/dist/src/view/server.d.ts +11 -2
  242. package/dist/src/view/server.js +245 -73
  243. package/dist/src/view/source-target.d.ts +2 -0
  244. package/dist/src/view/source-target.js +49 -8
  245. package/dist/src/view/static-build.d.ts +18 -2
  246. package/dist/src/view/static-build.js +449 -110
  247. package/dist/src/view/static-protocol.d.ts +26 -2
  248. package/dist/src/view/static-protocol.js +5 -0
  249. package/dist/src/view/store.d.ts +20 -3
  250. package/dist/src/view/store.js +304 -48
  251. package/dist/src/view/table-of-contents.d.ts +2 -2
  252. package/dist/src/view/table-of-contents.js +2 -22
  253. package/dist/src/view/vercel-build.d.ts +24 -0
  254. package/dist/src/view/vercel-build.js +152 -0
  255. package/dist/src/view/vercel-server-build.d.ts +10 -0
  256. package/dist/src/view/vercel-server-build.js +61 -0
  257. package/dist/src/wiki/catalog.d.ts +21 -0
  258. package/dist/src/wiki/catalog.js +256 -0
  259. package/dist/src/wiki/publish.d.ts +27 -0
  260. package/dist/src/wiki/publish.js +265 -0
  261. package/dist/src/wiki/render.d.ts +20 -0
  262. package/dist/src/wiki/render.js +163 -0
  263. package/dist/src/wiki/transform.d.ts +7 -0
  264. package/dist/src/wiki/transform.js +264 -0
  265. package/dist/vendor/lat.md-server/cli.d.ts +2 -0
  266. package/dist/vendor/lat.md-server/cli.js +12 -0
  267. package/dist/vendor/lat.md-server/index.d.ts +38 -0
  268. package/dist/vendor/lat.md-server/index.js +128 -0
  269. package/package.json +68 -22
  270. package/plugins/lat-md/README.md +61 -0
  271. package/plugins/lat-md/hooks.json +38 -0
  272. package/plugins/lat-md/plugin.json +9 -0
  273. package/plugins/lat-md/rules/AGENTS.md +344 -0
  274. package/plugins/lat-md/skills/lat-md/SKILL.md +210 -0
  275. package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +226 -0
  276. package/templates/AGENTS.md +26 -7
  277. package/templates/cursor-rules.md +23 -7
  278. package/templates/fork/conventions.md +133 -11
  279. package/templates/opencode-plugin.ts +9 -9
  280. package/templates/pi-extension.ts +11 -11
  281. package/templates/skill/SKILL.md +35 -3
  282. package/dist/src/cli/check-coverage.d.ts +0 -2
  283. package/dist/src/cli/check-coverage.js +0 -71
  284. package/dist/src/cli/check-frontmatter.d.ts +0 -12
  285. package/dist/src/cli/check-frontmatter.js +0 -44
  286. package/dist/src/cli/check-mode.d.ts +0 -21
  287. package/dist/src/cli/check-mode.js +0 -364
  288. package/dist/src/cli/check-status.d.ts +0 -74
  289. package/dist/src/cli/check-status.js +0 -217
  290. package/dist/src/cli/check.d.ts +0 -45
  291. package/dist/src/cli/check.js +0 -781
  292. package/dist/src/cli/context.d.ts +0 -11
  293. package/dist/src/cli/context.js +0 -58
  294. package/dist/src/cli/expand.d.ts +0 -8
  295. package/dist/src/cli/expand.js +0 -94
  296. package/dist/src/cli/gen-index.d.ts +0 -45
  297. package/dist/src/cli/gen-index.js +0 -235
  298. package/dist/src/cli/link-scheme.d.ts +0 -54
  299. package/dist/src/cli/link-scheme.js +0 -101
  300. package/dist/src/cli/locate.d.ts +0 -2
  301. package/dist/src/cli/locate.js +0 -17
  302. package/dist/src/cli/refs.d.ts +0 -22
  303. package/dist/src/cli/refs.js +0 -229
  304. package/dist/src/cli/section.d.ts +0 -43
  305. package/dist/src/cli/section.js +0 -252
  306. package/dist/src/cli/select-menu.d.ts +0 -13
  307. package/dist/src/cli/select-menu.js +0 -100
  308. package/dist/src/code-refs.d.ts +0 -17
  309. package/dist/src/code-refs.js +0 -298
  310. package/dist/src/config.d.ts +0 -29
  311. package/dist/src/config.js +0 -83
  312. package/dist/src/context.d.ts +0 -23
  313. package/dist/src/context.js +0 -11
  314. package/dist/src/extensions/wiki-link/from-markdown.d.ts +0 -5
  315. package/dist/src/extensions/wiki-link/from-markdown.js +0 -34
  316. package/dist/src/extensions/wiki-link/index.d.ts +0 -4
  317. package/dist/src/extensions/wiki-link/index.js +0 -3
  318. package/dist/src/extensions/wiki-link/syntax.d.ts +0 -14
  319. package/dist/src/extensions/wiki-link/syntax.js +0 -121
  320. package/dist/src/extensions/wiki-link/to-markdown.d.ts +0 -5
  321. package/dist/src/extensions/wiki-link/to-markdown.js +0 -28
  322. package/dist/src/extensions/wiki-link/types.d.ts +0 -34
  323. package/dist/src/format.d.ts +0 -8
  324. package/dist/src/format.js +0 -43
  325. package/dist/src/init-version.d.ts +0 -10
  326. package/dist/src/init-version.js +0 -49
  327. package/dist/src/lattice.d.ts +0 -109
  328. package/dist/src/lattice.js +0 -817
  329. package/dist/src/parser.d.ts +0 -3
  330. package/dist/src/parser.js +0 -18
  331. package/dist/src/source-parser.d.ts +0 -27
  332. package/dist/src/source-parser.js +0 -916
  333. package/dist/src/untrusted.d.ts +0 -18
  334. package/dist/src/untrusted.js +0 -93
  335. package/dist/src/view/client/assets/index-C3iaZyYT.css +0 -1
  336. package/dist/src/view/client/assets/index-KWi67IMz.js +0 -334
  337. package/dist/src/view/client/assets/logo-CNF8zs47.svg +0 -182
  338. package/dist/src/walk.d.ts +0 -18
  339. package/dist/src/walk.js +0 -27
  340. /package/dist/src/{extensions/wiki-link → search}/types.js +0 -0
@@ -1,334 +0,0 @@
1
- (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function l(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(o){if(o.ep)return;o.ep=!0;const f=l(o);fetch(o.href,f)}})();function fy(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var ms={exports:{}},ur={};var rg;function dy(){if(rg)return ur;rg=1;var u=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function l(a,o,f){var d=null;if(f!==void 0&&(d=""+f),o.key!==void 0&&(d=""+o.key),"key"in o){f={};for(var g in o)g!=="key"&&(f[g]=o[g])}else f=o;return o=f.ref,{$$typeof:u,type:a,key:d,ref:o!==void 0?o:null,props:f}}return ur.Fragment=r,ur.jsx=l,ur.jsxs=l,ur}var lg;function hy(){return lg||(lg=1,ms.exports=dy()),ms.exports}var x=hy(),vs={exports:{}},ve={};var ug;function gy(){if(ug)return ve;ug=1;var u=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),E=Symbol.iterator;function T(w){return w===null||typeof w!="object"?null:(w=E&&w[E]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,k={};function X(w,F,J){this.props=w,this.context=F,this.refs=k,this.updater=J||N}X.prototype.isReactComponent={},X.prototype.setState=function(w,F){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,F,"setState")},X.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function K(){}K.prototype=X.prototype;function V(w,F,J){this.props=w,this.context=F,this.refs=k,this.updater=J||N}var C=V.prototype=new K;C.constructor=V,L(C,X.prototype),C.isPureReactComponent=!0;var M=Array.isArray;function j(){}var O={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function B(w,F,J){var ne=J.ref;return{$$typeof:u,type:w,key:F,ref:ne!==void 0?ne:null,props:J}}function Q(w,F){return B(w.type,F,w.props)}function se(w){return typeof w=="object"&&w!==null&&w.$$typeof===u}function ce(w){var F={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(J){return F[J]})}var ue=/\/+/g;function Ee(w,F){return typeof w=="object"&&w!==null&&w.key!=null?ce(""+w.key):F.toString(36)}function Te(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(j,j):(w.status="pending",w.then(function(F){w.status==="pending"&&(w.status="fulfilled",w.value=F)},function(F){w.status==="pending"&&(w.status="rejected",w.reason=F)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function G(w,F,J,ne,he){var be=typeof w;(be==="undefined"||be==="boolean")&&(w=null);var q=!1;if(w===null)q=!0;else switch(be){case"bigint":case"string":case"number":q=!0;break;case"object":switch(w.$$typeof){case u:case r:q=!0;break;case b:return q=w._init,G(q(w._payload),F,J,ne,he)}}if(q)return he=he(w),q=ne===""?"."+Ee(w,0):ne,M(he)?(J="",q!=null&&(J=q.replace(ue,"$&/")+"/"),G(he,F,J,"",function(Be){return Be})):he!=null&&(se(he)&&(he=Q(he,J+(he.key==null||w&&w.key===he.key?"":(""+he.key).replace(ue,"$&/")+"/")+q)),F.push(he)),1;q=0;var me=ne===""?".":ne+":";if(M(w))for(var ge=0;ge<w.length;ge++)ne=w[ge],be=me+Ee(ne,ge),q+=G(ne,F,J,be,he);else if(ge=T(w),typeof ge=="function")for(w=ge.call(w),ge=0;!(ne=w.next()).done;)ne=ne.value,be=me+Ee(ne,ge++),q+=G(ne,F,J,be,he);else if(be==="object"){if(typeof w.then=="function")return G(Te(w),F,J,ne,he);throw F=String(w),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return q}function I(w,F,J){if(w==null)return w;var ne=[],he=0;return G(w,ne,"","",function(be){return F.call(J,be,he++)}),ne}function le(w){if(w._status===-1){var F=w._result;F=F(),F.then(function(J){(w._status===0||w._status===-1)&&(w._status=1,w._result=J)},function(J){(w._status===0||w._status===-1)&&(w._status=2,w._result=J)}),w._status===-1&&(w._status=0,w._result=F)}if(w._status===1)return w._result.default;throw w._result}var Se=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},we={map:I,forEach:function(w,F,J){I(w,function(){F.apply(this,arguments)},J)},count:function(w){var F=0;return I(w,function(){F++}),F},toArray:function(w){return I(w,function(F){return F})||[]},only:function(w){if(!se(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return ve.Activity=p,ve.Children=we,ve.Component=X,ve.Fragment=l,ve.Profiler=o,ve.PureComponent=V,ve.StrictMode=a,ve.Suspense=m,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ve.__COMPILER_RUNTIME={__proto__:null,c:function(w){return O.H.useMemoCache(w)}},ve.cache=function(w){return function(){return w.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.cloneElement=function(w,F,J){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var ne=L({},w.props),he=w.key;if(F!=null)for(be in F.key!==void 0&&(he=""+F.key),F)!ee.call(F,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&F.ref===void 0||(ne[be]=F[be]);var be=arguments.length-2;if(be===1)ne.children=J;else if(1<be){for(var q=Array(be),me=0;me<be;me++)q[me]=arguments[me+2];ne.children=q}return B(w.type,he,ne)},ve.createContext=function(w){return w={$$typeof:d,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:f,_context:w},w},ve.createElement=function(w,F,J){var ne,he={},be=null;if(F!=null)for(ne in F.key!==void 0&&(be=""+F.key),F)ee.call(F,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(he[ne]=F[ne]);var q=arguments.length-2;if(q===1)he.children=J;else if(1<q){for(var me=Array(q),ge=0;ge<q;ge++)me[ge]=arguments[ge+2];he.children=me}if(w&&w.defaultProps)for(ne in q=w.defaultProps,q)he[ne]===void 0&&(he[ne]=q[ne]);return B(w,be,he)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(w){return{$$typeof:g,render:w}},ve.isValidElement=se,ve.lazy=function(w){return{$$typeof:b,_payload:{_status:-1,_result:w},_init:le}},ve.memo=function(w,F){return{$$typeof:v,type:w,compare:F===void 0?null:F}},ve.startTransition=function(w){var F=O.T,J={};O.T=J;try{var ne=w(),he=O.S;he!==null&&he(J,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(j,Se)}catch(be){Se(be)}finally{F!==null&&J.types!==null&&(F.types=J.types),O.T=F}},ve.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ve.use=function(w){return O.H.use(w)},ve.useActionState=function(w,F,J){return O.H.useActionState(w,F,J)},ve.useCallback=function(w,F){return O.H.useCallback(w,F)},ve.useContext=function(w){return O.H.useContext(w)},ve.useDebugValue=function(){},ve.useDeferredValue=function(w,F){return O.H.useDeferredValue(w,F)},ve.useEffect=function(w,F){return O.H.useEffect(w,F)},ve.useEffectEvent=function(w){return O.H.useEffectEvent(w)},ve.useId=function(){return O.H.useId()},ve.useImperativeHandle=function(w,F,J){return O.H.useImperativeHandle(w,F,J)},ve.useInsertionEffect=function(w,F){return O.H.useInsertionEffect(w,F)},ve.useLayoutEffect=function(w,F){return O.H.useLayoutEffect(w,F)},ve.useMemo=function(w,F){return O.H.useMemo(w,F)},ve.useOptimistic=function(w,F){return O.H.useOptimistic(w,F)},ve.useReducer=function(w,F,J){return O.H.useReducer(w,F,J)},ve.useRef=function(w){return O.H.useRef(w)},ve.useState=function(w){return O.H.useState(w)},ve.useSyncExternalStore=function(w,F,J){return O.H.useSyncExternalStore(w,F,J)},ve.useTransition=function(){return O.H.useTransition()},ve.version="19.2.8",ve}var og;function Qs(){return og||(og=1,vs.exports=gy()),vs.exports}var P=Qs(),ps={exports:{}},or={},ys={exports:{}},bs={};var sg;function my(){return sg||(sg=1,(function(u){function r(G,I){var le=G.length;G.push(I);e:for(;0<le;){var Se=le-1>>>1,we=G[Se];if(0<o(we,I))G[Se]=I,G[le]=we,le=Se;else break e}}function l(G){return G.length===0?null:G[0]}function a(G){if(G.length===0)return null;var I=G[0],le=G.pop();if(le!==I){G[0]=le;e:for(var Se=0,we=G.length,w=we>>>1;Se<w;){var F=2*(Se+1)-1,J=G[F],ne=F+1,he=G[ne];if(0>o(J,le))ne<we&&0>o(he,J)?(G[Se]=he,G[ne]=le,Se=ne):(G[Se]=J,G[F]=le,Se=F);else if(ne<we&&0>o(he,le))G[Se]=he,G[ne]=le,Se=ne;else break e}}return I}function o(G,I){var le=G.sortIndex-I.sortIndex;return le!==0?le:G.id-I.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;u.unstable_now=function(){return f.now()}}else{var d=Date,g=d.now();u.unstable_now=function(){return d.now()-g}}var m=[],v=[],b=1,p=null,E=3,T=!1,N=!1,L=!1,k=!1,X=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var I=l(v);I!==null;){if(I.callback===null)a(v);else if(I.startTime<=G)a(v),I.sortIndex=I.expirationTime,r(m,I);else break;I=l(v)}}function M(G){if(L=!1,C(G),!N)if(l(m)!==null)N=!0,j||(j=!0,ce());else{var I=l(v);I!==null&&Te(M,I.startTime-G)}}var j=!1,O=-1,ee=5,B=-1;function Q(){return k?!0:!(u.unstable_now()-B<ee)}function se(){if(k=!1,j){var G=u.unstable_now();B=G;var I=!0;try{e:{N=!1,L&&(L=!1,K(O),O=-1),T=!0;var le=E;try{t:{for(C(G),p=l(m);p!==null&&!(p.expirationTime>G&&Q());){var Se=p.callback;if(typeof Se=="function"){p.callback=null,E=p.priorityLevel;var we=Se(p.expirationTime<=G);if(G=u.unstable_now(),typeof we=="function"){p.callback=we,C(G),I=!0;break t}p===l(m)&&a(m),C(G)}else a(m);p=l(m)}if(p!==null)I=!0;else{var w=l(v);w!==null&&Te(M,w.startTime-G),I=!1}}break e}finally{p=null,E=le,T=!1}I=void 0}}finally{I?ce():j=!1}}}var ce;if(typeof V=="function")ce=function(){V(se)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,Ee=ue.port2;ue.port1.onmessage=se,ce=function(){Ee.postMessage(null)}}else ce=function(){X(se,0)};function Te(G,I){O=X(function(){G(u.unstable_now())},I)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(G){G.callback=null},u.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<G?Math.floor(1e3/G):5},u.unstable_getCurrentPriorityLevel=function(){return E},u.unstable_next=function(G){switch(E){case 1:case 2:case 3:var I=3;break;default:I=E}var le=E;E=I;try{return G()}finally{E=le}},u.unstable_requestPaint=function(){k=!0},u.unstable_runWithPriority=function(G,I){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var le=E;E=G;try{return I()}finally{E=le}},u.unstable_scheduleCallback=function(G,I,le){var Se=u.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?Se+le:Se):le=Se,G){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=le+we,G={id:b++,callback:I,priorityLevel:G,startTime:le,expirationTime:we,sortIndex:-1},le>Se?(G.sortIndex=le,r(v,G),l(m)===null&&G===l(v)&&(L?(K(O),O=-1):L=!0,Te(M,le-Se))):(G.sortIndex=we,r(m,G),N||T||(N=!0,j||(j=!0,ce()))),G},u.unstable_shouldYield=Q,u.unstable_wrapCallback=function(G){var I=E;return function(){var le=E;E=I;try{return G.apply(this,arguments)}finally{E=le}}}})(bs)),bs}var cg;function vy(){return cg||(cg=1,ys.exports=my()),ys.exports}var Es={exports:{}},st={};var fg;function py(){if(fg)return st;fg=1;var u=Qs();function r(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)v+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var a={d:{f:l,r:function(){throw Error(r(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(m,v,b){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:m,containerInfo:v,implementation:b}}var d=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,v){if(m==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,st.createPortal=function(m,v){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(r(299));return f(m,v,null,b)},st.flushSync=function(m){var v=d.T,b=a.p;try{if(d.T=null,a.p=2,m)return m()}finally{d.T=v,a.p=b,a.d.f()}},st.preconnect=function(m,v){typeof m=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,a.d.C(m,v))},st.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},st.preinit=function(m,v){if(typeof m=="string"&&v&&typeof v.as=="string"){var b=v.as,p=g(b,v.crossOrigin),E=typeof v.integrity=="string"?v.integrity:void 0,T=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;b==="style"?a.d.S(m,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:p,integrity:E,fetchPriority:T}):b==="script"&&a.d.X(m,{crossOrigin:p,integrity:E,fetchPriority:T,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},st.preinitModule=function(m,v){if(typeof m=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var b=g(v.as,v.crossOrigin);a.d.M(m,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&a.d.M(m)},st.preload=function(m,v){if(typeof m=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var b=v.as,p=g(b,v.crossOrigin);a.d.L(m,b,{crossOrigin:p,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},st.preloadModule=function(m,v){if(typeof m=="string")if(v){var b=g(v.as,v.crossOrigin);a.d.m(m,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else a.d.m(m)},st.requestFormReset=function(m){a.d.r(m)},st.unstable_batchedUpdates=function(m,v){return m(v)},st.useFormState=function(m,v,b){return d.H.useFormState(m,v,b)},st.useFormStatus=function(){return d.H.useHostTransitionStatus()},st.version="19.2.8",st}var dg;function yy(){if(dg)return Es.exports;dg=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}return u(),Es.exports=py(),Es.exports}var hg;function by(){if(hg)return or;hg=1;var u=vy(),r=Qs(),l=yy();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(f(e)!==e)throw Error(a(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(a(188));return t!==e?null:e}for(var n=e,i=t;;){var s=n.return;if(s===null)break;var c=s.alternate;if(c===null){if(i=s.return,i!==null){n=i;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===n)return m(s),e;if(c===i)return m(s),t;c=c.sibling}throw Error(a(188))}if(n.return!==i.return)n=s,i=c;else{for(var h=!1,y=s.child;y;){if(y===n){h=!0,n=s,i=c;break}if(y===i){h=!0,i=s,n=c;break}y=y.sibling}if(!h){for(y=c.child;y;){if(y===n){h=!0,n=c,i=s;break}if(y===i){h=!0,i=c,n=s;break}y=y.sibling}if(!h)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),V=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=se&&e[se]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function Ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case X:return"Profiler";case k:return"StrictMode";case M:return"Suspense";case j:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case V:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case C:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}var Te=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},Se=[],we=-1;function w(e){return{current:e}}function F(e){0>we||(e.current=Se[we],Se[we]=null,we--)}function J(e,t){we++,Se[we]=e.current,e.current=t}var ne=w(null),he=w(null),be=w(null),q=w(null);function me(e,t){switch(J(be,t),J(he,e),J(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Nh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Nh(t),e=Rh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(ne),J(ne,e)}function ge(){F(ne),F(he),F(be)}function Be(e){e.memoizedState!==null&&J(q,e);var t=ne.current,n=Rh(t,e.type);t!==n&&(J(he,e),J(ne,n))}function Ye(e){he.current===e&&(F(ne),F(he)),q.current===e&&(F(q),ir._currentValue=le)}var ot,ht;function It(e){if(ot===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ot=t&&t[1]||"",ht=-1<n.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ot+e+ht}var Il=!1;function Wl(e,t){if(!e||Il)return"";Il=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(U){var z=U}Reflect.construct(e,[],$)}else{try{$.call()}catch(U){z=U}e.call($.prototype)}}else{try{throw Error()}catch(U){z=U}($=e())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(U){if(U&&z&&typeof U.stack=="string")return[U.stack,z.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),h=c[0],y=c[1];if(h&&y){var S=h.split(`
4
- `),D=y.split(`
5
- `);for(s=i=0;i<S.length&&!S[i].includes("DetermineComponentFrameRoot");)i++;for(;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;if(i===S.length||s===D.length)for(i=S.length-1,s=D.length-1;1<=i&&0<=s&&S[i]!==D[s];)s--;for(;1<=i&&0<=s;i--,s--)if(S[i]!==D[s]){if(i!==1||s!==1)do if(i--,s--,0>s||S[i]!==D[s]){var H=`
6
- `+S[i].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=i&&0<=s);break}}}finally{Il=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?It(n):""}function Ym(e,t){switch(e.tag){case 26:case 27:case 5:return It(e.type);case 16:return It("Lazy");case 13:return e.child!==t&&t!==null?It("Suspense Fallback"):It("Suspense");case 19:return It("SuspenseList");case 0:case 15:return Wl(e.type,!1);case 11:return Wl(e.type.render,!1);case 1:return Wl(e.type,!0);case 31:return It("Activity");default:return""}}function ac(e){try{var t="",n=null;do t+=Ym(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
7
- Error generating stack: `+i.message+`
8
- `+i.stack}}var Pl=Object.prototype.hasOwnProperty,eu=u.unstable_scheduleCallback,tu=u.unstable_cancelCallback,Fm=u.unstable_shouldYield,$m=u.unstable_requestPaint,St=u.unstable_now,Xm=u.unstable_getCurrentPriorityLevel,rc=u.unstable_ImmediatePriority,lc=u.unstable_UserBlockingPriority,Sr=u.unstable_NormalPriority,Vm=u.unstable_LowPriority,uc=u.unstable_IdlePriority,Zm=u.log,Qm=u.unstable_setDisableYieldValue,ma=null,wt=null;function Cn(e){if(typeof Zm=="function"&&Qm(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(ma,e)}catch{}}var Tt=Math.clz32?Math.clz32:Im,Km=Math.log,Jm=Math.LN2;function Im(e){return e>>>=0,e===0?32:31-(Km(e)/Jm|0)|0}var wr=256,Tr=262144,_r=4194304;function Pn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function xr(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var s=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var y=i&134217727;return y!==0?(i=y&~c,i!==0?s=Pn(i):(h&=y,h!==0?s=Pn(h):n||(n=y&~e,n!==0&&(s=Pn(n))))):(y=i&~c,y!==0?s=Pn(y):h!==0?s=Pn(h):n||(n=i&~e,n!==0&&(s=Pn(n)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:s}function va(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 oc(){var e=_r;return _r<<=1,(_r&62914560)===0&&(_r=4194304),e}function nu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Pm(e,t,n,i,s,c){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var y=e.entanglements,S=e.expirationTimes,D=e.hiddenUpdates;for(n=h&~n;0<n;){var H=31-Tt(n),$=1<<H;y[H]=0,S[H]=-1;var z=D[H];if(z!==null)for(D[H]=null,H=0;H<z.length;H++){var U=z[H];U!==null&&(U.lane&=-536870913)}n&=~$}i!==0&&sc(e,i,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function sc(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Tt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function cc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Tt(n),s=1<<i;s&t|e[i]&t&&(e[i]|=t),n&=~s}}function fc(e,t){var n=t&-t;return n=(n&42)!==0?1:iu(n),(n&(e.suspendedLanes|t))!==0?0:n}function iu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function au(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function dc(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Wh(e.type))}function hc(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Nn=Math.random().toString(36).slice(2),nt="__reactFiber$"+Nn,gt="__reactProps$"+Nn,Ti="__reactContainer$"+Nn,ru="__reactEvents$"+Nn,ev="__reactListeners$"+Nn,tv="__reactHandles$"+Nn,gc="__reactResources$"+Nn,ya="__reactMarker$"+Nn;function lu(e){delete e[nt],delete e[gt],delete e[ru],delete e[ev],delete e[tv]}function _i(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ti]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Uh(e);e!==null;){if(n=e[nt])return n;e=Uh(e)}return t}e=n,n=e.parentNode}return null}function xi(e){if(e=e[nt]||e[Ti]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ba(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Ai(e){var t=e[gc];return t||(t=e[gc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[ya]=!0}var mc=new Set,vc={};function ei(e,t){Ci(e,t),Ci(e+"Capture",t)}function Ci(e,t){for(vc[e]=t,e=0;e<t.length;e++)mc.add(t[e])}var nv=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]*$"),pc={},yc={};function iv(e){return Pl.call(yc,e)?!0:Pl.call(pc,e)?!1:nv.test(e)?yc[e]=!0:(pc[e]=!0,!1)}function Ar(e,t,n){if(iv(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Cr(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function rn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function av(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,c=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uu(e){if(!e._valueTracker){var t=bc(e)?"checked":"value";e._valueTracker=av(e,t,""+e[t])}}function Ec(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=bc(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Nr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var rv=/[\n"\\]/g;function Mt(e){return e.replace(rv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ou(e,t,n,i,s,c,h,y){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?su(e,h,zt(t)):n!=null?su(e,h,zt(n)):i!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+zt(y):e.removeAttribute("name")}function Sc(e,t,n,i,s,c,h,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){uu(e);return}n=n!=null?""+zt(n):"",t=t!=null?""+zt(t):n,y||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=y?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),uu(e)}function su(e,t,n){t==="number"&&Nr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ni(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&i&&(e[n].defaultSelected=!0)}else{for(n=""+zt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function wc(e,t,n){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+zt(n):""}function Tc(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(a(92));if(Te(i)){if(1<i.length)throw Error(a(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=zt(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),uu(e)}function Ri(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lv=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 _c(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||lv.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function xc(e,t,n){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var s in t)i=t[s],t.hasOwnProperty(s)&&n[s]!==i&&_c(e,s,i)}else for(var c in t)t.hasOwnProperty(c)&&_c(e,c,t[c])}function cu(e){if(e.indexOf("-")===-1)return!1;switch(e){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 uv=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"],["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"]]),ov=/^[\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 Rr(e){return ov.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ln(){}var fu=null;function du(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Di=null,zi=null;function Ac(e){var t=xi(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ou(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Mt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var s=i[gt]||null;if(!s)throw Error(a(90));ou(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&Ec(i)}break e;case"textarea":wc(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ni(e,!!n.multiple,t,!1)}}}var hu=!1;function Cc(e,t,n){if(hu)return e(t,n);hu=!0;try{var i=e(t);return i}finally{if(hu=!1,(Di!==null||zi!==null)&&(vl(),Di&&(t=Di,e=zi,zi=Di=null,Ac(t),e)))for(t=0;t<e.length;t++)Ac(e[t])}}function Ea(e,t){var n=e.stateNode;if(n===null)return null;var i=n[gt]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(a(231,t,typeof n));return n}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gu=!1;if(un)try{var Sa={};Object.defineProperty(Sa,"passive",{get:function(){gu=!0}}),window.addEventListener("test",Sa,Sa),window.removeEventListener("test",Sa,Sa)}catch{gu=!1}var Rn=null,mu=null,Dr=null;function Nc(){if(Dr)return Dr;var e,t=mu,n=t.length,i,s="value"in Rn?Rn.value:Rn.textContent,c=s.length;for(e=0;e<n&&t[e]===s[e];e++);var h=n-e;for(i=1;i<=h&&t[n-i]===s[c-i];i++);return Dr=s.slice(e,1<i?1-i:void 0)}function zr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mr(){return!0}function Rc(){return!1}function mt(e){function t(n,i,s,c,h){this._reactName=n,this._targetInst=s,this.type=i,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(n=e[y],this[y]=n?n(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Mr:Rc,this.isPropagationStopped=Rc,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Mr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mr)},persist:function(){},isPersistent:Mr}),t}var ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lr=mt(ti),wa=p({},ti,{view:0,detail:0}),sv=mt(wa),vu,pu,Ta,Gr=p({},wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ta&&(Ta&&e.type==="mousemove"?(vu=e.screenX-Ta.screenX,pu=e.screenY-Ta.screenY):pu=vu=0,Ta=e),vu)},movementY:function(e){return"movementY"in e?e.movementY:pu}}),Dc=mt(Gr),cv=p({},Gr,{dataTransfer:0}),fv=mt(cv),dv=p({},wa,{relatedTarget:0}),yu=mt(dv),hv=p({},ti,{animationName:0,elapsedTime:0,pseudoElement:0}),gv=mt(hv),mv=p({},ti,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vv=mt(mv),pv=p({},ti,{data:0}),zc=mt(pv),yv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bv={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"},Ev={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ev[e])?!!t[e]:!1}function bu(){return Sv}var wv=p({},wa,{key:function(e){if(e.key){var t=yv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bu,charCode:function(e){return e.type==="keypress"?zr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Tv=mt(wv),_v=p({},Gr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mc=mt(_v),xv=p({},wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bu}),Av=mt(xv),Cv=p({},ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nv=mt(Cv),Rv=p({},Gr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Dv=mt(Rv),zv=p({},ti,{newState:0,oldState:0}),Mv=mt(zv),Lv=[9,13,27,32],Eu=un&&"CompositionEvent"in window,_a=null;un&&"documentMode"in document&&(_a=document.documentMode);var Gv=un&&"TextEvent"in window&&!_a,Lc=un&&(!Eu||_a&&8<_a&&11>=_a),Gc=" ",Oc=!1;function Uc(e,t){switch(e){case"keyup":return Lv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mi=!1;function Ov(e,t){switch(e){case"compositionend":return kc(t);case"keypress":return t.which!==32?null:(Oc=!0,Gc);case"textInput":return e=t.data,e===Gc&&Oc?null:e;default:return null}}function Uv(e,t){if(Mi)return e==="compositionend"||!Eu&&Uc(e,t)?(e=Nc(),Dr=mu=Rn=null,Mi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Lc&&t.locale!=="ko"?null:t.data;default:return null}}var kv={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 jc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kv[e.type]:t==="textarea"}function Bc(e,t,n,i){Di?zi?zi.push(i):zi=[i]:Di=i,t=Tl(t,"onChange"),0<t.length&&(n=new Lr("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var xa=null,Aa=null;function jv(e){wh(e,0)}function Or(e){var t=ba(e);if(Ec(t))return e}function Hc(e,t){if(e==="change")return t}var qc=!1;if(un){var Su;if(un){var wu="oninput"in document;if(!wu){var Yc=document.createElement("div");Yc.setAttribute("oninput","return;"),wu=typeof Yc.oninput=="function"}Su=wu}else Su=!1;qc=Su&&(!document.documentMode||9<document.documentMode)}function Fc(){xa&&(xa.detachEvent("onpropertychange",$c),Aa=xa=null)}function $c(e){if(e.propertyName==="value"&&Or(Aa)){var t=[];Bc(t,Aa,e,du(e)),Cc(jv,t)}}function Bv(e,t,n){e==="focusin"?(Fc(),xa=t,Aa=n,xa.attachEvent("onpropertychange",$c)):e==="focusout"&&Fc()}function Hv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Or(Aa)}function qv(e,t){if(e==="click")return Or(t)}function Yv(e,t){if(e==="input"||e==="change")return Or(t)}function Fv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:Fv;function Ca(e,t){if(_t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var s=n[i];if(!Pl.call(t,s)||!_t(e[s],t[s]))return!1}return!0}function Xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vc(e,t){var n=Xc(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xc(n)}}function Zc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nr(e.document)}return t}function Tu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $v=un&&"documentMode"in document&&11>=document.documentMode,Li=null,_u=null,Na=null,xu=!1;function Kc(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xu||Li==null||Li!==Nr(i)||(i=Li,"selectionStart"in i&&Tu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Na&&Ca(Na,i)||(Na=i,i=Tl(_u,"onSelect"),0<i.length&&(t=new Lr("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Li)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Gi={animationend:ni("Animation","AnimationEnd"),animationiteration:ni("Animation","AnimationIteration"),animationstart:ni("Animation","AnimationStart"),transitionrun:ni("Transition","TransitionRun"),transitionstart:ni("Transition","TransitionStart"),transitioncancel:ni("Transition","TransitionCancel"),transitionend:ni("Transition","TransitionEnd")},Au={},Jc={};un&&(Jc=document.createElement("div").style,"AnimationEvent"in window||(delete Gi.animationend.animation,delete Gi.animationiteration.animation,delete Gi.animationstart.animation),"TransitionEvent"in window||delete Gi.transitionend.transition);function ii(e){if(Au[e])return Au[e];if(!Gi[e])return e;var t=Gi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jc)return Au[e]=t[n];return e}var Ic=ii("animationend"),Wc=ii("animationiteration"),Pc=ii("animationstart"),Xv=ii("transitionrun"),Vv=ii("transitionstart"),Zv=ii("transitioncancel"),ef=ii("transitionend"),tf=new Map,Cu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");Cu.push("scrollEnd");function Xt(e,t){tf.set(e,t),ei(t,[e])}var Ur=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Lt=[],Oi=0,Nu=0;function kr(){for(var e=Oi,t=Nu=Oi=0;t<e;){var n=Lt[t];Lt[t++]=null;var i=Lt[t];Lt[t++]=null;var s=Lt[t];Lt[t++]=null;var c=Lt[t];if(Lt[t++]=null,i!==null&&s!==null){var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}c!==0&&nf(n,s,c)}}function jr(e,t,n,i){Lt[Oi++]=e,Lt[Oi++]=t,Lt[Oi++]=n,Lt[Oi++]=i,Nu|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ru(e,t,n,i){return jr(e,t,n,i),Br(e)}function ai(e,t){return jr(e,null,null,t),Br(e)}function nf(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var s=!1,c=e.return;c!==null;)c.childLanes|=n,i=c.alternate,i!==null&&(i.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-Tt(n),e=c.hiddenUpdates,i=e[s],i===null?e[s]=[t]:i.push(t),t.lane=n|536870912),c):null}function Br(e){if(50<Ja)throw Ja=0,Bo=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ui={};function Qv(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(e,t,n,i){return new Qv(e,t,n,i)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function on(e,t){var n=e.alternate;return n===null?(n=xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function af(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hr(e,t,n,i,s,c){var h=0;if(i=e,typeof e=="function")Du(e)&&(h=1);else if(typeof e=="string")h=Pp(e,n,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=xt(31,n,t,s),e.elementType=B,e.lanes=c,e;case L:return ri(n.children,s,c,t);case k:h=8,s|=24;break;case X:return e=xt(12,n,t,s|2),e.elementType=X,e.lanes=c,e;case M:return e=xt(13,n,t,s),e.elementType=M,e.lanes=c,e;case j:return e=xt(19,n,t,s),e.elementType=j,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:h=10;break e;case K:h=9;break e;case C:h=11;break e;case O:h=14;break e;case ee:h=16,i=null;break e}h=29,n=Error(a(130,e===null?"null":typeof e,"")),i=null}return t=xt(h,n,t,s),t.elementType=e,t.type=i,t.lanes=c,t}function ri(e,t,n,i){return e=xt(7,e,i,t),e.lanes=n,e}function zu(e,t,n){return e=xt(6,e,null,t),e.lanes=n,e}function rf(e){var t=xt(18,null,null,0);return t.stateNode=e,t}function Mu(e,t,n){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var lf=new WeakMap;function Gt(e,t){if(typeof e=="object"&&e!==null){var n=lf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ac(t)},lf.set(e,t),t)}return{value:e,source:t,stack:ac(t)}}var ki=[],ji=0,qr=null,Ra=0,Ot=[],Ut=0,Dn=null,Wt=1,Pt="";function sn(e,t){ki[ji++]=Ra,ki[ji++]=qr,qr=e,Ra=t}function uf(e,t,n){Ot[Ut++]=Wt,Ot[Ut++]=Pt,Ot[Ut++]=Dn,Dn=e;var i=Wt;e=Pt;var s=32-Tt(i)-1;i&=~(1<<s),n+=1;var c=32-Tt(t)+s;if(30<c){var h=s-s%5;c=(i&(1<<h)-1).toString(32),i>>=h,s-=h,Wt=1<<32-Tt(t)+s|n<<s|i,Pt=c+e}else Wt=1<<c|n<<s|i,Pt=e}function Lu(e){e.return!==null&&(sn(e,1),uf(e,1,0))}function Gu(e){for(;e===qr;)qr=ki[--ji],ki[ji]=null,Ra=ki[--ji],ki[ji]=null;for(;e===Dn;)Dn=Ot[--Ut],Ot[Ut]=null,Pt=Ot[--Ut],Ot[Ut]=null,Wt=Ot[--Ut],Ot[Ut]=null}function of(e,t){Ot[Ut++]=Wt,Ot[Ut++]=Pt,Ot[Ut++]=Dn,Wt=t.id,Pt=t.overflow,Dn=e}var it=null,He=null,Ne=!1,zn=null,kt=!1,Ou=Error(a(519));function Mn(e){var t=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Da(Gt(t,e)),Ou}function sf(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[nt]=e,t[gt]=i,n){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(n=0;n<Wa.length;n++)xe(Wa[n],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),Sc(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),Tc(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||Ah(t.textContent,n)?(i.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),i.onScroll!=null&&xe("scroll",t),i.onScrollEnd!=null&&xe("scrollend",t),i.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||Mn(e,!0)}function cf(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:kt=!1;return;case 27:case 3:kt=!0;return;default:it=it.return}}function Bi(e){if(e!==it)return!1;if(!Ne)return cf(e),Ne=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||es(e.type,e.memoizedProps)),n=!n),n&&He&&Mn(e),cf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));He=Oh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));He=Oh(e)}else t===27?(t=He,Vn(e.type)?(e=rs,rs=null,He=e):He=t):He=it?Bt(e.stateNode.nextSibling):null;return!0}function li(){He=it=null,Ne=!1}function Uu(){var e=zn;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),zn=null),e}function Da(e){zn===null?zn=[e]:zn.push(e)}var ku=w(null),ui=null,cn=null;function Ln(e,t,n){J(ku,t._currentValue),t._currentValue=n}function fn(e){e._currentValue=ku.current,F(ku)}function ju(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Bu(e,t,n,i){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var h=s.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=s;for(var S=0;S<t.length;S++)if(y.context===t[S]){c.lanes|=n,y=c.alternate,y!==null&&(y.lanes|=n),ju(c.return,n,e),i||(h=null);break e}c=y.next}}else if(s.tag===18){if(h=s.return,h===null)throw Error(a(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),ju(h,n,e),h=null}else h=s.child;if(h!==null)h.return=s;else for(h=s;h!==null;){if(h===e){h=null;break}if(s=h.sibling,s!==null){s.return=h.return,h=s;break}h=h.return}s=h}}function Hi(e,t,n,i){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var h=s.alternate;if(h===null)throw Error(a(387));if(h=h.memoizedProps,h!==null){var y=s.type;_t(s.pendingProps.value,h.value)||(e!==null?e.push(y):e=[y])}}else if(s===q.current){if(h=s.alternate,h===null)throw Error(a(387));h.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ir):e=[ir])}s=s.return}e!==null&&Bu(t,e,n,i),t.flags|=262144}function Yr(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function oi(e){ui=e,cn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return ff(ui,e)}function Fr(e,t){return ui===null&&oi(e),ff(e,t)}function ff(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},cn===null){if(e===null)throw Error(a(308));cn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else cn=cn.next=t;return n}var Kv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Jv=u.unstable_scheduleCallback,Iv=u.unstable_NormalPriority,Qe={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hu(){return{controller:new Kv,data:new Map,refCount:0}}function za(e){e.refCount--,e.refCount===0&&Jv(Iv,function(){e.controller.abort()})}var Ma=null,qu=0,qi=0,Yi=null;function Wv(e,t){if(Ma===null){var n=Ma=[];qu=0,qi=Xo(),Yi={status:"pending",value:void 0,then:function(i){n.push(i)}}}return qu++,t.then(df,df),t}function df(){if(--qu===0&&Ma!==null){Yi!==null&&(Yi.status="fulfilled");var e=Ma;Ma=null,qi=0,Yi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pv(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(i.status="rejected",i.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),i}var hf=G.S;G.S=function(e,t){Jd=St(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Wv(e,t),hf!==null&&hf(e,t)};var si=w(null);function Yu(){var e=si.current;return e!==null?e:ke.pooledCache}function $r(e,t){t===null?J(si,si.current):J(si,t.pool)}function gf(){var e=Yu();return e===null?null:{parent:Qe._currentValue,pool:e}}var Fi=Error(a(460)),Fu=Error(a(474)),Xr=Error(a(542)),Vr={then:function(){}};function mf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ln,ln),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yf(e),e;default:if(typeof t.status=="string")t.then(ln,ln);else{if(e=ke,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=i}},function(i){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yf(e),e}throw fi=t,Fi}}function ci(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(fi=n,Fi):n}}var fi=null;function pf(){if(fi===null)throw Error(a(459));var e=fi;return fi=null,e}function yf(e){if(e===Fi||e===Xr)throw Error(a(483))}var $i=null,La=0;function Zr(e){var t=La;return La+=1,$i===null&&($i=[]),vf($i,e,t)}function Ga(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Qr(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bf(e){function t(A,_){if(e){var R=A.deletions;R===null?(A.deletions=[_],A.flags|=16):R.push(_)}}function n(A,_){if(!e)return null;for(;_!==null;)t(A,_),_=_.sibling;return null}function i(A){for(var _=new Map;A!==null;)A.key!==null?_.set(A.key,A):_.set(A.index,A),A=A.sibling;return _}function s(A,_){return A=on(A,_),A.index=0,A.sibling=null,A}function c(A,_,R){return A.index=R,e?(R=A.alternate,R!==null?(R=R.index,R<_?(A.flags|=67108866,_):R):(A.flags|=67108866,_)):(A.flags|=1048576,_)}function h(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function y(A,_,R,Y){return _===null||_.tag!==6?(_=zu(R,A.mode,Y),_.return=A,_):(_=s(_,R),_.return=A,_)}function S(A,_,R,Y){var oe=R.type;return oe===L?H(A,_,R.props.children,Y,R.key):_!==null&&(_.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===ee&&ci(oe)===_.type)?(_=s(_,R.props),Ga(_,R),_.return=A,_):(_=Hr(R.type,R.key,R.props,null,A.mode,Y),Ga(_,R),_.return=A,_)}function D(A,_,R,Y){return _===null||_.tag!==4||_.stateNode.containerInfo!==R.containerInfo||_.stateNode.implementation!==R.implementation?(_=Mu(R,A.mode,Y),_.return=A,_):(_=s(_,R.children||[]),_.return=A,_)}function H(A,_,R,Y,oe){return _===null||_.tag!==7?(_=ri(R,A.mode,Y,oe),_.return=A,_):(_=s(_,R),_.return=A,_)}function $(A,_,R){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=zu(""+_,A.mode,R),_.return=A,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case T:return R=Hr(_.type,_.key,_.props,null,A.mode,R),Ga(R,_),R.return=A,R;case N:return _=Mu(_,A.mode,R),_.return=A,_;case ee:return _=ci(_),$(A,_,R)}if(Te(_)||ce(_))return _=ri(_,A.mode,R,null),_.return=A,_;if(typeof _.then=="function")return $(A,Zr(_),R);if(_.$$typeof===V)return $(A,Fr(A,_),R);Qr(A,_)}return null}function z(A,_,R,Y){var oe=_!==null?_.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return oe!==null?null:y(A,_,""+R,Y);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case T:return R.key===oe?S(A,_,R,Y):null;case N:return R.key===oe?D(A,_,R,Y):null;case ee:return R=ci(R),z(A,_,R,Y)}if(Te(R)||ce(R))return oe!==null?null:H(A,_,R,Y,null);if(typeof R.then=="function")return z(A,_,Zr(R),Y);if(R.$$typeof===V)return z(A,_,Fr(A,R),Y);Qr(A,R)}return null}function U(A,_,R,Y,oe){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return A=A.get(R)||null,y(_,A,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case T:return A=A.get(Y.key===null?R:Y.key)||null,S(_,A,Y,oe);case N:return A=A.get(Y.key===null?R:Y.key)||null,D(_,A,Y,oe);case ee:return Y=ci(Y),U(A,_,R,Y,oe)}if(Te(Y)||ce(Y))return A=A.get(R)||null,H(_,A,Y,oe,null);if(typeof Y.then=="function")return U(A,_,R,Zr(Y),oe);if(Y.$$typeof===V)return U(A,_,R,Fr(_,Y),oe);Qr(_,Y)}return null}function ie(A,_,R,Y){for(var oe=null,Re=null,ae=_,ye=_=0,Ce=null;ae!==null&&ye<R.length;ye++){ae.index>ye?(Ce=ae,ae=null):Ce=ae.sibling;var De=z(A,ae,R[ye],Y);if(De===null){ae===null&&(ae=Ce);break}e&&ae&&De.alternate===null&&t(A,ae),_=c(De,_,ye),Re===null?oe=De:Re.sibling=De,Re=De,ae=Ce}if(ye===R.length)return n(A,ae),Ne&&sn(A,ye),oe;if(ae===null){for(;ye<R.length;ye++)ae=$(A,R[ye],Y),ae!==null&&(_=c(ae,_,ye),Re===null?oe=ae:Re.sibling=ae,Re=ae);return Ne&&sn(A,ye),oe}for(ae=i(ae);ye<R.length;ye++)Ce=U(ae,A,ye,R[ye],Y),Ce!==null&&(e&&Ce.alternate!==null&&ae.delete(Ce.key===null?ye:Ce.key),_=c(Ce,_,ye),Re===null?oe=Ce:Re.sibling=Ce,Re=Ce);return e&&ae.forEach(function(In){return t(A,In)}),Ne&&sn(A,ye),oe}function fe(A,_,R,Y){if(R==null)throw Error(a(151));for(var oe=null,Re=null,ae=_,ye=_=0,Ce=null,De=R.next();ae!==null&&!De.done;ye++,De=R.next()){ae.index>ye?(Ce=ae,ae=null):Ce=ae.sibling;var In=z(A,ae,De.value,Y);if(In===null){ae===null&&(ae=Ce);break}e&&ae&&In.alternate===null&&t(A,ae),_=c(In,_,ye),Re===null?oe=In:Re.sibling=In,Re=In,ae=Ce}if(De.done)return n(A,ae),Ne&&sn(A,ye),oe;if(ae===null){for(;!De.done;ye++,De=R.next())De=$(A,De.value,Y),De!==null&&(_=c(De,_,ye),Re===null?oe=De:Re.sibling=De,Re=De);return Ne&&sn(A,ye),oe}for(ae=i(ae);!De.done;ye++,De=R.next())De=U(ae,A,ye,De.value,Y),De!==null&&(e&&De.alternate!==null&&ae.delete(De.key===null?ye:De.key),_=c(De,_,ye),Re===null?oe=De:Re.sibling=De,Re=De);return e&&ae.forEach(function(cy){return t(A,cy)}),Ne&&sn(A,ye),oe}function Ue(A,_,R,Y){if(typeof R=="object"&&R!==null&&R.type===L&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case T:e:{for(var oe=R.key;_!==null;){if(_.key===oe){if(oe=R.type,oe===L){if(_.tag===7){n(A,_.sibling),Y=s(_,R.props.children),Y.return=A,A=Y;break e}}else if(_.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===ee&&ci(oe)===_.type){n(A,_.sibling),Y=s(_,R.props),Ga(Y,R),Y.return=A,A=Y;break e}n(A,_);break}else t(A,_);_=_.sibling}R.type===L?(Y=ri(R.props.children,A.mode,Y,R.key),Y.return=A,A=Y):(Y=Hr(R.type,R.key,R.props,null,A.mode,Y),Ga(Y,R),Y.return=A,A=Y)}return h(A);case N:e:{for(oe=R.key;_!==null;){if(_.key===oe)if(_.tag===4&&_.stateNode.containerInfo===R.containerInfo&&_.stateNode.implementation===R.implementation){n(A,_.sibling),Y=s(_,R.children||[]),Y.return=A,A=Y;break e}else{n(A,_);break}else t(A,_);_=_.sibling}Y=Mu(R,A.mode,Y),Y.return=A,A=Y}return h(A);case ee:return R=ci(R),Ue(A,_,R,Y)}if(Te(R))return ie(A,_,R,Y);if(ce(R)){if(oe=ce(R),typeof oe!="function")throw Error(a(150));return R=oe.call(R),fe(A,_,R,Y)}if(typeof R.then=="function")return Ue(A,_,Zr(R),Y);if(R.$$typeof===V)return Ue(A,_,Fr(A,R),Y);Qr(A,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,_!==null&&_.tag===6?(n(A,_.sibling),Y=s(_,R),Y.return=A,A=Y):(n(A,_),Y=zu(R,A.mode,Y),Y.return=A,A=Y),h(A)):n(A,_)}return function(A,_,R,Y){try{La=0;var oe=Ue(A,_,R,Y);return $i=null,oe}catch(ae){if(ae===Fi||ae===Xr)throw ae;var Re=xt(29,ae,null,A.mode);return Re.lanes=Y,Re.return=A,Re}}}var di=bf(!0),Ef=bf(!1),Gn=!1;function $u(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function On(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Un(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(ze&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,t=Br(e),nf(e,null,n),t}return jr(e,i,t,n),Br(e)}function Oa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,cc(e,n)}}function Vu(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var s=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?s=c=t:c=c.next=t}else s=c=t;n={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Zu=!1;function Ua(){if(Zu){var e=Yi;if(e!==null)throw e}}function ka(e,t,n,i){Zu=!1;var s=e.updateQueue;Gn=!1;var c=s.firstBaseUpdate,h=s.lastBaseUpdate,y=s.shared.pending;if(y!==null){s.shared.pending=null;var S=y,D=S.next;S.next=null,h===null?c=D:h.next=D,h=S;var H=e.alternate;H!==null&&(H=H.updateQueue,y=H.lastBaseUpdate,y!==h&&(y===null?H.firstBaseUpdate=D:y.next=D,H.lastBaseUpdate=S))}if(c!==null){var $=s.baseState;h=0,H=D=S=null,y=c;do{var z=y.lane&-536870913,U=z!==y.lane;if(U?(Ae&z)===z:(i&z)===z){z!==0&&z===qi&&(Zu=!0),H!==null&&(H=H.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ie=e,fe=y;z=t;var Ue=n;switch(fe.tag){case 1:if(ie=fe.payload,typeof ie=="function"){$=ie.call(Ue,$,z);break e}$=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=fe.payload,z=typeof ie=="function"?ie.call(Ue,$,z):ie,z==null)break e;$=p({},$,z);break e;case 2:Gn=!0}}z=y.callback,z!==null&&(e.flags|=64,U&&(e.flags|=8192),U=s.callbacks,U===null?s.callbacks=[z]:U.push(z))}else U={lane:z,tag:y.tag,payload:y.payload,callback:y.callback,next:null},H===null?(D=H=U,S=$):H=H.next=U,h|=z;if(y=y.next,y===null){if(y=s.shared.pending,y===null)break;U=y,y=U.next,U.next=null,s.lastBaseUpdate=U,s.shared.pending=null}}while(!0);H===null&&(S=$),s.baseState=S,s.firstBaseUpdate=D,s.lastBaseUpdate=H,c===null&&(s.shared.lanes=0),qn|=h,e.lanes=h,e.memoizedState=$}}function Sf(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function wf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Sf(n[e],t)}var Xi=w(null),Kr=w(0);function Tf(e,t){e=En,J(Kr,e),J(Xi,t),En=e|t.baseLanes}function Qu(){J(Kr,En),J(Xi,Xi.current)}function Ku(){En=Kr.current,F(Xi),F(Kr)}var At=w(null),jt=null;function kn(e){var t=e.alternate;J(Ve,Ve.current&1),J(At,e),jt===null&&(t===null||Xi.current!==null||t.memoizedState!==null)&&(jt=e)}function Ju(e){J(Ve,Ve.current),J(At,e),jt===null&&(jt=e)}function _f(e){e.tag===22?(J(Ve,Ve.current),J(At,e),jt===null&&(jt=e)):jn()}function jn(){J(Ve,Ve.current),J(At,At.current)}function Ct(e){F(At),jt===e&&(jt=null),F(Ve)}var Ve=w(0);function Jr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||is(n)||as(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var dn=0,pe=null,Ge=null,Ke=null,Ir=!1,Vi=!1,hi=!1,Wr=0,ja=0,Zi=null,ep=0;function $e(){throw Error(a(321))}function Iu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_t(e[n],t[n]))return!1;return!0}function Wu(e,t,n,i,s,c){return dn=c,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?ud:go,hi=!1,c=n(i,s),hi=!1,Vi&&(c=Af(t,n,i,s)),xf(e),c}function xf(e){G.H=qa;var t=Ge!==null&&Ge.next!==null;if(dn=0,Ke=Ge=pe=null,Ir=!1,ja=0,Zi=null,t)throw Error(a(300));e===null||Je||(e=e.dependencies,e!==null&&Yr(e)&&(Je=!0))}function Af(e,t,n,i){pe=e;var s=0;do{if(Vi&&(Zi=null),ja=0,Vi=!1,25<=s)throw Error(a(301));if(s+=1,Ke=Ge=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}G.H=od,c=t(n,i)}while(Vi);return c}function tp(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Ba(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(pe.flags|=1024),t}function Pu(){var e=Wr!==0;return Wr=0,e}function eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function to(e){if(Ir){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ir=!1}dn=0,Ke=Ge=pe=null,Vi=!1,ja=Wr=0,Zi=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?pe.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function Ze(){if(Ge===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=Ke===null?pe.memoizedState:Ke.next;if(t!==null)Ke=t,Ge=e;else{if(e===null)throw pe.alternate===null?Error(a(467)):Error(a(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Ke===null?pe.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function Pr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ba(e){var t=ja;return ja+=1,Zi===null&&(Zi=[]),e=vf(Zi,e,t),t=pe,(Ke===null?t.memoizedState:Ke.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?ud:go),e}function el(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ba(e);if(e.$$typeof===V)return at(e)}throw Error(a(438,String(e)))}function no(e){var t=null,n=pe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=pe.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Pr(),pe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=Q;return t.index++,n}function hn(e,t){return typeof t=="function"?t(e):t}function tl(e){var t=Ze();return io(t,Ge,e)}function io(e,t,n){var i=e.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=n;var s=e.baseQueue,c=i.pending;if(c!==null){if(s!==null){var h=s.next;s.next=c.next,c.next=h}t.baseQueue=s=c,i.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var y=h=null,S=null,D=t,H=!1;do{var $=D.lane&-536870913;if($!==D.lane?(Ae&$)===$:(dn&$)===$){var z=D.revertLane;if(z===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),$===qi&&(H=!0);else if((dn&z)===z){D=D.next,z===qi&&(H=!0);continue}else $={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},S===null?(y=S=$,h=c):S=S.next=$,pe.lanes|=z,qn|=z;$=D.action,hi&&n(c,$),c=D.hasEagerState?D.eagerState:n(c,$)}else z={lane:$,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},S===null?(y=S=z,h=c):S=S.next=z,pe.lanes|=$,qn|=$;D=D.next}while(D!==null&&D!==t);if(S===null?h=c:S.next=y,!_t(c,e.memoizedState)&&(Je=!0,H&&(n=Yi,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=S,i.lastRenderedState=c}return s===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function ao(e){var t=Ze(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var i=n.dispatch,s=n.pending,c=t.memoizedState;if(s!==null){n.pending=null;var h=s=s.next;do c=e(c,h.action),h=h.next;while(h!==s);_t(c,t.memoizedState)||(Je=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function Cf(e,t,n){var i=pe,s=Ze(),c=Ne;if(c){if(n===void 0)throw Error(a(407));n=n()}else n=t();var h=!_t((Ge||s).memoizedState,n);if(h&&(s.memoizedState=n,Je=!0),s=s.queue,uo(Df.bind(null,i,s,e),[e]),s.getSnapshot!==t||h||Ke!==null&&Ke.memoizedState.tag&1){if(i.flags|=2048,Qi(9,{destroy:void 0},Rf.bind(null,i,s,n,t),null),ke===null)throw Error(a(349));c||(dn&127)!==0||Nf(i,t,n)}return n}function Nf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pe.updateQueue,t===null?(t=Pr(),pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rf(e,t,n,i){t.value=n,t.getSnapshot=i,zf(t)&&Mf(e)}function Df(e,t,n){return n(function(){zf(t)&&Mf(e)})}function zf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_t(e,n)}catch{return!0}}function Mf(e){var t=ai(e,2);t!==null&&Et(t,e,2)}function ro(e){var t=dt();if(typeof e=="function"){var n=e;if(e=n(),hi){Cn(!0);try{n()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:e},t}function Lf(e,t,n,i){return e.baseState=n,io(e,Ge,typeof i=="function"?i:hn)}function np(e,t,n,i,s){if(al(e))throw Error(a(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};G.T!==null?n(!0):c.isTransition=!1,i(c),n=t.pending,n===null?(c.next=t.pending=c,Gf(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Gf(e,t){var n=t.action,i=t.payload,s=e.state;if(t.isTransition){var c=G.T,h={};G.T=h;try{var y=n(s,i),S=G.S;S!==null&&S(h,y),Of(e,t,y)}catch(D){lo(e,t,D)}finally{c!==null&&h.types!==null&&(c.types=h.types),G.T=c}}else try{c=n(s,i),Of(e,t,c)}catch(D){lo(e,t,D)}}function Of(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Uf(e,t,i)},function(i){return lo(e,t,i)}):Uf(e,t,n)}function Uf(e,t,n){t.status="fulfilled",t.value=n,kf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Gf(e,n)))}function lo(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,kf(t),t=t.next;while(t!==i)}e.action=null}function kf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jf(e,t){return t}function Bf(e,t){if(Ne){var n=ke.formState;if(n!==null){e:{var i=pe;if(Ne){if(He){t:{for(var s=He,c=kt;s.nodeType!==8;){if(!c){s=null;break t}if(s=Bt(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){He=Bt(s.nextSibling),i=s.data==="F!";break e}}Mn(i)}i=!1}i&&(t=n[0])}}return n=dt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jf,lastRenderedState:t},n.queue=i,n=ad.bind(null,pe,i),i.dispatch=n,i=ro(!1),c=ho.bind(null,pe,!1,i.queue),i=dt(),s={state:t,dispatch:null,action:e,pending:null},i.queue=s,n=np.bind(null,pe,s,c,n),s.dispatch=n,i.memoizedState=e,[t,n,!1]}function Hf(e){var t=Ze();return qf(t,Ge,e)}function qf(e,t,n){if(t=io(e,t,jf)[0],e=tl(hn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ba(t)}catch(h){throw h===Fi?Xr:h}else i=t;t=Ze();var s=t.queue,c=s.dispatch;return n!==t.memoizedState&&(pe.flags|=2048,Qi(9,{destroy:void 0},ip.bind(null,s,n),null)),[i,c,e]}function ip(e,t){e.action=t}function Yf(e){var t=Ze(),n=Ge;if(n!==null)return qf(t,n,e);Ze(),t=t.memoizedState,n=Ze();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function Qi(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=pe.updateQueue,t===null&&(t=Pr(),pe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Ff(){return Ze().memoizedState}function nl(e,t,n,i){var s=dt();pe.flags|=e,s.memoizedState=Qi(1|t,{destroy:void 0},n,i===void 0?null:i)}function il(e,t,n,i){var s=Ze();i=i===void 0?null:i;var c=s.memoizedState.inst;Ge!==null&&i!==null&&Iu(i,Ge.memoizedState.deps)?s.memoizedState=Qi(t,c,n,i):(pe.flags|=e,s.memoizedState=Qi(1|t,c,n,i))}function $f(e,t){nl(8390656,8,e,t)}function uo(e,t){il(2048,8,e,t)}function ap(e){pe.flags|=4;var t=pe.updateQueue;if(t===null)t=Pr(),pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Xf(e){var t=Ze().memoizedState;return ap({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Vf(e,t){return il(4,2,e,t)}function Zf(e,t){return il(4,4,e,t)}function Qf(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kf(e,t,n){n=n!=null?n.concat([e]):null,il(4,4,Qf.bind(null,t,e),n)}function oo(){}function Jf(e,t){var n=Ze();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Iu(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function If(e,t){var n=Ze();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Iu(t,i[1]))return i[0];if(i=e(),hi){Cn(!0);try{e()}finally{Cn(!1)}}return n.memoizedState=[i,t],i}function so(e,t,n){return n===void 0||(dn&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Wd(),pe.lanes|=e,qn|=e,n)}function Wf(e,t,n,i){return _t(n,t)?n:Xi.current!==null?(e=so(e,n,i),_t(e,t)||(Je=!0),e):(dn&42)===0||(dn&1073741824)!==0&&(Ae&261930)===0?(Je=!0,e.memoizedState=n):(e=Wd(),pe.lanes|=e,qn|=e,t)}function Pf(e,t,n,i,s){var c=I.p;I.p=c!==0&&8>c?c:8;var h=G.T,y={};G.T=y,ho(e,!1,t,n);try{var S=s(),D=G.S;if(D!==null&&D(y,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var H=Pv(S,i);Ha(e,t,H,Dt(e))}else Ha(e,t,i,Dt(e))}catch($){Ha(e,t,{then:function(){},status:"rejected",reason:$},Dt())}finally{I.p=c,h!==null&&y.types!==null&&(h.types=y.types),G.T=h}}function rp(){}function co(e,t,n,i){if(e.tag!==5)throw Error(a(476));var s=ed(e).queue;Pf(e,s,t,le,n===null?rp:function(){return td(e),n(i)})}function ed(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function td(e){var t=ed(e);t.next===null&&(t=e.alternate.memoizedState),Ha(e,t.next.queue,{},Dt())}function fo(){return at(ir)}function nd(){return Ze().memoizedState}function id(){return Ze().memoizedState}function lp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Dt();e=On(n);var i=Un(t,e,n);i!==null&&(Et(i,t,n),Oa(i,t,n)),t={cache:Hu()},e.payload=t;return}t=t.return}}function up(e,t,n){var i=Dt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},al(e)?rd(t,n):(n=Ru(e,t,n,i),n!==null&&(Et(n,e,i),ld(n,t,i)))}function ad(e,t,n){var i=Dt();Ha(e,t,n,i)}function Ha(e,t,n,i){var s={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(al(e))rd(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,y=c(h,n);if(s.hasEagerState=!0,s.eagerState=y,_t(y,h))return jr(e,t,s,0),ke===null&&kr(),!1}catch{}if(n=Ru(e,t,s,i),n!==null)return Et(n,e,i),ld(n,t,i),!0}return!1}function ho(e,t,n,i){if(i={lane:2,revertLane:Xo(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},al(e)){if(t)throw Error(a(479))}else t=Ru(e,n,i,2),t!==null&&Et(t,e,2)}function al(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function rd(e,t){Vi=Ir=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ld(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,cc(e,n)}}var qa={readContext:at,use:el,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useLayoutEffect:$e,useInsertionEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useSyncExternalStore:$e,useId:$e,useHostTransitionStatus:$e,useFormState:$e,useActionState:$e,useOptimistic:$e,useMemoCache:$e,useCacheRefresh:$e};qa.useEffectEvent=$e;var ud={readContext:at,use:el,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:$f,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,nl(4194308,4,Qf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nl(4194308,4,e,t)},useInsertionEffect:function(e,t){nl(4,2,e,t)},useMemo:function(e,t){var n=dt();t=t===void 0?null:t;var i=e();if(hi){Cn(!0);try{e()}finally{Cn(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=dt();if(n!==void 0){var s=n(t);if(hi){Cn(!0);try{n(t)}finally{Cn(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=up.bind(null,pe,e),[i.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=ro(e);var t=e.queue,n=ad.bind(null,pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:oo,useDeferredValue:function(e,t){var n=dt();return so(n,e,t)},useTransition:function(){var e=ro(!1);return e=Pf.bind(null,pe,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=pe,s=dt();if(Ne){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),ke===null)throw Error(a(349));(Ae&127)!==0||Nf(i,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,$f(Df.bind(null,i,c,e),[e]),i.flags|=2048,Qi(9,{destroy:void 0},Rf.bind(null,i,c,n,t),null),n},useId:function(){var e=dt(),t=ke.identifierPrefix;if(Ne){var n=Pt,i=Wt;n=(i&~(1<<32-Tt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Wr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ep++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:fo,useFormState:Bf,useActionState:Bf,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ho.bind(null,pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:no,useCacheRefresh:function(){return dt().memoizedState=lp.bind(null,pe)},useEffectEvent:function(e){var t=dt(),n={impl:e};return t.memoizedState=n,function(){if((ze&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},go={readContext:at,use:el,useCallback:Jf,useContext:at,useEffect:uo,useImperativeHandle:Kf,useInsertionEffect:Vf,useLayoutEffect:Zf,useMemo:If,useReducer:tl,useRef:Ff,useState:function(){return tl(hn)},useDebugValue:oo,useDeferredValue:function(e,t){var n=Ze();return Wf(n,Ge.memoizedState,e,t)},useTransition:function(){var e=tl(hn)[0],t=Ze().memoizedState;return[typeof e=="boolean"?e:Ba(e),t]},useSyncExternalStore:Cf,useId:nd,useHostTransitionStatus:fo,useFormState:Hf,useActionState:Hf,useOptimistic:function(e,t){var n=Ze();return Lf(n,Ge,e,t)},useMemoCache:no,useCacheRefresh:id};go.useEffectEvent=Xf;var od={readContext:at,use:el,useCallback:Jf,useContext:at,useEffect:uo,useImperativeHandle:Kf,useInsertionEffect:Vf,useLayoutEffect:Zf,useMemo:If,useReducer:ao,useRef:Ff,useState:function(){return ao(hn)},useDebugValue:oo,useDeferredValue:function(e,t){var n=Ze();return Ge===null?so(n,e,t):Wf(n,Ge.memoizedState,e,t)},useTransition:function(){var e=ao(hn)[0],t=Ze().memoizedState;return[typeof e=="boolean"?e:Ba(e),t]},useSyncExternalStore:Cf,useId:nd,useHostTransitionStatus:fo,useFormState:Yf,useActionState:Yf,useOptimistic:function(e,t){var n=Ze();return Ge!==null?Lf(n,Ge,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:no,useCacheRefresh:id};od.useEffectEvent=Xf;function mo(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vo={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Dt(),s=On(i);s.payload=t,n!=null&&(s.callback=n),t=Un(e,s,i),t!==null&&(Et(t,e,i),Oa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Dt(),s=On(i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Un(e,s,i),t!==null&&(Et(t,e,i),Oa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Dt(),i=On(n);i.tag=2,t!=null&&(i.callback=t),t=Un(e,i,n),t!==null&&(Et(t,e,n),Oa(t,e,n))}};function sd(e,t,n,i,s,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!Ca(n,i)||!Ca(s,c):!0}function cd(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&vo.enqueueReplaceState(t,t.state,null)}function gi(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=p({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function fd(e){Ur(e)}function dd(e){console.error(e)}function hd(e){Ur(e)}function rl(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function gd(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function po(e,t,n){return n=On(n),n.tag=3,n.payload={element:null},n.callback=function(){rl(e,t)},n}function md(e){return e=On(e),e.tag=3,e}function vd(e,t,n,i){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var c=i.value;e.payload=function(){return s(c)},e.callback=function(){gd(t,n,i)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){gd(t,n,i),typeof s!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var y=i.stack;this.componentDidCatch(i.value,{componentStack:y!==null?y:""})})}function op(e,t,n,i,s){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&Hi(t,n,s,!0),n=At.current,n!==null){switch(n.tag){case 31:case 13:return jt===null?pl():n.alternate===null&&Xe===0&&(Xe=3),n.flags&=-257,n.flags|=65536,n.lanes=s,i===Vr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),Yo(e,i,s)),!1;case 22:return n.flags|=65536,i===Vr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),Yo(e,i,s)),!1}throw Error(a(435,n.tag))}return Yo(e,i,s),pl(),!1}if(Ne)return t=At.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Ou&&(e=Error(a(422),{cause:i}),Da(Gt(e,n)))):(i!==Ou&&(t=Error(a(423),{cause:i}),Da(Gt(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=Gt(i,n),s=po(e.stateNode,i,s),Vu(e,s),Xe!==4&&(Xe=2)),!1;var c=Error(a(520),{cause:i});if(c=Gt(c,n),Ka===null?Ka=[c]:Ka.push(c),Xe!==4&&(Xe=2),t===null)return!0;i=Gt(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=po(n.stateNode,i,e),Vu(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Yn===null||!Yn.has(c))))return n.flags|=65536,s&=-s,n.lanes|=s,s=md(s),vd(s,e,n,i),Vu(n,s),!1}n=n.return}while(n!==null);return!1}var yo=Error(a(461)),Je=!1;function rt(e,t,n,i){t.child=e===null?Ef(t,null,n,i):di(t,e.child,n,i)}function pd(e,t,n,i,s){n=n.render;var c=t.ref;if("ref"in i){var h={};for(var y in i)y!=="ref"&&(h[y]=i[y])}else h=i;return oi(t),i=Wu(e,t,n,h,c,s),y=Pu(),e!==null&&!Je?(eo(e,t,s),gn(e,t,s)):(Ne&&y&&Lu(t),t.flags|=1,rt(e,t,i,s),t.child)}function yd(e,t,n,i,s){if(e===null){var c=n.type;return typeof c=="function"&&!Du(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,bd(e,t,c,i,s)):(e=Hr(n.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Ao(e,s)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:Ca,n(h,i)&&e.ref===t.ref)return gn(e,t,s)}return t.flags|=1,e=on(c,i),e.ref=t.ref,e.return=t,t.child=e}function bd(e,t,n,i,s){if(e!==null){var c=e.memoizedProps;if(Ca(c,i)&&e.ref===t.ref)if(Je=!1,t.pendingProps=i=c,Ao(e,s))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,gn(e,t,s)}return bo(e,t,n,i,s)}function Ed(e,t,n,i){var s=i.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(i=t.child=e.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~c}else i=0,t.child=null;return Sd(e,t,c,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$r(t,c!==null?c.cachePool:null),c!==null?Tf(t,c):Qu(),_f(t);else return i=t.lanes=536870912,Sd(e,t,c!==null?c.baseLanes|n:n,n,i)}else c!==null?($r(t,c.cachePool),Tf(t,c),jn(),t.memoizedState=null):(e!==null&&$r(t,null),Qu(),jn());return rt(e,t,s,n),t.child}function Ya(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sd(e,t,n,i,s){var c=Yu();return c=c===null?null:{parent:Qe._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&$r(t,null),Qu(),_f(t),e!==null&&Hi(e,t,i,!0),t.childLanes=s,null}function ll(e,t){return t=ol({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wd(e,t,n){return di(t,e.child,null,n),e=ll(t,t.pendingProps),e.flags|=2,Ct(t),t.memoizedState=null,e}function sp(e,t,n){var i=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(i.mode==="hidden")return e=ll(t,i),t.lanes=536870912,Ya(null,e);if(Ju(t),(e=He)?(e=Gh(e,kt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dn!==null?{id:Wt,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},n=rf(e),n.return=t,t.child=n,it=t,He=null)):e=null,e===null)throw Mn(t);return t.lanes=536870912,null}return ll(t,i)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(Ju(t),s)if(t.flags&256)t.flags&=-257,t=wd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(Je||Hi(e,t,n,!1),s=(n&e.childLanes)!==0,Je||s){if(i=ke,i!==null&&(h=fc(i,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,ai(e,h),Et(i,e,h),yo;pl(),t=wd(e,t,n)}else e=c.treeContext,He=Bt(h.nextSibling),it=t,Ne=!0,zn=null,kt=!1,e!==null&&of(t,e),t=ll(t,i),t.flags|=4096;return t}return e=on(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ul(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bo(e,t,n,i,s){return oi(t),n=Wu(e,t,n,i,void 0,s),i=Pu(),e!==null&&!Je?(eo(e,t,s),gn(e,t,s)):(Ne&&i&&Lu(t),t.flags|=1,rt(e,t,n,s),t.child)}function Td(e,t,n,i,s,c){return oi(t),t.updateQueue=null,n=Af(t,i,n,s),xf(e),i=Pu(),e!==null&&!Je?(eo(e,t,c),gn(e,t,c)):(Ne&&i&&Lu(t),t.flags|=1,rt(e,t,n,c),t.child)}function _d(e,t,n,i,s){if(oi(t),t.stateNode===null){var c=Ui,h=n.contextType;typeof h=="object"&&h!==null&&(c=at(h)),c=new n(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=vo,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},$u(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?at(h):Ui,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(mo(t,n,h,i),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&vo.enqueueReplaceState(c,c.state,null),ka(t,i,c,s),Ua(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,S=gi(n,y);c.props=S;var D=c.context,H=n.contextType;h=Ui,typeof H=="object"&&H!==null&&(h=at(H));var $=n.getDerivedStateFromProps;H=typeof $=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,H||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||D!==h)&&cd(t,c,i,h),Gn=!1;var z=t.memoizedState;c.state=z,ka(t,i,c,s),Ua(),D=t.memoizedState,y||z!==D||Gn?(typeof $=="function"&&(mo(t,n,$,i),D=t.memoizedState),(S=Gn||sd(t,n,S,i,z,D,h))?(H||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=D),c.props=i,c.state=D,c.context=h,i=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,Xu(e,t),h=t.memoizedProps,H=gi(n,h),c.props=H,$=t.pendingProps,z=c.context,D=n.contextType,S=Ui,typeof D=="object"&&D!==null&&(S=at(D)),y=n.getDerivedStateFromProps,(D=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==$||z!==S)&&cd(t,c,i,S),Gn=!1,z=t.memoizedState,c.state=z,ka(t,i,c,s),Ua();var U=t.memoizedState;h!==$||z!==U||Gn||e!==null&&e.dependencies!==null&&Yr(e.dependencies)?(typeof y=="function"&&(mo(t,n,y,i),U=t.memoizedState),(H=Gn||sd(t,n,H,i,z,U,S)||e!==null&&e.dependencies!==null&&Yr(e.dependencies))?(D||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,U,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,U,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=U),c.props=i,c.state=U,c.context=S,i=H):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),i=!1)}return c=i,ul(e,t),i=(t.flags&128)!==0,c||i?(c=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&i?(t.child=di(t,e.child,null,s),t.child=di(t,null,n,s)):rt(e,t,n,s),t.memoizedState=c.state,e=t.child):e=gn(e,t,s),e}function xd(e,t,n,i){return li(),t.flags|=256,rt(e,t,n,i),t.child}var Eo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function So(e){return{baseLanes:e,cachePool:gf()}}function wo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Rt),e}function Ad(e,t,n){var i=t.pendingProps,s=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Ve.current&2)!==0),h&&(s=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(s?kn(t):jn(),(e=He)?(e=Gh(e,kt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dn!==null?{id:Wt,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},n=rf(e),n.return=t,t.child=n,it=t,He=null)):e=null,e===null)throw Mn(t);return as(e)?t.lanes=32:t.lanes=536870912,null}var y=i.children;return i=i.fallback,s?(jn(),s=t.mode,y=ol({mode:"hidden",children:y},s),i=ri(i,s,n,null),y.return=t,i.return=t,y.sibling=i,t.child=y,i=t.child,i.memoizedState=So(n),i.childLanes=wo(e,h,n),t.memoizedState=Eo,Ya(null,i)):(kn(t),To(t,y))}var S=e.memoizedState;if(S!==null&&(y=S.dehydrated,y!==null)){if(c)t.flags&256?(kn(t),t.flags&=-257,t=_o(e,t,n)):t.memoizedState!==null?(jn(),t.child=e.child,t.flags|=128,t=null):(jn(),y=i.fallback,s=t.mode,i=ol({mode:"visible",children:i.children},s),y=ri(y,s,n,null),y.flags|=2,i.return=t,y.return=t,i.sibling=y,t.child=i,di(t,e.child,null,n),i=t.child,i.memoizedState=So(n),i.childLanes=wo(e,h,n),t.memoizedState=Eo,t=Ya(null,i));else if(kn(t),as(y)){if(h=y.nextSibling&&y.nextSibling.dataset,h)var D=h.dgst;h=D,i=Error(a(419)),i.stack="",i.digest=h,Da({value:i,source:null,stack:null}),t=_o(e,t,n)}else if(Je||Hi(e,t,n,!1),h=(n&e.childLanes)!==0,Je||h){if(h=ke,h!==null&&(i=fc(h,n),i!==0&&i!==S.retryLane))throw S.retryLane=i,ai(e,i),Et(h,e,i),yo;is(y)||pl(),t=_o(e,t,n)}else is(y)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,He=Bt(y.nextSibling),it=t,Ne=!0,zn=null,kt=!1,e!==null&&of(t,e),t=To(t,i.children),t.flags|=4096);return t}return s?(jn(),y=i.fallback,s=t.mode,S=e.child,D=S.sibling,i=on(S,{mode:"hidden",children:i.children}),i.subtreeFlags=S.subtreeFlags&65011712,D!==null?y=on(D,y):(y=ri(y,s,n,null),y.flags|=2),y.return=t,i.return=t,i.sibling=y,t.child=i,Ya(null,i),i=t.child,y=e.child.memoizedState,y===null?y=So(n):(s=y.cachePool,s!==null?(S=Qe._currentValue,s=s.parent!==S?{parent:S,pool:S}:s):s=gf(),y={baseLanes:y.baseLanes|n,cachePool:s}),i.memoizedState=y,i.childLanes=wo(e,h,n),t.memoizedState=Eo,Ya(e.child,i)):(kn(t),n=e.child,e=n.sibling,n=on(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function To(e,t){return t=ol({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ol(e,t){return e=xt(22,e,null,t),e.lanes=0,e}function _o(e,t,n){return di(t,e.child,null,n),e=To(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cd(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ju(e.return,t,n)}function xo(e,t,n,i,s,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:s,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=n,h.tailMode=s,h.treeForkCount=c)}function Nd(e,t,n){var i=t.pendingProps,s=i.revealOrder,c=i.tail;i=i.children;var h=Ve.current,y=(h&2)!==0;if(y?(h=h&1|2,t.flags|=128):h&=1,J(Ve,h),rt(e,t,i,n),i=Ne?Ra:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cd(e,n,t);else if(e.tag===19)Cd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Jr(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),xo(t,!1,s,n,c,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Jr(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}xo(t,!0,n,null,c,i);break;case"together":xo(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function gn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),qn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=on(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=on(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ao(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Yr(e)))}function cp(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Ln(t,Qe,e.memoizedState.cache),li();break;case 27:case 5:Be(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Ln(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ju(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(kn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Ad(e,t,n):(kn(t),e=gn(e,t,n),e!==null?e.sibling:null);kn(t);break;case 19:var s=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Hi(e,t,n,!1),i=(n&t.childLanes)!==0),s){if(i)return Nd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),J(Ve,Ve.current),i)break;return null;case 22:return t.lanes=0,Ed(e,t,n,t.pendingProps);case 24:Ln(t,Qe,e.memoizedState.cache)}return gn(e,t,n)}function Rd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!Ao(e,n)&&(t.flags&128)===0)return Je=!1,cp(e,t,n);Je=(e.flags&131072)!==0}else Je=!1,Ne&&(t.flags&1048576)!==0&&uf(t,Ra,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=ci(t.elementType),t.type=e,typeof e=="function")Du(e)?(i=gi(e,i),t.tag=1,t=_d(null,t,e,i,n)):(t.tag=0,t=bo(null,t,e,i,n));else{if(e!=null){var s=e.$$typeof;if(s===C){t.tag=11,t=pd(null,t,e,i,n);break e}else if(s===O){t.tag=14,t=yd(null,t,e,i,n);break e}}throw t=Ee(e)||e,Error(a(306,t,""))}}return t;case 0:return bo(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,s=gi(i,t.pendingProps),_d(e,t,i,s,n);case 3:e:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(a(387));i=t.pendingProps;var c=t.memoizedState;s=c.element,Xu(e,t),ka(t,i,null,n);var h=t.memoizedState;if(i=h.cache,Ln(t,Qe,i),i!==c.cache&&Bu(t,[Qe],n,!0),Ua(),i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=xd(e,t,i,n);break e}else if(i!==s){s=Gt(Error(a(424)),t),Da(s),t=xd(e,t,i,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,He=Bt(e.firstChild),it=t,Ne=!0,zn=null,kt=!0,n=Ef(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(li(),i===s){t=gn(e,t,n);break e}rt(e,t,i,n)}t=t.child}return t;case 26:return ul(e,t),e===null?(n=Hh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,i=_l(be.current).createElement(n),i[nt]=t,i[gt]=e,lt(i,n,e),et(i),t.stateNode=i):t.memoizedState=Hh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&Ne&&(i=t.stateNode=kh(t.type,t.pendingProps,be.current),it=t,kt=!0,s=He,Vn(t.type)?(rs=s,He=Bt(i.firstChild)):He=s),rt(e,t,t.pendingProps.children,n),ul(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((s=i=He)&&(i=Hp(i,t.type,t.pendingProps,kt),i!==null?(t.stateNode=i,it=t,He=Bt(i.firstChild),kt=!1,s=!0):s=!1),s||Mn(t)),Be(t),s=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,i=c.children,es(s,c)?i=null:h!==null&&es(s,h)&&(t.flags|=32),t.memoizedState!==null&&(s=Wu(e,t,tp,null,null,n),ir._currentValue=s),ul(e,t),rt(e,t,i,n),t.child;case 6:return e===null&&Ne&&((e=n=He)&&(n=qp(n,t.pendingProps,kt),n!==null?(t.stateNode=n,it=t,He=null,e=!0):e=!1),e||Mn(t)),null;case 13:return Ad(e,t,n);case 4:return me(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=di(t,null,i,n):rt(e,t,i,n),t.child;case 11:return pd(e,t,t.type,t.pendingProps,n);case 7:return rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Ln(t,t.type,i.value),rt(e,t,i.children,n),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,oi(t),s=at(s),i=i(s),t.flags|=1,rt(e,t,i,n),t.child;case 14:return yd(e,t,t.type,t.pendingProps,n);case 15:return bd(e,t,t.type,t.pendingProps,n);case 19:return Nd(e,t,n);case 31:return sp(e,t,n);case 22:return Ed(e,t,n,t.pendingProps);case 24:return oi(t),i=at(Qe),e===null?(s=Yu(),s===null&&(s=ke,c=Hu(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=n),s=c),t.memoizedState={parent:i,cache:s},$u(t),Ln(t,Qe,s)):((e.lanes&n)!==0&&(Xu(e,t),ka(t,null,null,n),Ua()),s=e.memoizedState,c=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ln(t,Qe,i)):(i=c.cache,Ln(t,Qe,i),i!==s.cache&&Bu(t,[Qe],n,!0))),rt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function mn(e){e.flags|=4}function Co(e,t,n,i,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(nh())e.flags|=8192;else throw fi=Vr,Fu}else e.flags&=-16777217}function Dd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xh(t))if(nh())e.flags|=8192;else throw fi=Vr,Fu}function sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oc():536870912,e.lanes|=t,Wi|=t)}function Fa(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function fp(e,t,n){var i=t.pendingProps;switch(Gu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),fn(Qe),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Bi(t)?mn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Uu())),qe(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(mn(t),c!==null?(qe(t),Dd(t,c)):(qe(t),Co(t,s,null,i,n))):c?c!==e.memoizedState?(mn(t),qe(t),Dd(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&mn(t),qe(t),Co(t,s,e,i,n)),null;case 27:if(Ye(t),n=be.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&mn(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return qe(t),null}e=ne.current,Bi(t)?sf(t):(e=kh(s,i,n),t.stateNode=e,mn(t))}return qe(t),null;case 5:if(Ye(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&mn(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return qe(t),null}if(c=ne.current,Bi(t))sf(t);else{var h=_l(be.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?h.createElement(s,{is:i.is}):h.createElement(s)}}c[nt]=t,c[gt]=i;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(lt(c,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&mn(t)}}return qe(t),Co(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&mn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(a(166));if(e=be.current,Bi(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,s=it,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Ah(e.nodeValue,n)),e||Mn(t,!0)}else e=_l(e).createTextNode(i),e[nt]=t,t.stateNode=e}return qe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Bi(t),n!==null){if(e===null){if(!i)throw Error(a(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[nt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else n=Uu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ct(t),t):(Ct(t),null);if((t.flags&128)!==0)throw Error(a(558))}return qe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Bi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(a(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));s[nt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),s=!1}else s=Uu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Ct(t),t):(Ct(t),null)}return Ct(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),sl(t,t.updateQueue),qe(t),null);case 4:return ge(),e===null&&Ko(t.stateNode.containerInfo),qe(t),null;case 10:return fn(t.type),qe(t),null;case 19:if(F(Ve),i=t.memoizedState,i===null)return qe(t),null;if(s=(t.flags&128)!==0,c=i.rendering,c===null)if(s)Fa(i,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Jr(e),c!==null){for(t.flags|=128,Fa(i,!1),e=c.updateQueue,t.updateQueue=e,sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)af(n,e),n=n.sibling;return J(Ve,Ve.current&1|2),Ne&&sn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&St()>gl&&(t.flags|=128,s=!0,Fa(i,!1),t.lanes=4194304)}else{if(!s)if(e=Jr(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,sl(t,e),Fa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Ne)return qe(t),null}else 2*St()-i.renderingStartTime>gl&&n!==536870912&&(t.flags|=128,s=!0,Fa(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=St(),e.sibling=null,n=Ve.current,J(Ve,s?n&1|2:n&1),Ne&&sn(t,i.treeForkCount),e):(qe(t),null);case 22:case 23:return Ct(t),Ku(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),n=t.updateQueue,n!==null&&sl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&F(si),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fn(Qe),qe(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function dp(e,t){switch(Gu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fn(Qe),ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ye(t),null;case 31:if(t.memoizedState!==null){if(Ct(t),t.alternate===null)throw Error(a(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ct(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(Ve),null;case 4:return ge(),null;case 10:return fn(t.type),null;case 22:case 23:return Ct(t),Ku(),e!==null&&F(si),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fn(Qe),null;case 25:return null;default:return null}}function zd(e,t){switch(Gu(t),t.tag){case 3:fn(Qe),ge();break;case 26:case 27:case 5:Ye(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&Ct(t);break;case 13:Ct(t);break;case 19:F(Ve);break;case 10:fn(t.type);break;case 22:case 23:Ct(t),Ku(),e!==null&&F(si);break;case 24:fn(Qe)}}function $a(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var s=i.next;n=s;do{if((n.tag&e)===e){i=void 0;var c=n.create,h=n.inst;i=c(),h.destroy=i}n=n.next}while(n!==s)}}catch(y){Le(t,t.return,y)}}function Bn(e,t,n){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&e)===e){var h=i.inst,y=h.destroy;if(y!==void 0){h.destroy=void 0,s=t;var S=n,D=y;try{D()}catch(H){Le(s,S,H)}}}i=i.next}while(i!==c)}}catch(H){Le(t,t.return,H)}}function Md(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wf(t,n)}catch(i){Le(e,e.return,i)}}}function Ld(e,t,n){n.props=gi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Le(e,t,i)}}function Xa(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(s){Le(e,t,s)}}function en(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(s){Le(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){Le(e,t,s)}else n.current=null}function Gd(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(s){Le(e,e.return,s)}}function No(e,t,n){try{var i=e.stateNode;Gp(i,e.type,n,t),i[gt]=t}catch(s){Le(e,e.return,s)}}function Od(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vn(e.type)||e.tag===4}function Ro(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Od(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Do(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln));else if(i!==4&&(i===27&&Vn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Do(e,t,n),e=e.sibling;e!==null;)Do(e,t,n),e=e.sibling}function cl(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Vn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function Ud(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);lt(t,i,n),t[nt]=e,t[gt]=n}catch(c){Le(e,e.return,c)}}var vn=!1,Ie=!1,zo=!1,kd=typeof WeakSet=="function"?WeakSet:Set,tt=null;function hp(e,t){if(e=e.containerInfo,Wo=zl,e=Qc(e),Tu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,y=-1,S=-1,D=0,H=0,$=e,z=null;t:for(;;){for(var U;$!==n||s!==0&&$.nodeType!==3||(y=h+s),$!==c||i!==0&&$.nodeType!==3||(S=h+i),$.nodeType===3&&(h+=$.nodeValue.length),(U=$.firstChild)!==null;)z=$,$=U;for(;;){if($===e)break t;if(z===n&&++D===s&&(y=h),z===c&&++H===i&&(S=h),(U=$.nextSibling)!==null)break;$=z,z=$.parentNode}$=U}n=y===-1||S===-1?null:{start:y,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(Po={focusedElem:e,selectionRange:n},zl=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){switch(t=tt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,s=c.memoizedProps,c=c.memoizedState,i=n.stateNode;try{var ie=gi(n.type,s);e=i.getSnapshotBeforeUpdate(ie,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(fe){Le(n,n.return,fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ns(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ns(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}}function jd(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:yn(e,n),i&4&&$a(5,n);break;case 1:if(yn(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Le(n,n.return,h)}else{var s=gi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Le(n,n.return,h)}}i&64&&Md(n),i&512&&Xa(n,n.return);break;case 3:if(yn(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{wf(e,t)}catch(h){Le(n,n.return,h)}}break;case 27:t===null&&i&4&&Ud(n);case 26:case 5:yn(e,n),t===null&&i&4&&Gd(n),i&512&&Xa(n,n.return);break;case 12:yn(e,n);break;case 31:yn(e,n),i&4&&qd(e,n);break;case 13:yn(e,n),i&4&&Yd(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=wp.bind(null,n),Yp(e,n))));break;case 22:if(i=n.memoizedState!==null||vn,!i){t=t!==null&&t.memoizedState!==null||Ie,s=vn;var c=Ie;vn=i,(Ie=t)&&!c?bn(e,n,(n.subtreeFlags&8772)!==0):yn(e,n),vn=s,Ie=c}break;case 30:break;default:yn(e,n)}}function Bd(e){var t=e.alternate;t!==null&&(e.alternate=null,Bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Fe=null,vt=!1;function pn(e,t,n){for(n=n.child;n!==null;)Hd(e,t,n),n=n.sibling}function Hd(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(ma,n)}catch{}switch(n.tag){case 26:Ie||en(n,t),pn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ie||en(n,t);var i=Fe,s=vt;Vn(n.type)&&(Fe=n.stateNode,vt=!1),pn(e,t,n),er(n.stateNode),Fe=i,vt=s;break;case 5:Ie||en(n,t);case 6:if(i=Fe,s=vt,Fe=null,pn(e,t,n),Fe=i,vt=s,Fe!==null)if(vt)try{(Fe.nodeType===9?Fe.body:Fe.nodeName==="HTML"?Fe.ownerDocument.body:Fe).removeChild(n.stateNode)}catch(c){Le(n,t,c)}else try{Fe.removeChild(n.stateNode)}catch(c){Le(n,t,c)}break;case 18:Fe!==null&&(vt?(e=Fe,Mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),la(e)):Mh(Fe,n.stateNode));break;case 4:i=Fe,s=vt,Fe=n.stateNode.containerInfo,vt=!0,pn(e,t,n),Fe=i,vt=s;break;case 0:case 11:case 14:case 15:Bn(2,n,t),Ie||Bn(4,n,t),pn(e,t,n);break;case 1:Ie||(en(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Ld(n,t,i)),pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:Ie=(i=Ie)||n.memoizedState!==null,pn(e,t,n),Ie=i;break;default:pn(e,t,n)}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{la(e)}catch(n){Le(t,t.return,n)}}}function Yd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{la(e)}catch(n){Le(t,t.return,n)}}function gp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kd),t;default:throw Error(a(435,e.tag))}}function fl(e,t){var n=gp(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var s=Tp.bind(null,e,i);i.then(s,s)}})}function pt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var s=n[i],c=e,h=t,y=h;e:for(;y!==null;){switch(y.tag){case 27:if(Vn(y.type)){Fe=y.stateNode,vt=!1;break e}break;case 5:Fe=y.stateNode,vt=!1;break e;case 3:case 4:Fe=y.stateNode.containerInfo,vt=!0;break e}y=y.return}if(Fe===null)throw Error(a(160));Hd(c,h,s),Fe=null,vt=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fd(t,e),t=t.sibling}var Vt=null;function Fd(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),yt(e),i&4&&(Bn(3,e,e.return),$a(3,e),Bn(5,e,e.return));break;case 1:pt(t,e),yt(e),i&512&&(Ie||n===null||en(n,n.return)),i&64&&vn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var s=Vt;if(pt(t,e),yt(e),i&512&&(Ie||n===null||en(n,n.return)),i&4){var c=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(i){case"title":c=s.getElementsByTagName("title")[0],(!c||c[ya]||c[nt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(i),s.head.insertBefore(c,s.querySelector("head > title"))),lt(c,i,n),c[nt]=e,et(c),i=c;break e;case"link":var h=Fh("link","href",s).get(i+(n.href||""));if(h){for(var y=0;y<h.length;y++)if(c=h[y],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(y,1);break t}}c=s.createElement(i),lt(c,i,n),s.head.appendChild(c);break;case"meta":if(h=Fh("meta","content",s).get(i+(n.content||""))){for(y=0;y<h.length;y++)if(c=h[y],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(y,1);break t}}c=s.createElement(i),lt(c,i,n),s.head.appendChild(c);break;default:throw Error(a(468,i))}c[nt]=e,et(c),i=c}e.stateNode=i}else $h(s,e.type,e.stateNode);else e.stateNode=Yh(s,i,e.memoizedProps);else c!==i?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,i===null?$h(s,e.type,e.stateNode):Yh(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&No(e,e.memoizedProps,n.memoizedProps)}break;case 27:pt(t,e),yt(e),i&512&&(Ie||n===null||en(n,n.return)),n!==null&&i&4&&No(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pt(t,e),yt(e),i&512&&(Ie||n===null||en(n,n.return)),e.flags&32){s=e.stateNode;try{Ri(s,"")}catch(ie){Le(e,e.return,ie)}}i&4&&e.stateNode!=null&&(s=e.memoizedProps,No(e,s,n!==null?n.memoizedProps:s)),i&1024&&(zo=!0);break;case 6:if(pt(t,e),yt(e),i&4){if(e.stateNode===null)throw Error(a(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(ie){Le(e,e.return,ie)}}break;case 3:if(Cl=null,s=Vt,Vt=xl(t.containerInfo),pt(t,e),Vt=s,yt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{la(t.containerInfo)}catch(ie){Le(e,e.return,ie)}zo&&(zo=!1,$d(e));break;case 4:i=Vt,Vt=xl(e.stateNode.containerInfo),pt(t,e),yt(e),Vt=i;break;case 12:pt(t,e),yt(e);break;case 31:pt(t,e),yt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fl(e,i)));break;case 13:pt(t,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(hl=St()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fl(e,i)));break;case 22:s=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,D=vn,H=Ie;if(vn=D||s,Ie=H||S,pt(t,e),Ie=H,vn=D,yt(e),i&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||S||vn||Ie||mi(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(c=S.stateNode,s)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{y=S.stateNode;var $=S.memoizedProps.style,z=$!=null&&$.hasOwnProperty("display")?$.display:null;y.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(ie){Le(S,S.return,ie)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=s?"":S.memoizedProps}catch(ie){Le(S,S.return,ie)}}}else if(t.tag===18){if(n===null){S=t;try{var U=S.stateNode;s?Lh(U,!0):Lh(S.stateNode,!1)}catch(ie){Le(S,S.return,ie)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,fl(e,n))));break;case 19:pt(t,e),yt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fl(e,i)));break;case 30:break;case 21:break;default:pt(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(Od(i)){n=i;break}i=i.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var s=n.stateNode,c=Ro(e);cl(e,c,s);break;case 5:var h=n.stateNode;n.flags&32&&(Ri(h,""),n.flags&=-33);var y=Ro(e);cl(e,y,h);break;case 3:case 4:var S=n.stateNode.containerInfo,D=Ro(e);Do(e,D,S);break;default:throw Error(a(161))}}catch(H){Le(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $d(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;$d(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jd(e,t.alternate,t),t=t.sibling}function mi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bn(4,t,t.return),mi(t);break;case 1:en(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Ld(t,t.return,n),mi(t);break;case 27:er(t.stateNode);case 26:case 5:en(t,t.return),mi(t);break;case 22:t.memoizedState===null&&mi(t);break;case 30:mi(t);break;default:mi(t)}e=e.sibling}}function bn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,s=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:bn(s,c,n),$a(4,c);break;case 1:if(bn(s,c,n),i=c,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(D){Le(i,i.return,D)}if(i=c,s=i.updateQueue,s!==null){var y=i.stateNode;try{var S=s.shared.hiddenCallbacks;if(S!==null)for(s.shared.hiddenCallbacks=null,s=0;s<S.length;s++)Sf(S[s],y)}catch(D){Le(i,i.return,D)}}n&&h&64&&Md(c),Xa(c,c.return);break;case 27:Ud(c);case 26:case 5:bn(s,c,n),n&&i===null&&h&4&&Gd(c),Xa(c,c.return);break;case 12:bn(s,c,n);break;case 31:bn(s,c,n),n&&h&4&&qd(s,c);break;case 13:bn(s,c,n),n&&h&4&&Yd(s,c);break;case 22:c.memoizedState===null&&bn(s,c,n),Xa(c,c.return);break;case 30:break;default:bn(s,c,n)}t=t.sibling}}function Mo(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&za(n))}function Lo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&za(e))}function Zt(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xd(e,t,n,i),t=t.sibling}function Xd(e,t,n,i){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Zt(e,t,n,i),s&2048&&$a(9,t);break;case 1:Zt(e,t,n,i);break;case 3:Zt(e,t,n,i),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&za(e)));break;case 12:if(s&2048){Zt(e,t,n,i),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,y=c.onPostCommit;typeof y=="function"&&y(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Le(t,t.return,S)}}else Zt(e,t,n,i);break;case 31:Zt(e,t,n,i);break;case 13:Zt(e,t,n,i);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Zt(e,t,n,i):Va(e,t):c._visibility&2?Zt(e,t,n,i):(c._visibility|=2,Ki(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Mo(h,t);break;case 24:Zt(e,t,n,i),s&2048&&Lo(t.alternate,t);break;default:Zt(e,t,n,i)}}function Ki(e,t,n,i,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,y=n,S=i,D=h.flags;switch(h.tag){case 0:case 11:case 15:Ki(c,h,y,S,s),$a(8,h);break;case 23:break;case 22:var H=h.stateNode;h.memoizedState!==null?H._visibility&2?Ki(c,h,y,S,s):Va(c,h):(H._visibility|=2,Ki(c,h,y,S,s)),s&&D&2048&&Mo(h.alternate,h);break;case 24:Ki(c,h,y,S,s),s&&D&2048&&Lo(h.alternate,h);break;default:Ki(c,h,y,S,s)}t=t.sibling}}function Va(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,s=i.flags;switch(i.tag){case 22:Va(n,i),s&2048&&Mo(i.alternate,i);break;case 24:Va(n,i),s&2048&&Lo(i.alternate,i);break;default:Va(n,i)}t=t.sibling}}var Za=8192;function Ji(e,t,n){if(e.subtreeFlags&Za)for(e=e.child;e!==null;)Vd(e,t,n),e=e.sibling}function Vd(e,t,n){switch(e.tag){case 26:Ji(e,t,n),e.flags&Za&&e.memoizedState!==null&&ey(n,Vt,e.memoizedState,e.memoizedProps);break;case 5:Ji(e,t,n);break;case 3:case 4:var i=Vt;Vt=xl(e.stateNode.containerInfo),Ji(e,t,n),Vt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Za,Za=16777216,Ji(e,t,n),Za=i):Ji(e,t,n));break;default:Ji(e,t,n)}}function Zd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qa(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];tt=i,Kd(i,e)}Zd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qd(e),e=e.sibling}function Qd(e){switch(e.tag){case 0:case 11:case 15:Qa(e),e.flags&2048&&Bn(9,e,e.return);break;case 3:Qa(e);break;case 12:Qa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,dl(e)):Qa(e);break;default:Qa(e)}}function dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];tt=i,Kd(i,e)}Zd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bn(8,t,t.return),dl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,dl(t));break;default:dl(t)}e=e.sibling}}function Kd(e,t){for(;tt!==null;){var n=tt;switch(n.tag){case 0:case 11:case 15:Bn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:za(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,tt=i;else e:for(n=e;tt!==null;){i=tt;var s=i.sibling,c=i.return;if(Bd(i),i===n){tt=null;break e}if(s!==null){s.return=c,tt=s;break e}tt=c}}}var mp={getCacheForType:function(e){var t=at(Qe),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return at(Qe).controller.signal}},vp=typeof WeakMap=="function"?WeakMap:Map,ze=0,ke=null,_e=null,Ae=0,Me=0,Nt=null,Hn=!1,Ii=!1,Go=!1,En=0,Xe=0,qn=0,vi=0,Oo=0,Rt=0,Wi=0,Ka=null,bt=null,Uo=!1,hl=0,Jd=0,gl=1/0,ml=null,Yn=null,We=0,Fn=null,Pi=null,Sn=0,ko=0,jo=null,Id=null,Ja=0,Bo=null;function Dt(){return(ze&2)!==0&&Ae!==0?Ae&-Ae:G.T!==null?Xo():dc()}function Wd(){if(Rt===0)if((Ae&536870912)===0||Ne){var e=Tr;Tr<<=1,(Tr&3932160)===0&&(Tr=262144),Rt=e}else Rt=536870912;return e=At.current,e!==null&&(e.flags|=32),Rt}function Et(e,t,n){(e===ke&&(Me===2||Me===9)||e.cancelPendingCommit!==null)&&(ea(e,0),$n(e,Ae,Rt,!1)),pa(e,n),((ze&2)===0||e!==ke)&&(e===ke&&((ze&2)===0&&(vi|=n),Xe===4&&$n(e,Ae,Rt,!1)),tn(e))}function Pd(e,t,n){if((ze&6)!==0)throw Error(a(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||va(e,t),s=i?bp(e,t):qo(e,t,!0),c=i;do{if(s===0){Ii&&!i&&$n(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!pp(n)){s=qo(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var y=e;s=Ka;var S=y.current.memoizedState.isDehydrated;if(S&&(ea(y,h).flags|=256),h=qo(y,h,!1),h!==2){if(Go&&!S){y.errorRecoveryDisabledLanes|=c,vi|=c,s=4;break e}c=bt,bt=s,c!==null&&(bt===null?bt=c:bt.push.apply(bt,c))}s=h}if(c=!1,s!==2)continue}}if(s===1){ea(e,0),$n(e,t,0,!0);break}e:{switch(i=e,c=s,c){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:$n(i,t,Rt,!Hn);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(s=hl+300-St(),10<s)){if($n(i,t,Rt,!Hn),xr(i,0,!0)!==0)break e;Sn=t,i.timeoutHandle=Dh(eh.bind(null,i,n,bt,ml,Uo,t,Rt,vi,Wi,Hn,c,"Throttled",-0,0),s);break e}eh(i,n,bt,ml,Uo,t,Rt,vi,Wi,Hn,c,null,-0,0)}}break}while(!0);tn(e)}function eh(e,t,n,i,s,c,h,y,S,D,H,$,z,U){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ln},Vd(t,c,$);var ie=(c&62914560)===c?hl-St():(c&4194048)===c?Jd-St():0;if(ie=ty($,ie),ie!==null){Sn=c,e.cancelPendingCommit=ie(oh.bind(null,e,t,c,n,i,s,h,y,S,H,$,null,z,U)),$n(e,c,h,!D);return}}oh(e,t,c,n,i,s,h,y,S)}function pp(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var s=n[i],c=s.getSnapshot;s=s.value;try{if(!_t(c(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $n(e,t,n,i){t&=~Oo,t&=~vi,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var s=t;0<s;){var c=31-Tt(s),h=1<<c;i[c]=-1,s&=~h}n!==0&&sc(e,n,t)}function vl(){return(ze&6)===0?(Ia(0),!1):!0}function Ho(){if(_e!==null){if(Me===0)var e=_e.return;else e=_e,cn=ui=null,to(e),$i=null,La=0,e=_e;for(;e!==null;)zd(e.alternate,e),e=e.return;_e=null}}function ea(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,kp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sn=0,Ho(),ke=e,_e=n=on(e.current,null),Ae=t,Me=0,Nt=null,Hn=!1,Ii=va(e,t),Go=!1,Wi=Rt=Oo=vi=qn=Xe=0,bt=Ka=null,Uo=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-Tt(i),c=1<<s;t|=e[s],i&=~c}return En=t,kr(),n}function th(e,t){pe=null,G.H=qa,t===Fi||t===Xr?(t=pf(),Me=3):t===Fu?(t=pf(),Me=4):Me=t===yo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,_e===null&&(Xe=1,rl(e,Gt(t,e.current)))}function nh(){var e=At.current;return e===null?!0:(Ae&4194048)===Ae?jt===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===jt:!1}function ih(){var e=G.H;return G.H=qa,e===null?qa:e}function ah(){var e=G.A;return G.A=mp,e}function pl(){Xe=4,Hn||(Ae&4194048)!==Ae&&At.current!==null||(Ii=!0),(qn&134217727)===0&&(vi&134217727)===0||ke===null||$n(ke,Ae,Rt,!1)}function qo(e,t,n){var i=ze;ze|=2;var s=ih(),c=ah();(ke!==e||Ae!==t)&&(ml=null,ea(e,t)),t=!1;var h=Xe;e:do try{if(Me!==0&&_e!==null){var y=_e,S=Nt;switch(Me){case 8:Ho(),h=6;break e;case 3:case 2:case 9:case 6:At.current===null&&(t=!0);var D=Me;if(Me=0,Nt=null,ta(e,y,S,D),n&&Ii){h=0;break e}break;default:D=Me,Me=0,Nt=null,ta(e,y,S,D)}}yp(),h=Xe;break}catch(H){th(e,H)}while(!0);return t&&e.shellSuspendCounter++,cn=ui=null,ze=i,G.H=s,G.A=c,_e===null&&(ke=null,Ae=0,kr()),h}function yp(){for(;_e!==null;)rh(_e)}function bp(e,t){var n=ze;ze|=2;var i=ih(),s=ah();ke!==e||Ae!==t?(ml=null,gl=St()+500,ea(e,t)):Ii=va(e,t);e:do try{if(Me!==0&&_e!==null){t=_e;var c=Nt;t:switch(Me){case 1:Me=0,Nt=null,ta(e,t,c,1);break;case 2:case 9:if(mf(c)){Me=0,Nt=null,lh(t);break}t=function(){Me!==2&&Me!==9||ke!==e||(Me=7),tn(e)},c.then(t,t);break e;case 3:Me=7;break e;case 4:Me=5;break e;case 7:mf(c)?(Me=0,Nt=null,lh(t)):(Me=0,Nt=null,ta(e,t,c,7));break;case 5:var h=null;switch(_e.tag){case 26:h=_e.memoizedState;case 5:case 27:var y=_e;if(h?Xh(h):y.stateNode.complete){Me=0,Nt=null;var S=y.sibling;if(S!==null)_e=S;else{var D=y.return;D!==null?(_e=D,yl(D)):_e=null}break t}}Me=0,Nt=null,ta(e,t,c,5);break;case 6:Me=0,Nt=null,ta(e,t,c,6);break;case 8:Ho(),Xe=6;break e;default:throw Error(a(462))}}Ep();break}catch(H){th(e,H)}while(!0);return cn=ui=null,G.H=i,G.A=s,ze=n,_e!==null?0:(ke=null,Ae=0,kr(),Xe)}function Ep(){for(;_e!==null&&!Fm();)rh(_e)}function rh(e){var t=Rd(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?yl(e):_e=t}function lh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Td(n,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=Td(n,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:to(t);default:zd(n,t),t=_e=af(t,En),t=Rd(n,t,En)}e.memoizedProps=e.pendingProps,t===null?yl(e):_e=t}function ta(e,t,n,i){cn=ui=null,to(t),$i=null,La=0;var s=t.return;try{if(op(e,s,t,n,Ae)){Xe=1,rl(e,Gt(n,e.current)),_e=null;return}}catch(c){if(s!==null)throw _e=s,c;Xe=1,rl(e,Gt(n,e.current)),_e=null;return}t.flags&32768?(Ne||i===1?e=!0:Ii||(Ae&536870912)!==0?e=!1:(Hn=e=!0,(i===2||i===9||i===3||i===6)&&(i=At.current,i!==null&&i.tag===13&&(i.flags|=16384))),uh(t,e)):yl(t)}function yl(e){var t=e;do{if((t.flags&32768)!==0){uh(t,Hn);return}e=t.return;var n=fp(t.alternate,t,En);if(n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Xe===0&&(Xe=5)}function uh(e,t){do{var n=dp(e.alternate,e);if(n!==null){n.flags&=32767,_e=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=n}while(e!==null);Xe=6,_e=null}function oh(e,t,n,i,s,c,h,y,S){e.cancelPendingCommit=null;do bl();while(We!==0);if((ze&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(c=t.lanes|t.childLanes,c|=Nu,Pm(e,n,c,h,y,S),e===ke&&(_e=ke=null,Ae=0),Pi=t,Fn=e,Sn=n,ko=c,jo=s,Id=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_p(Sr,function(){return hh(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null,s=I.p,I.p=2,h=ze,ze|=4;try{hp(e,t,n)}finally{ze=h,I.p=s,G.T=i}}We=1,sh(),ch(),fh()}}function sh(){if(We===1){We=0;var e=Fn,t=Pi,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=G.T,G.T=null;var i=I.p;I.p=2;var s=ze;ze|=4;try{Fd(t,e);var c=Po,h=Qc(e.containerInfo),y=c.focusedElem,S=c.selectionRange;if(h!==y&&y&&y.ownerDocument&&Zc(y.ownerDocument.documentElement,y)){if(S!==null&&Tu(y)){var D=S.start,H=S.end;if(H===void 0&&(H=D),"selectionStart"in y)y.selectionStart=D,y.selectionEnd=Math.min(H,y.value.length);else{var $=y.ownerDocument||document,z=$&&$.defaultView||window;if(z.getSelection){var U=z.getSelection(),ie=y.textContent.length,fe=Math.min(S.start,ie),Ue=S.end===void 0?fe:Math.min(S.end,ie);!U.extend&&fe>Ue&&(h=Ue,Ue=fe,fe=h);var A=Vc(y,fe),_=Vc(y,Ue);if(A&&_&&(U.rangeCount!==1||U.anchorNode!==A.node||U.anchorOffset!==A.offset||U.focusNode!==_.node||U.focusOffset!==_.offset)){var R=$.createRange();R.setStart(A.node,A.offset),U.removeAllRanges(),fe>Ue?(U.addRange(R),U.extend(_.node,_.offset)):(R.setEnd(_.node,_.offset),U.addRange(R))}}}}for($=[],U=y;U=U.parentNode;)U.nodeType===1&&$.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<$.length;y++){var Y=$[y];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}zl=!!Wo,Po=Wo=null}finally{ze=s,I.p=i,G.T=n}}e.current=t,We=2}}function ch(){if(We===2){We=0;var e=Fn,t=Pi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=G.T,G.T=null;var i=I.p;I.p=2;var s=ze;ze|=4;try{jd(e,t.alternate,t)}finally{ze=s,I.p=i,G.T=n}}We=3}}function fh(){if(We===4||We===3){We=0,$m();var e=Fn,t=Pi,n=Sn,i=Id;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?We=5:(We=0,Pi=Fn=null,dh(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Yn=null),au(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(ma,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=G.T,s=I.p,I.p=2,G.T=null;try{for(var c=e.onRecoverableError,h=0;h<i.length;h++){var y=i[h];c(y.value,{componentStack:y.stack})}}finally{G.T=t,I.p=s}}(Sn&3)!==0&&bl(),tn(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===Bo?Ja++:(Ja=0,Bo=e):Ja=0,Ia(0)}}function dh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,za(t)))}function bl(){return sh(),ch(),fh(),hh()}function hh(){if(We!==5)return!1;var e=Fn,t=ko;ko=0;var n=au(Sn),i=G.T,s=I.p;try{I.p=32>n?32:n,G.T=null,n=jo,jo=null;var c=Fn,h=Sn;if(We=0,Pi=Fn=null,Sn=0,(ze&6)!==0)throw Error(a(331));var y=ze;if(ze|=4,Qd(c.current),Xd(c,c.current,h,n),ze=y,Ia(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(ma,c)}catch{}return!0}finally{I.p=s,G.T=i,dh(e,t)}}function gh(e,t,n){t=Gt(n,t),t=po(e.stateNode,t,2),e=Un(e,t,2),e!==null&&(pa(e,2),tn(e))}function Le(e,t,n){if(e.tag===3)gh(e,e,n);else for(;t!==null;){if(t.tag===3){gh(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Yn===null||!Yn.has(i))){e=Gt(n,e),n=md(2),i=Un(t,n,2),i!==null&&(vd(n,i,t,e),pa(i,2),tn(i));break}}t=t.return}}function Yo(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new vp;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(n)||(Go=!0,s.add(n),e=Sp.bind(null,e,t,n),t.then(e,e))}function Sp(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ke===e&&(Ae&n)===n&&(Xe===4||Xe===3&&(Ae&62914560)===Ae&&300>St()-hl?(ze&2)===0&&ea(e,0):Oo|=n,Wi===Ae&&(Wi=0)),tn(e)}function mh(e,t){t===0&&(t=oc()),e=ai(e,t),e!==null&&(pa(e,t),tn(e))}function wp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mh(e,n)}function Tp(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(a(314))}i!==null&&i.delete(t),mh(e,n)}function _p(e,t){return eu(e,t)}var El=null,na=null,Fo=!1,Sl=!1,$o=!1,Xn=0;function tn(e){e!==na&&e.next===null&&(na===null?El=na=e:na=na.next=e),Sl=!0,Fo||(Fo=!0,Ap())}function Ia(e,t){if(!$o&&Sl){$o=!0;do for(var n=!1,i=El;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var c=0;else{var h=i.suspendedLanes,y=i.pingedLanes;c=(1<<31-Tt(42|e)+1)-1,c&=s&~(h&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,bh(i,c))}else c=Ae,c=xr(i,i===ke?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||va(i,c)||(n=!0,bh(i,c));i=i.next}while(n);$o=!1}}function xp(){vh()}function vh(){Sl=Fo=!1;var e=0;Xn!==0&&Up()&&(e=Xn);for(var t=St(),n=null,i=El;i!==null;){var s=i.next,c=ph(i,t);c===0?(i.next=null,n===null?El=s:n.next=s,s===null&&(na=n)):(n=i,(e!==0||(c&3)!==0)&&(Sl=!0)),i=s}We!==0&&We!==5||Ia(e),Xn!==0&&(Xn=0)}function ph(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-Tt(c),y=1<<h,S=s[h];S===-1?((y&n)===0||(y&i)!==0)&&(s[h]=Wm(y,t)):S<=t&&(e.expiredLanes|=y),c&=~y}if(t=ke,n=Ae,n=xr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Me===2||Me===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&tu(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||va(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&tu(i),au(n)){case 2:case 8:n=lc;break;case 32:n=Sr;break;case 268435456:n=uc;break;default:n=Sr}return i=yh.bind(null,e),n=eu(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&tu(i),e.callbackPriority=2,e.callbackNode=null,2}function yh(e,t){if(We!==0&&We!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(bl()&&e.callbackNode!==n)return null;var i=Ae;return i=xr(e,e===ke?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Pd(e,i,t),ph(e,St()),e.callbackNode!=null&&e.callbackNode===n?yh.bind(null,e):null)}function bh(e,t){if(bl())return null;Pd(e,t,!0)}function Ap(){jp(function(){(ze&6)!==0?eu(rc,xp):vh()})}function Xo(){if(Xn===0){var e=qi;e===0&&(e=wr,wr<<=1,(wr&261888)===0&&(wr=256)),Xn=e}return Xn}function Eh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Rr(""+e)}function Sh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cp(e,t,n,i,s){if(t==="submit"&&n&&n.stateNode===s){var c=Eh((s[gt]||null).action),h=i.submitter;h&&(t=(t=h[gt]||null)?Eh(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var y=new Lr("action","action",null,i,s);e.push({event:y,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Xn!==0){var S=h?Sh(s,h):new FormData(s);co(n,{pending:!0,data:S,method:s.method,action:c},null,S)}}else typeof c=="function"&&(y.preventDefault(),S=h?Sh(s,h):new FormData(s),co(n,{pending:!0,data:S,method:s.method,action:c},c,S))},currentTarget:s}]})}}for(var Vo=0;Vo<Cu.length;Vo++){var Zo=Cu[Vo],Np=Zo.toLowerCase(),Rp=Zo[0].toUpperCase()+Zo.slice(1);Xt(Np,"on"+Rp)}Xt(Ic,"onAnimationEnd"),Xt(Wc,"onAnimationIteration"),Xt(Pc,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(Xv,"onTransitionRun"),Xt(Vv,"onTransitionStart"),Xt(Zv,"onTransitionCancel"),Xt(ef,"onTransitionEnd"),Ci("onMouseEnter",["mouseout","mouseover"]),Ci("onMouseLeave",["mouseout","mouseover"]),Ci("onPointerEnter",["pointerout","pointerover"]),Ci("onPointerLeave",["pointerout","pointerover"]),ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wa="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(" "),Dp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wa));function wh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],s=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var h=i.length-1;0<=h;h--){var y=i[h],S=y.instance,D=y.currentTarget;if(y=y.listener,S!==c&&s.isPropagationStopped())break e;c=y,s.currentTarget=D;try{c(s)}catch(H){Ur(H)}s.currentTarget=null,c=S}else for(h=0;h<i.length;h++){if(y=i[h],S=y.instance,D=y.currentTarget,y=y.listener,S!==c&&s.isPropagationStopped())break e;c=y,s.currentTarget=D;try{c(s)}catch(H){Ur(H)}s.currentTarget=null,c=S}}}}function xe(e,t){var n=t[ru];n===void 0&&(n=t[ru]=new Set);var i=e+"__bubble";n.has(i)||(Th(t,e,2,!1),n.add(i))}function Qo(e,t,n){var i=0;t&&(i|=4),Th(n,e,i,t)}var wl="_reactListening"+Math.random().toString(36).slice(2);function Ko(e){if(!e[wl]){e[wl]=!0,mc.forEach(function(n){n!=="selectionchange"&&(Dp.has(n)||Qo(n,!1,e),Qo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wl]||(t[wl]=!0,Qo("selectionchange",!1,t))}}function Th(e,t,n,i){switch(Wh(t)){case 2:var s=ay;break;case 8:s=ry;break;default:s=cs}n=s.bind(null,t,n,e),s=void 0,!gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Jo(e,t,n,i,s){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var y=i.stateNode.containerInfo;if(y===s)break;if(h===4)for(h=i.return;h!==null;){var S=h.tag;if((S===3||S===4)&&h.stateNode.containerInfo===s)return;h=h.return}for(;y!==null;){if(h=_i(y),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){i=c=h;continue e}y=y.parentNode}}i=i.return}Cc(function(){var D=c,H=du(n),$=[];e:{var z=tf.get(e);if(z!==void 0){var U=Lr,ie=e;switch(e){case"keypress":if(zr(n)===0)break e;case"keydown":case"keyup":U=Tv;break;case"focusin":ie="focus",U=yu;break;case"focusout":ie="blur",U=yu;break;case"beforeblur":case"afterblur":U=yu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=Dc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=fv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=Av;break;case Ic:case Wc:case Pc:U=gv;break;case ef:U=Nv;break;case"scroll":case"scrollend":U=sv;break;case"wheel":U=Dv;break;case"copy":case"cut":case"paste":U=vv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=Mc;break;case"toggle":case"beforetoggle":U=Mv}var fe=(t&4)!==0,Ue=!fe&&(e==="scroll"||e==="scrollend"),A=fe?z!==null?z+"Capture":null:z;fe=[];for(var _=D,R;_!==null;){var Y=_;if(R=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||R===null||A===null||(Y=Ea(_,A),Y!=null&&fe.push(Pa(_,Y,R))),Ue)break;_=_.return}0<fe.length&&(z=new U(z,ie,null,n,H),$.push({event:z,listeners:fe}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",z&&n!==fu&&(ie=n.relatedTarget||n.fromElement)&&(_i(ie)||ie[Ti]))break e;if((U||z)&&(z=H.window===H?H:(z=H.ownerDocument)?z.defaultView||z.parentWindow:window,U?(ie=n.relatedTarget||n.toElement,U=D,ie=ie?_i(ie):null,ie!==null&&(Ue=f(ie),fe=ie.tag,ie!==Ue||fe!==5&&fe!==27&&fe!==6)&&(ie=null)):(U=null,ie=D),U!==ie)){if(fe=Dc,Y="onMouseLeave",A="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(fe=Mc,Y="onPointerLeave",A="onPointerEnter",_="pointer"),Ue=U==null?z:ba(U),R=ie==null?z:ba(ie),z=new fe(Y,_+"leave",U,n,H),z.target=Ue,z.relatedTarget=R,Y=null,_i(H)===D&&(fe=new fe(A,_+"enter",ie,n,H),fe.target=R,fe.relatedTarget=Ue,Y=fe),Ue=Y,U&&ie)t:{for(fe=zp,A=U,_=ie,R=0,Y=A;Y;Y=fe(Y))R++;Y=0;for(var oe=_;oe;oe=fe(oe))Y++;for(;0<R-Y;)A=fe(A),R--;for(;0<Y-R;)_=fe(_),Y--;for(;R--;){if(A===_||_!==null&&A===_.alternate){fe=A;break t}A=fe(A),_=fe(_)}fe=null}else fe=null;U!==null&&_h($,z,U,fe,!1),ie!==null&&Ue!==null&&_h($,Ue,ie,fe,!0)}}e:{if(z=D?ba(D):window,U=z.nodeName&&z.nodeName.toLowerCase(),U==="select"||U==="input"&&z.type==="file")var Re=Hc;else if(jc(z))if(qc)Re=Yv;else{Re=Hv;var ae=Bv}else U=z.nodeName,!U||U.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?D&&cu(D.elementType)&&(Re=Hc):Re=qv;if(Re&&(Re=Re(e,D))){Bc($,Re,n,H);break e}ae&&ae(e,z,D),e==="focusout"&&D&&z.type==="number"&&D.memoizedProps.value!=null&&su(z,"number",z.value)}switch(ae=D?ba(D):window,e){case"focusin":(jc(ae)||ae.contentEditable==="true")&&(Li=ae,_u=D,Na=null);break;case"focusout":Na=_u=Li=null;break;case"mousedown":xu=!0;break;case"contextmenu":case"mouseup":case"dragend":xu=!1,Kc($,n,H);break;case"selectionchange":if($v)break;case"keydown":case"keyup":Kc($,n,H)}var ye;if(Eu)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Mi?Uc(e,n)&&(Ce="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ce="onCompositionStart");Ce&&(Lc&&n.locale!=="ko"&&(Mi||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Mi&&(ye=Nc()):(Rn=H,mu="value"in Rn?Rn.value:Rn.textContent,Mi=!0)),ae=Tl(D,Ce),0<ae.length&&(Ce=new zc(Ce,e,null,n,H),$.push({event:Ce,listeners:ae}),ye?Ce.data=ye:(ye=kc(n),ye!==null&&(Ce.data=ye)))),(ye=Gv?Ov(e,n):Uv(e,n))&&(Ce=Tl(D,"onBeforeInput"),0<Ce.length&&(ae=new zc("onBeforeInput","beforeinput",null,n,H),$.push({event:ae,listeners:Ce}),ae.data=ye)),Cp($,e,D,n,H)}wh($,t)})}function Pa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Tl(e,t){for(var n=t+"Capture",i=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=Ea(e,n),s!=null&&i.unshift(Pa(e,s,c)),s=Ea(e,t),s!=null&&i.push(Pa(e,s,c))),e.tag===3)return i;e=e.return}return[]}function zp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _h(e,t,n,i,s){for(var c=t._reactName,h=[];n!==null&&n!==i;){var y=n,S=y.alternate,D=y.stateNode;if(y=y.tag,S!==null&&S===i)break;y!==5&&y!==26&&y!==27||D===null||(S=D,s?(D=Ea(n,c),D!=null&&h.unshift(Pa(n,D,S))):s||(D=Ea(n,c),D!=null&&h.push(Pa(n,D,S)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Mp=/\r\n?/g,Lp=/\u0000|\uFFFD/g;function xh(e){return(typeof e=="string"?e:""+e).replace(Mp,`
9
- `).replace(Lp,"")}function Ah(e,t){return t=xh(t),xh(e)===t}function Oe(e,t,n,i,s,c){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ri(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ri(e,""+i);break;case"className":Cr(e,"class",i);break;case"tabIndex":Cr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Cr(e,n,i);break;case"style":xc(e,i,c);break;case"data":if(t!=="object"){Cr(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Rr(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"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 c=="function"&&(n==="formAction"?(t!=="input"&&Oe(e,t,"name",s.name,s,null),Oe(e,t,"formEncType",s.formEncType,s,null),Oe(e,t,"formMethod",s.formMethod,s,null),Oe(e,t,"formTarget",s.formTarget,s,null)):(Oe(e,t,"encType",s.encType,s,null),Oe(e,t,"method",s.method,s,null),Oe(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Rr(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=ln);break;case"onScroll":i!=null&&xe("scroll",e);break;case"onScrollEnd":i!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(a(61));if(n=i.__html,n!=null){if(s.children!=null)throw Error(a(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=Rr(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Ar(e,"popover",i);break;case"xlinkActuate":rn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":rn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":rn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":rn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":rn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":rn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":rn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":rn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":rn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ar(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=uv.get(n)||n,Ar(e,n,i))}}function Io(e,t,n,i,s,c){switch(n){case"style":xc(e,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(a(61));if(n=i.__html,n!=null){if(s.children!=null)throw Error(a(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Ri(e,i):(typeof i=="number"||typeof i=="bigint")&&Ri(e,""+i);break;case"onScroll":i!=null&&xe("scroll",e);break;case"onScrollEnd":i!=null&&xe("scrollend",e);break;case"onClick":i!=null&&(e.onclick=ln);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vc.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),c=e[gt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,s),typeof i=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,s);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):Ar(e,n,i)}}}function lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var i=!1,s=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Oe(e,t,c,h,n,null)}}s&&Oe(e,t,"srcSet",n.srcSet,n,null),i&&Oe(e,t,"src",n.src,n,null);return;case"input":xe("invalid",e);var y=c=h=s=null,S=null,D=null;for(i in n)if(n.hasOwnProperty(i)){var H=n[i];if(H!=null)switch(i){case"name":s=H;break;case"type":h=H;break;case"checked":S=H;break;case"defaultChecked":D=H;break;case"value":c=H;break;case"defaultValue":y=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(a(137,t));break;default:Oe(e,t,i,H,n,null)}}Sc(e,c,y,S,D,h,s,!1);return;case"select":xe("invalid",e),i=h=c=null;for(s in n)if(n.hasOwnProperty(s)&&(y=n[s],y!=null))switch(s){case"value":c=y;break;case"defaultValue":h=y;break;case"multiple":i=y;default:Oe(e,t,s,y,n,null)}t=c,n=h,e.multiple=!!i,t!=null?Ni(e,!!i,t,!1):n!=null&&Ni(e,!!i,n,!0);return;case"textarea":xe("invalid",e),c=s=i=null;for(h in n)if(n.hasOwnProperty(h)&&(y=n[h],y!=null))switch(h){case"value":i=y;break;case"defaultValue":s=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(a(91));break;default:Oe(e,t,h,y,n,null)}Tc(e,i,s,c);return;case"option":for(S in n)n.hasOwnProperty(S)&&(i=n[S],i!=null)&&(S==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Oe(e,t,S,i,n,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(i=0;i<Wa.length;i++)xe(Wa[i],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(D in n)if(n.hasOwnProperty(D)&&(i=n[D],i!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Oe(e,t,D,i,n,null)}return;default:if(cu(t)){for(H in n)n.hasOwnProperty(H)&&(i=n[H],i!==void 0&&Io(e,t,H,i,n,void 0));return}}for(y in n)n.hasOwnProperty(y)&&(i=n[y],i!=null&&Oe(e,t,y,i,n,null))}function Gp(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,h=null,y=null,S=null,D=null,H=null;for(U in n){var $=n[U];if(n.hasOwnProperty(U)&&$!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":S=$;default:i.hasOwnProperty(U)||Oe(e,t,U,null,i,$)}}for(var z in i){var U=i[z];if($=n[z],i.hasOwnProperty(z)&&(U!=null||$!=null))switch(z){case"type":c=U;break;case"name":s=U;break;case"checked":D=U;break;case"defaultChecked":H=U;break;case"value":h=U;break;case"defaultValue":y=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(137,t));break;default:U!==$&&Oe(e,t,z,U,i,$)}}ou(e,h,y,S,D,H,c,s);return;case"select":U=h=y=z=null;for(c in n)if(S=n[c],n.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":U=S;default:i.hasOwnProperty(c)||Oe(e,t,c,null,i,S)}for(s in i)if(c=i[s],S=n[s],i.hasOwnProperty(s)&&(c!=null||S!=null))switch(s){case"value":z=c;break;case"defaultValue":y=c;break;case"multiple":h=c;default:c!==S&&Oe(e,t,s,c,i,S)}t=y,n=h,i=U,z!=null?Ni(e,!!n,z,!1):!!i!=!!n&&(t!=null?Ni(e,!!n,t,!0):Ni(e,!!n,n?[]:"",!1));return;case"textarea":U=z=null;for(y in n)if(s=n[y],n.hasOwnProperty(y)&&s!=null&&!i.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Oe(e,t,y,null,i,s)}for(h in i)if(s=i[h],c=n[h],i.hasOwnProperty(h)&&(s!=null||c!=null))switch(h){case"value":z=s;break;case"defaultValue":U=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(a(91));break;default:s!==c&&Oe(e,t,h,s,i,c)}wc(e,z,U);return;case"option":for(var ie in n)z=n[ie],n.hasOwnProperty(ie)&&z!=null&&!i.hasOwnProperty(ie)&&(ie==="selected"?e.selected=!1:Oe(e,t,ie,null,i,z));for(S in i)z=i[S],U=n[S],i.hasOwnProperty(S)&&z!==U&&(z!=null||U!=null)&&(S==="selected"?e.selected=z&&typeof z!="function"&&typeof z!="symbol":Oe(e,t,S,z,i,U));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 fe in n)z=n[fe],n.hasOwnProperty(fe)&&z!=null&&!i.hasOwnProperty(fe)&&Oe(e,t,fe,null,i,z);for(D in i)if(z=i[D],U=n[D],i.hasOwnProperty(D)&&z!==U&&(z!=null||U!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(137,t));break;default:Oe(e,t,D,z,i,U)}return;default:if(cu(t)){for(var Ue in n)z=n[Ue],n.hasOwnProperty(Ue)&&z!==void 0&&!i.hasOwnProperty(Ue)&&Io(e,t,Ue,void 0,i,z);for(H in i)z=i[H],U=n[H],!i.hasOwnProperty(H)||z===U||z===void 0&&U===void 0||Io(e,t,H,z,i,U);return}}for(var A in n)z=n[A],n.hasOwnProperty(A)&&z!=null&&!i.hasOwnProperty(A)&&Oe(e,t,A,null,i,z);for($ in i)z=i[$],U=n[$],!i.hasOwnProperty($)||z===U||z==null&&U==null||Oe(e,t,$,z,i,U)}function Ch(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Op(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var s=n[i],c=s.transferSize,h=s.initiatorType,y=s.duration;if(c&&y&&Ch(h)){for(h=0,y=s.responseEnd,i+=1;i<n.length;i++){var S=n[i],D=S.startTime;if(D>y)break;var H=S.transferSize,$=S.initiatorType;H&&Ch($)&&(S=S.responseEnd,h+=H*(S<y?1:(y-D)/(S-D)))}if(--i,t+=8*(c+h)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Wo=null,Po=null;function _l(e){return e.nodeType===9?e:e.ownerDocument}function Nh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Rh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function es(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ts=null;function Up(){var e=window.event;return e&&e.type==="popstate"?e===ts?!1:(ts=e,!0):(ts=null,!1)}var Dh=typeof setTimeout=="function"?setTimeout:void 0,kp=typeof clearTimeout=="function"?clearTimeout:void 0,zh=typeof Promise=="function"?Promise:void 0,jp=typeof queueMicrotask=="function"?queueMicrotask:typeof zh<"u"?function(e){return zh.resolve(null).then(e).catch(Bp)}:Dh;function Bp(e){setTimeout(function(){throw e})}function Vn(e){return e==="head"}function Mh(e,t){var n=t,i=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(s),la(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")er(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,er(n);for(var c=n.firstChild;c;){var h=c.nextSibling,y=c.nodeName;c[ya]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&er(e.ownerDocument.body);n=s}while(n);la(t)}function Lh(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function ns(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ns(n),lu(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Hp(e,t,n,i){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ya])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Bt(e.nextSibling),e===null)break}return null}function qp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Bt(e.nextSibling),e===null))return null;return e}function Gh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Bt(e.nextSibling),e===null))return null;return e}function is(e){return e.data==="$?"||e.data==="$~"}function as(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Yp(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Bt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var rs=null;function Oh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Bt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Uh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function kh(e,t,n){switch(t=_l(n),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function er(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lu(e)}var Ht=new Map,jh=new Set;function xl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wn=I.d;I.d={f:Fp,r:$p,D:Xp,C:Vp,L:Zp,m:Qp,X:Jp,S:Kp,M:Ip};function Fp(){var e=wn.f(),t=vl();return e||t}function $p(e){var t=xi(e);t!==null&&t.tag===5&&t.type==="form"?td(t):wn.r(e)}var ia=typeof document>"u"?null:document;function Bh(e,t,n){var i=ia;if(i&&typeof t=="string"&&t){var s=Mt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),jh.has(s)||(jh.add(s),e={rel:e,crossOrigin:n,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),lt(t,"link",e),et(t),i.head.appendChild(t)))}}function Xp(e){wn.D(e),Bh("dns-prefetch",e,null)}function Vp(e,t){wn.C(e,t),Bh("preconnect",e,t)}function Zp(e,t,n){wn.L(e,t,n);var i=ia;if(i&&e&&t){var s='link[rel="preload"][as="'+Mt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Mt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Mt(n.imageSizes)+'"]')):s+='[href="'+Mt(e)+'"]';var c=s;switch(t){case"style":c=aa(e);break;case"script":c=ra(e)}Ht.has(c)||(e=p({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ht.set(c,e),i.querySelector(s)!==null||t==="style"&&i.querySelector(tr(c))||t==="script"&&i.querySelector(nr(c))||(t=i.createElement("link"),lt(t,"link",e),et(t),i.head.appendChild(t)))}}function Qp(e,t){wn.m(e,t);var n=ia;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Mt(i)+'"][href="'+Mt(e)+'"]',c=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ra(e)}if(!Ht.has(c)&&(e=p({rel:"modulepreload",href:e},t),Ht.set(c,e),n.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(nr(c)))return}i=n.createElement("link"),lt(i,"link",e),et(i),n.head.appendChild(i)}}}function Kp(e,t,n){wn.S(e,t,n);var i=ia;if(i&&e){var s=Ai(i).hoistableStyles,c=aa(e);t=t||"default";var h=s.get(c);if(!h){var y={loading:0,preload:null};if(h=i.querySelector(tr(c)))y.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ht.get(c))&&ls(e,n);var S=h=i.createElement("link");et(S),lt(S,"link",e),S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),S.addEventListener("load",function(){y.loading|=1}),S.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Al(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:y},s.set(c,h)}}}function Jp(e,t){wn.X(e,t);var n=ia;if(n&&e){var i=Ai(n).hoistableScripts,s=ra(e),c=i.get(s);c||(c=n.querySelector(nr(s)),c||(e=p({src:e,async:!0},t),(t=Ht.get(s))&&us(e,t),c=n.createElement("script"),et(c),lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function Ip(e,t){wn.M(e,t);var n=ia;if(n&&e){var i=Ai(n).hoistableScripts,s=ra(e),c=i.get(s);c||(c=n.querySelector(nr(s)),c||(e=p({src:e,async:!0,type:"module"},t),(t=Ht.get(s))&&us(e,t),c=n.createElement("script"),et(c),lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function Hh(e,t,n,i){var s=(s=be.current)?xl(s):null;if(!s)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=aa(n.href),n=Ai(s).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=aa(n.href);var c=Ai(s).hoistableStyles,h=c.get(e);if(h||(s=s.ownerDocument||s,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=s.querySelector(tr(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Ht.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ht.set(e,n),c||Wp(s,e,n,h.state))),t&&i===null)throw Error(a(528,""));return h}if(t&&i!==null)throw Error(a(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ra(n),n=Ai(s).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function aa(e){return'href="'+Mt(e)+'"'}function tr(e){return'link[rel="stylesheet"]['+e+"]"}function qh(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Wp(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),lt(t,"link",n),et(t),e.head.appendChild(t))}function ra(e){return'[src="'+Mt(e)+'"]'}function nr(e){return"script[async]"+e}function Yh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Mt(n.href)+'"]');if(i)return t.instance=i,et(i),i;var s=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),et(i),lt(i,"style",s),Al(i,n.precedence,e),t.instance=i;case"stylesheet":s=aa(n.href);var c=e.querySelector(tr(s));if(c)return t.state.loading|=4,t.instance=c,et(c),c;i=qh(n),(s=Ht.get(s))&&ls(i,s),c=(e.ownerDocument||e).createElement("link"),et(c);var h=c;return h._p=new Promise(function(y,S){h.onload=y,h.onerror=S}),lt(c,"link",i),t.state.loading|=4,Al(c,n.precedence,e),t.instance=c;case"script":return c=ra(n.src),(s=e.querySelector(nr(c)))?(t.instance=s,et(s),s):(i=n,(s=Ht.get(c))&&(i=p({},n),us(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),et(s),lt(s,"link",i),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Al(i,n.precedence,e));return t.instance}function Al(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,c=s,h=0;h<i.length;h++){var y=i[h];if(y.dataset.precedence===t)c=y;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ls(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function us(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Cl=null;function Fh(e,t,n){if(Cl===null){var i=new Map,s=Cl=new Map;s.set(n,i)}else s=Cl,i=s.get(n),i||(i=new Map,s.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var c=n[s];if(!(c[ya]||c[nt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var y=i.get(h);y?y.push(c):i.set(h,[c])}}return i}function $h(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Pp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Xh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ey(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=aa(i.href),c=t.querySelector(tr(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Nl.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,et(c);return}c=t.ownerDocument||t,i=qh(i),(s=Ht.get(s))&&ls(i,s),c=c.createElement("link"),et(c);var h=c;h._p=new Promise(function(y,S){h.onload=y,h.onerror=S}),lt(c,"link",i),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Nl.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var os=0;function ty(e,t){return e.stylesheets&&e.count===0&&Dl(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Dl(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&os===0&&(os=62500*Op());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dl(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>os?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Nl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Rl=null;function Dl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Rl=new Map,t.forEach(ny,e),Rl=null,Nl.call(e))}function ny(e,t){if(!(t.state.loading&4)){var n=Rl.get(e);if(n)var i=n.get(null);else{n=new Map,Rl.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var h=s[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),i=h)}i&&n.set(null,i)}s=t.instance,h=s.getAttribute("data-precedence"),c=n.get(h)||i,c===i&&n.set(null,s),n.set(h,s),this.count++,i=Nl.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ir={$$typeof:V,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function iy(e,t,n,i,s,c,h,y,S){this.tag=1,this.containerInfo=e,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=nu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nu(0),this.hiddenUpdates=nu(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Vh(e,t,n,i,s,c,h,y,S,D,H,$){return e=new iy(e,t,n,h,S,D,H,$,y),t=1,c===!0&&(t|=24),c=xt(3,null,null,t),e.current=c,c.stateNode=e,t=Hu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:n,cache:t},$u(c),e}function Zh(e){return e?(e=Ui,e):Ui}function Qh(e,t,n,i,s,c){s=Zh(s),i.context===null?i.context=s:i.pendingContext=s,i=On(t),i.payload={element:n},c=c===void 0?null:c,c!==null&&(i.callback=c),n=Un(e,i,t),n!==null&&(Et(n,e,t),Oa(n,e,t))}function Kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ss(e,t){Kh(e,t),(e=e.alternate)&&Kh(e,t)}function Jh(e){if(e.tag===13||e.tag===31){var t=ai(e,67108864);t!==null&&Et(t,e,67108864),ss(e,67108864)}}function Ih(e){if(e.tag===13||e.tag===31){var t=Dt();t=iu(t);var n=ai(e,t);n!==null&&Et(n,e,t),ss(e,t)}}var zl=!0;function ay(e,t,n,i){var s=G.T;G.T=null;var c=I.p;try{I.p=2,cs(e,t,n,i)}finally{I.p=c,G.T=s}}function ry(e,t,n,i){var s=G.T;G.T=null;var c=I.p;try{I.p=8,cs(e,t,n,i)}finally{I.p=c,G.T=s}}function cs(e,t,n,i){if(zl){var s=fs(i);if(s===null)Jo(e,t,i,Ml,n),Ph(e,i);else if(uy(s,e,t,n,i))i.stopPropagation();else if(Ph(e,i),t&4&&-1<ly.indexOf(e)){for(;s!==null;){var c=xi(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=Pn(c.pendingLanes);if(h!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;h;){var S=1<<31-Tt(h);y.entanglements[1]|=S,h&=~S}tn(c),(ze&6)===0&&(gl=St()+500,Ia(0))}}break;case 31:case 13:y=ai(c,2),y!==null&&Et(y,c,2),vl(),ss(c,2)}if(c=fs(i),c===null&&Jo(e,t,i,Ml,n),c===s)break;s=c}s!==null&&i.stopPropagation()}else Jo(e,t,i,null,n)}}function fs(e){return e=du(e),ds(e)}var Ml=null;function ds(e){if(Ml=null,e=_i(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=d(t),e!==null)return e;e=null}else if(n===31){if(e=g(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ml=e,null}function Wh(e){switch(e){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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xm()){case rc:return 2;case lc:return 8;case Sr:case Vm:return 32;case uc:return 268435456;default:return 32}default:return 32}}var hs=!1,Zn=null,Qn=null,Kn=null,ar=new Map,rr=new Map,Jn=[],ly="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 Ph(e,t){switch(e){case"focusin":case"focusout":Zn=null;break;case"dragenter":case"dragleave":Qn=null;break;case"mouseover":case"mouseout":Kn=null;break;case"pointerover":case"pointerout":ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rr.delete(t.pointerId)}}function lr(e,t,n,i,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:c,targetContainers:[s]},t!==null&&(t=xi(t),t!==null&&Jh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function uy(e,t,n,i,s){switch(t){case"focusin":return Zn=lr(Zn,e,t,n,i,s),!0;case"dragenter":return Qn=lr(Qn,e,t,n,i,s),!0;case"mouseover":return Kn=lr(Kn,e,t,n,i,s),!0;case"pointerover":var c=s.pointerId;return ar.set(c,lr(ar.get(c)||null,e,t,n,i,s)),!0;case"gotpointercapture":return c=s.pointerId,rr.set(c,lr(rr.get(c)||null,e,t,n,i,s)),!0}return!1}function eg(e){var t=_i(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=d(n),t!==null){e.blockedOn=t,hc(e.priority,function(){Ih(n)});return}}else if(t===31){if(t=g(n),t!==null){e.blockedOn=t,hc(e.priority,function(){Ih(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ll(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fs(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);fu=i,n.target.dispatchEvent(i),fu=null}else return t=xi(n),t!==null&&Jh(t),e.blockedOn=n,!1;t.shift()}return!0}function tg(e,t,n){Ll(e)&&n.delete(t)}function oy(){hs=!1,Zn!==null&&Ll(Zn)&&(Zn=null),Qn!==null&&Ll(Qn)&&(Qn=null),Kn!==null&&Ll(Kn)&&(Kn=null),ar.forEach(tg),rr.forEach(tg)}function Gl(e,t){e.blockedOn===t&&(e.blockedOn=null,hs||(hs=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,oy)))}var Ol=null;function ng(e){Ol!==e&&(Ol=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){Ol===e&&(Ol=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],s=e[t+2];if(typeof i!="function"){if(ds(i||n)===null)continue;break}var c=xi(n);c!==null&&(e.splice(t,3),t-=3,co(c,{pending:!0,data:s,method:n.method,action:i},i,s))}}))}function la(e){function t(S){return Gl(S,e)}Zn!==null&&Gl(Zn,e),Qn!==null&&Gl(Qn,e),Kn!==null&&Gl(Kn,e),ar.forEach(t),rr.forEach(t);for(var n=0;n<Jn.length;n++){var i=Jn[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Jn.length&&(n=Jn[0],n.blockedOn===null);)eg(n),n.blockedOn===null&&Jn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var s=n[i],c=n[i+1],h=s[gt]||null;if(typeof c=="function")h||ng(n);else if(h){var y=null;if(c&&c.hasAttribute("formAction")){if(s=c,h=c[gt]||null)y=h.formAction;else if(ds(s)!==null)continue}else y=h.action;typeof y=="function"?n[i+1]=y:(n.splice(i,3),i-=3),ng(n)}}}function ig(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return s=h})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function gs(e){this._internalRoot=e}Ul.prototype.render=gs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current,i=Dt();Qh(n,i,e,t,null,null)},Ul.prototype.unmount=gs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qh(e.current,2,null,e,null,null),vl(),t[Ti]=null}};function Ul(e){this._internalRoot=e}Ul.prototype.unstable_scheduleHydration=function(e){if(e){var t=dc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jn.length&&t!==0&&t<Jn[n].priority;n++);Jn.splice(n,0,e),n===0&&eg(e)}};var ag=r.version;if(ag!=="19.2.8")throw Error(a(527,ag,"19.2.8"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=v(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var sy={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{ma=kl.inject(sy),wt=kl}catch{}}return or.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,i="",s=fd,c=dd,h=hd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Vh(e,1,!1,null,null,n,i,null,s,c,h,ig),e[Ti]=t.current,Ko(e),new gs(t)},or.hydrateRoot=function(e,t,n){if(!o(e))throw Error(a(299));var i=!1,s="",c=fd,h=dd,y=hd,S=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=Vh(e,1,!0,t,n??null,i,s,S,c,h,y,ig),t.context=Zh(null),n=t.current,i=Dt(),i=iu(i),s=On(i),s.callback=null,Un(n,s,i),n=i,t.current.lanes=n,pa(t,n),tn(t),e[Ti]=t.current,Ko(e),new Ul(t)},or.version="19.2.8",or}var gg;function Ey(){if(gg)return ps.exports;gg=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}return u(),ps.exports=by(),ps.exports}var Sy=Ey();const Ss="lat.md",wy="/assets/logo-CNF8zs47.svg",Ty=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function Ig(u,r){return[...u.values()].sort((l,a)=>{if(r){const o=l.kind==="file"&&l.path===r,f=a.kind==="file"&&a.path===r;if(o!==f)return o?-1:1}return Ty.compare(l.name,a.name)||l.name.localeCompare(a.name)}).map(l=>l.kind==="directory"?{...l,children:Ig(l.children,`${l.path}/${l.name}.md`)}:l)}function _y(u){const r=`${u.path}/${u.name}.md`;return u.children.find(l=>l.kind==="file"&&l.path===r)??null}function xy(u){u&&(u.open=!0)}function js(u,r){return u.kind==="file"?r[u.path]??0:u.children.reduce((l,a)=>l+js(a,r),0)}function Bs(u,r){if(u.kind==="file")return r[u.path]??null;let l=null;for(const a of u.children){const o=Bs(a,r);if(o==="modified")return"modified";o==="new"&&(l="new")}return l}function Ay(u){const r=new Map;for(const l of u){const a=l.split("/").filter(Boolean);if(a.length===0)continue;let o=r;for(let d=0;d<a.length-1;d++){const g=a[d],m=a.slice(0,d+1).join("/"),v=o.get(g);if(v?.kind==="file")break;const b=v??{kind:"directory",name:g,path:m,children:new Map};o.set(g,b),o=b.children}const f=a[a.length-1];o.set(f,{kind:"file",name:f,path:l})}return Ig(r,"lat.md")}function wi(){return typeof window>"u"?null:window.__LAT_STATIC_VIEW__?.basePath??null}function Cy(){return wi()!==null}function Ny(u,r=wi()){return!r||!u.startsWith("/assets/")?u:`${r}${u.slice(1)}`}function oa(u){const r=wi();if(!r)return u;const l=r==="/"?"":r.slice(0,-1),a=l&&u.startsWith(l)?u.slice(l.length)||"/":u;return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function Ry(u){const r=wi();return r?`${r}${u.replace(/^\//,"")}`:null}const Hs="/docs/",mg="/code/";function br(u){const r=u.split("/").map(encodeURIComponent).join("/");return Ry(`docs/${r}/`)??`${Hs}${r}`}function an(u){if(u=oa(u),!u.startsWith(Hs))return null;try{return u.slice(Hs.length).split("/").map(decodeURIComponent).join("/")}catch{return null}}function Dy(u){const r=new URL(u,"http://lat.local");return an(r.pathname)?`${r.pathname}${r.search}`:`${r.pathname}${r.search}${r.hash}`}function zy(u,r){return an(u.pathname)!==null&&u.origin===r.origin&&u.pathname===r.pathname&&u.search===r.search}function bi(u){if(u=oa(u),!u.startsWith(mg))return null;try{return u.slice(mg.length).split("/").map(decodeURIComponent).join("/")}catch{return null}}function Ql(u){if(!u)return"";try{return decodeURIComponent(u.slice(1))}catch{return u.slice(1)}}function My(u){return new URLSearchParams(u).get("q")??""}function Ly(u){return u?`/search?${new URLSearchParams({q:u})}`:"/search"}function Gy(u){return new URLSearchParams(u).get("node")??""}function Oy(u){return new URLSearchParams(u).get("target")??""}function Uy(u){return`lat.ui.graph-mode:${u??"/"}`}function ky(u,r){return u.getItem(r)==="true"}function jy(u,r,l){l?u.setItem(r,"true"):u.removeItem(r)}function Wg(u){const r=Number(u);return Number.isInteger(r)&&r>0?r:0}function By(u){const r=an(u.pathname);if(r!==null)return`document:${r}`;const l=bi(u.pathname);if(l===null)return"";const a=Wg(u.searchParams.get("at"));if(a>0)return`code-ref:${l}:${a}`;const o=Ql(u.hash);return`source:${l}${o?`#${o}`:""}`}function vg(u){return`${u.pathname}${u.search}${u.hash}`}function Pg(u,r){const l=an(r.pathname);if(l!==null){const g=u.nodes.find(m=>m.kind==="document"&&m.documentPath===l);return g?{nodeId:g.id,target:vg(r)}:null}const a=bi(r.pathname);if(a===null)return null;const o=Wg(r.searchParams.get("at")),f=Ql(r.hash);let d;return o>0&&(d=u.nodes.find(g=>g.kind==="code-reference"&&g.sourcePath===a&&g.line===o)),!d&&f&&(d=u.nodes.find(g=>g.kind==="source"&&g.sourcePath===a&&g.symbol===f)),!d&&!f&&o===0&&(d=u.nodes.find(g=>g.kind==="source"&&g.sourcePath===a&&!g.symbol)),d?{nodeId:d.id,target:vg(r)}:null}function em(u,r,l){try{const a=new URL(l),o=new URL(u,new URL(r,a));return o.origin===a.origin?o:null}catch{return null}}function qs(u,r,l,a){if(!l)return r.url;const o=em(l,r.url,a),f=o?Pg(u,o):null;return f?.nodeId===r.id?f.target:r.url}const tm="latSearchReturnTo",nm="latScrollPosition";function Hy(u){return{[tm]:u}}function qy(u){if(!u||typeof u!="object")return null;const r=u[tm];return typeof r=="string"&&r.startsWith("/")?r:null}function Yy(u,r){return{...u&&typeof u=="object"&&!Array.isArray(u)?u:{},[nm]:r}}function Fy(u){if(!u||typeof u!="object")return null;const r=u[nm];if(!r||typeof r!="object")return null;const{left:l,top:a}=r;return typeof l=="number"&&Number.isFinite(l)&&typeof a=="number"&&Number.isFinite(a)?{left:l,top:a}:null}function $y(u){return u?"clear":"close"}function Xy(u){return u==="/search"?"close":"open"}function Vy(u,r,l=""){if(!u){r.scrollTo({top:0,behavior:"instant"});return}let a=u.slice(1);try{a=decodeURIComponent(a)}catch{}if(a===l){r.scrollTo({top:0,behavior:"instant"});return}r.getElementById(a)?.scrollIntoView({behavior:"instant",block:"start"})}function im(u,r){return r?u.kind==="file"?u.path===r:u.children.some(l=>im(l,r)):!1}function am({activePath:u,errorCounts:r,gitFiles:l,node:a,onNavigate:o}){if(a.kind==="directory"){const g=_y(a),m=js(a,r),v=Bs(a,l);return x.jsxs("details",{className:"tree-directory",open:im(a,u)||void 0,children:[x.jsx("summary",{children:g?x.jsxs("a",{href:br(g.path),onClick:b=>{xy(b.currentTarget.closest("details")),o(b)},children:[x.jsx("span",{className:"document-link-name",children:a.name}),(m>0||v)&&x.jsx(ws,{errorCount:m,gitStatus:v})]}):x.jsxs("span",{children:[x.jsx("span",{className:"document-link-name",children:a.name}),(m>0||v)&&x.jsx(ws,{errorCount:m,gitStatus:v})]})}),x.jsx("div",{className:"tree-children",children:a.children.map(b=>x.jsx(am,{activePath:u,errorCounts:r,gitFiles:l,node:b,onNavigate:o},b.path))})]})}const f=js(a,r),d=Bs(a,l);return x.jsxs("a",{className:a.path===u?"document-link active":"document-link",href:br(a.path),onClick:o,children:[x.jsx("span",{className:"document-link-name",children:a.name.replace(/\.md$/i,"")}),(f>0||d)&&x.jsx(ws,{errorCount:f,gitStatus:d})]})}function ws({errorCount:u,gitStatus:r}){const a=[u>0?`${u} validation ${u===1?"error":"errors"}`:"",r?`${r} in Git`:""].filter(Boolean).join("; ");return x.jsx("span",{"aria-label":a,className:`document-state-disc${u>0?" has-errors":""}${r?` git-${r}`:""}`,role:"img",title:a})}function Zy({activePath:u,errorCounts:r,files:l,gitFiles:a,onNavigate:o}){const f=P.useMemo(()=>Ay(l),[l]);return x.jsx("div",{className:"file-tree",children:f.map(d=>x.jsx(am,{activePath:u,errorCounts:r,gitFiles:a,node:d,onNavigate:o},d.path))},u)}function Qy(u,r,l=96){let a=u[0]??"";for(const o of u){const f=r.get(o);if(f!==void 0){if(f>l)break;a=o}}return a}function Ky(u,r){return u===1?0:Math.max(0,u-r)}function Jy({scrollTop:u,viewportHeight:r,scrollHeight:l,topOffset:a=96}){const o=Math.max(0,Math.min(a,r)),f=Math.max(0,l-r);if(u<=0||f===0)return o;const d=Math.max(0,f-u),g=Math.max(0,r-o);return o+Math.max(0,g-d)}function Iy({containerHeight:u,contentHeight:r,itemHeight:l,itemTop:a}){const o=a+l/2-u/2;return Math.max(0,Math.min(o,r-u))}function pg(){return x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[x.jsx("path",{d:"M9 6h11"}),x.jsx("path",{d:"M12 12h8"}),x.jsx("path",{d:"M15 18h5"}),x.jsx("path",{d:"M5 6v.01"}),x.jsx("path",{d:"M8 12v.01"}),x.jsx("path",{d:"M11 18v.01"})]})}function Wy({gitEnabled:u,items:r,onNavigate:l}){const a=P.useMemo(()=>r.map(p=>p.id),[r]),o=r.filter(p=>p.depth>1).map(p=>p.depth),f=o.length>0?Math.min(...o):2,[d,g]=P.useState(a[0]??""),[m,v]=P.useState(!1),b=P.useRef(null);return P.useEffect(()=>{v(!1)},[a]),P.useEffect(()=>{if(!m)return;const p=E=>{E.key==="Escape"&&v(!1)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[m]),P.useEffect(()=>{let p=0;const E=()=>{window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{const T=new Map(a.flatMap(k=>{const X=window.document.getElementById(k);return X?[[k,X.getBoundingClientRect().top]]:[]})),N=window.document.scrollingElement,L=Jy({scrollTop:N?.scrollTop??window.scrollY,viewportHeight:N?.clientHeight??window.innerHeight,scrollHeight:N?.scrollHeight??window.document.documentElement.scrollHeight});g(Qy(a,T,L))})};return E(),window.addEventListener("scroll",E,{passive:!0}),window.addEventListener("resize",E),()=>{window.cancelAnimationFrame(p),window.removeEventListener("scroll",E),window.removeEventListener("resize",E)}},[a]),P.useEffect(()=>{const p=b.current,E=p?.querySelector('[aria-current="location"]');if(!p||!E||p.clientHeight===0)return;const T=p.getBoundingClientRect(),N=E.getBoundingClientRect(),L=Iy({containerHeight:p.clientHeight,contentHeight:p.scrollHeight,itemHeight:N.height,itemTop:p.scrollTop+N.top-T.top});Math.abs(p.scrollTop-L)<1||p.scrollTo({behavior:"smooth",top:L})},[d,m]),r.length===0?null:x.jsxs("aside",{className:"document-toc","data-expanded":m||void 0,children:[x.jsxs("div",{className:"document-toc-title document-toc-heading",children:[x.jsx(pg,{}),x.jsx("span",{children:"On this page"})]}),x.jsxs("button",{"aria-controls":"document-table-of-contents","aria-expanded":m,className:"document-toc-title document-toc-toggle",onClick:()=>v(p=>!p),type:"button",children:[x.jsx(pg,{}),x.jsx("span",{children:"On this page"}),x.jsx("span",{"aria-hidden":"true",className:"document-toc-chevron",children:"›"})]}),x.jsx("nav",{"aria-label":"On this page",className:"document-toc-list",id:"document-table-of-contents",ref:b,children:r.map(p=>{const E=u&&p.hasGitChanges;return x.jsxs("a",{"aria-current":d===p.id?"location":void 0,className:"document-toc-link","data-depth":p.depth,href:`#${encodeURIComponent(p.id)}`,onClick:T=>{g(p.id),v(!1),l(T),p.depth===1&&T.defaultPrevented&&window.scrollTo({top:0,behavior:"instant"})},style:{"--toc-depth":Ky(p.depth,f)},children:[x.jsx("span",{className:"document-toc-link-label",children:p.title}),(E||p.errorCount>0)&&x.jsxs("span",{className:"document-toc-states",children:[E&&x.jsx("span",{"aria-label":"Git changes",className:"document-toc-state git",role:"img",title:"Git changes"}),p.errorCount>0&&x.jsx("span",{"aria-label":`${p.errorCount} validation ${p.errorCount===1?"error":"errors"}`,className:"document-toc-state error",role:"img",title:`${p.errorCount} validation ${p.errorCount===1?"error":"errors"}`})]})]},p.id)})})]})}function Py(u){return JSON.stringify([u.path,u.symbol,u.from,u.line,u.at])}let jl=null;async function vr(u,r){const l=await fetch(u,{signal:r}),a=await l.json();if(!l.ok)throw new Error(a&&typeof a=="object"&&"error"in a?a.error:"Request failed");return a}function Vl(u){const r=wi();return r?new URL(`${r}${u}`,window.location.origin).toString():u}function eb(){return jl||(jl=vr(Vl("data/manifest.json")).catch(u=>{throw jl=null,u})),jl}function yg(u){const r=Number(u);return Number.isInteger(r)&&r>0?r:0}async function Ei(u,r){if(!wi())return vr(u,r);const l=await eb(),a=new URL(u,"http://lat.local");if(a.pathname==="/api/index")return l.index;let o;if(a.pathname==="/api/graph")o=l.graph;else if(a.pathname==="/api/document")o=l.documents[a.searchParams.get("path")??""];else if(a.pathname==="/api/source"){const f={path:a.searchParams.get("path")??"",symbol:a.searchParams.get("symbol")??"",from:a.searchParams.get("from")??"",line:yg(a.searchParams.get("line")),at:yg(a.searchParams.get("at"))},d=l.sources[Py(f)];if(!d)throw new Error("Static view data not found");const[g,m]=await Promise.all([vr(Vl(d.file),r),vr(Vl(d.view),r)]);return{...g,...m}}if(!o)throw new Error("Static view data not found");return vr(Vl(o),r)}var Bl={exports:{}},bg;function tb(){if(bg)return Bl.exports;bg=1;var u=typeof Reflect=="object"?Reflect:null,r=u&&typeof u.apply=="function"?u.apply:function(M,j,O){return Function.prototype.apply.call(M,j,O)},l;u&&typeof u.ownKeys=="function"?l=u.ownKeys:Object.getOwnPropertySymbols?l=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:l=function(M){return Object.getOwnPropertyNames(M)};function a(C){console&&console.warn&&console.warn(C)}var o=Number.isNaN||function(M){return M!==M};function f(){f.init.call(this)}Bl.exports=f,Bl.exports.once=X,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var d=10;function g(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(C){if(typeof C!="number"||C<0||o(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");d=C}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||o(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function m(C){return C._maxListeners===void 0?f.defaultMaxListeners:C._maxListeners}f.prototype.getMaxListeners=function(){return m(this)},f.prototype.emit=function(M){for(var j=[],O=1;O<arguments.length;O++)j.push(arguments[O]);var ee=M==="error",B=this._events;if(B!==void 0)ee=ee&&B.error===void 0;else if(!ee)return!1;if(ee){var Q;if(j.length>0&&(Q=j[0]),Q instanceof Error)throw Q;var se=new Error("Unhandled error."+(Q?" ("+Q.message+")":""));throw se.context=Q,se}var ce=B[M];if(ce===void 0)return!1;if(typeof ce=="function")r(ce,this,j);else for(var ue=ce.length,Ee=N(ce,ue),O=0;O<ue;++O)r(Ee[O],this,j);return!0};function v(C,M,j,O){var ee,B,Q;if(g(j),B=C._events,B===void 0?(B=C._events=Object.create(null),C._eventsCount=0):(B.newListener!==void 0&&(C.emit("newListener",M,j.listener?j.listener:j),B=C._events),Q=B[M]),Q===void 0)Q=B[M]=j,++C._eventsCount;else if(typeof Q=="function"?Q=B[M]=O?[j,Q]:[Q,j]:O?Q.unshift(j):Q.push(j),ee=m(C),ee>0&&Q.length>ee&&!Q.warned){Q.warned=!0;var se=new Error("Possible EventEmitter memory leak detected. "+Q.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");se.name="MaxListenersExceededWarning",se.emitter=C,se.type=M,se.count=Q.length,a(se)}return C}f.prototype.addListener=function(M,j){return v(this,M,j,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(M,j){return v(this,M,j,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(C,M,j){var O={fired:!1,wrapFn:void 0,target:C,type:M,listener:j},ee=b.bind(O);return ee.listener=j,O.wrapFn=ee,ee}f.prototype.once=function(M,j){return g(j),this.on(M,p(this,M,j)),this},f.prototype.prependOnceListener=function(M,j){return g(j),this.prependListener(M,p(this,M,j)),this},f.prototype.removeListener=function(M,j){var O,ee,B,Q,se;if(g(j),ee=this._events,ee===void 0)return this;if(O=ee[M],O===void 0)return this;if(O===j||O.listener===j)--this._eventsCount===0?this._events=Object.create(null):(delete ee[M],ee.removeListener&&this.emit("removeListener",M,O.listener||j));else if(typeof O!="function"){for(B=-1,Q=O.length-1;Q>=0;Q--)if(O[Q]===j||O[Q].listener===j){se=O[Q].listener,B=Q;break}if(B<0)return this;B===0?O.shift():L(O,B),O.length===1&&(ee[M]=O[0]),ee.removeListener!==void 0&&this.emit("removeListener",M,se||j)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(M){var j,O,ee;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[M]),this;if(arguments.length===0){var B=Object.keys(O),Q;for(ee=0;ee<B.length;++ee)Q=B[ee],Q!=="removeListener"&&this.removeAllListeners(Q);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(j=O[M],typeof j=="function")this.removeListener(M,j);else if(j!==void 0)for(ee=j.length-1;ee>=0;ee--)this.removeListener(M,j[ee]);return this};function E(C,M,j){var O=C._events;if(O===void 0)return[];var ee=O[M];return ee===void 0?[]:typeof ee=="function"?j?[ee.listener||ee]:[ee]:j?k(ee):N(ee,ee.length)}f.prototype.listeners=function(M){return E(this,M,!0)},f.prototype.rawListeners=function(M){return E(this,M,!1)},f.listenerCount=function(C,M){return typeof C.listenerCount=="function"?C.listenerCount(M):T.call(C,M)},f.prototype.listenerCount=T;function T(C){var M=this._events;if(M!==void 0){var j=M[C];if(typeof j=="function")return 1;if(j!==void 0)return j.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function N(C,M){for(var j=new Array(M),O=0;O<M;++O)j[O]=C[O];return j}function L(C,M){for(;M+1<C.length;M++)C[M]=C[M+1];C.pop()}function k(C){for(var M=new Array(C.length),j=0;j<M.length;++j)M[j]=C[j].listener||C[j];return M}function X(C,M){return new Promise(function(j,O){function ee(Q){C.removeListener(M,B),O(Q)}function B(){typeof C.removeListener=="function"&&C.removeListener("error",ee),j([].slice.call(arguments))}V(C,M,B,{once:!0}),M!=="error"&&K(C,ee,{once:!0})})}function K(C,M,j){typeof C.on=="function"&&V(C,"error",M,j)}function V(C,M,j,O){if(typeof C.on=="function")O.once?C.once(M,j):C.on(M,j);else if(typeof C.addEventListener=="function")C.addEventListener(M,function ee(B){O.once&&C.removeEventListener(M,ee),j(B)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return Bl.exports}var rm=tb();function nb(){const u=arguments[0];for(let r=1,l=arguments.length;r<l;r++)if(arguments[r])for(const a in arguments[r])u[a]=arguments[r][a];return u}let Pe=nb;typeof Object.assign=="function"&&(Pe=Object.assign);function Yt(u,r,l,a){const o=u._nodes.get(r);let f=null;return o&&(a==="mixed"?f=o.out&&o.out[l]||o.undirected&&o.undirected[l]:a==="directed"?f=o.out&&o.out[l]:f=o.undirected&&o.undirected[l]),f}function ut(u){return typeof u=="object"&&u!==null}function lm(u){let r;for(r in u)return!1;return!0}function qt(u,r,l){Object.defineProperty(u,r,{enumerable:!1,configurable:!1,writable:!0,value:l})}function Qt(u,r,l){const a={enumerable:!0,configurable:!0};typeof l=="function"?a.get=l:(a.value=l,a.writable=!1),Object.defineProperty(u,r,a)}function Eg(u){return!(!ut(u)||u.attributes&&!Array.isArray(u.attributes))}function ib(){let u=Math.floor(Math.random()*256)&255;return()=>u++}function xn(){const u=arguments;let r=null,l=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(r===null){if(l++,l>=u.length)return{done:!0};r=u[l][Symbol.iterator]()}if(a=r.next(),a.done){r=null;continue}break}while(!0);return a}}}function da(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Ks extends Error{constructor(r){super(),this.name="GraphError",this.message=r}}class te extends Ks{constructor(r){super(r),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,te.prototype.constructor)}}class W extends Ks{constructor(r){super(r),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,W.prototype.constructor)}}class de extends Ks{constructor(r){super(r),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,de.prototype.constructor)}}function um(u,r){this.key=u,this.attributes=r,this.clear()}um.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function om(u,r){this.key=u,this.attributes=r,this.clear()}om.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function sm(u,r){this.key=u,this.attributes=r,this.clear()}sm.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function ha(u,r,l,a,o){this.key=r,this.attributes=o,this.undirected=u,this.source=l,this.target=a}ha.prototype.attach=function(){let u="out",r="in";this.undirected&&(u=r="undirected");const l=this.source.key,a=this.target.key;this.source[u][a]=this,!(this.undirected&&l===a)&&(this.target[r][l]=this)};ha.prototype.attachMulti=function(){let u="out",r="in";const l=this.source.key,a=this.target.key;this.undirected&&(u=r="undirected");const o=this.source[u],f=o[a];if(typeof f>"u"){o[a]=this,this.undirected&&l===a||(this.target[r][l]=this);return}f.previous=this,this.next=f,o[a]=this,this.target[r][l]=this};ha.prototype.detach=function(){const u=this.source.key,r=this.target.key;let l="out",a="in";this.undirected&&(l=a="undirected"),delete this.source[l][r],delete this.target[a][u]};ha.prototype.detachMulti=function(){const u=this.source.key,r=this.target.key;let l="out",a="in";this.undirected&&(l=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[l][r],delete this.target[a][u]):(this.next.previous=void 0,this.source[l][r]=this.next,this.target[a][u]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const cm=0,fm=1,ab=2,dm=3;function An(u,r,l,a,o,f,d){let g,m,v,b;if(a=""+a,l===cm){if(g=u._nodes.get(a),!g)throw new W(`Graph.${r}: could not find the "${a}" node in the graph.`);v=o,b=f}else if(l===dm){if(o=""+o,m=u._edges.get(o),!m)throw new W(`Graph.${r}: could not find the "${o}" edge in the graph.`);const p=m.source.key,E=m.target.key;if(a===p)g=m.target;else if(a===E)g=m.source;else throw new W(`Graph.${r}: the "${a}" node is not attached to the "${o}" edge (${p}, ${E}).`);v=f,b=d}else{if(m=u._edges.get(a),!m)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`);l===fm?g=m.source:g=m.target,v=o,b=f}return[g,v,b]}function rb(u,r,l){u.prototype[r]=function(a,o,f){const[d,g]=An(this,r,l,a,o,f);return d.attributes[g]}}function lb(u,r,l){u.prototype[r]=function(a,o){const[f]=An(this,r,l,a,o);return f.attributes}}function ub(u,r,l){u.prototype[r]=function(a,o,f){const[d,g]=An(this,r,l,a,o,f);return d.attributes.hasOwnProperty(g)}}function ob(u,r,l){u.prototype[r]=function(a,o,f,d){const[g,m,v]=An(this,r,l,a,o,f,d);return g.attributes[m]=v,this.emit("nodeAttributesUpdated",{key:g.key,type:"set",attributes:g.attributes,name:m}),this}}function sb(u,r,l){u.prototype[r]=function(a,o,f,d){const[g,m,v]=An(this,r,l,a,o,f,d);if(typeof v!="function")throw new te(`Graph.${r}: updater should be a function.`);const b=g.attributes,p=v(b[m]);return b[m]=p,this.emit("nodeAttributesUpdated",{key:g.key,type:"set",attributes:g.attributes,name:m}),this}}function cb(u,r,l){u.prototype[r]=function(a,o,f){const[d,g]=An(this,r,l,a,o,f);return delete d.attributes[g],this.emit("nodeAttributesUpdated",{key:d.key,type:"remove",attributes:d.attributes,name:g}),this}}function fb(u,r,l){u.prototype[r]=function(a,o,f){const[d,g]=An(this,r,l,a,o,f);if(!ut(g))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return d.attributes=g,this.emit("nodeAttributesUpdated",{key:d.key,type:"replace",attributes:d.attributes}),this}}function db(u,r,l){u.prototype[r]=function(a,o,f){const[d,g]=An(this,r,l,a,o,f);if(!ut(g))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return Pe(d.attributes,g),this.emit("nodeAttributesUpdated",{key:d.key,type:"merge",attributes:d.attributes,data:g}),this}}function hb(u,r,l){u.prototype[r]=function(a,o,f){const[d,g]=An(this,r,l,a,o,f);if(typeof g!="function")throw new te(`Graph.${r}: provided updater is not a function.`);return d.attributes=g(d.attributes),this.emit("nodeAttributesUpdated",{key:d.key,type:"update",attributes:d.attributes}),this}}const gb=[{name:u=>`get${u}Attribute`,attacher:rb},{name:u=>`get${u}Attributes`,attacher:lb},{name:u=>`has${u}Attribute`,attacher:ub},{name:u=>`set${u}Attribute`,attacher:ob},{name:u=>`update${u}Attribute`,attacher:sb},{name:u=>`remove${u}Attribute`,attacher:cb},{name:u=>`replace${u}Attributes`,attacher:fb},{name:u=>`merge${u}Attributes`,attacher:db},{name:u=>`update${u}Attributes`,attacher:hb}];function mb(u){gb.forEach(function({name:r,attacher:l}){l(u,r("Node"),cm),l(u,r("Source"),fm),l(u,r("Target"),ab),l(u,r("Opposite"),dm)})}function vb(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const d=""+a,g=""+o;if(o=arguments[2],f=Yt(this,d,g,l),!f)throw new W(`Graph.${r}: could not find an edge for the given path ("${d}" - "${g}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,f=this._edges.get(a),!f)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return f.attributes[o]}}function pb(u,r,l){u.prototype[r]=function(a){let o;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const f=""+a,d=""+arguments[1];if(o=Yt(this,f,d,l),!o)throw new W(`Graph.${r}: could not find an edge for the given path ("${f}" - "${d}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,o=this._edges.get(a),!o)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return o.attributes}}function yb(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const d=""+a,g=""+o;if(o=arguments[2],f=Yt(this,d,g,l),!f)throw new W(`Graph.${r}: could not find an edge for the given path ("${d}" - "${g}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,f=this._edges.get(a),!f)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return f.attributes.hasOwnProperty(o)}}function bb(u,r,l){u.prototype[r]=function(a,o,f){let d;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const g=""+a,m=""+o;if(o=arguments[2],f=arguments[3],d=Yt(this,g,m,l),!d)throw new W(`Graph.${r}: could not find an edge for the given path ("${g}" - "${m}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,d=this._edges.get(a),!d)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return d.attributes[o]=f,this.emit("edgeAttributesUpdated",{key:d.key,type:"set",attributes:d.attributes,name:o}),this}}function Eb(u,r,l){u.prototype[r]=function(a,o,f){let d;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const g=""+a,m=""+o;if(o=arguments[2],f=arguments[3],d=Yt(this,g,m,l),!d)throw new W(`Graph.${r}: could not find an edge for the given path ("${g}" - "${m}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,d=this._edges.get(a),!d)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}if(typeof f!="function")throw new te(`Graph.${r}: updater should be a function.`);return d.attributes[o]=f(d.attributes[o]),this.emit("edgeAttributesUpdated",{key:d.key,type:"set",attributes:d.attributes,name:o}),this}}function Sb(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const d=""+a,g=""+o;if(o=arguments[2],f=Yt(this,d,g,l),!f)throw new W(`Graph.${r}: could not find an edge for the given path ("${d}" - "${g}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,f=this._edges.get(a),!f)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return delete f.attributes[o],this.emit("edgeAttributesUpdated",{key:f.key,type:"remove",attributes:f.attributes,name:o}),this}}function wb(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const d=""+a,g=""+o;if(o=arguments[2],f=Yt(this,d,g,l),!f)throw new W(`Graph.${r}: could not find an edge for the given path ("${d}" - "${g}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,f=this._edges.get(a),!f)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}if(!ut(o))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return f.attributes=o,this.emit("edgeAttributesUpdated",{key:f.key,type:"replace",attributes:f.attributes}),this}}function Tb(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const d=""+a,g=""+o;if(o=arguments[2],f=Yt(this,d,g,l),!f)throw new W(`Graph.${r}: could not find an edge for the given path ("${d}" - "${g}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,f=this._edges.get(a),!f)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}if(!ut(o))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return Pe(f.attributes,o),this.emit("edgeAttributesUpdated",{key:f.key,type:"merge",attributes:f.attributes,data:o}),this}}function _b(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new de(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new de(`Graph.${r}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const d=""+a,g=""+o;if(o=arguments[2],f=Yt(this,d,g,l),!f)throw new W(`Graph.${r}: could not find an edge for the given path ("${d}" - "${g}").`)}else{if(l!=="mixed")throw new de(`Graph.${r}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,f=this._edges.get(a),!f)throw new W(`Graph.${r}: could not find the "${a}" edge in the graph.`)}if(typeof o!="function")throw new te(`Graph.${r}: provided updater is not a function.`);return f.attributes=o(f.attributes),this.emit("edgeAttributesUpdated",{key:f.key,type:"update",attributes:f.attributes}),this}}const xb=[{name:u=>`get${u}Attribute`,attacher:vb},{name:u=>`get${u}Attributes`,attacher:pb},{name:u=>`has${u}Attribute`,attacher:yb},{name:u=>`set${u}Attribute`,attacher:bb},{name:u=>`update${u}Attribute`,attacher:Eb},{name:u=>`remove${u}Attribute`,attacher:Sb},{name:u=>`replace${u}Attributes`,attacher:wb},{name:u=>`merge${u}Attributes`,attacher:Tb},{name:u=>`update${u}Attributes`,attacher:_b}];function Ab(u){xb.forEach(function({name:r,attacher:l}){l(u,r("Edge"),"mixed"),l(u,r("DirectedEdge"),"directed"),l(u,r("UndirectedEdge"),"undirected")})}const Cb=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Nb(u,r,l,a){let o=!1;for(const f in r){if(f===a)continue;const d=r[f];if(o=l(d.key,d.attributes,d.source.key,d.target.key,d.source.attributes,d.target.attributes,d.undirected),u&&o)return d.key}}function Rb(u,r,l,a){let o,f,d,g=!1;for(const m in r)if(m!==a){o=r[m];do{if(f=o.source,d=o.target,g=l(o.key,o.attributes,f.key,d.key,f.attributes,d.attributes,o.undirected),u&&g)return o.key;o=o.next}while(o!==void 0)}}function Ts(u,r){const l=Object.keys(u),a=l.length;let o,f=0;return{[Symbol.iterator](){return this},next(){do if(o)o=o.next;else{if(f>=a)return{done:!0};const d=l[f++];if(d===r){o=void 0;continue}o=u[d]}while(!o);return{done:!1,value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected}}}}}function Db(u,r,l,a){const o=r[l];if(!o)return;const f=o.source,d=o.target;if(a(o.key,o.attributes,f.key,d.key,f.attributes,d.attributes,o.undirected)&&u)return o.key}function zb(u,r,l,a){let o=r[l];if(!o)return;let f=!1;do{if(f=a(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),u&&f)return o.key;o=o.next}while(o!==void 0)}function _s(u,r){let l=u[r];if(l.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!l)return{done:!0};const o={edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected};return l=l.next,{done:!1,value:o}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!0,{done:!1,value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected}})}}}function Mb(u,r){if(u.size===0)return[];if(r==="mixed"||r===u.type)return Array.from(u._edges.keys());const l=r==="undirected"?u.undirectedSize:u.directedSize,a=new Array(l),o=r==="undirected",f=u._edges.values();let d=0,g,m;for(;g=f.next(),g.done!==!0;)m=g.value,m.undirected===o&&(a[d++]=m.key);return a}function hm(u,r,l,a){if(r.size===0)return;const o=l!=="mixed"&&l!==r.type,f=l==="undirected";let d,g,m=!1;const v=r._edges.values();for(;d=v.next(),d.done!==!0;){if(g=d.value,o&&g.undirected!==f)continue;const{key:b,attributes:p,source:E,target:T}=g;if(m=a(b,p,E.key,T.key,E.attributes,T.attributes,g.undirected),u&&m)return b}}function Lb(u,r){if(u.size===0)return da();const l=r!=="mixed"&&r!==u.type,a=r==="undirected",o=u._edges.values();return{[Symbol.iterator](){return this},next(){let f,d;for(;;){if(f=o.next(),f.done)return f;if(d=f.value,!(l&&d.undirected!==a))break}return{value:{edge:d.key,attributes:d.attributes,source:d.source.key,target:d.target.key,sourceAttributes:d.source.attributes,targetAttributes:d.target.attributes,undirected:d.undirected},done:!1}}}}function Js(u,r,l,a,o,f){const d=r?Rb:Nb;let g;if(l!=="undirected"&&(a!=="out"&&(g=d(u,o.in,f),u&&g)||a!=="in"&&(g=d(u,o.out,f,a?void 0:o.key),u&&g))||l!=="directed"&&(g=d(u,o.undirected,f),u&&g))return g}function Gb(u,r,l,a){const o=[];return Js(!1,u,r,l,a,function(f){o.push(f)}),o}function Ob(u,r,l){let a=da();return u!=="undirected"&&(r!=="out"&&typeof l.in<"u"&&(a=xn(a,Ts(l.in))),r!=="in"&&typeof l.out<"u"&&(a=xn(a,Ts(l.out,r?void 0:l.key)))),u!=="directed"&&typeof l.undirected<"u"&&(a=xn(a,Ts(l.undirected))),a}function Is(u,r,l,a,o,f,d){const g=l?zb:Db;let m;if(r!=="undirected"&&(typeof o.in<"u"&&a!=="out"&&(m=g(u,o.in,f,d),u&&m)||typeof o.out<"u"&&a!=="in"&&(a||o.key!==f)&&(m=g(u,o.out,f,d),u&&m))||r!=="directed"&&typeof o.undirected<"u"&&(m=g(u,o.undirected,f,d),u&&m))return m}function Ub(u,r,l,a,o){const f=[];return Is(!1,u,r,l,a,o,function(d){f.push(d)}),f}function kb(u,r,l,a){let o=da();return u!=="undirected"&&(typeof l.in<"u"&&r!=="out"&&a in l.in&&(o=xn(o,_s(l.in,a))),typeof l.out<"u"&&r!=="in"&&a in l.out&&(r||l.key!==a)&&(o=xn(o,_s(l.out,a)))),u!=="directed"&&typeof l.undirected<"u"&&a in l.undirected&&(o=xn(o,_s(l.undirected,a))),o}function jb(u,r){const{name:l,type:a,direction:o}=r;u.prototype[l]=function(f,d){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return Mb(this,a);if(arguments.length===1){f=""+f;const g=this._nodes.get(f);if(typeof g>"u")throw new W(`Graph.${l}: could not find the "${f}" node in the graph.`);return Gb(this.multi,a==="mixed"?this.type:a,o,g)}if(arguments.length===2){f=""+f,d=""+d;const g=this._nodes.get(f);if(!g)throw new W(`Graph.${l}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(d))throw new W(`Graph.${l}: could not find the "${d}" target node in the graph.`);return Ub(a,this.multi,o,g,d)}throw new te(`Graph.${l}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Bb(u,r){const{name:l,type:a,direction:o}=r,f="forEach"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[f]=function(v,b,p){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return p=v,hm(!1,this,a,p);if(arguments.length===2){v=""+v,p=b;const E=this._nodes.get(v);if(typeof E>"u")throw new W(`Graph.${f}: could not find the "${v}" node in the graph.`);return Js(!1,this.multi,a==="mixed"?this.type:a,o,E,p)}if(arguments.length===3){v=""+v,b=""+b;const E=this._nodes.get(v);if(!E)throw new W(`Graph.${f}: could not find the "${v}" source node in the graph.`);if(!this._nodes.has(b))throw new W(`Graph.${f}: could not find the "${b}" target node in the graph.`);return Is(!1,a,this.multi,o,E,b,p)}throw new te(`Graph.${f}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const d="map"+l[0].toUpperCase()+l.slice(1);u.prototype[d]=function(){const v=Array.prototype.slice.call(arguments),b=v.pop();let p;if(v.length===0){let E=0;a!=="directed"&&(E+=this.undirectedSize),a!=="undirected"&&(E+=this.directedSize),p=new Array(E);let T=0;v.push((N,L,k,X,K,V,C)=>{p[T++]=b(N,L,k,X,K,V,C)})}else p=[],v.push((E,T,N,L,k,X,K)=>{p.push(b(E,T,N,L,k,X,K))});return this[f].apply(this,v),p};const g="filter"+l[0].toUpperCase()+l.slice(1);u.prototype[g]=function(){const v=Array.prototype.slice.call(arguments),b=v.pop(),p=[];return v.push((E,T,N,L,k,X,K)=>{b(E,T,N,L,k,X,K)&&p.push(E)}),this[f].apply(this,v),p};const m="reduce"+l[0].toUpperCase()+l.slice(1);u.prototype[m]=function(){let v=Array.prototype.slice.call(arguments);if(v.length<2||v.length>4)throw new te(`Graph.${m}: invalid number of arguments (expecting 2, 3 or 4 and got ${v.length}).`);if(typeof v[v.length-1]=="function"&&typeof v[v.length-2]!="function")throw new te(`Graph.${m}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let b,p;v.length===2?(b=v[0],p=v[1],v=[]):v.length===3?(b=v[1],p=v[2],v=[v[0]]):v.length===4&&(b=v[2],p=v[3],v=[v[0],v[1]]);let E=p;return v.push((T,N,L,k,X,K,V)=>{E=b(E,T,N,L,k,X,K,V)}),this[f].apply(this,v),E}}function Hb(u,r){const{name:l,type:a,direction:o}=r,f="find"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[f]=function(m,v,b){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return b=m,hm(!0,this,a,b);if(arguments.length===2){m=""+m,b=v;const p=this._nodes.get(m);if(typeof p>"u")throw new W(`Graph.${f}: could not find the "${m}" node in the graph.`);return Js(!0,this.multi,a==="mixed"?this.type:a,o,p,b)}if(arguments.length===3){m=""+m,v=""+v;const p=this._nodes.get(m);if(!p)throw new W(`Graph.${f}: could not find the "${m}" source node in the graph.`);if(!this._nodes.has(v))throw new W(`Graph.${f}: could not find the "${v}" target node in the graph.`);return Is(!0,a,this.multi,o,p,v,b)}throw new te(`Graph.${f}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const d="some"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[d]=function(){const m=Array.prototype.slice.call(arguments),v=m.pop();return m.push((p,E,T,N,L,k,X)=>v(p,E,T,N,L,k,X)),!!this[f].apply(this,m)};const g="every"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[g]=function(){const m=Array.prototype.slice.call(arguments),v=m.pop();return m.push((p,E,T,N,L,k,X)=>!v(p,E,T,N,L,k,X)),!this[f].apply(this,m)}}function qb(u,r){const{name:l,type:a,direction:o}=r,f=l.slice(0,-1)+"Entries";u.prototype[f]=function(d,g){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return da();if(!arguments.length)return Lb(this,a);if(arguments.length===1){d=""+d;const m=this._nodes.get(d);if(!m)throw new W(`Graph.${f}: could not find the "${d}" node in the graph.`);return Ob(a,o,m)}if(arguments.length===2){d=""+d,g=""+g;const m=this._nodes.get(d);if(!m)throw new W(`Graph.${f}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(g))throw new W(`Graph.${f}: could not find the "${g}" target node in the graph.`);return kb(a,o,m,g)}throw new te(`Graph.${f}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Yb(u){Cb.forEach(r=>{jb(u,r),Bb(u,r),Hb(u,r),qb(u,r)})}const Fb=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Kl(){this.A=null,this.B=null}Kl.prototype.wrap=function(u){this.A===null?this.A=u:this.B===null&&(this.B=u)};Kl.prototype.has=function(u){return this.A!==null&&u in this.A||this.B!==null&&u in this.B};function sr(u,r,l,a,o){for(const f in a){const d=a[f],g=d.source,m=d.target,v=g===l?m:g;if(r&&r.has(v.key))continue;const b=o(v.key,v.attributes);if(u&&b)return v.key}}function Ws(u,r,l,a,o){if(r!=="mixed"){if(r==="undirected")return sr(u,null,a,a.undirected,o);if(typeof l=="string")return sr(u,null,a,a[l],o)}const f=new Kl;let d;if(r!=="undirected"){if(l!=="out"){if(d=sr(u,null,a,a.in,o),u&&d)return d;f.wrap(a.in)}if(l!=="in"){if(d=sr(u,f,a,a.out,o),u&&d)return d;f.wrap(a.out)}}if(r!=="directed"&&(d=sr(u,f,a,a.undirected,o),u&&d))return d}function $b(u,r,l){if(u!=="mixed"){if(u==="undirected")return Object.keys(l.undirected);if(typeof r=="string")return Object.keys(l[r])}const a=[];return Ws(!1,u,r,l,function(o){a.push(o)}),a}function cr(u,r,l){const a=Object.keys(l),o=a.length;let f=0;return{[Symbol.iterator](){return this},next(){let d=null;do{if(f>=o)return u&&u.wrap(l),{done:!0};const g=l[a[f++]],m=g.source,v=g.target;if(d=m===r?v:m,u&&u.has(d.key)){d=null;continue}}while(d===null);return{done:!1,value:{neighbor:d.key,attributes:d.attributes}}}}}function Xb(u,r,l){if(u!=="mixed"){if(u==="undirected")return cr(null,l,l.undirected);if(typeof r=="string")return cr(null,l,l[r])}let a=da();const o=new Kl;return u!=="undirected"&&(r!=="out"&&(a=xn(a,cr(o,l,l.in))),r!=="in"&&(a=xn(a,cr(o,l,l.out)))),u!=="directed"&&(a=xn(a,cr(o,l,l.undirected))),a}function Vb(u,r){const{name:l,type:a,direction:o}=r;u.prototype[l]=function(f){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];f=""+f;const d=this._nodes.get(f);if(typeof d>"u")throw new W(`Graph.${l}: could not find the "${f}" node in the graph.`);return $b(a==="mixed"?this.type:a,o,d)}}function Zb(u,r){const{name:l,type:a,direction:o}=r,f="forEach"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[f]=function(v,b){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;v=""+v;const p=this._nodes.get(v);if(typeof p>"u")throw new W(`Graph.${f}: could not find the "${v}" node in the graph.`);Ws(!1,a==="mixed"?this.type:a,o,p,b)};const d="map"+l[0].toUpperCase()+l.slice(1);u.prototype[d]=function(v,b){const p=[];return this[f](v,(E,T)=>{p.push(b(E,T))}),p};const g="filter"+l[0].toUpperCase()+l.slice(1);u.prototype[g]=function(v,b){const p=[];return this[f](v,(E,T)=>{b(E,T)&&p.push(E)}),p};const m="reduce"+l[0].toUpperCase()+l.slice(1);u.prototype[m]=function(v,b,p){if(arguments.length<3)throw new te(`Graph.${m}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let E=p;return this[f](v,(T,N)=>{E=b(E,T,N)}),E}}function Qb(u,r){const{name:l,type:a,direction:o}=r,f=l[0].toUpperCase()+l.slice(1,-1),d="find"+f;u.prototype[d]=function(v,b){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;v=""+v;const p=this._nodes.get(v);if(typeof p>"u")throw new W(`Graph.${d}: could not find the "${v}" node in the graph.`);return Ws(!0,a==="mixed"?this.type:a,o,p,b)};const g="some"+f;u.prototype[g]=function(v,b){return!!this[d](v,b)};const m="every"+f;u.prototype[m]=function(v,b){return!this[d](v,(E,T)=>!b(E,T))}}function Kb(u,r){const{name:l,type:a,direction:o}=r,f=l.slice(0,-1)+"Entries";u.prototype[f]=function(d){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return da();d=""+d;const g=this._nodes.get(d);if(typeof g>"u")throw new W(`Graph.${f}: could not find the "${d}" node in the graph.`);return Xb(a==="mixed"?this.type:a,o,g)}}function Jb(u){Fb.forEach(r=>{Vb(u,r),Zb(u,r),Qb(u,r),Kb(u,r)})}function Hl(u,r,l,a,o){const f=a._nodes.values(),d=a.type;let g,m,v,b,p,E;for(;g=f.next(),g.done!==!0;){let T=!1;if(m=g.value,d!=="undirected"){b=m.out;for(v in b){p=b[v];do E=p.target,T=!0,o(m.key,E.key,m.attributes,E.attributes,p.key,p.attributes,p.undirected),p=p.next;while(p)}}if(d!=="directed"){b=m.undirected;for(v in b)if(!(r&&m.key>v)){p=b[v];do E=p.target,E.key!==v&&(E=p.source),T=!0,o(m.key,E.key,m.attributes,E.attributes,p.key,p.attributes,p.undirected),p=p.next;while(p)}}l&&!T&&o(m.key,null,m.attributes,null,null,null,null)}}function Ib(u,r){const l={key:u};return lm(r.attributes)||(l.attributes=Pe({},r.attributes)),l}function Wb(u,r,l){const a={key:r,source:l.source.key,target:l.target.key};return lm(l.attributes)||(a.attributes=Pe({},l.attributes)),u==="mixed"&&l.undirected&&(a.undirected=!0),a}function Pb(u){if(!ut(u))throw new te('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in u))throw new te("Graph.import: serialized node is missing its key.");if("attributes"in u&&(!ut(u.attributes)||u.attributes===null))throw new te("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function e0(u){if(!ut(u))throw new te('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in u))throw new te("Graph.import: serialized edge is missing its source.");if(!("target"in u))throw new te("Graph.import: serialized edge is missing its target.");if("attributes"in u&&(!ut(u.attributes)||u.attributes===null))throw new te("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in u&&typeof u.undirected!="boolean")throw new te("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const t0=ib(),n0=new Set(["directed","undirected","mixed"]),Sg=new Set(["domain","_events","_eventsCount","_maxListeners"]),i0=[{name:u=>`${u}Edge`,generateKey:!0},{name:u=>`${u}DirectedEdge`,generateKey:!0,type:"directed"},{name:u=>`${u}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:u=>`${u}EdgeWithKey`},{name:u=>`${u}DirectedEdgeWithKey`,type:"directed"},{name:u=>`${u}UndirectedEdgeWithKey`,type:"undirected"}],a0={allowSelfLoops:!0,multi:!1,type:"mixed"};function r0(u,r,l){if(l&&!ut(l))throw new te(`Graph.addNode: invalid attributes. Expecting an object but got "${l}"`);if(r=""+r,l=l||{},u._nodes.has(r))throw new de(`Graph.addNode: the "${r}" node already exist in the graph.`);const a=new u.NodeDataClass(r,l);return u._nodes.set(r,a),u.emit("nodeAdded",{key:r,attributes:l}),a}function wg(u,r,l){const a=new u.NodeDataClass(r,l);return u._nodes.set(r,a),u.emit("nodeAdded",{key:r,attributes:l}),a}function gm(u,r,l,a,o,f,d,g){if(!a&&u.type==="undirected")throw new de(`Graph.${r}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&u.type==="directed")throw new de(`Graph.${r}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(g&&!ut(g))throw new te(`Graph.${r}: invalid attributes. Expecting an object but got "${g}"`);if(f=""+f,d=""+d,g=g||{},!u.allowSelfLoops&&f===d)throw new de(`Graph.${r}: source & target are the same ("${f}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const m=u._nodes.get(f),v=u._nodes.get(d);if(!m)throw new W(`Graph.${r}: source node "${f}" not found.`);if(!v)throw new W(`Graph.${r}: target node "${d}" not found.`);const b={key:null,undirected:a,source:f,target:d,attributes:g};if(l)o=u._edgeKeyGenerator();else if(o=""+o,u._edges.has(o))throw new de(`Graph.${r}: the "${o}" edge already exists in the graph.`);if(!u.multi&&(a?typeof m.undirected[d]<"u":typeof m.out[d]<"u"))throw new de(`Graph.${r}: an edge linking "${f}" to "${d}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const p=new ha(a,o,m,v,g);u._edges.set(o,p);const E=f===d;return a?(m.undirectedDegree++,v.undirectedDegree++,E&&(m.undirectedLoops++,u._undirectedSelfLoopCount++)):(m.outDegree++,v.inDegree++,E&&(m.directedLoops++,u._directedSelfLoopCount++)),u.multi?p.attachMulti():p.attach(),a?u._undirectedSize++:u._directedSize++,b.key=o,u.emit("edgeAdded",b),o}function l0(u,r,l,a,o,f,d,g,m){if(!a&&u.type==="undirected")throw new de(`Graph.${r}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&u.type==="directed")throw new de(`Graph.${r}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(g){if(m){if(typeof g!="function")throw new te(`Graph.${r}: invalid updater function. Expecting a function but got "${g}"`)}else if(!ut(g))throw new te(`Graph.${r}: invalid attributes. Expecting an object but got "${g}"`)}f=""+f,d=""+d;let v;if(m&&(v=g,g=void 0),!u.allowSelfLoops&&f===d)throw new de(`Graph.${r}: source & target are the same ("${f}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let b=u._nodes.get(f),p=u._nodes.get(d),E,T;if(!l&&(E=u._edges.get(o),E)){if((E.source.key!==f||E.target.key!==d)&&(!a||E.source.key!==d||E.target.key!==f))throw new de(`Graph.${r}: inconsistency detected when attempting to merge the "${o}" edge with "${f}" source & "${d}" target vs. ("${E.source.key}", "${E.target.key}").`);T=E}if(!T&&!u.multi&&b&&(T=a?b.undirected[d]:b.out[d]),T){const K=[T.key,!1,!1,!1];if(m?!v:!g)return K;if(m){const V=T.attributes;T.attributes=v(V),u.emit("edgeAttributesUpdated",{type:"replace",key:T.key,attributes:T.attributes})}else Pe(T.attributes,g),u.emit("edgeAttributesUpdated",{type:"merge",key:T.key,attributes:T.attributes,data:g});return K}g=g||{},m&&v&&(g=v(g));const N={key:null,undirected:a,source:f,target:d,attributes:g};if(l)o=u._edgeKeyGenerator();else if(o=""+o,u._edges.has(o))throw new de(`Graph.${r}: the "${o}" edge already exists in the graph.`);let L=!1,k=!1;b||(b=wg(u,f,{}),L=!0,f===d&&(p=b,k=!0)),p||(p=wg(u,d,{}),k=!0),E=new ha(a,o,b,p,g),u._edges.set(o,E);const X=f===d;return a?(b.undirectedDegree++,p.undirectedDegree++,X&&(b.undirectedLoops++,u._undirectedSelfLoopCount++)):(b.outDegree++,p.inDegree++,X&&(b.directedLoops++,u._directedSelfLoopCount++)),u.multi?E.attachMulti():E.attach(),a?u._undirectedSize++:u._directedSize++,N.key=o,u.emit("edgeAdded",N),[o,!0,L,k]}function ua(u,r){u._edges.delete(r.key);const{source:l,target:a,attributes:o}=r,f=r.undirected,d=l===a;f?(l.undirectedDegree--,a.undirectedDegree--,d&&(l.undirectedLoops--,u._undirectedSelfLoopCount--)):(l.outDegree--,a.inDegree--,d&&(l.directedLoops--,u._directedSelfLoopCount--)),u.multi?r.detachMulti():r.detach(),f?u._undirectedSize--:u._directedSize--,u.emit("edgeDropped",{key:r.key,attributes:o,source:l.key,target:a.key,undirected:f})}class je extends rm.EventEmitter{constructor(r){if(super(),r=Pe({},a0,r),typeof r.multi!="boolean")throw new te(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${r.multi}".`);if(!n0.has(r.type))throw new te(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${r.type}".`);if(typeof r.allowSelfLoops!="boolean")throw new te(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${r.allowSelfLoops}".`);const l=r.type==="mixed"?um:r.type==="directed"?om:sm;qt(this,"NodeDataClass",l);const a="geid_"+t0()+"_";let o=0;const f=()=>{let d;do d=a+o++;while(this._edges.has(d));return d};qt(this,"_attributes",{}),qt(this,"_nodes",new Map),qt(this,"_edges",new Map),qt(this,"_directedSize",0),qt(this,"_undirectedSize",0),qt(this,"_directedSelfLoopCount",0),qt(this,"_undirectedSelfLoopCount",0),qt(this,"_edgeKeyGenerator",f),qt(this,"_options",r),Sg.forEach(d=>qt(this,d,this[d])),Qt(this,"order",()=>this._nodes.size),Qt(this,"size",()=>this._edges.size),Qt(this,"directedSize",()=>this._directedSize),Qt(this,"undirectedSize",()=>this._undirectedSize),Qt(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Qt(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Qt(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Qt(this,"multi",this._options.multi),Qt(this,"type",this._options.type),Qt(this,"allowSelfLoops",this._options.allowSelfLoops),Qt(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(r){return this._nodes.has(""+r)}hasDirectedEdge(r,l){if(this.type==="undirected")return!1;if(arguments.length===1){const a=""+r,o=this._edges.get(a);return!!o&&!o.undirected}else if(arguments.length===2){r=""+r,l=""+l;const a=this._nodes.get(r);return a?a.out.hasOwnProperty(l):!1}throw new te(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(r,l){if(this.type==="directed")return!1;if(arguments.length===1){const a=""+r,o=this._edges.get(a);return!!o&&o.undirected}else if(arguments.length===2){r=""+r,l=""+l;const a=this._nodes.get(r);return a?a.undirected.hasOwnProperty(l):!1}throw new te(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(r,l){if(arguments.length===1){const a=""+r;return this._edges.has(a)}else if(arguments.length===2){r=""+r,l=""+l;const a=this._nodes.get(r);return a?typeof a.out<"u"&&a.out.hasOwnProperty(l)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(l):!1}throw new te(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(r,l){if(this.type==="undirected")return;if(r=""+r,l=""+l,this.multi)throw new de("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(r);if(!a)throw new W(`Graph.directedEdge: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(l))throw new W(`Graph.directedEdge: could not find the "${l}" target node in the graph.`);const o=a.out&&a.out[l]||void 0;if(o)return o.key}undirectedEdge(r,l){if(this.type==="directed")return;if(r=""+r,l=""+l,this.multi)throw new de("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(r);if(!a)throw new W(`Graph.undirectedEdge: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(l))throw new W(`Graph.undirectedEdge: could not find the "${l}" target node in the graph.`);const o=a.undirected&&a.undirected[l]||void 0;if(o)return o.key}edge(r,l){if(this.multi)throw new de("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.edge: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(l))throw new W(`Graph.edge: could not find the "${l}" target node in the graph.`);const o=a.out&&a.out[l]||a.undirected&&a.undirected[l]||void 0;if(o)return o.key}areDirectedNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areDirectedNeighbors: could not find the "${r}" node in the graph.`);return this.type==="undirected"?!1:l in a.in||l in a.out}areOutNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areOutNeighbors: could not find the "${r}" node in the graph.`);return this.type==="undirected"?!1:l in a.out}areInNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areInNeighbors: could not find the "${r}" node in the graph.`);return this.type==="undirected"?!1:l in a.in}areUndirectedNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areUndirectedNeighbors: could not find the "${r}" node in the graph.`);return this.type==="directed"?!1:l in a.undirected}areNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areNeighbors: could not find the "${r}" node in the graph.`);return this.type!=="undirected"&&(l in a.in||l in a.out)||this.type!=="directed"&&l in a.undirected}areInboundNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areInboundNeighbors: could not find the "${r}" node in the graph.`);return this.type!=="undirected"&&l in a.in||this.type!=="directed"&&l in a.undirected}areOutboundNeighbors(r,l){r=""+r,l=""+l;const a=this._nodes.get(r);if(!a)throw new W(`Graph.areOutboundNeighbors: could not find the "${r}" node in the graph.`);return this.type!=="undirected"&&l in a.out||this.type!=="directed"&&l in a.undirected}inDegree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.inDegree: could not find the "${r}" node in the graph.`);return this.type==="undirected"?0:l.inDegree}outDegree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.outDegree: could not find the "${r}" node in the graph.`);return this.type==="undirected"?0:l.outDegree}directedDegree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.directedDegree: could not find the "${r}" node in the graph.`);return this.type==="undirected"?0:l.inDegree+l.outDegree}undirectedDegree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.undirectedDegree: could not find the "${r}" node in the graph.`);return this.type==="directed"?0:l.undirectedDegree}inboundDegree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.inboundDegree: could not find the "${r}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=l.undirectedDegree),this.type!=="undirected"&&(a+=l.inDegree),a}outboundDegree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.outboundDegree: could not find the "${r}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=l.undirectedDegree),this.type!=="undirected"&&(a+=l.outDegree),a}degree(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.degree: could not find the "${r}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=l.undirectedDegree),this.type!=="undirected"&&(a+=l.inDegree+l.outDegree),a}inDegreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.inDegreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);return this.type==="undirected"?0:l.inDegree-l.directedLoops}outDegreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.outDegreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);return this.type==="undirected"?0:l.outDegree-l.directedLoops}directedDegreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.directedDegreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);return this.type==="undirected"?0:l.inDegree+l.outDegree-l.directedLoops*2}undirectedDegreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);return this.type==="directed"?0:l.undirectedDegree-l.undirectedLoops*2}inboundDegreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=l.undirectedDegree,o+=l.undirectedLoops*2),this.type!=="undirected"&&(a+=l.inDegree,o+=l.directedLoops),a-o}outboundDegreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=l.undirectedDegree,o+=l.undirectedLoops*2),this.type!=="undirected"&&(a+=l.outDegree,o+=l.directedLoops),a-o}degreeWithoutSelfLoops(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.degreeWithoutSelfLoops: could not find the "${r}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=l.undirectedDegree,o+=l.undirectedLoops*2),this.type!=="undirected"&&(a+=l.inDegree+l.outDegree,o+=l.directedLoops*2),a-o}source(r){r=""+r;const l=this._edges.get(r);if(!l)throw new W(`Graph.source: could not find the "${r}" edge in the graph.`);return l.source.key}target(r){r=""+r;const l=this._edges.get(r);if(!l)throw new W(`Graph.target: could not find the "${r}" edge in the graph.`);return l.target.key}extremities(r){r=""+r;const l=this._edges.get(r);if(!l)throw new W(`Graph.extremities: could not find the "${r}" edge in the graph.`);return[l.source.key,l.target.key]}opposite(r,l){r=""+r,l=""+l;const a=this._edges.get(l);if(!a)throw new W(`Graph.opposite: could not find the "${l}" edge in the graph.`);const o=a.source.key,f=a.target.key;if(r===o)return f;if(r===f)return o;throw new W(`Graph.opposite: the "${r}" node is not attached to the "${l}" edge (${o}, ${f}).`)}hasExtremity(r,l){r=""+r,l=""+l;const a=this._edges.get(r);if(!a)throw new W(`Graph.hasExtremity: could not find the "${r}" edge in the graph.`);return a.source.key===l||a.target.key===l}isUndirected(r){r=""+r;const l=this._edges.get(r);if(!l)throw new W(`Graph.isUndirected: could not find the "${r}" edge in the graph.`);return l.undirected}isDirected(r){r=""+r;const l=this._edges.get(r);if(!l)throw new W(`Graph.isDirected: could not find the "${r}" edge in the graph.`);return!l.undirected}isSelfLoop(r){r=""+r;const l=this._edges.get(r);if(!l)throw new W(`Graph.isSelfLoop: could not find the "${r}" edge in the graph.`);return l.source===l.target}addNode(r,l){return r0(this,r,l).key}mergeNode(r,l){if(l&&!ut(l))throw new te(`Graph.mergeNode: invalid attributes. Expecting an object but got "${l}"`);r=""+r,l=l||{};let a=this._nodes.get(r);return a?(l&&(Pe(a.attributes,l),this.emit("nodeAttributesUpdated",{type:"merge",key:r,attributes:a.attributes,data:l})),[r,!1]):(a=new this.NodeDataClass(r,l),this._nodes.set(r,a),this.emit("nodeAdded",{key:r,attributes:l}),[r,!0])}updateNode(r,l){if(l&&typeof l!="function")throw new te(`Graph.updateNode: invalid updater function. Expecting a function but got "${l}"`);r=""+r;let a=this._nodes.get(r);if(a){if(l){const f=a.attributes;a.attributes=l(f),this.emit("nodeAttributesUpdated",{type:"replace",key:r,attributes:a.attributes})}return[r,!1]}const o=l?l({}):{};return a=new this.NodeDataClass(r,o),this._nodes.set(r,a),this.emit("nodeAdded",{key:r,attributes:o}),[r,!0]}dropNode(r){r=""+r;const l=this._nodes.get(r);if(!l)throw new W(`Graph.dropNode: could not find the "${r}" node in the graph.`);let a;if(this.type!=="undirected"){for(const o in l.out){a=l.out[o];do ua(this,a),a=a.next;while(a)}for(const o in l.in){a=l.in[o];do ua(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const o in l.undirected){a=l.undirected[o];do ua(this,a),a=a.next;while(a)}this._nodes.delete(r),this.emit("nodeDropped",{key:r,attributes:l.attributes})}dropEdge(r){let l;if(arguments.length>1){const a=""+arguments[0],o=""+arguments[1];if(l=Yt(this,a,o,this.type),!l)throw new W(`Graph.dropEdge: could not find the "${a}" -> "${o}" edge in the graph.`)}else if(r=""+r,l=this._edges.get(r),!l)throw new W(`Graph.dropEdge: could not find the "${r}" edge in the graph.`);return ua(this,l),this}dropDirectedEdge(r,l){if(arguments.length<2)throw new de("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new de("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");r=""+r,l=""+l;const a=Yt(this,r,l,"directed");if(!a)throw new W(`Graph.dropDirectedEdge: could not find a "${r}" -> "${l}" edge in the graph.`);return ua(this,a),this}dropUndirectedEdge(r,l){if(arguments.length<2)throw new de("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new de("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const a=Yt(this,r,l,"undirected");if(!a)throw new W(`Graph.dropUndirectedEdge: could not find a "${r}" -> "${l}" edge in the graph.`);return ua(this,a),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const r=this._nodes.values();let l;for(;l=r.next(),l.done!==!0;)l.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(r){return this._attributes[r]}getAttributes(){return this._attributes}hasAttribute(r){return this._attributes.hasOwnProperty(r)}setAttribute(r,l){return this._attributes[r]=l,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:r}),this}updateAttribute(r,l){if(typeof l!="function")throw new te("Graph.updateAttribute: updater should be a function.");const a=this._attributes[r];return this._attributes[r]=l(a),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:r}),this}removeAttribute(r){return delete this._attributes[r],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:r}),this}replaceAttributes(r){if(!ut(r))throw new te("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=r,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(r){if(!ut(r))throw new te("Graph.mergeAttributes: provided attributes are not a plain object.");return Pe(this._attributes,r),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:r}),this}updateAttributes(r){if(typeof r!="function")throw new te("Graph.updateAttributes: provided updater is not a function.");return this._attributes=r(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(r,l){if(typeof r!="function")throw new te("Graph.updateEachNodeAttributes: expecting an updater function.");if(l&&!Eg(l))throw new te("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let o,f;for(;o=a.next(),o.done!==!0;)f=o.value,f.attributes=r(f.key,f.attributes);this.emit("eachNodeAttributesUpdated",{hints:l||null})}updateEachEdgeAttributes(r,l){if(typeof r!="function")throw new te("Graph.updateEachEdgeAttributes: expecting an updater function.");if(l&&!Eg(l))throw new te("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let o,f,d,g;for(;o=a.next(),o.done!==!0;)f=o.value,d=f.source,g=f.target,f.attributes=r(f.key,f.attributes,d.key,g.key,d.attributes,g.attributes,f.undirected);this.emit("eachEdgeAttributesUpdated",{hints:l||null})}forEachAdjacencyEntry(r){if(typeof r!="function")throw new te("Graph.forEachAdjacencyEntry: expecting a callback.");Hl(!1,!1,!1,this,r)}forEachAdjacencyEntryWithOrphans(r){if(typeof r!="function")throw new te("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Hl(!1,!1,!0,this,r)}forEachAssymetricAdjacencyEntry(r){if(typeof r!="function")throw new te("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Hl(!1,!0,!1,this,r)}forEachAssymetricAdjacencyEntryWithOrphans(r){if(typeof r!="function")throw new te("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Hl(!1,!0,!0,this,r)}nodes(){return Array.from(this._nodes.keys())}forEachNode(r){if(typeof r!="function")throw new te("Graph.forEachNode: expecting a callback.");const l=this._nodes.values();let a,o;for(;a=l.next(),a.done!==!0;)o=a.value,r(o.key,o.attributes)}findNode(r){if(typeof r!="function")throw new te("Graph.findNode: expecting a callback.");const l=this._nodes.values();let a,o;for(;a=l.next(),a.done!==!0;)if(o=a.value,r(o.key,o.attributes))return o.key}mapNodes(r){if(typeof r!="function")throw new te("Graph.mapNode: expecting a callback.");const l=this._nodes.values();let a,o;const f=new Array(this.order);let d=0;for(;a=l.next(),a.done!==!0;)o=a.value,f[d++]=r(o.key,o.attributes);return f}someNode(r){if(typeof r!="function")throw new te("Graph.someNode: expecting a callback.");const l=this._nodes.values();let a,o;for(;a=l.next(),a.done!==!0;)if(o=a.value,r(o.key,o.attributes))return!0;return!1}everyNode(r){if(typeof r!="function")throw new te("Graph.everyNode: expecting a callback.");const l=this._nodes.values();let a,o;for(;a=l.next(),a.done!==!0;)if(o=a.value,!r(o.key,o.attributes))return!1;return!0}filterNodes(r){if(typeof r!="function")throw new te("Graph.filterNodes: expecting a callback.");const l=this._nodes.values();let a,o;const f=[];for(;a=l.next(),a.done!==!0;)o=a.value,r(o.key,o.attributes)&&f.push(o.key);return f}reduceNodes(r,l){if(typeof r!="function")throw new te("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new te("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let a=l;const o=this._nodes.values();let f,d;for(;f=o.next(),f.done!==!0;)d=f.value,a=r(a,d.key,d.attributes);return a}nodeEntries(){const r=this._nodes.values();return{[Symbol.iterator](){return this},next(){const l=r.next();if(l.done)return l;const a=l.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const r=new Array(this._nodes.size);let l=0;this._nodes.forEach((o,f)=>{r[l++]=Ib(f,o)});const a=new Array(this._edges.size);return l=0,this._edges.forEach((o,f)=>{a[l++]=Wb(this.type,f,o)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:r,edges:a}}import(r,l=!1){if(r instanceof je)return r.forEachNode((m,v)=>{l?this.mergeNode(m,v):this.addNode(m,v)}),r.forEachEdge((m,v,b,p,E,T,N)=>{l?N?this.mergeUndirectedEdgeWithKey(m,b,p,v):this.mergeDirectedEdgeWithKey(m,b,p,v):N?this.addUndirectedEdgeWithKey(m,b,p,v):this.addDirectedEdgeWithKey(m,b,p,v)}),this;if(!ut(r))throw new te("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(r.attributes){if(!ut(r.attributes))throw new te("Graph.import: invalid attributes. Expecting a plain object.");l?this.mergeAttributes(r.attributes):this.replaceAttributes(r.attributes)}let a,o,f,d,g;if(r.nodes){if(f=r.nodes,!Array.isArray(f))throw new te("Graph.import: invalid nodes. Expecting an array.");for(a=0,o=f.length;a<o;a++){d=f[a],Pb(d);const{key:m,attributes:v}=d;l?this.mergeNode(m,v):this.addNode(m,v)}}if(r.edges){let m=!1;if(this.type==="undirected"&&(m=!0),f=r.edges,!Array.isArray(f))throw new te("Graph.import: invalid edges. Expecting an array.");for(a=0,o=f.length;a<o;a++){g=f[a],e0(g);const{source:v,target:b,attributes:p,undirected:E=m}=g;let T;"key"in g?(T=l?E?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:E?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,T.call(this,g.key,v,b,p)):(T=l?E?this.mergeUndirectedEdge:this.mergeDirectedEdge:E?this.addUndirectedEdge:this.addDirectedEdge,T.call(this,v,b,p))}}return this}nullCopy(r){const l=new je(Pe({},this._options,r));return l.replaceAttributes(Pe({},this.getAttributes())),l}emptyCopy(r){const l=this.nullCopy(r);return this._nodes.forEach((a,o)=>{const f=Pe({},a.attributes);a=new l.NodeDataClass(o,f),l._nodes.set(o,a)}),l}copy(r){if(r=r||{},typeof r.type=="string"&&r.type!==this.type&&r.type!=="mixed")throw new de(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${r.type}" because this would mean losing information about the current graph.`);if(typeof r.multi=="boolean"&&r.multi!==this.multi&&r.multi!==!0)throw new de("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof r.allowSelfLoops=="boolean"&&r.allowSelfLoops!==this.allowSelfLoops&&r.allowSelfLoops!==!0)throw new de("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const l=this.emptyCopy(r),a=this._edges.values();let o,f;for(;o=a.next(),o.done!==!0;)f=o.value,gm(l,"copy",!1,f.undirected,f.key,f.source.key,f.target.key,Pe({},f.attributes));return l}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const r={};this._nodes.forEach((f,d)=>{r[d]=f.attributes});const l={},a={};this._edges.forEach((f,d)=>{const g=f.undirected?"--":"->";let m="",v=f.source.key,b=f.target.key,p;f.undirected&&v>b&&(p=v,v=b,b=p);const E=`(${v})${g}(${b})`;d.startsWith("geid_")?this.multi&&(typeof a[E]>"u"?a[E]=0:a[E]++,m+=`${a[E]}. `):m+=`[${d}]: `,m+=E,l[m]=f.attributes});const o={};for(const f in this)this.hasOwnProperty(f)&&!Sg.has(f)&&typeof this[f]!="function"&&typeof f!="symbol"&&(o[f]=this[f]);return o.attributes=this._attributes,o.nodes=r,o.edges=l,qt(o,"constructor",this.constructor),o}}typeof Symbol<"u"&&(je.prototype[Symbol.for("nodejs.util.inspect.custom")]=je.prototype.inspect);i0.forEach(u=>{["add","merge","update"].forEach(r=>{const l=u.name(r),a=r==="add"?gm:l0;u.generateKey?je.prototype[l]=function(o,f,d){return a(this,l,!0,(u.type||this.type)==="undirected",null,o,f,d,r==="update")}:je.prototype[l]=function(o,f,d,g){return a(this,l,!1,(u.type||this.type)==="undirected",o,f,d,g,r==="update")}})});mb(je);Ab(je);Yb(je);Jb(je);class mm extends je{constructor(r){const l=Pe({type:"directed"},r);if("multi"in l&&l.multi!==!1)throw new te("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(l.type!=="directed")throw new te('DirectedGraph.from: inconsistent "'+l.type+'" type in given options!');super(l)}}class vm extends je{constructor(r){const l=Pe({type:"undirected"},r);if("multi"in l&&l.multi!==!1)throw new te("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(l.type!=="undirected")throw new te('UndirectedGraph.from: inconsistent "'+l.type+'" type in given options!');super(l)}}class pm extends je{constructor(r){const l=Pe({multi:!0},r);if("multi"in l&&l.multi!==!0)throw new te("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(l)}}class Ps extends je{constructor(r){const l=Pe({type:"directed",multi:!0},r);if("multi"in l&&l.multi!==!0)throw new te("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(l.type!=="directed")throw new te('MultiDirectedGraph.from: inconsistent "'+l.type+'" type in given options!');super(l)}}class ym extends je{constructor(r){const l=Pe({type:"undirected",multi:!0},r);if("multi"in l&&l.multi!==!0)throw new te("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(l.type!=="undirected")throw new te('MultiUndirectedGraph.from: inconsistent "'+l.type+'" type in given options!');super(l)}}function ga(u){u.from=function(r,l){const a=Pe({},r.options,l),o=new u(a);return o.import(r),o}}ga(je);ga(mm);ga(vm);ga(pm);ga(Ps);ga(ym);je.Graph=je;je.DirectedGraph=mm;je.UndirectedGraph=vm;je.MultiGraph=pm;je.MultiDirectedGraph=Ps;je.MultiUndirectedGraph=ym;je.InvalidArgumentsGraphError=te;je.NotFoundGraphError=W;je.UsageGraphError=de;function u0(u,r){if(typeof u!="object"||!u)return u;var l=u[Symbol.toPrimitive];if(l!==void 0){var a=l.call(u,r);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(u)}function yr(u){var r=u0(u,"string");return typeof r=="symbol"?r:r+""}function ct(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")}function Tg(u,r){for(var l=0;l<r.length;l++){var a=r[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(u,yr(a.key),a)}}function ft(u,r,l){return r&&Tg(u.prototype,r),l&&Tg(u,l),Object.defineProperty(u,"prototype",{writable:!1}),u}function ca(u){return ca=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ca(u)}function bm(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bm=function(){return!!u})()}function o0(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function s0(u,r){if(r&&(typeof r=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o0(u)}function Ft(u,r,l){return r=ca(r),s0(u,bm()?Reflect.construct(r,l||[],ca(u).constructor):r.apply(u,l))}function Ys(u,r){return Ys=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,a){return l.__proto__=a,l},Ys(u,r)}function $t(u,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(r&&r.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),r&&Ys(u,r)}function c0(u){if(Array.isArray(u))return u}function f0(u,r){var l=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(l!=null){var a,o,f,d,g=[],m=!0,v=!1;try{if(f=(l=l.call(u)).next,r===0){if(Object(l)!==l)return;m=!1}else for(;!(m=(a=f.call(l)).done)&&(g.push(a.value),g.length!==r);m=!0);}catch(b){v=!0,o=b}finally{try{if(!m&&l.return!=null&&(d=l.return(),Object(d)!==d))return}finally{if(v)throw o}}return g}}function Fs(u,r){(r==null||r>u.length)&&(r=u.length);for(var l=0,a=Array(r);l<r;l++)a[l]=u[l];return a}function Em(u,r){if(u){if(typeof u=="string")return Fs(u,r);var l={}.toString.call(u).slice(8,-1);return l==="Object"&&u.constructor&&(l=u.constructor.name),l==="Map"||l==="Set"?Array.from(u):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?Fs(u,r):void 0}}function d0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fa(u,r){return c0(u)||f0(u,r)||Em(u,r)||d0()}var xs={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Sm=new Int8Array(4),As=new Int32Array(Sm.buffer,0,1),h0=new Float32Array(Sm.buffer,0,1),g0=/^\s*rgba?\s*\(/,m0=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function v0(u){var r=0,l=0,a=0,o=1;if(u[0]==="#")u.length===4?(r=parseInt(u.charAt(1)+u.charAt(1),16),l=parseInt(u.charAt(2)+u.charAt(2),16),a=parseInt(u.charAt(3)+u.charAt(3),16)):(r=parseInt(u.charAt(1)+u.charAt(2),16),l=parseInt(u.charAt(3)+u.charAt(4),16),a=parseInt(u.charAt(5)+u.charAt(6),16)),u.length===9&&(o=parseInt(u.charAt(7)+u.charAt(8),16)/255);else if(g0.test(u)){var f=u.match(m0);f&&(r=+f[1],l=+f[2],a=+f[3],f[4]&&(o=+f[4]))}return{r,g:l,b:a,a:o}}var sa={};for(var ql in xs)sa[ql]=Er(xs[ql]),sa[xs[ql]]=sa[ql];function wm(u,r,l,a,o){return As[0]=a<<24|l<<16|r<<8|u,As[0]=As[0]&4278190079,h0[0]}function Er(u){if(u=u.toLowerCase(),typeof sa[u]<"u")return sa[u];var r=v0(u),l=r.r,a=r.g,o=r.b,f=r.a;f=f*255|0;var d=wm(l,a,o,f);return sa[u]=d,d}var Cs={};function Tm(u){if(typeof Cs[u]<"u")return Cs[u];var r=(u&16711680)>>>16,l=(u&65280)>>>8,a=u&255,o=255,f=wm(r,l,a,o);return Cs[u]=f,f}function _g(u,r,l,a){return l+(r<<8)+(u<<16)}function xg(u,r,l,a,o,f){var d=Math.floor(l/f*o),g=Math.floor(u.drawingBufferHeight/f-a/f*o),m=new Uint8Array(4);u.bindFramebuffer(u.FRAMEBUFFER,r),u.readPixels(d,g,1,1,u.RGBA,u.UNSIGNED_BYTE,m);var v=fa(m,4),b=v[0],p=v[1],E=v[2],T=v[3];return[b,p,E,T]}function Z(u,r,l){return(r=yr(r))in u?Object.defineProperty(u,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):u[r]=l,u}function Ag(u,r){var l=Object.keys(u);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(u);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(u,o).enumerable})),l.push.apply(l,a)}return l}function re(u){for(var r=1;r<arguments.length;r++){var l=arguments[r]!=null?arguments[r]:{};r%2?Ag(Object(l),!0).forEach(function(a){Z(u,a,l[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(l)):Ag(Object(l)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(l,a))})}return u}function p0(u,r){for(;!{}.hasOwnProperty.call(u,r)&&(u=ca(u))!==null;);return u}function $s(){return $s=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(u,r,l){var a=p0(u,r);if(a){var o=Object.getOwnPropertyDescriptor(a,r);return o.get?o.get.call(arguments.length<3?u:l):o.value}},$s.apply(null,arguments)}function _m(u,r,l,a){var o=$s(ca(u.prototype),r,l);return typeof o=="function"?function(f){return o.apply(l,f)}:o}function y0(u){return u.normalized?1:u.size}function Ns(u){var r=0;return u.forEach(function(l){return r+=y0(l)}),r}function xm(u,r,l){var a=u==="VERTEX"?r.VERTEX_SHADER:r.FRAGMENT_SHADER,o=r.createShader(a);if(o===null)throw new Error("loadShader: error while creating the shader");r.shaderSource(o,l),r.compileShader(o);var f=r.getShaderParameter(o,r.COMPILE_STATUS);if(!f){var d=r.getShaderInfoLog(o);throw r.deleteShader(o),new Error(`loadShader: error while compiling the shader:
11
- `.concat(d,`
12
- `).concat(l))}return o}function b0(u,r){return xm("VERTEX",u,r)}function E0(u,r){return xm("FRAGMENT",u,r)}function S0(u,r){var l=u.createProgram();if(l===null)throw new Error("loadProgram: error while creating the program.");var a,o;for(a=0,o=r.length;a<o;a++)u.attachShader(l,r[a]);u.linkProgram(l);var f=u.getProgramParameter(l,u.LINK_STATUS);if(!f){var d=u.getProgramInfoLog(l);throw u.deleteProgram(l),new Error("loadProgram: error while linking the program: ".concat(d))}return l}function Cg(u){var r=u.gl,l=u.buffer,a=u.program,o=u.vertexShader,f=u.fragmentShader;r.deleteShader(o),r.deleteShader(f),r.deleteProgram(a),r.deleteBuffer(l)}var Ng=`#define PICKING_MODE
13
- `,w0=Z(Z(Z(Z(Z(Z(Z(Z({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),Am=(function(){function u(r,l,a){ct(this,u),Z(this,"array",new Float32Array),Z(this,"constantArray",new Float32Array),Z(this,"capacity",0),Z(this,"verticesCount",0);var o=this.getDefinition();if(this.VERTICES=o.VERTICES,this.VERTEX_SHADER_SOURCE=o.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=o.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=o.UNIFORMS,this.ATTRIBUTES=o.ATTRIBUTES,this.METHOD=o.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in o?o.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in o?o.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in o,this.ATTRIBUTES_ITEMS_COUNT=Ns(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=a,this.normalProgram=this.getProgramInfo("normal",r,o.VERTEX_SHADER_SOURCE,o.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=l?this.getProgramInfo("pick",r,Ng+o.VERTEX_SHADER_SOURCE,Ng+o.FRAGMENT_SHADER_SOURCE,l):null,this.isInstanced){var f=Ns(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw new Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*f);for(var d=0;d<this.CONSTANT_DATA.length;d++){var g=this.CONSTANT_DATA[d];if(g.length!==f)throw new Error("Program: error while getting constant data (one vector has ".concat(g.length," items instead of ").concat(f,")"));for(var m=0;m<g.length;m++)this.constantArray[d*f+m]=g[m]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return ft(u,[{key:"kill",value:function(){Cg(this.normalProgram),this.pickProgram&&(Cg(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(l,a,o,f,d){var g=this.getDefinition(),m=a.createBuffer();if(m===null)throw new Error("Program: error while creating the WebGL buffer.");var v=b0(a,o),b=E0(a,f),p=S0(a,[v,b]),E={};g.UNIFORMS.forEach(function(L){var k=a.getUniformLocation(p,L);k&&(E[L]=k)});var T={};g.ATTRIBUTES.forEach(function(L){T[L.name]=a.getAttribLocation(p,L.name)});var N;if("CONSTANT_ATTRIBUTES"in g&&(g.CONSTANT_ATTRIBUTES.forEach(function(L){T[L.name]=a.getAttribLocation(p,L.name)}),N=a.createBuffer(),N===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:l,program:p,gl:a,frameBuffer:d,buffer:m,constantBuffer:N||{},uniformLocations:E,attributeLocations:T,isPicking:l==="pick",vertexShader:v,fragmentShader:b}}},{key:"bindProgram",value:function(l){var a=this,o=0,f=l.gl,d=l.buffer;this.isInstanced?(f.bindBuffer(f.ARRAY_BUFFER,l.constantBuffer),o=0,this.CONSTANT_ATTRIBUTES.forEach(function(g){return o+=a.bindAttribute(g,l,o,!1)}),f.bufferData(f.ARRAY_BUFFER,this.constantArray,f.STATIC_DRAW),f.bindBuffer(f.ARRAY_BUFFER,l.buffer),o=0,this.ATTRIBUTES.forEach(function(g){return o+=a.bindAttribute(g,l,o,!0)}),f.bufferData(f.ARRAY_BUFFER,this.array,f.DYNAMIC_DRAW)):(f.bindBuffer(f.ARRAY_BUFFER,d),o=0,this.ATTRIBUTES.forEach(function(g){return o+=a.bindAttribute(g,l,o)}),f.bufferData(f.ARRAY_BUFFER,this.array,f.DYNAMIC_DRAW)),f.bindBuffer(f.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(l){var a=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(o){return a.unbindAttribute(o,l,!1)}),this.ATTRIBUTES.forEach(function(o){return a.unbindAttribute(o,l,!0)})):this.ATTRIBUTES.forEach(function(o){return a.unbindAttribute(o,l)})}},{key:"bindAttribute",value:function(l,a,o,f){var d=w0[l.type];if(typeof d!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(l.type,'"'));var g=a.attributeLocations[l.name],m=a.gl;if(g!==-1){m.enableVertexAttribArray(g);var v=this.isInstanced?(f?this.ATTRIBUTES_ITEMS_COUNT:Ns(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(m.vertexAttribPointer(g,l.size,l.type,l.normalized||!1,v,o),this.isInstanced&&f)if(m instanceof WebGL2RenderingContext)m.vertexAttribDivisor(g,1);else{var b=m.getExtension("ANGLE_instanced_arrays");b&&b.vertexAttribDivisorANGLE(g,1)}}return l.size*d}},{key:"unbindAttribute",value:function(l,a,o){var f=a.attributeLocations[l.name],d=a.gl;if(f!==-1&&(d.disableVertexAttribArray(f),this.isInstanced&&o))if(d instanceof WebGL2RenderingContext)d.vertexAttribDivisor(f,0);else{var g=d.getExtension("ANGLE_instanced_arrays");g&&g.vertexAttribDivisorANGLE(f,0)}}},{key:"reallocate",value:function(l){l!==this.capacity&&(this.capacity=l,this.verticesCount=this.VERTICES*l,this.array=new Float32Array(this.isInstanced?this.capacity*this.ATTRIBUTES_ITEMS_COUNT:this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT))}},{key:"hasNothingToRender",value:function(){return this.verticesCount===0}},{key:"renderProgram",value:function(l,a){var o=a.gl,f=a.program;o.enable(o.BLEND),o.useProgram(f),this.setUniforms(l,a),this.drawWebGL(this.METHOD,a)}},{key:"render",value:function(l){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,l.width*l.pixelRatio/l.downSizingRatio,l.height*l.pixelRatio/l.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(re(re({},l),{},{pixelRatio:l.pixelRatio/l.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,l.width*l.pixelRatio,l.height*l.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(l,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:"drawWebGL",value:function(l,a){var o=a.gl,f=a.frameBuffer;if(o.bindFramebuffer(o.FRAMEBUFFER,f),!this.isInstanced)o.drawArrays(l,0,this.verticesCount);else if(o instanceof WebGL2RenderingContext)o.drawArraysInstanced(l,0,this.VERTICES,this.capacity);else{var d=o.getExtension("ANGLE_instanced_arrays");d&&d.drawArraysInstancedANGLE(l,0,this.VERTICES,this.capacity)}}}])})(),T0=(function(u){function r(){return ct(this,r),Ft(this,r,arguments)}return $t(r,u),ft(r,[{key:"kill",value:function(){_m(r,"kill",this)([])}},{key:"process",value:function(a,o,f){var d=o*this.STRIDE;if(f.hidden){for(var g=d+this.STRIDE;d<g;d++)this.array[d]=0;return}return this.processVisibleItem(Tm(a),d,f)}}])})(Am),ec=(function(u){function r(){var l;ct(this,r);for(var a=arguments.length,o=new Array(a),f=0;f<a;f++)o[f]=arguments[f];return l=Ft(this,r,[].concat(o)),Z(l,"drawLabel",void 0),l}return $t(r,u),ft(r,[{key:"kill",value:function(){_m(r,"kill",this)([])}},{key:"process",value:function(a,o,f,d,g){var m=o*this.STRIDE;if(g.hidden||f.hidden||d.hidden){for(var v=m+this.STRIDE;m<v;m++)this.array[m]=0;return}return this.processVisibleItem(Tm(a),m,f,d,g)}}])})(Am);function _0(u,r){return(function(){function l(a,o,f){ct(this,l),Z(this,"drawLabel",r),this.programs=u.map(function(d){return new d(a,o,f)})}return ft(l,[{key:"reallocate",value:function(o){this.programs.forEach(function(f){return f.reallocate(o)})}},{key:"process",value:function(o,f,d,g,m){this.programs.forEach(function(v){return v.process(o,f,d,g,m)})}},{key:"render",value:function(o){this.programs.forEach(function(f){return f.render(o)})}},{key:"kill",value:function(){this.programs.forEach(function(o){return o.kill()})}}])})()}function x0(u,r,l,a,o){var f=o.edgeLabelSize,d=o.edgeLabelFont,g=o.edgeLabelWeight,m=o.edgeLabelColor.attribute?r[o.edgeLabelColor.attribute]||o.edgeLabelColor.color||"#000":o.edgeLabelColor.color,v=r.label;if(v){u.fillStyle=m,u.font="".concat(g," ").concat(f,"px ").concat(d);var b=l.size,p=a.size,E=l.x,T=l.y,N=a.x,L=a.y,k=(E+N)/2,X=(T+L)/2,K=N-E,V=L-T,C=Math.sqrt(K*K+V*V);if(!(C<b+p)){E+=K*b/C,T+=V*b/C,N-=K*p/C,L-=V*p/C,k=(E+N)/2,X=(T+L)/2,K=N-E,V=L-T,C=Math.sqrt(K*K+V*V);var M=u.measureText(v).width;if(M>C){var j="…";for(v=v+j,M=u.measureText(v).width;M>C&&v.length>1;)v=v.slice(0,-2)+j,M=u.measureText(v).width;if(v.length<4)return}var O;K>0?V>0?O=Math.acos(K/C):O=Math.asin(V/C):V>0?O=Math.acos(K/C)+Math.PI:O=Math.asin(K/C)+Math.PI/2,u.save(),u.translate(k,X),u.rotate(O),u.fillText(v,-M/2,r.size/2+f),u.restore()}}}function Cm(u,r,l){if(r.label){var a=l.labelSize,o=l.labelFont,f=l.labelWeight,d=l.labelColor.attribute?r[l.labelColor.attribute]||l.labelColor.color||"#000":l.labelColor.color;u.fillStyle=d,u.font="".concat(f," ").concat(a,"px ").concat(o),u.fillText(r.label,r.x+r.size+3,r.y+a/3)}}function A0(u,r,l){var a=l.labelSize,o=l.labelFont,f=l.labelWeight;u.font="".concat(f," ").concat(a,"px ").concat(o),u.fillStyle="#FFF",u.shadowOffsetX=0,u.shadowOffsetY=0,u.shadowBlur=8,u.shadowColor="#000";var d=2;if(typeof r.label=="string"){var g=u.measureText(r.label).width,m=Math.round(g+5),v=Math.round(a+2*d),b=Math.max(r.size,a/2)+d,p=Math.asin(v/2/b),E=Math.sqrt(Math.abs(Math.pow(b,2)-Math.pow(v/2,2)));u.beginPath(),u.moveTo(r.x+E,r.y+v/2),u.lineTo(r.x+b+m,r.y+v/2),u.lineTo(r.x+b+m,r.y-v/2),u.lineTo(r.x+E,r.y-v/2),u.arc(r.x,r.y,b,p,-p),u.closePath(),u.fill()}else u.beginPath(),u.arc(r.x,r.y,r.size+d,0,Math.PI*2),u.closePath(),u.fill();u.shadowOffsetX=0,u.shadowOffsetY=0,u.shadowBlur=0,Cm(u,r,l)}var C0=`
14
- precision highp float;
15
-
16
- varying vec4 v_color;
17
- varying vec2 v_diffVector;
18
- varying float v_radius;
19
-
20
- uniform float u_correctionRatio;
21
-
22
- const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
23
-
24
- void main(void) {
25
- float border = u_correctionRatio * 2.0;
26
- float dist = length(v_diffVector) - v_radius + border;
27
-
28
- // No antialiasing for picking mode:
29
- #ifdef PICKING_MODE
30
- if (dist > border)
31
- gl_FragColor = transparent;
32
- else
33
- gl_FragColor = v_color;
34
-
35
- #else
36
- float t = 0.0;
37
- if (dist > border)
38
- t = 1.0;
39
- else if (dist > 0.0)
40
- t = dist / border;
41
-
42
- gl_FragColor = mix(v_color, transparent, t);
43
- #endif
44
- }
45
- `,N0=C0,R0=`
46
- attribute vec4 a_id;
47
- attribute vec4 a_color;
48
- attribute vec2 a_position;
49
- attribute float a_size;
50
- attribute float a_angle;
51
-
52
- uniform mat3 u_matrix;
53
- uniform float u_sizeRatio;
54
- uniform float u_correctionRatio;
55
-
56
- varying vec4 v_color;
57
- varying vec2 v_diffVector;
58
- varying float v_radius;
59
- varying float v_border;
60
-
61
- const float bias = 255.0 / 254.0;
62
-
63
- void main() {
64
- float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
65
- vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
66
- vec2 position = a_position + diffVector;
67
- gl_Position = vec4(
68
- (u_matrix * vec3(position, 1)).xy,
69
- 0,
70
- 1
71
- );
72
-
73
- v_diffVector = diffVector;
74
- v_radius = size / 2.0;
75
-
76
- #ifdef PICKING_MODE
77
- // For picking mode, we use the ID as the color:
78
- v_color = a_id;
79
- #else
80
- // For normal mode, we use the color:
81
- v_color = a_color;
82
- #endif
83
-
84
- v_color.a *= bias;
85
- }
86
- `,D0=R0,Nm=WebGLRenderingContext,Rg=Nm.UNSIGNED_BYTE,Rs=Nm.FLOAT,z0=["u_sizeRatio","u_correctionRatio","u_matrix"],Jl=(function(u){function r(){return ct(this,r),Ft(this,r,arguments)}return $t(r,u),ft(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:D0,FRAGMENT_SHADER_SOURCE:N0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:z0,ATTRIBUTES:[{name:"a_position",size:2,type:Rs},{name:"a_size",size:1,type:Rs},{name:"a_color",size:4,type:Rg,normalized:!0},{name:"a_id",size:4,type:Rg,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Rs}],CONSTANT_DATA:[[r.ANGLE_1],[r.ANGLE_2],[r.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,o,f){var d=this.array,g=Er(f.color);d[o++]=f.x,d[o++]=f.y,d[o++]=f.size,d[o++]=g,d[o++]=a}},{key:"setUniforms",value:function(a,o){var f=o.gl,d=o.uniformLocations,g=d.u_sizeRatio,m=d.u_correctionRatio,v=d.u_matrix;f.uniform1f(m,a.correctionRatio),f.uniform1f(g,a.sizeRatio),f.uniformMatrix3fv(v,!1,a.matrix)}}])})(T0);Z(Jl,"ANGLE_1",0);Z(Jl,"ANGLE_2",2*Math.PI/3);Z(Jl,"ANGLE_3",4*Math.PI/3);var M0=`
87
- precision mediump float;
88
-
89
- varying vec4 v_color;
90
-
91
- void main(void) {
92
- gl_FragColor = v_color;
93
- }
94
- `,L0=M0,G0=`
95
- attribute vec2 a_position;
96
- attribute vec2 a_normal;
97
- attribute float a_radius;
98
- attribute vec3 a_barycentric;
99
-
100
- #ifdef PICKING_MODE
101
- attribute vec4 a_id;
102
- #else
103
- attribute vec4 a_color;
104
- #endif
105
-
106
- uniform mat3 u_matrix;
107
- uniform float u_sizeRatio;
108
- uniform float u_correctionRatio;
109
- uniform float u_minEdgeThickness;
110
- uniform float u_lengthToThicknessRatio;
111
- uniform float u_widenessToThicknessRatio;
112
-
113
- varying vec4 v_color;
114
-
115
- const float bias = 255.0 / 254.0;
116
-
117
- void main() {
118
- float minThickness = u_minEdgeThickness;
119
-
120
- float normalLength = length(a_normal);
121
- vec2 unitNormal = a_normal / normalLength;
122
-
123
- // These first computations are taken from edge.vert.glsl and
124
- // edge.clamped.vert.glsl. Please read it to get better comments on what's
125
- // happening:
126
- float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
127
- float webGLThickness = pixelsThickness * u_correctionRatio;
128
- float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
129
- float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
130
- float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
131
-
132
- float da = a_barycentric.x;
133
- float db = a_barycentric.y;
134
- float dc = a_barycentric.z;
135
-
136
- vec2 delta = vec2(
137
- da * (webGLNodeRadius * unitNormal.y)
138
- + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
139
- + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
140
-
141
- da * (-webGLNodeRadius * unitNormal.x)
142
- + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
143
- + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
144
- );
145
-
146
- vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
147
-
148
- gl_Position = vec4(position, 0, 1);
149
-
150
- #ifdef PICKING_MODE
151
- // For picking mode, we use the ID as the color:
152
- v_color = a_id;
153
- #else
154
- // For normal mode, we use the color:
155
- v_color = a_color;
156
- #endif
157
-
158
- v_color.a *= bias;
159
- }
160
- `,O0=G0,Rm=WebGLRenderingContext,Dg=Rm.UNSIGNED_BYTE,Yl=Rm.FLOAT,U0=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Dm={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function zm(u){var r=re(re({},Dm),{});return(function(l){function a(){return ct(this,a),Ft(this,a,arguments)}return $t(a,l),ft(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:O0,FRAGMENT_SHADER_SOURCE:L0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:U0,ATTRIBUTES:[{name:"a_position",size:2,type:Yl},{name:"a_normal",size:2,type:Yl},{name:"a_radius",size:1,type:Yl},{name:"a_color",size:4,type:Dg,normalized:!0},{name:"a_id",size:4,type:Dg,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Yl}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(f,d,g,m,v){if(r.extremity==="source"){var b=[m,g];g=b[0],m=b[1]}var p=v.size||1,E=m.size||1,T=g.x,N=g.y,L=m.x,k=m.y,X=Er(v.color),K=L-T,V=k-N,C=K*K+V*V,M=0,j=0;C&&(C=1/Math.sqrt(C),M=-V*C*p,j=K*C*p);var O=this.array;O[d++]=L,O[d++]=k,O[d++]=-M,O[d++]=-j,O[d++]=E,O[d++]=X,O[d++]=f}},{key:"setUniforms",value:function(f,d){var g=d.gl,m=d.uniformLocations,v=m.u_matrix,b=m.u_sizeRatio,p=m.u_correctionRatio,E=m.u_minEdgeThickness,T=m.u_lengthToThicknessRatio,N=m.u_widenessToThicknessRatio;g.uniformMatrix3fv(v,!1,f.matrix),g.uniform1f(b,f.sizeRatio),g.uniform1f(p,f.correctionRatio),g.uniform1f(E,f.minEdgeThickness),g.uniform1f(T,r.lengthToThicknessRatio),g.uniform1f(N,r.widenessToThicknessRatio)}}])})(ec)}zm();var k0=`
161
- precision mediump float;
162
-
163
- varying vec4 v_color;
164
- varying vec2 v_normal;
165
- varying float v_thickness;
166
- varying float v_feather;
167
-
168
- const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
169
-
170
- void main(void) {
171
- // We only handle antialiasing for normal mode:
172
- #ifdef PICKING_MODE
173
- gl_FragColor = v_color;
174
- #else
175
- float dist = length(v_normal) * v_thickness;
176
-
177
- float t = smoothstep(
178
- v_thickness - v_feather,
179
- v_thickness,
180
- dist
181
- );
182
-
183
- gl_FragColor = mix(v_color, transparent, t);
184
- #endif
185
- }
186
- `,Mm=k0,j0=`
187
- attribute vec4 a_id;
188
- attribute vec4 a_color;
189
- attribute vec2 a_normal;
190
- attribute float a_normalCoef;
191
- attribute vec2 a_positionStart;
192
- attribute vec2 a_positionEnd;
193
- attribute float a_positionCoef;
194
- attribute float a_radius;
195
- attribute float a_radiusCoef;
196
-
197
- uniform mat3 u_matrix;
198
- uniform float u_zoomRatio;
199
- uniform float u_sizeRatio;
200
- uniform float u_pixelRatio;
201
- uniform float u_correctionRatio;
202
- uniform float u_minEdgeThickness;
203
- uniform float u_lengthToThicknessRatio;
204
- uniform float u_feather;
205
-
206
- varying vec4 v_color;
207
- varying vec2 v_normal;
208
- varying float v_thickness;
209
- varying float v_feather;
210
-
211
- const float bias = 255.0 / 254.0;
212
-
213
- void main() {
214
- float minThickness = u_minEdgeThickness;
215
-
216
- float radius = a_radius * a_radiusCoef;
217
- vec2 normal = a_normal * a_normalCoef;
218
- vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
219
-
220
- float normalLength = length(normal);
221
- vec2 unitNormal = normal / normalLength;
222
-
223
- // These first computations are taken from edge.vert.glsl. Please read it to
224
- // get better comments on what's happening:
225
- float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
226
- float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
227
-
228
- // Here, we move the point to leave space for the arrow head:
229
- float direction = sign(radius);
230
- float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
231
- float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
232
-
233
- vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
234
-
235
- // Here is the proper position of the vertex
236
- gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
237
-
238
- v_thickness = webGLThickness / u_zoomRatio;
239
-
240
- v_normal = unitNormal;
241
-
242
- v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
243
-
244
- #ifdef PICKING_MODE
245
- // For picking mode, we use the ID as the color:
246
- v_color = a_id;
247
- #else
248
- // For normal mode, we use the color:
249
- v_color = a_color;
250
- #endif
251
-
252
- v_color.a *= bias;
253
- }
254
- `,B0=j0,Lm=WebGLRenderingContext,zg=Lm.UNSIGNED_BYTE,pi=Lm.FLOAT,H0=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],q0={lengthToThicknessRatio:Dm.lengthToThicknessRatio};function Gm(u){var r=re(re({},q0),{});return(function(l){function a(){return ct(this,a),Ft(this,a,arguments)}return $t(a,l),ft(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:B0,FRAGMENT_SHADER_SOURCE:Mm,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:H0,ATTRIBUTES:[{name:"a_positionStart",size:2,type:pi},{name:"a_positionEnd",size:2,type:pi},{name:"a_normal",size:2,type:pi},{name:"a_color",size:4,type:zg,normalized:!0},{name:"a_id",size:4,type:zg,normalized:!0},{name:"a_radius",size:1,type:pi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:pi},{name:"a_normalCoef",size:1,type:pi},{name:"a_radiusCoef",size:1,type:pi}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(f,d,g,m,v){var b=v.size||1,p=g.x,E=g.y,T=m.x,N=m.y,L=Er(v.color),k=T-p,X=N-E,K=m.size||1,V=k*k+X*X,C=0,M=0;V&&(V=1/Math.sqrt(V),C=-X*V*b,M=k*V*b);var j=this.array;j[d++]=p,j[d++]=E,j[d++]=T,j[d++]=N,j[d++]=C,j[d++]=M,j[d++]=L,j[d++]=f,j[d++]=K}},{key:"setUniforms",value:function(f,d){var g=d.gl,m=d.uniformLocations,v=m.u_matrix,b=m.u_zoomRatio,p=m.u_feather,E=m.u_pixelRatio,T=m.u_correctionRatio,N=m.u_sizeRatio,L=m.u_minEdgeThickness,k=m.u_lengthToThicknessRatio;g.uniformMatrix3fv(v,!1,f.matrix),g.uniform1f(b,f.zoomRatio),g.uniform1f(N,f.sizeRatio),g.uniform1f(T,f.correctionRatio),g.uniform1f(E,f.pixelRatio),g.uniform1f(p,f.antiAliasingFeather),g.uniform1f(L,f.minEdgeThickness),g.uniform1f(k,r.lengthToThicknessRatio)}}])})(ec)}Gm();function Om(u){return _0([Gm(),zm()])}var Y0=Om(),F0=Y0,$0=`
255
- attribute vec4 a_id;
256
- attribute vec4 a_color;
257
- attribute vec2 a_normal;
258
- attribute float a_normalCoef;
259
- attribute vec2 a_positionStart;
260
- attribute vec2 a_positionEnd;
261
- attribute float a_positionCoef;
262
-
263
- uniform mat3 u_matrix;
264
- uniform float u_sizeRatio;
265
- uniform float u_zoomRatio;
266
- uniform float u_pixelRatio;
267
- uniform float u_correctionRatio;
268
- uniform float u_minEdgeThickness;
269
- uniform float u_feather;
270
-
271
- varying vec4 v_color;
272
- varying vec2 v_normal;
273
- varying float v_thickness;
274
- varying float v_feather;
275
-
276
- const float bias = 255.0 / 254.0;
277
-
278
- void main() {
279
- float minThickness = u_minEdgeThickness;
280
-
281
- vec2 normal = a_normal * a_normalCoef;
282
- vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
283
-
284
- float normalLength = length(normal);
285
- vec2 unitNormal = normal / normalLength;
286
-
287
- // We require edges to be at least "minThickness" pixels thick *on screen*
288
- // (so we need to compensate the size ratio):
289
- float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
290
-
291
- // Then, we need to retrieve the normalized thickness of the edge in the WebGL
292
- // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
293
- // ratio:
294
- float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
295
-
296
- // Here is the proper position of the vertex
297
- gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
298
-
299
- // For the fragment shader though, we need a thickness that takes the "magic"
300
- // correction ratio into account (as in webGLThickness), but so that the
301
- // antialiasing effect does not depend on the zoom level. So here's yet
302
- // another thickness version:
303
- v_thickness = webGLThickness / u_zoomRatio;
304
-
305
- v_normal = unitNormal;
306
-
307
- v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
308
-
309
- #ifdef PICKING_MODE
310
- // For picking mode, we use the ID as the color:
311
- v_color = a_id;
312
- #else
313
- // For normal mode, we use the color:
314
- v_color = a_color;
315
- #endif
316
-
317
- v_color.a *= bias;
318
- }
319
- `,X0=$0,Um=WebGLRenderingContext,Mg=Um.UNSIGNED_BYTE,fr=Um.FLOAT,V0=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],Z0=(function(u){function r(){return ct(this,r),Ft(this,r,arguments)}return $t(r,u),ft(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:X0,FRAGMENT_SHADER_SOURCE:Mm,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:V0,ATTRIBUTES:[{name:"a_positionStart",size:2,type:fr},{name:"a_positionEnd",size:2,type:fr},{name:"a_normal",size:2,type:fr},{name:"a_color",size:4,type:Mg,normalized:!0},{name:"a_id",size:4,type:Mg,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:fr},{name:"a_normalCoef",size:1,type:fr}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,o,f,d,g){var m=g.size||1,v=f.x,b=f.y,p=d.x,E=d.y,T=Er(g.color),N=p-v,L=E-b,k=N*N+L*L,X=0,K=0;k&&(k=1/Math.sqrt(k),X=-L*k*m,K=N*k*m);var V=this.array;V[o++]=v,V[o++]=b,V[o++]=p,V[o++]=E,V[o++]=X,V[o++]=K,V[o++]=T,V[o++]=a}},{key:"setUniforms",value:function(a,o){var f=o.gl,d=o.uniformLocations,g=d.u_matrix,m=d.u_zoomRatio,v=d.u_feather,b=d.u_pixelRatio,p=d.u_correctionRatio,E=d.u_sizeRatio,T=d.u_minEdgeThickness;f.uniformMatrix3fv(g,!1,a.matrix),f.uniform1f(m,a.zoomRatio),f.uniform1f(E,a.sizeRatio),f.uniform1f(p,a.correctionRatio),f.uniform1f(b,a.pixelRatio),f.uniform1f(v,a.antiAliasingFeather),f.uniform1f(T,a.minEdgeThickness)}}])})(ec),tc=(function(u){function r(){var l;return ct(this,r),l=Ft(this,r),l.rawEmitter=l,l}return $t(r,u),ft(r)})(rm.EventEmitter),Ds,Lg;function Q0(){return Lg||(Lg=1,Ds=function(r){return r!==null&&typeof r=="object"&&typeof r.addUndirectedEdgeWithKey=="function"&&typeof r.dropNode=="function"&&typeof r.multi=="boolean"}),Ds}var K0=Q0();const J0=fy(K0);var I0=function(r){return r},W0=function(r){return r*r},P0=function(r){return r*(2-r)},eE=function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},tE=function(r){return r*r*r},nE=function(r){return--r*r*r+1},iE=function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},aE={linear:I0,quadraticIn:W0,quadraticOut:P0,quadraticInOut:eE,cubicIn:tE,cubicOut:nE,cubicInOut:iE},rE={easing:"quadraticInOut",duration:150};function Kt(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Fl(u,r,l){return u[0]=r,u[4]=typeof l=="number"?l:r,u}function Gg(u,r){var l=Math.sin(r),a=Math.cos(r);return u[0]=a,u[1]=l,u[3]=-l,u[4]=a,u}function Og(u,r,l){return u[6]=r,u[7]=l,u}function Wn(u,r){var l=u[0],a=u[1],o=u[2],f=u[3],d=u[4],g=u[5],m=u[6],v=u[7],b=u[8],p=r[0],E=r[1],T=r[2],N=r[3],L=r[4],k=r[5],X=r[6],K=r[7],V=r[8];return u[0]=p*l+E*f+T*m,u[1]=p*a+E*d+T*v,u[2]=p*o+E*g+T*b,u[3]=N*l+L*f+k*m,u[4]=N*a+L*d+k*v,u[5]=N*o+L*g+k*b,u[6]=X*l+K*f+V*m,u[7]=X*a+K*d+V*v,u[8]=X*o+K*g+V*b,u}function Xs(u,r){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=u[0],o=u[1],f=u[3],d=u[4],g=u[6],m=u[7],v=r.x,b=r.y;return{x:v*a+b*f+g*l,y:v*o+b*d+m*l}}function lE(u,r){var l=u.height/u.width,a=r.height/r.width;return l<1&&a>1||l>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/l,l))}function dr(u,r,l,a,o){var f=u.angle,d=u.ratio,g=u.x,m=u.y,v=r.width,b=r.height,p=Kt(),E=Math.min(v,b)-2*a,T=lE(r,l);return o?(Wn(p,Og(Kt(),g,m)),Wn(p,Fl(Kt(),d)),Wn(p,Gg(Kt(),f)),Wn(p,Fl(Kt(),v/E/2/T,b/E/2/T))):(Wn(p,Fl(Kt(),2*(E/v)*T,2*(E/b)*T)),Wn(p,Gg(Kt(),-f)),Wn(p,Fl(Kt(),1/d)),Wn(p,Og(Kt(),-g,-m))),p}function uE(u,r,l){var a=Xs(u,{x:Math.cos(r.angle),y:Math.sin(r.angle)},0),o=a.x,f=a.y;return 1/Math.sqrt(Math.pow(o,2)+Math.pow(f,2))/l.width}function oE(u){if(!u.order)return{x:[0,1],y:[0,1]};var r=1/0,l=-1/0,a=1/0,o=-1/0;return u.forEachNode(function(f,d){var g=d.x,m=d.y;g<r&&(r=g),g>l&&(l=g),m<a&&(a=m),m>o&&(o=m)}),{x:[r,l],y:[a,o]}}function sE(u){if(!J0(u))throw new Error("Sigma: invalid graph instance.");u.forEachNode(function(r,l){if(!Number.isFinite(l.x)||!Number.isFinite(l.y))throw new Error("Sigma: Coordinates of node ".concat(r," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function cE(u,r,l){var a=document.createElement(u);if(r)for(var o in r)a.style[o]=r[o];if(l)for(var f in l)a.setAttribute(f,l[f]);return a}function Ug(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function kg(u,r,l){return l.sort(function(a,o){var f=r(a)||0,d=r(o)||0;return f<d?-1:f>d?1:0})}function jg(u){var r=fa(u.x,2),l=r[0],a=r[1],o=fa(u.y,2),f=o[0],d=o[1],g=Math.max(a-l,d-f),m=(a+l)/2,v=(d+f)/2;(g===0||Math.abs(g)===1/0||isNaN(g))&&(g=1),isNaN(m)&&(m=0),isNaN(v)&&(v=0);var b=function(E){return{x:.5+(E.x-m)/g,y:.5+(E.y-v)/g}};return b.applyTo=function(p){p.x=.5+(p.x-m)/g,p.y=.5+(p.y-v)/g},b.inverse=function(p){return{x:m+g*(p.x-.5),y:v+g*(p.y-.5)}},b.ratio=g,b}function Vs(u){"@babel/helpers - typeof";return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vs(u)}function Bg(u,r){var l=r.size;if(l!==0){var a=u.length;u.length+=l;var o=0;r.forEach(function(f){u[a+o]=f,o++})}}function zs(u){u=u||{};for(var r=0,l=arguments.length<=1?0:arguments.length-1;r<l;r++){var a=r+1<1||arguments.length<=r+1?void 0:arguments[r+1];a&&Object.assign(u,a)}return u}var nc={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,defaultDrawEdgeLabel:x0,defaultDrawNodeLabel:Cm,defaultDrawNodeHover:A0,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:"screen",autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},fE={circle:Jl},dE={arrow:F0,line:Z0};function Ms(u){if(typeof u.labelDensity!="number"||u.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var r=u.minCameraRatio,l=u.maxCameraRatio;if(typeof r=="number"&&typeof l=="number"&&l<r)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function hE(u){var r=zs({},nc,u);return r.nodeProgramClasses=zs({},fE,r.nodeProgramClasses),r.edgeProgramClasses=zs({},dE,r.edgeProgramClasses),r}var $l=1.5,Hg=(function(u){function r(){var l;return ct(this,r),l=Ft(this,r),Z(l,"x",.5),Z(l,"y",.5),Z(l,"angle",0),Z(l,"ratio",1),Z(l,"minRatio",null),Z(l,"maxRatio",null),Z(l,"enabledZooming",!0),Z(l,"enabledPanning",!0),Z(l,"enabledRotation",!0),Z(l,"clean",null),Z(l,"nextFrame",null),Z(l,"previousState",null),Z(l,"enabled",!0),l.previousState=l.getState(),l}return $t(r,u),ft(r,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"hasState",value:function(a){return this.x===a.x&&this.y===a.y&&this.ratio===a.ratio&&this.angle===a.angle}},{key:"getPreviousState",value:function(){var a=this.previousState;return a?{x:a.x,y:a.y,angle:a.angle,ratio:a.ratio}:null}},{key:"getBoundedRatio",value:function(a){var o=a;return typeof this.minRatio=="number"&&(o=Math.max(o,this.minRatio)),typeof this.maxRatio=="number"&&(o=Math.min(o,this.maxRatio)),o}},{key:"validateState",value:function(a){var o={};return this.enabledPanning&&typeof a.x=="number"&&(o.x=a.x),this.enabledPanning&&typeof a.y=="number"&&(o.y=a.y),this.enabledZooming&&typeof a.ratio=="number"&&(o.ratio=this.getBoundedRatio(a.ratio)),this.enabledRotation&&typeof a.angle=="number"&&(o.angle=a.angle),this.clean?this.clean(re(re({},this.getState()),o)):o}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(a){if(!this.enabled)return this;this.previousState=this.getState();var o=this.validateState(a);return typeof o.x=="number"&&(this.x=o.x),typeof o.y=="number"&&(this.y=o.y),typeof o.ratio=="number"&&(this.ratio=o.ratio),typeof o.angle=="number"&&(this.angle=o.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(a){return this.setState(a(this.getState())),this}},{key:"animate",value:function(a){var o=this,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=arguments.length>2?arguments[2]:void 0;if(!d)return new Promise(function(T){return o.animate(a,f,T)});if(this.enabled){var g=re(re({},rE),f),m=this.validateState(a),v=typeof g.easing=="function"?g.easing:aE[g.easing],b=Date.now(),p=this.getState(),E=function(){var N=(Date.now()-b)/g.duration;if(N>=1){o.nextFrame=null,o.setState(m),o.animationCallback&&(o.animationCallback.call(null),o.animationCallback=void 0);return}var L=v(N),k={};typeof m.x=="number"&&(k.x=p.x+(m.x-p.x)*L),typeof m.y=="number"&&(k.y=p.y+(m.y-p.y)*L),o.enabledRotation&&typeof m.angle=="number"&&(k.angle=p.angle+(m.angle-p.angle)*L),typeof m.ratio=="number"&&(k.ratio=p.ratio+(m.ratio-p.ratio)*L),o.setState(k),o.nextFrame=requestAnimationFrame(E)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(E)):E(),this.animationCallback=d}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||$l)},a):this.animate({ratio:this.ratio/$l})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||$l)},a):this.animate({ratio:this.ratio*$l})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return r.from(this.getState())}}],[{key:"from",value:function(a){var o=new r;return o.setState(a)}}])})(tc);function Jt(u,r){var l=r.getBoundingClientRect();return{x:u.clientX-l.left,y:u.clientY-l.top}}function Tn(u,r){var l=re(re({},Jt(u,r)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){l.sigmaDefaultPrevented=!0},original:u});return l}function hr(u){var r="x"in u?u:re(re({},u.touches[0]||u.previousTouches[0]),{},{original:u.original,sigmaDefaultPrevented:u.sigmaDefaultPrevented,preventSigmaDefault:function(){u.sigmaDefaultPrevented=!0,r.sigmaDefaultPrevented=!0}});return r}function gE(u,r){return re(re({},Tn(u,r)),{},{delta:km(u)})}var mE=2;function Zl(u){for(var r=[],l=0,a=Math.min(u.length,mE);l<a;l++)r.push(u[l]);return r}function gr(u,r,l){var a={touches:Zl(u.touches).map(function(o){return Jt(o,l)}),previousTouches:r.map(function(o){return Jt(o,l)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){a.sigmaDefaultPrevented=!0},original:u};return a}function km(u){if(typeof u.deltaY<"u")return u.deltaY*-3/360;if(typeof u.detail<"u")return u.detail/-9;throw new Error("Captor: could not extract delta from event.")}var jm=(function(u){function r(l,a){var o;return ct(this,r),o=Ft(this,r),o.container=l,o.renderer=a,o}return $t(r,u),ft(r)})(tc),vE=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],pE=vE.reduce(function(u,r){return re(re({},u),{},Z({},r,nc[r]))},{}),yE=(function(u){function r(l,a){var o;return ct(this,r),o=Ft(this,r,[l,a]),Z(o,"enabled",!0),Z(o,"draggedEvents",0),Z(o,"downStartTime",null),Z(o,"lastMouseX",null),Z(o,"lastMouseY",null),Z(o,"isMouseDown",!1),Z(o,"isMoving",!1),Z(o,"movingTimeout",null),Z(o,"startCameraState",null),Z(o,"clicks",0),Z(o,"doubleClickTimeout",null),Z(o,"currentWheelDirection",0),Z(o,"settings",pE),o.handleClick=o.handleClick.bind(o),o.handleRightClick=o.handleRightClick.bind(o),o.handleDown=o.handleDown.bind(o),o.handleUp=o.handleUp.bind(o),o.handleMove=o.handleMove.bind(o),o.handleWheel=o.handleWheel.bind(o),o.handleLeave=o.handleLeave.bind(o),o.handleEnter=o.handleEnter.bind(o),l.addEventListener("click",o.handleClick,{capture:!1}),l.addEventListener("contextmenu",o.handleRightClick,{capture:!1}),l.addEventListener("mousedown",o.handleDown,{capture:!1}),l.addEventListener("wheel",o.handleWheel,{capture:!1}),l.addEventListener("mouseleave",o.handleLeave,{capture:!1}),l.addEventListener("mouseenter",o.handleEnter,{capture:!1}),document.addEventListener("mousemove",o.handleMove,{capture:!1}),document.addEventListener("mouseup",o.handleUp,{capture:!1}),o}return $t(r,u),ft(r,[{key:"kill",value:function(){var a=this.container;a.removeEventListener("click",this.handleClick),a.removeEventListener("contextmenu",this.handleRightClick),a.removeEventListener("mousedown",this.handleDown),a.removeEventListener("wheel",this.handleWheel),a.removeEventListener("mouseleave",this.handleLeave),a.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(a){var o=this;if(this.enabled){if(this.clicks++,this.clicks===2)return this.clicks=0,typeof this.doubleClickTimeout=="number"&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(a);setTimeout(function(){o.clicks=0,o.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",Tn(a,this.container))}}},{key:"handleRightClick",value:function(a){this.enabled&&this.emit("rightClick",Tn(a,this.container))}},{key:"handleDoubleClick",value:function(a){if(this.enabled){a.preventDefault(),a.stopPropagation();var o=Tn(a,this.container);if(this.emit("doubleClick",o),!o.sigmaDefaultPrevented){var f=this.renderer.getCamera(),d=f.getBoundedRatio(f.getState().ratio/this.settings.doubleClickZoomingRatio);f.animate(this.renderer.getViewportZoomedState(Jt(a,this.container),d),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(a){if(this.enabled){if(a.button===0){this.startCameraState=this.renderer.getCamera().getState();var o=Jt(a,this.container),f=o.x,d=o.y;this.lastMouseX=f,this.lastMouseY=d,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",Tn(a,this.container))}}},{key:"handleUp",value:function(a){var o=this;if(!(!this.enabled||!this.isMouseDown)){var f=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var d=Jt(a,this.container),g=d.x,m=d.y,v=f.getState(),b=f.getPreviousState()||{x:0,y:0};this.isMoving?f.animate({x:v.x+this.settings.inertiaRatio*(v.x-b.x),y:v.y+this.settings.inertiaRatio*(v.y-b.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==g||this.lastMouseY!==m)&&f.setState({x:v.x,y:v.y}),this.isMoving=!1,setTimeout(function(){var p=o.draggedEvents>0;o.draggedEvents=0,p&&o.renderer.getSetting("hideEdgesOnMove")&&o.renderer.refresh()},0),this.emit("mouseup",Tn(a,this.container))}}},{key:"handleMove",value:function(a){var o=this;if(this.enabled){var f=Tn(a,this.container);if(this.emit("mousemovebody",f),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",f),!f.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.movingTimeout=null,o.isMoving=!1},this.settings.dragTimeout);var d=this.renderer.getCamera(),g=Jt(a,this.container),m=g.x,v=g.y,b=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),p=this.renderer.viewportToFramedGraph({x:m,y:v}),E=b.x-p.x,T=b.y-p.y,N=d.getState(),L=N.x+E,k=N.y+T;d.setState({x:L,y:k}),this.lastMouseX=m,this.lastMouseY=v,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",Tn(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",Tn(a,this.container))}},{key:"handleWheel",value:function(a){var o=this,f=this.renderer.getCamera();if(!(!this.enabled||!f.enabledZooming)){var d=km(a);if(d){var g=gE(a,this.container);if(this.emit("wheel",g),g.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var m=f.getState().ratio,v=d>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,b=f.getBoundedRatio(m*v),p=d>0?1:-1,E=Date.now();m!==b&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===p&&this.lastWheelTriggerTime&&E-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(f.animate(this.renderer.getViewportZoomedState(Jt(a,this.container),b),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){o.currentWheelDirection=0}),this.currentWheelDirection=p,this.lastWheelTriggerTime=E))}}}},{key:"setSettings",value:function(a){this.settings=a}}])})(jm),bE=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],EE=bE.reduce(function(u,r){return re(re({},u),{},Z({},r,nc[r]))},{}),SE=(function(u){function r(l,a){var o;return ct(this,r),o=Ft(this,r,[l,a]),Z(o,"enabled",!0),Z(o,"isMoving",!1),Z(o,"hasMoved",!1),Z(o,"touchMode",0),Z(o,"startTouchesPositions",[]),Z(o,"lastTouches",[]),Z(o,"lastTap",null),Z(o,"settings",EE),o.handleStart=o.handleStart.bind(o),o.handleLeave=o.handleLeave.bind(o),o.handleMove=o.handleMove.bind(o),l.addEventListener("touchstart",o.handleStart,{capture:!1}),l.addEventListener("touchcancel",o.handleLeave,{capture:!1}),document.addEventListener("touchend",o.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",o.handleMove,{capture:!1,passive:!1}),o}return $t(r,u),ft(r,[{key:"kill",value:function(){var a=this.container;a.removeEventListener("touchstart",this.handleStart),a.removeEventListener("touchcancel",this.handleLeave),document.removeEventListener("touchend",this.handleLeave),document.removeEventListener("touchmove",this.handleMove)}},{key:"getDimensions",value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:"handleStart",value:function(a){var o=this;if(this.enabled){a.preventDefault();var f=Zl(a.touches);if(this.touchMode=f.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=f.map(function(T){return Jt(T,o.container)}),this.touchMode===2){var d=fa(this.startTouchesPositions,2),g=d[0],m=g.x,v=g.y,b=d[1],p=b.x,E=b.y;this.startTouchesAngle=Math.atan2(E-v,p-m),this.startTouchesDistance=Math.sqrt(Math.pow(p-m,2)+Math.pow(E-v,2))}this.emit("touchdown",gr(a,this.lastTouches,this.container)),this.lastTouches=f,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(a){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(a.cancelable&&a.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(a.touches.length===1){this.handleStart(a),a.preventDefault();break}case 1:if(this.isMoving){var o=this.renderer.getCamera(),f=o.getState(),d=o.getPreviousState()||{x:0,y:0};o.animate({x:f.x+this.settings.inertiaRatio*(f.x-d.x),y:f.y+this.settings.inertiaRatio*(f.y-d.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",gr(a,this.lastTouches,this.container)),!a.touches.length){var g=Jt(this.lastTouches[0],this.container),m=this.startTouchesPositions[0],v=Math.pow(g.x-m.x,2)+Math.pow(g.y-m.y,2);if(!a.touches.length&&v<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var b=gr(a,this.lastTouches,this.container);if(this.emit("doubletap",b),this.lastTap=null,!b.sigmaDefaultPrevented){var p=this.renderer.getCamera(),E=p.getBoundedRatio(p.getState().ratio/this.settings.doubleClickZoomingRatio);p.animate(this.renderer.getViewportZoomedState(g,E),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var T=gr(a,this.lastTouches,this.container);this.emit("tap",T),this.lastTap={time:Date.now(),position:T.touches[0]||T.previousTouches[0]}}}this.lastTouches=Zl(a.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(a){var o=this;if(!(!this.enabled||!this.startTouchesPositions.length)){a.preventDefault();var f=Zl(a.touches),d=f.map(function(w){return Jt(w,o.container)}),g=this.lastTouches;this.lastTouches=f,this.lastTouchesPositions=d;var m=gr(a,g,this.container);if(this.emit("touchmove",m),!m.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=d.some(function(w,F){var J=o.startTouchesPositions[F];return J&&(w.x!==J.x||w.y!==J.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.isMoving=!1},this.settings.dragTimeout);var v=this.renderer.getCamera(),b=this.startCameraState,p=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var E=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),T=E.x,N=E.y,L=this.renderer.viewportToFramedGraph(d[0]),k=L.x,X=L.y;v.setState({x:b.x+T-k,y:b.y+N-X});break}case 2:{var K={x:.5,y:.5,angle:0,ratio:1},V=d[0],C=V.x,M=V.y,j=d[1],O=j.x,ee=j.y,B=Math.atan2(ee-M,O-C)-this.startTouchesAngle,Q=Math.hypot(ee-M,O-C)/this.startTouchesDistance,se=v.getBoundedRatio(b.ratio/Q);K.ratio=se,K.angle=b.angle+B;var ce=this.getDimensions(),ue=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:b}),Ee=Math.min(ce.width,ce.height)-2*p,Te=Ee/ce.width,G=Ee/ce.height,I=se/Ee,le=C-Ee/2/Te,Se=M-Ee/2/G,we=[le*Math.cos(-K.angle)-Se*Math.sin(-K.angle),Se*Math.cos(-K.angle)+le*Math.sin(-K.angle)];le=we[0],Se=we[1],K.x=ue.x-le*I,K.y=ue.y+Se*I,v.setState(K);break}}}}}},{key:"setSettings",value:function(a){this.settings=a}}])})(jm);function wE(u){if(Array.isArray(u))return Fs(u)}function TE(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function _E(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
320
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qg(u){return wE(u)||TE(u)||Em(u)||_E()}function xE(u,r){if(u==null)return{};var l={};for(var a in u)if({}.hasOwnProperty.call(u,a)){if(r.indexOf(a)!==-1)continue;l[a]=u[a]}return l}function Ls(u,r){if(u==null)return{};var l,a,o=xE(u,r);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(u);for(a=0;a<f.length;a++)l=f[a],r.indexOf(l)===-1&&{}.propertyIsEnumerable.call(u,l)&&(o[l]=u[l])}return o}var Yg=(function(){function u(r,l){ct(this,u),this.key=r,this.size=l}return ft(u,null,[{key:"compare",value:function(l,a){return l.size>a.size?-1:l.size<a.size||l.key>a.key?1:-1}}])})(),Fg=(function(){function u(){ct(this,u),Z(this,"width",0),Z(this,"height",0),Z(this,"cellSize",0),Z(this,"columns",0),Z(this,"rows",0),Z(this,"cells",{})}return ft(u,[{key:"resizeAndClear",value:function(l,a){this.width=l.width,this.height=l.height,this.cellSize=a,this.columns=Math.ceil(l.width/a),this.rows=Math.ceil(l.height/a),this.cells={}}},{key:"getIndex",value:function(l){var a=Math.floor(l.x/this.cellSize),o=Math.floor(l.y/this.cellSize);return o*this.columns+a}},{key:"add",value:function(l,a,o){var f=new Yg(l,a),d=this.getIndex(o),g=this.cells[d];g||(g=[],this.cells[d]=g),g.push(f)}},{key:"organize",value:function(){for(var l in this.cells){var a=this.cells[l];a.sort(Yg.compare)}}},{key:"getLabelsToDisplay",value:function(l,a){var o=this.cellSize*this.cellSize,f=o/l/l,d=f*a/o,g=Math.ceil(d),m=[];for(var v in this.cells)for(var b=this.cells[v],p=0;p<Math.min(g,b.length);p++)m.push(b[p].key);return m}}])})();function AE(u){var r=u.graph,l=u.hoveredNode,a=u.highlightedNodes,o=u.displayedNodeLabels,f=[];return r.forEachEdge(function(d,g,m,v){(m===l||v===l||a.has(m)||a.has(v)||o.has(m)&&o.has(v))&&f.push(d)}),f}var $g=150,Xg=50,_n=Object.prototype.hasOwnProperty;function CE(u,r,l){if(!_n.call(l,"x")||!_n.call(l,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(r,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return l.color||(l.color=u.defaultNodeColor),!l.label&&l.label!==""&&(l.label=null),l.label!==void 0&&l.label!==null?l.label=""+l.label:l.label=null,l.size||(l.size=2),_n.call(l,"hidden")||(l.hidden=!1),_n.call(l,"highlighted")||(l.highlighted=!1),_n.call(l,"forceLabel")||(l.forceLabel=!1),(!l.type||l.type==="")&&(l.type=u.defaultNodeType),l.zIndex||(l.zIndex=0),l}function NE(u,r,l){return l.color||(l.color=u.defaultEdgeColor),l.label||(l.label=""),l.size||(l.size=.5),_n.call(l,"hidden")||(l.hidden=!1),_n.call(l,"forceLabel")||(l.forceLabel=!1),(!l.type||l.type==="")&&(l.type=u.defaultEdgeType),l.zIndex||(l.zIndex=0),l}var RE=(function(u){function r(l,a){var o,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(ct(this,r),o=Ft(this,r),Z(o,"elements",{}),Z(o,"canvasContexts",{}),Z(o,"webGLContexts",{}),Z(o,"pickingLayers",new Set),Z(o,"textures",{}),Z(o,"frameBuffers",{}),Z(o,"activeListeners",{}),Z(o,"labelGrid",new Fg),Z(o,"nodeDataCache",{}),Z(o,"edgeDataCache",{}),Z(o,"nodeProgramIndex",{}),Z(o,"edgeProgramIndex",{}),Z(o,"nodesWithForcedLabels",new Set),Z(o,"edgesWithForcedLabels",new Set),Z(o,"nodeExtent",{x:[0,1],y:[0,1]}),Z(o,"nodeZExtent",[1/0,-1/0]),Z(o,"edgeZExtent",[1/0,-1/0]),Z(o,"matrix",Kt()),Z(o,"invMatrix",Kt()),Z(o,"correctionRatio",1),Z(o,"customBBox",null),Z(o,"normalizationFunction",jg({x:[0,1],y:[0,1]})),Z(o,"graphToViewportRatio",1),Z(o,"itemIDsIndex",{}),Z(o,"nodeIndices",{}),Z(o,"edgeIndices",{}),Z(o,"width",0),Z(o,"height",0),Z(o,"pixelRatio",Ug()),Z(o,"pickingDownSizingRatio",2*o.pixelRatio),Z(o,"displayedNodeLabels",new Set),Z(o,"displayedEdgeLabels",new Set),Z(o,"highlightedNodes",new Set),Z(o,"hoveredNode",null),Z(o,"hoveredEdge",null),Z(o,"renderFrame",null),Z(o,"renderHighlightedNodesFrame",null),Z(o,"needToProcess",!1),Z(o,"checkEdgesEventsFrame",null),Z(o,"nodePrograms",{}),Z(o,"nodeHoverPrograms",{}),Z(o,"edgePrograms",{}),o.settings=hE(f),Ms(o.settings),sE(l),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");o.graph=l,o.container=a,o.createWebGLContext("edges",{picking:f.enableEdgeEvents}),o.createCanvasContext("edgeLabels"),o.createWebGLContext("nodes",{picking:!0}),o.createCanvasContext("labels"),o.createCanvasContext("hovers"),o.createWebGLContext("hoverNodes"),o.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),o.resize();for(var d in o.settings.nodeProgramClasses)o.registerNodeProgram(d,o.settings.nodeProgramClasses[d],o.settings.nodeHoverProgramClasses[d]);for(var g in o.settings.edgeProgramClasses)o.registerEdgeProgram(g,o.settings.edgeProgramClasses[g]);return o.camera=new Hg,o.bindCameraHandlers(),o.mouseCaptor=new yE(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new SE(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return $t(r,u),ft(r,[{key:"registerNodeProgram",value:function(a,o,f){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new o(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(f||o)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,o){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new o(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var o=this.nodePrograms,f=o[a],d=Ls(o,[a].map(yr));f.kill(),this.nodePrograms=d}if(this.nodeHoverPrograms[a]){var g=this.nodeHoverPrograms,m=g[a],v=Ls(g,[a].map(yr));m.kill(),this.nodePrograms=v}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var o=this.edgePrograms,f=o[a],d=Ls(o,[a].map(yr));f.kill(),this.edgePrograms=d}return this}},{key:"resetWebGLTexture",value:function(a){var o=this.webGLContexts[a],f=this.frameBuffers[a],d=this.textures[a];d&&o.deleteTexture(d);var g=o.createTexture();return o.bindFramebuffer(o.FRAMEBUFFER,f),o.bindTexture(o.TEXTURE_2D,g),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.width,this.height,0,o.RGBA,o.UNSIGNED_BYTE,null),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,g,0),this.textures[a]=g,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(a){var o=a.x,f=a.y,d=xg(this.webGLContexts.nodes,this.frameBuffers.nodes,o,f,this.pixelRatio,this.pickingDownSizingRatio),g=_g.apply(void 0,qg(d)),m=this.itemIDsIndex[g];return m&&m.type==="node"?m.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(f){var d=hr(f),g={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}},m=a.getNodeAtPosition(d);if(m&&a.hoveredNode!==m&&!a.nodeDataCache[m].hidden){a.hoveredNode&&a.emit("leaveNode",re(re({},g),{},{node:a.hoveredNode})),a.hoveredNode=m,a.emit("enterNode",re(re({},g),{},{node:m})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(d)!==a.hoveredNode){var v=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",re(re({},g),{},{node:v})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var b=a.hoveredNode?null:a.getEdgeAtPoint(g.event.x,g.event.y);b!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",re(re({},g),{},{edge:a.hoveredEdge})),b&&a.emit("enterEdge",re(re({},g),{},{edge:b})),a.hoveredEdge=b)}},this.activeListeners.handleMoveBody=function(f){var d=hr(f);a.emit("moveBody",{event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(f){var d=hr(f),g={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",re(re({},g),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",re(re({},g),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",re({},g))},this.activeListeners.handleEnter=function(f){var d=hr(f),g={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}};a.emit("enterStage",re({},g))};var o=function(d){return function(g){var m=hr(g),v={event:m,preventSigmaDefault:function(){m.preventSigmaDefault()}},b=a.getNodeAtPosition(m);if(b)return a.emit("".concat(d,"Node"),re(re({},v),{},{node:b}));if(a.settings.enableEdgeEvents){var p=a.getEdgeAtPoint(m.x,m.y);if(p)return a.emit("".concat(d,"Edge"),re(re({},v),{},{edge:p}))}return a.emit("".concat(d,"Stage"),v)}};return this.activeListeners.handleClick=o("click"),this.activeListeners.handleRightClick=o("rightClick"),this.activeListeners.handleDoubleClick=o("doubleClick"),this.activeListeners.handleWheel=o("wheel"),this.activeListeners.handleDown=o("down"),this.activeListeners.handleUp=o("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var a=this,o=this.graph,f=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(d){var g,m=(g=d.hints)===null||g===void 0?void 0:g.attributes;a.graph.forEachNode(function(b){return a.updateNode(b)});var v=!m||m.some(function(b){return f.has(b)});a.refresh({partialGraph:{nodes:o.nodes()},skipIndexation:!v,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(d){var g,m=(g=d.hints)===null||g===void 0?void 0:g.attributes;a.graph.forEachEdge(function(b){return a.updateEdge(b)});var v=m&&["zIndex","type"].some(function(b){return m?.includes(b)});a.refresh({partialGraph:{edges:o.edges()},skipIndexation:!v,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(d){var g=d.key;a.addNode(g),a.refresh({partialGraph:{nodes:[g]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(d){var g=d.key;a.refresh({partialGraph:{nodes:[g]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(d){var g=d.key;a.removeNode(g),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(d){var g=d.key;a.addEdge(g),a.refresh({partialGraph:{edges:[g]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(d){var g=d.key;a.refresh({partialGraph:{edges:[g]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(d){var g=d.key;a.removeEdge(g),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},o.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),o.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),o.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),o.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),o.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),o.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),o.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),o.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),o.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),o.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,o){var f=xg(this.webGLContexts.edges,this.frameBuffers.edges,a,o,this.pixelRatio,this.pickingDownSizingRatio),d=_g.apply(void 0,qg(f)),g=this.itemIDsIndex[d];return g&&g.type==="edge"?g.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var o=this.graph,f=this.settings,d=this.getDimensions();if(this.nodeExtent=oE(this.graph),!this.settings.autoRescale){var g=d.width,m=d.height,v=this.nodeExtent,b=v.x,p=v.y;this.nodeExtent={x:[(b[0]+b[1])/2-g/2,(b[0]+b[1])/2+g/2],y:[(p[0]+p[1])/2-m/2,(p[0]+p[1])/2+m/2]}}this.normalizationFunction=jg(this.customBBox||this.nodeExtent);var E=new Hg,T=dr(E.getState(),d,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(d,f.labelGridCellSize);for(var N={},L={},k={},X={},K=1,V=o.nodes(),C=0,M=V.length;C<M;C++){var j=V[C],O=this.nodeDataCache[j],ee=o.getNodeAttributes(j);O.x=ee.x,O.y=ee.y,this.normalizationFunction.applyTo(O),typeof O.label=="string"&&!O.hidden&&this.labelGrid.add(j,O.size,this.framedGraphToViewport(O,{matrix:T})),N[O.type]=(N[O.type]||0)+1}this.labelGrid.organize();for(var B in this.nodePrograms){if(!_n.call(this.nodePrograms,B))throw new Error('Sigma: could not find a suitable program for node type "'.concat(B,'"!'));this.nodePrograms[B].reallocate(N[B]||0),N[B]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(V=kg(this.nodeZExtent,function(he){return a.nodeDataCache[he].zIndex},V));for(var Q=0,se=V.length;Q<se;Q++){var ce=V[Q];L[ce]=K,X[L[ce]]={type:"node",id:ce},K++;var ue=this.nodeDataCache[ce];this.addNodeToProgram(ce,L[ce],N[ue.type]++)}for(var Ee={},Te=o.edges(),G=0,I=Te.length;G<I;G++){var le=Te[G],Se=this.edgeDataCache[le];Ee[Se.type]=(Ee[Se.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(Te=kg(this.edgeZExtent,function(he){return a.edgeDataCache[he].zIndex},Te));for(var we in this.edgePrograms){if(!_n.call(this.edgePrograms,we))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(we,'"!'));this.edgePrograms[we].reallocate(Ee[we]||0),Ee[we]=0}for(var w=0,F=Te.length;w<F;w++){var J=Te[w];k[J]=K,X[k[J]]={type:"edge",id:J},K++;var ne=this.edgeDataCache[J];this.addEdgeToProgram(J,k[J],Ee[ne.type]++)}return this.itemIDsIndex=X,this.nodeIndices=L,this.edgeIndices=k,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(a){var o=this,f=this.settings;if(this.camera.minRatio=f.minCameraRatio,this.camera.maxRatio=f.maxCameraRatio,this.camera.enabledZooming=f.enableCameraZooming,this.camera.enabledPanning=f.enableCameraPanning,this.camera.enabledRotation=f.enableCameraRotation,f.cameraPanBoundaries?this.camera.clean=function(b){return o.cleanCameraState(b,f.cameraPanBoundaries&&Vs(f.cameraPanBoundaries)==="object"?f.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),a){if(a.edgeProgramClasses!==f.edgeProgramClasses){for(var d in f.edgeProgramClasses)f.edgeProgramClasses[d]!==a.edgeProgramClasses[d]&&this.registerEdgeProgram(d,f.edgeProgramClasses[d]);for(var g in a.edgeProgramClasses)f.edgeProgramClasses[g]||this.unregisterEdgeProgram(g)}if(a.nodeProgramClasses!==f.nodeProgramClasses||a.nodeHoverProgramClasses!==f.nodeHoverProgramClasses){for(var m in f.nodeProgramClasses)(f.nodeProgramClasses[m]!==a.nodeProgramClasses[m]||f.nodeHoverProgramClasses[m]!==a.nodeHoverProgramClasses[m])&&this.registerNodeProgram(m,f.nodeProgramClasses[m],f.nodeHoverProgramClasses[m]);for(var v in a.nodeProgramClasses)f.nodeProgramClasses[v]||this.unregisterNodeProgram(v)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=o.tolerance,d=f===void 0?0:f,g=o.boundaries,m=re({},a),v=g||this.nodeExtent,b=fa(v.x,2),p=b[0],E=b[1],T=fa(v.y,2),N=T[0],L=T[1],k=[this.graphToViewport({x:p,y:N},{cameraState:a}),this.graphToViewport({x:E,y:N},{cameraState:a}),this.graphToViewport({x:p,y:L},{cameraState:a}),this.graphToViewport({x:E,y:L},{cameraState:a})],X=1/0,K=-1/0,V=1/0,C=-1/0;k.forEach(function(Ee){var Te=Ee.x,G=Ee.y;X=Math.min(X,Te),K=Math.max(K,Te),V=Math.min(V,G),C=Math.max(C,G)});var M=K-X,j=C-V,O=this.getDimensions(),ee=O.width,B=O.height,Q=0,se=0;if(M>=ee?K<ee-d?Q=K-(ee-d):X>d&&(Q=X-d):K>ee+d?Q=K-(ee+d):X<-d&&(Q=X+d),j>=B?C<B-d?se=C-(B-d):V>d&&(se=V-d):C>B+d?se=C-(B+d):V<-d&&(se=V+d),Q||se){var ce=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),ue=this.viewportToFramedGraph({x:Q,y:se},{cameraState:a});Q=ue.x-ce.x,se=ue.y-ce.y,m.x+=Q,m.y+=se}return m}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),o=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);Bg(o,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var f=this.canvasContexts.labels,d=0,g=o.length;d<g;d++){var m=o[d],v=this.nodeDataCache[m];if(!this.displayedNodeLabels.has(m)&&!v.hidden){var b=this.framedGraphToViewport(v),p=b.x,E=b.y,T=this.scaleSize(v.size);if(!(!v.forceLabel&&T<this.settings.labelRenderedSizeThreshold)&&!(p<-$g||p>this.width+$g||E<-Xg||E>this.height+Xg)){this.displayedNodeLabels.add(m);var N=this.settings.defaultDrawNodeLabel,L=this.nodePrograms[v.type],k=L?.drawLabel||N;k(f,re(re({key:m},v),{},{size:T,x:p,y:E}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var o=AE({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});Bg(o,this.edgesWithForcedLabels);for(var f=new Set,d=0,g=o.length;d<g;d++){var m=o[d],v=this.graph.extremities(m),b=this.nodeDataCache[v[0]],p=this.nodeDataCache[v[1]],E=this.edgeDataCache[m];if(!f.has(m)&&!(E.hidden||b.hidden||p.hidden)){var T=this.settings.defaultDrawEdgeLabel,N=this.edgePrograms[E.type],L=N?.drawLabel||T;L(a,re(re({key:m},E),{},{size:this.scaleSize(E.size)}),re(re(re({key:v[0]},b),this.framedGraphToViewport(b)),{},{size:this.scaleSize(b.size)}),re(re(re({key:v[1]},p),this.framedGraphToViewport(p)),{},{size:this.scaleSize(p.size)}),this.settings),f.add(m)}}return this.displayedEdgeLabels=f,this}},{key:"renderHighlightedNodes",value:function(){var a=this,o=this.canvasContexts.hovers;o.clearRect(0,0,this.width,this.height);var f=function(T){var N=a.nodeDataCache[T],L=a.framedGraphToViewport(N),k=L.x,X=L.y,K=a.scaleSize(N.size),V=a.settings.defaultDrawNodeHover,C=a.nodePrograms[N.type],M=C?.drawHover||V;M(o,re(re({key:T},N),{},{size:K,x:k,y:X}),a.settings)},d=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&d.push(this.hoveredNode),this.highlightedNodes.forEach(function(E){E!==a.hoveredNode&&d.push(E)}),d.forEach(function(E){return f(E)});var g={};d.forEach(function(E){var T=a.nodeDataCache[E].type;g[T]=(g[T]||0)+1});for(var m in this.nodeHoverPrograms)this.nodeHoverPrograms[m].reallocate(g[m]||0),g[m]=0;d.forEach(function(E){var T=a.nodeDataCache[E];a.nodeHoverPrograms[T.type].process(0,g[T.type]++,T)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var v=this.getRenderParams();for(var b in this.nodeHoverPrograms){var p=this.nodeHoverPrograms[b];p.render(v)}}},{key:"scheduleHighlightedNodesRender",value:function(){var a=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){a.renderHighlightedNodesFrame=null,a.renderHighlightedNodes(),a.renderEdgeLabels()}))}},{key:"render",value:function(){var a=this;this.emit("beforeRender");var o=function(){return a.emit("afterRender"),a};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(k){return a.resetWebGLTexture(k)}),!this.graph.order)return o();var f=this.mouseCaptor,d=this.camera.isAnimated()||f.isMoving||f.draggedEvents||f.currentWheelDirection,g=this.camera.getState(),m=this.getDimensions(),v=this.getGraphDimensions(),b=this.getStagePadding();this.matrix=dr(g,m,v,b),this.invMatrix=dr(g,m,v,b,!0),this.correctionRatio=uE(this.matrix,g,m),this.graphToViewportRatio=this.getGraphToViewportRatio();var p=this.getRenderParams();for(var E in this.nodePrograms){var T=this.nodePrograms[E];T.render(p)}if(!this.settings.hideEdgesOnMove||!d)for(var N in this.edgePrograms){var L=this.edgePrograms[N];L.render(p)}return this.settings.hideLabelsOnMove&&d||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),o()}},{key:"addNode",value:function(a){var o=Object.assign({},this.graph.getNodeAttributes(a));this.settings.nodeReducer&&(o=this.settings.nodeReducer(a,o));var f=CE(this.settings,a,o);this.nodeDataCache[a]=f,this.nodesWithForcedLabels.delete(a),f.forceLabel&&!f.hidden&&this.nodesWithForcedLabels.add(a),this.highlightedNodes.delete(a),f.highlighted&&!f.hidden&&this.highlightedNodes.add(a),this.settings.zIndex&&(f.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=f.zIndex),f.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=f.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var o=this.nodeDataCache[a];this.normalizationFunction.applyTo(o)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var o=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(o=this.settings.edgeReducer(a,o));var f=NE(this.settings,a,o);this.edgeDataCache[a]=f,this.edgesWithForcedLabels.delete(a),f.forceLabel&&!f.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(f.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=f.zIndex),f.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=f.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new Fg,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(a,o,f){var d=this.nodeDataCache[a],g=this.nodePrograms[d.type];if(!g)throw new Error('Sigma: could not find a suitable program for node type "'.concat(d.type,'"!'));g.process(o,f,d),this.nodeProgramIndex[a]=f}},{key:"addEdgeToProgram",value:function(a,o,f){var d=this.edgeDataCache[a],g=this.edgePrograms[d.type];if(!g)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(d.type,'"!'));var m=this.graph.extremities(a),v=this.nodeDataCache[m[0]],b=this.nodeDataCache[m[1]];g.process(o,f,v,b,d),this.edgeProgramIndex[a]=f}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var a=this.settings,o=a.stagePadding,f=a.autoRescale;return f&&o||0}},{key:"createLayer",value:function(a,o){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var d=cE(o,{position:"absolute"},{class:"sigma-".concat(a)});return f.style&&Object.assign(d.style,f.style),this.elements[a]=d,"beforeLayer"in f&&f.beforeLayer?this.elements[f.beforeLayer].before(d):"afterLayer"in f&&f.afterLayer?this.elements[f.afterLayer].after(d):this.container.appendChild(d),d}},{key:"createCanvas",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",o)}},{key:"createCanvasContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=this.createCanvas(a,o),d={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=f.getContext("2d",d),this}},{key:"createWebGLContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=o?.canvas||this.createCanvas(a,o);o.hidden&&f.remove();var d=re({preserveDrawingBuffer:!1,antialias:!1},o),g;g=f.getContext("webgl2",d),g||(g=f.getContext("webgl",d)),g||(g=f.getContext("experimental-webgl",d));var m=g;if(this.webGLContexts[a]=m,m.blendFunc(m.ONE,m.ONE_MINUS_SRC_ALPHA),o.picking){this.pickingLayers.add(a);var v=m.createFramebuffer();if(!v)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=v}return m}},{key:"killLayer",value:function(a){var o=this.elements[a];if(!o)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var f,d=this.webGLContexts[a];(f=d.getExtension("WEBGL_lose_context"))===null||f===void 0||f.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return o.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var o=this.nodeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getEdgeDisplayData",value:function(a){var o=this.edgeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return re({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,o){var f=re({},this.settings);return this.settings[a]=o,Ms(this.settings),this.handleSettingsUpdate(f),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,o){return this.setSetting(a,o(this.settings[a])),this}},{key:"setSettings",value:function(a){var o=re({},this.settings);return this.settings=re(re({},this.settings),a),Ms(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var o=this.width,f=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=Ug(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!a&&o===this.width&&f===this.height)return this;for(var d in this.elements){var g=this.elements[d];g.style.width=this.width+"px",g.style.height=this.height+"px"}for(var m in this.canvasContexts)this.elements[m].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[m].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[m].scale(this.pixelRatio,this.pixelRatio);for(var v in this.webGLContexts){this.elements[v].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[v].setAttribute("height",this.height*this.pixelRatio+"px");var b=this.webGLContexts[v];if(b.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(v)){var p=this.textures[v];p&&b.deleteTexture(p)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(a){var o=this,f=a?.skipIndexation!==void 0?a?.skipIndexation:!1,d=a?.schedule!==void 0?a.schedule:!1,g=!a||!a.partialGraph;if(g)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(C){return o.addNode(C)}),this.graph.forEachEdge(function(C){return o.addEdge(C)});else{for(var m,v,b=((m=a.partialGraph)===null||m===void 0?void 0:m.nodes)||[],p=0,E=b?.length||0;p<E;p++){var T=b[p];if(this.updateNode(T),f){var N=this.nodeProgramIndex[T];if(N===void 0)throw new Error('Sigma: node "'.concat(T,`" can't be repaint`));this.addNodeToProgram(T,this.nodeIndices[T],N)}}for(var L=(a==null||(v=a.partialGraph)===null||v===void 0?void 0:v.edges)||[],k=0,X=L.length;k<X;k++){var K=L[k];if(this.updateEdge(K),f){var V=this.edgeProgramIndex[K];if(V===void 0)throw new Error('Sigma: edge "'.concat(K,`" can't be repaint`));this.addEdgeToProgram(K,this.edgeIndices[K],V)}}}return(g||!f)&&(this.needToProcess=!0),d?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var a=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame(function(){a.render()})),this}},{key:"scheduleRefresh",value:function(a){return this.refresh(re(re({},a),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(a,o){var f=this.camera.getState(),d=f.ratio,g=f.angle,m=f.x,v=f.y,b=this.settings,p=b.minCameraRatio,E=b.maxCameraRatio;typeof E=="number"&&(o=Math.min(o,E)),typeof p=="number"&&(o=Math.max(o,p));var T=o/d,N={x:this.width/2,y:this.height/2},L=this.viewportToFramedGraph(a),k=this.viewportToFramedGraph(N);return{angle:g,x:(L.x-k.x)*(1-T)+m,y:(L.y-k.y)*(1-T)+v,ratio:o}}},{key:"viewRectangle",value:function(){var a=this.viewportToFramedGraph({x:0,y:0}),o=this.viewportToFramedGraph({x:this.width,y:0}),f=this.viewportToFramedGraph({x:0,y:this.height});return{x1:a.x,y1:a.y,x2:o.x,y2:o.y,height:o.y-f.y}}},{key:"framedGraphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=!!o.cameraState||!!o.viewportDimensions||!!o.graphDimensions,d=o.matrix?o.matrix:f?dr(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding()):this.matrix,g=Xs(d,a);return{x:(1+g.x)*this.width/2,y:(1-g.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=!!o.cameraState||!!o.viewportDimensions||!o.graphDimensions,d=o.matrix?o.matrix:f?dr(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding(),!0):this.invMatrix,g=Xs(d,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(g.x)&&(g.x=0),isNaN(g.y)&&(g.y=0),g}},{key:"viewportToGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,o))}},{key:"graphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),o)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},o={x:1,y:1},f=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),d=this.graphToViewport(a),g=this.graphToViewport(o),m=Math.sqrt(Math.pow(d.x-g.x,2)+Math.pow(d.y-g.y,2));return m/f}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var a=this.container;a.firstChild;)a.removeChild(a.firstChild);for(var o in this.nodePrograms)this.nodePrograms[o].kill();for(var f in this.nodeHoverPrograms)this.nodeHoverPrograms[f].kill();for(var d in this.edgePrograms)this.edgePrograms[d].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var g in this.elements)this.killLayer(g);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(o)*(this.getSetting("itemSizesReference")==="positions"?o*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var o in this.elements)this.elements[o]instanceof HTMLCanvasElement&&(a[o]=this.elements[o]);return a}}])})(tc),DE=RE;function Si(u){return u.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function zE(u){return u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ME(u){switch(u.slice(u.lastIndexOf(".")).toLowerCase()){case".ts":case".tsx":return{className:"code-language-ts",label:"TS"};case".js":case".jsx":return{className:"code-language-js",label:"JS"};case".py":return{className:"code-language-py",label:"PY"};case".rs":return{className:"code-language-rs",label:"RS"};case".go":return{className:"code-language-go",label:"GO"};case".c":case".h":return{className:"code-language-c",label:"C"};default:return{className:"",label:"&lt;/&gt;"}}}function LE(u){return u.breadcrumbs.map((r,l)=>`${l>0?'<span aria-hidden="true">›</span>':""}<span>${Si(r)}</span>`).join("")}function GE(u){return`<div class="section-back-reference-item section-back-reference-markdown">
321
- <a class="section-back-reference-location" href="${Si(u.url)}">${LE(u)}</a>
322
- <div class="section-back-reference-paragraph">${u.paragraphHtml}</div>
323
- </div>`}function OE(u){const r=ME(u.path),l=r.className?` ${r.className}`:"";return`<div class="section-back-reference-item section-back-reference-code">
324
- <a class="section-back-reference-location" href="${Si(u.url)}">
325
- <span class="code-link-language${l}" aria-hidden="true">${r.label}</span>
326
- <span>${Si(u.path)}:${u.line}</span>
327
- </a>
328
- <code>${Si(u.snippet)}</code>
329
- </div>`}function UE(u,r){const l=u.references.length,a=`section-back-references-${r}`,o=`<button class="section-back-reference-toggle" type="button" aria-controls="${a}" aria-expanded="false" data-section-back-references>
330
- <span>Refs</span><span class="section-back-reference-count">${l}</span>
331
- </button>`,f=u.references.map(g=>g.kind==="markdown"?GE(g):OE(g)).join(""),d=`<section class="section-back-reference-panel" id="${a}" aria-label="References to ${Si(u.sectionId)}" hidden>
332
- <div class="section-back-reference-header">Referenced from</div>
333
- <div class="section-back-reference-list">${f}</div>
334
- </section>`;return{button:o,panel:d}}function Bm(u,r){return r.reduce((l,a,o)=>{if(!a.headingId||a.references.length===0)return l;const f=Si(a.headingId),d=new RegExp(`<h([1-6])([^>]*)\\bid="${zE(f)}"([^>]*)>([\\s\\S]*?)</h\\1>`),g=UE(a,o);return l.replace(d,(m,v)=>{const b=`</h${v}>`;return`${m.slice(0,-b.length)}${g.button}${b}${g.panel}`})},u)}function kE(u,r){const l=r.getElementById(u);return l?{elementId:u,top:l.getBoundingClientRect().top}:null}function jE(u,r){const l=r.getElementById(u.elementId);if(!l)return;const a=l.getBoundingClientRect().top-u.top;a!==0&&r.scrollBy({top:a,behavior:"instant"})}const Vg=5;function BE(u,r,l=!1,a=!1){if(!r||u<1)return{startLine:u>0?1:0,endLine:u,hiddenAbove:0,hiddenBelow:0};const o=Math.max(1,Math.min(u,r.startLine)),f=Math.max(o,Math.min(u,r.endLine)),d=l?1:Math.max(1,o-Vg),g=a?u:Math.min(u,f+Vg);return{startLine:d,endLine:g,hiddenAbove:d-1,hiddenBelow:u-g}}function HE(u,r,l,a=!1,o=!1){const f=BE(u,r,a,o),d=[];!r&&l&&d.push({kind:"context"}),f.hiddenAbove>0&&d.push({kind:"expand",count:f.hiddenAbove,direction:"above"});for(let g=f.startLine;g<=f.endLine;g++)l&&g===r?.startLine&&d.push({kind:"context"}),d.push({kind:"line",focused:!!(r&&g>=r.startLine&&g<=r.endLine),lineNumber:g});return f.hiddenBelow>0&&d.push({kind:"expand",count:f.hiddenBelow,direction:"below"}),d}const Zs=u=>`source-line-${u}`;function Zg({reference:u}){return x.jsx("span",{className:"source-breadcrumbs",children:u.breadcrumbs.map((r,l)=>x.jsxs("span",{children:[l>0&&x.jsx("span",{"aria-hidden":"true",children:"›"}),r]},`${r}-${l}`))})}function qE({hasReferences:u,onContentClick:r,referencesOpen:l,setReferencesOpen:a,source:o}){return x.jsxs("section",{className:["source-context",u?"has-references":"",l?"references-open":""].filter(Boolean).join(" "),onClick:r,children:[x.jsx("div",{className:"source-context-header",children:x.jsx("span",{children:o.context?"Context":"References"})}),o.context&&x.jsxs("div",{className:"source-context-current",children:[x.jsx("a",{href:o.context.url,children:x.jsx(Zg,{reference:o.context})}),x.jsx("div",{className:"source-context-paragraph",dangerouslySetInnerHTML:{__html:o.context.paragraphHtml}})]}),u&&x.jsx("div",{className:"source-reference-toggle",children:x.jsxs("button",{"aria-controls":"source-other-references","aria-expanded":l,onClick:()=>a(!l),type:"button",children:[o.context?"Other references":"References",x.jsx("span",{children:o.otherReferences.length})]})}),l&&x.jsx("div",{className:"source-reference-list",id:"source-other-references",children:o.otherReferences.map(f=>x.jsxs("div",{className:"source-reference-item",children:[x.jsx("a",{href:f.url,children:x.jsx(Zg,{reference:f})}),x.jsx("div",{className:"source-reference-paragraph",dangerouslySetInnerHTML:{__html:f.paragraphHtml}})]},f.sectionId))})]})}function YE({count:u,direction:r,onExpand:l}){return x.jsxs("div",{className:"source-collapse",children:[x.jsx("span",{"aria-hidden":"true",children:"⋯"}),x.jsxs("button",{onClick:l,type:"button",children:["Show ",u," ",u===1?"line":"lines"," ",r]})]})}function Hm({onContentClick:u,source:r}){const[l,a]=P.useState(!1),[o,f]=P.useState(!1),[d,g]=P.useState(!1),m=P.useRef(null),v=r.otherReferences.length>0,b=!!(r.context||v),p=HE(r.highlightedHtmlLines.length,r.focus,b,o,d);P.useLayoutEffect(()=>{const T=m.current;T&&(m.current=null,jE(T,{getElementById:N=>window.document.getElementById(N),scrollBy:N=>window.scrollBy(N)}))},[o]);function E(){const T=p.find(N=>N.kind==="line");T&&(m.current=kE(Zs(T.lineNumber),{getElementById:N=>window.document.getElementById(N)})),f(!0)}return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"document-metadata",children:[x.jsx("div",{className:"document-path",children:r.path}),r.focus&&x.jsxs("div",{className:"document-flag",title:r.focus.signature,children:[r.focus.kind," ",r.focus.symbol]})]}),x.jsx("div",{className:"source-code","aria-label":`Source code for ${r.path}`,children:p.map(T=>{if(T.kind==="context")return x.jsx(qE,{hasReferences:v,onContentClick:u,referencesOpen:l,setReferencesOpen:a,source:r},"context");if(T.kind==="expand")return x.jsx(YE,{count:T.count,direction:T.direction,onExpand:()=>T.direction==="above"?E():g(!0)},`expand-${T.direction}`);const N=r.highlightedHtmlLines[T.lineNumber-1];return x.jsxs("div",{className:T.focused?"source-line focused":"source-line",id:Zs(T.lineNumber),children:[x.jsx("span",{className:"source-line-number","aria-hidden":"true",children:T.lineNumber}),x.jsx("code",{className:"source-line-content",dangerouslySetInnerHTML:{__html:N||" "}})]},T.lineNumber)})})]})}function FE(u){if(u.kind==="code-reference"){const g=(u.sourcePath?.split("/")??[]).at(-2);return g?`${g} › ${u.label}`:u.label}const r=u.breadcrumbs.filter(Boolean),l=u.label.trim(),a=r.at(-1)?.trim();if(!a)return l;const f=a.localeCompare(l,void 0,{sensitivity:"accent"})===0?r.at(-2)?.trim():a;return f&&f!==l?`${f} › ${l}`:l}function $E(u){const r=Number.isFinite(u)?Math.max(0,u):0;return 5+Math.log2(r+1)*1.8}function Gs(u,r){return{x:Math.cos(u)*r,y:Math.sin(u)*r}}function XE(u){const r=u.nodes.filter(p=>p.kind==="document").sort((p,E)=>p.id.localeCompare(E.id)),l=u.nodes.filter(p=>p.kind!=="document").sort((p,E)=>p.id.localeCompare(E.id)),a=new Set(r.map(p=>p.id)),o=new Set(l.map(p=>p.id)),f=new Map,d=r.length>1?Math.max(14,r.length*2.5):0;r.forEach((p,E)=>{const T=-Math.PI/2+E/Math.max(1,r.length)*Math.PI*2;f.set(p.id,Gs(T,d))});const g=new Map;for(const p of u.edges){const E=a.has(p.from)?p.from:a.has(p.to)?p.to:"",T=o.has(p.from)?p.from:o.has(p.to)?p.to:"";if(!E||!T)continue;const N=g.get(T)??new Map;N.set(E,(N.get(E)??0)+p.weight),g.set(T,N)}const m=new Map,v=[];for(const p of l){const E=[...g.get(p.id)??[]].sort((N,L)=>L[1]-N[1]||N[0].localeCompare(L[0]))[0]?.[0];if(!E){v.push(p.id);continue}const T=m.get(E)??[];T.push(p.id),m.set(E,T)}for(const[p,E]of m){const T=f.get(p)??{x:0,y:0},N=Math.atan2(T.y,T.x);let L=0,k=0;for(;L<E.length;){const X=Math.min(12+k*4,E.length-L),K=4+k*3.5;for(let V=0;V<X;V++){const C=N+k*.31+V/X*Math.PI*2,M=Gs(C,K);f.set(E[L+V],{x:T.x+M.x,y:T.y+M.y})}L+=X,k++}}const b=d+16;return v.forEach((p,E)=>{const T=E/Math.max(1,v.length)*Math.PI*2;f.set(p,Gs(T,b))}),f}function VE(u,r){const l=new Map(u.nodes.flatMap(f=>{if(f.kind!=="document"||!f.documentPath)return[];const d=r.get(f.documentPath);return d===void 0||!Number.isFinite(d)?[]:[[f.id,d]]})),a=new Map(l),o=new Map(u.nodes.map(f=>[f.id,f.kind]));for(const f of u.edges){const d=l.get(f.from);d!==void 0&&o.get(f.to)!=="document"&&a.set(f.to,Math.max(a.get(f.to)??-1/0,d));const g=l.get(f.to);g!==void 0&&o.get(f.from)!=="document"&&a.set(f.from,Math.max(a.get(f.from)??-1/0,g))}return a}function ZE(u){const r=[...u.values()].filter(Number.isFinite);if(r.length===0)return new Map;const l=Math.min(...r),a=Math.max(...r),o=5,f=14,d=a-l;return new Map([...u].flatMap(([g,m])=>{if(!Number.isFinite(m))return[];const v=d===0?1:(m-l)/d;return[[g,o+v*(f-o)]]}))}function QE(u){let r=2166136261;for(let o=0;o<u.length;o++)r^=u.charCodeAt(o),r=Math.imul(r,16777619);const l=(r>>>0)/4294967295*Math.PI*2,a=1+(r>>>8&255)/255*2;return{x:Math.cos(l)*a,y:Math.sin(l)*a}}function Qg(u){return!!(u&&Number.isFinite(u.x)&&Number.isFinite(u.y))}const Xl=new Map;let Os=null,pr=null,yi=null;const KE=220;function qm(u){return u==="document"?"document":"code"}function mr(u,r,l){return u.getPropertyValue(r).trim()||l}function Us(u,r){return/^#[\da-f]{6}$/i.test(u)?`${u}${r}`:u}const Kg=(u,r,l)=>{if(!r.label)return;const a=l.labelSize,o=r.x+r.size+4,f=r.y+a/3,d=5,g=3;u.save(),u.font=`${l.labelWeight} ${a}px ${l.labelFont}`;const m=u.measureText(r.label),v=m.actualBoundingBoxAscent||a*.8,b=m.actualBoundingBoxDescent||a*.2,p=o-d,E=f-v-g,T=m.width+d*2,N=v+b+g*2,L=3;u.fillStyle="rgba(0, 0, 0, 0.8)",u.beginPath(),u.moveTo(p+L,E),u.lineTo(p+T-L,E),u.quadraticCurveTo(p+T,E,p+T,E+L),u.lineTo(p+T,E+N-L),u.quadraticCurveTo(p+T,E+N,p+T-L,E+N),u.lineTo(p+L,E+N),u.quadraticCurveTo(p,E+N,p,E+N-L),u.lineTo(p,E+L),u.quadraticCurveTo(p,E,p+L,E),u.closePath(),u.fill(),u.fillStyle="#fff",u.shadowColor="rgba(0, 0, 0, 0.95)",u.shadowBlur=5,u.shadowOffsetX=0,u.shadowOffsetY=1,u.fillText(r.label,o,f),u.restore()};function JE({graph:u,onSelect:r,searchNodeSizes:l,selectedNodeId:a,visibleNodes:o}){const f=P.useRef(null),d=P.useRef(null),g=P.useRef(a),m=P.useRef(l),v=P.useRef(o),b=P.useRef(r);return P.useLayoutEffect(()=>{g.current=a,d.current?.refresh()},[a]),P.useEffect(()=>{v.current=o,d.current?.refresh()},[o]),P.useEffect(()=>{m.current=l,d.current?.refresh()},[l]),P.useEffect(()=>{b.current=r},[r]),P.useEffect(()=>{const p=f.current;if(!p)return;const E=window.getComputedStyle(p),T={document:mr(E,"--graph-document","#ededed"),code:mr(E,"--graph-code","#737373")},N=mr(E,"--text","#ededed"),L=mr(E,"--muted","#888888"),k=mr(E,"--panel-border","#262626"),X=new Ps,K=XE(u);for(const B of u.nodes){const Q=Xl.get(B.id),se=Qg(Q)?Q:K.get(B.id)??QE(B.id),ce=B.inDegree;X.addNode(B.id,{...se,label:FE(B),backlinks:ce,size:$E(ce),color:T[qm(B.kind)]})}for(const B of u.edges)!X.hasNode(B.from)||!X.hasNode(B.to)||X.addDirectedEdgeWithKey(B.id,B.from,B.to,{color:k,size:.6+Math.log2(B.weight+1)*.45,type:"arrow",weight:B.weight});const V=()=>{X.forEachNode((B,Q)=>{const se={x:Q.x,y:Q.y};Qg(se)?Xl.set(B,se):Xl.delete(B)})};V();let C="";const M=new DE(X,p,{defaultEdgeColor:k,defaultEdgeType:"arrow",defaultDrawNodeHover:Kg,defaultDrawNodeLabel:Kg,edgeProgramClasses:{arrow:Om()},hideEdgesOnMove:!0,labelColor:{color:"#fff"},labelDensity:.12,labelFont:'Geist, "Geist Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif',labelRenderedSizeThreshold:6,labelSize:11,labelWeight:"600",minCameraRatio:.08,maxCameraRatio:8,renderEdgeLabels:!1,stagePadding:40,zIndex:!0,nodeReducer:(B,Q)=>{if(!v.current.has(B))return{...Q,hidden:!0};const se=m.current?.get(B),ce=se===void 0?Q:{...Q,size:se},ue=C||g.current;return ue&&B!==ue&&!X.areNeighbors(B,ue)?{...ce,color:Us(L,"48"),label:null,zIndex:0}:B===ue?{...ce,forceLabel:!0,highlighted:!0,size:ce.size+2.5,zIndex:3}:{...ce,forceLabel:Q.backlinks>=4,zIndex:Q.backlinks>=4?2:1}},edgeReducer:(B,Q)=>{const[se,ce]=X.extremities(B);if(!v.current.has(se)||!v.current.has(ce))return{...Q,hidden:!0};const ue=C||g.current;return ue&&se!==ue&&ce!==ue?{...Q,color:Us(k,"24"),size:.35}:ue?{...Q,color:Us(N,"70"),size:Q.size+.4}:Q}});d.current=M,Os&&M.getCamera().setState(Os),M.on("enterNode",({node:B})=>{C=B,M.refresh()}),M.on("leaveNode",()=>{C="",M.refresh()}),M.on("clickNode",({node:B})=>b.current(B));let j="",O=!1;M.on("downNode",({node:B,preventSigmaDefault:Q})=>{j=B,O=!1,Q()});const ee=M.getMouseCaptor();return ee.on("mousemovebody",B=>{if(!j)return;O=!0,B.preventSigmaDefault();const Q=M.viewportToGraph(B);X.mergeNodeAttributes(j,Q)}),ee.on("mouseup",()=>{j&&(Xl.set(j,X.getNodeAttributes(j)),j="",O&&M.refresh())}),()=>{V(),Os=M.getCamera().getState(),M.kill(),d.current=null}},[u]),x.jsxs("div",{className:"graph-canvas-shell",children:[x.jsx("div",{"aria-label":"Interactive Lat reference graph",className:"graph-canvas",ref:f}),x.jsx("button",{className:"graph-fit",onClick:()=>{d.current?.getCamera().animatedReset()},title:"Fit graph",type:"button",children:"Fit"})]})}function ic(u=0){if(pr&&pr.generation>=u)return Promise.resolve(pr);if(yi)return yi.then(l=>l.generation>=u?l:ic(u));const r=Ei("/api/graph").then(l=>(pr=l,l));return yi=r,r.then(()=>{yi===r&&(yi=null)},()=>{yi===r&&(yi=null)}),r}function IE({gitEnabled:u,graph:r,node:l,onSelect:a,target:o}){const[f,d]=P.useState(null),[g,m]=P.useState(""),v=P.useRef(null),b=P.useMemo(()=>l?qs(r,l,o,window.location.origin):"",[r,l,o]),p=l?.kind==="document"?l.url:b,E=P.useMemo(()=>f?.kind==="markdown"?Bm(u&&f.document.gitHtml?f.document.gitHtml:f.document.html,f.document.backReferences):"",[f,u]);P.useEffect(()=>{const N=new AbortController;if(d(null),m(""),!l)return()=>N.abort();const L=new URL(p||l.url,window.location.origin),k=bi(L.pathname),X=L.searchParams,K=new URLSearchParams({path:l.sourcePath??"",symbol:k===l.sourcePath?Ql(L.hash):l.symbol??"",from:k===l.sourcePath?X.get("from")??"":"",line:k===l.sourcePath?X.get("line")??"0":"0",at:k===l.sourcePath?X.get("at")??"0":String(l.line??0)});return(l.kind==="document"?Ei(`/api/document?path=${encodeURIComponent(l.documentPath??"")}`,N.signal).then(C=>d({kind:"markdown",document:C})):Ei(`/api/source?${K}`,N.signal).then(C=>d({kind:"source",source:C}))).catch(C=>{C.name!=="AbortError"&&m(C.message)}),()=>N.abort()},[p,r.generation,l]),P.useLayoutEffect(()=>{const N=v.current;if(!N||!l||!f||(N.scrollTop=0,f.kind!=="markdown"))return;const L=new URL(b||l.url,window.location.origin).hash.slice(1);if(!L)return;let k=L;try{k=decodeURIComponent(L)}catch{}N.querySelector(`#${CSS.escape(k)}`)?.scrollIntoView({block:"start",behavior:"instant"})},[f,l,b]);function T(N){if(N.button!==0||N.metaKey||N.ctrlKey||N.shiftKey||N.altKey)return;const L=N.target,k=L instanceof Element?L.closest("[data-section-back-references]"):null;if(k){const M=k.getAttribute("aria-controls"),j=M?window.document.getElementById(M):null;if(j){const O=k.getAttribute("aria-expanded")==="true";k.setAttribute("aria-expanded",String(!O)),j.hidden=O}return}const X=L instanceof Element?L.closest("a"):null;if(!X||X.target||X.hasAttribute("download"))return;const K=X.getAttribute("href");if(!K)return;const V=em(K,b||l?.url||"/",window.location.origin);if(!V||!an(V.pathname)&&!bi(V.pathname))return;N.preventDefault();const C=Pg(r,V);C&&a(C.nodeId,C.target)}return l?x.jsx("div",{className:"graph-inspector-scroll",ref:v,children:g?x.jsxs("div",{className:"state error",role:"alert",children:[x.jsx("strong",{children:"Could not open this node"}),x.jsx("span",{children:g})]}):f?.kind==="markdown"?x.jsxs("div",{className:"graph-inspector-document",onClick:T,children:[x.jsxs("div",{className:"document-metadata",children:[x.jsx("div",{className:"document-path",children:f.document.path}),f.document.frontmatter.requireCodeMention&&x.jsx("div",{className:"document-flag",children:"Code mentions required"}),f.document.errors.length>0&&x.jsxs("div",{className:"document-error-toggle",children:[f.document.errors.length," ",f.document.errors.length===1?"error":"errors"]})]}),x.jsx("article",{className:"markdown",dangerouslySetInnerHTML:{__html:E}})]}):f?.kind==="source"?x.jsx("div",{className:"graph-inspector-source",children:x.jsx(Hm,{onContentClick:T,source:f.source},`${f.source.path}#${f.source.focus?.symbol??""}@${f.source.focus?.startLine??0}`)}):x.jsx("div",{className:"state",children:"Loading node…"})}):x.jsx("div",{className:"graph-inspector-empty",children:"Choose a document or code reference in the graph."})}function WE({generation:u,gitEnabled:r,header:l,markdownGeneration:a,onNavigate:o,searchEnabled:f,selectedNodeId:d,target:g}){const[m,v]=P.useState(pr),[b,p]=P.useState(""),[E,T]=P.useState(""),[N,L]=P.useState(null),[k,X]=P.useState(!1),[K,V]=P.useState(""),[C,M]=P.useState({document:!0,code:!0});P.useEffect(()=>{let ue=!1;return p(""),ic(u).then(Ee=>{ue||v(Ee)}).catch(Ee=>{ue||p(Ee.message)}),()=>{ue=!0}},[u]);const j=f?E.trim():"";P.useEffect(()=>{const ue=new AbortController;if(V(""),X(!!j),!j)return L(null),()=>ue.abort();const Ee=window.setTimeout(()=>{Ei(`/api/search?query=${encodeURIComponent(j)}`,ue.signal).then(Te=>{const G=new Map;for(const I of Te.results)G.set(I.path,Math.max(G.get(I.path)??-1/0,I.score));L({pathScores:G,query:j})}).catch(Te=>{Te.name!=="AbortError"&&V(Te.message)}).finally(()=>{ue.signal.aborted||X(!1)})},KE);return()=>{window.clearTimeout(Ee),ue.abort()}},[a,j]);const O=P.useMemo(()=>!m||!j||N?.query!==j?null:VE(m,N.pathScores),[m,j,N]),ee=P.useMemo(()=>O?ZE(O):null,[O]),B=P.useMemo(()=>new Set((m?.nodes??[]).filter(ue=>C[qm(ue.kind)]&&(!O||O.has(ue.id))).map(ue=>ue.id)),[C,m,O]),Q=m?.nodes.find(ue=>ue.id===d)??null,se=m&&Q?qs(m,Q,g,window.location.origin):"";function ce(ue,Ee=""){const Te=m?.nodes.find(I=>I.id===ue);if(!m||!Te)return;const G=qs(m,Te,Ee,window.location.origin);o(new URL(G,window.location.origin))}return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"graph-topbar",children:x.jsxs("div",{className:"graph-topbar-graph",children:[l(Q,se),x.jsx("div",{className:"graph-tools",children:f?x.jsxs("label",{className:"graph-filter",children:[x.jsx("span",{className:"visually-hidden",children:"Search graph with embeddings"}),x.jsx("input",{autoComplete:"off",onChange:ue=>T(ue.currentTarget.value),placeholder:"Search graph…",spellCheck:"false",type:"search",value:E}),x.jsx("span",{"aria-live":"polite",className:"graph-node-count",children:k?"Searching…":`${B.size} ${B.size===1?"node":"nodes"}`})]}):x.jsxs("span",{className:"graph-node-count",children:[B.size," ",B.size===1?"node":"nodes"]})})]})}),b?x.jsxs("div",{className:"state error graph-state",role:"alert",children:[x.jsx("strong",{children:"Could not build the graph"}),x.jsx("span",{children:b})]}):m?x.jsxs("div",{className:"graph-workspace",children:[x.jsxs("section",{className:"graph-pane",children:[x.jsx(JE,{graph:m,onSelect:ce,searchNodeSizes:ee,selectedNodeId:d,visibleNodes:B}),x.jsx("div",{"aria-label":"Graph node kinds",className:"graph-kind-filters graph-legend",children:["document","code"].map(ue=>x.jsxs("label",{className:ue,children:[x.jsx("input",{checked:C[ue],onChange:Ee=>{const Te=Ee.currentTarget.checked;M(G=>({...G,[ue]:Te}))},type:"checkbox"}),x.jsx("span",{children:ue})]},ue))}),K?x.jsx("div",{className:"graph-no-results",children:K}):!k&&B.size===0&&x.jsx("div",{className:"graph-no-results",children:"No nodes match this search."})]}),x.jsxs("aside",{className:"graph-inspector",children:[x.jsx("div",{"aria-live":"polite",className:"visually-hidden",children:Q?`Selected ${Q.label}`:"No node selected"}),x.jsx(IE,{gitEnabled:r,graph:m,node:Q,onSelect:ce,target:se})]})]}):x.jsx("div",{className:"state graph-state",children:"Loading graph…"})]})}const PE=250;function eS({result:u}){return x.jsx("span",{className:"search-result-breadcrumbs",children:u.breadcrumbs.map((r,l)=>x.jsxs("span",{children:[l>0&&x.jsx("span",{"aria-hidden":"true",children:"›"}),r]},`${r}-${l}`))})}function tS({onClose:u,onNavigate:r,onScrollRestored:l,markdownGeneration:a,restoreScroll:o}){const[f,d]=P.useState(()=>My(window.location.search)),[g,m]=P.useState([]),[v,b]=P.useState(!1),[p,E]=P.useState(!1),[T,N]=P.useState(""),L=P.useRef(null);return P.useEffect(()=>{L.current?.focus()},[]),P.useLayoutEffect(()=>{o&&(f.trim()&&!p&&!T||(window.scrollTo({...o,behavior:"instant"}),l()))},[T,l,f,o,p]),P.useEffect(()=>{const k=X=>{X.key==="Escape"&&(X.preventDefault(),$y(f)==="clear"?d(""):u())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[u,f]),P.useEffect(()=>{const k=Ly(f),X=`${window.location.pathname}${window.location.search}`;k!==X&&window.history.replaceState(window.history.state,"",k)},[f]),P.useEffect(()=>{const k=f.trim(),X=new AbortController;if(N(""),E(!1),b(!1),m([]),!k)return()=>X.abort();const K=window.setTimeout(()=>{b(!0),fetch(`/api/search?query=${encodeURIComponent(k)}`,{signal:X.signal}).then(async V=>{const C=await V.json();if(!V.ok)throw new Error("error"in C?C.error:"Search request failed");return C}).then(V=>{m(V.results),E(!0)}).catch(V=>{V.name!=="AbortError"&&N(V.message)}).finally(()=>{X.signal.aborted||b(!1)})},PE);return()=>{window.clearTimeout(K),X.abort()}},[a,f]),x.jsxs("section",{className:"search-page",children:[x.jsxs("label",{className:"search-input-shell",children:[x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[x.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),x.jsx("path",{d:"m16 16 4 4"})]}),x.jsx("span",{className:"visually-hidden",children:"Search lat.md sections"}),x.jsx("input",{autoComplete:"off",onChange:k=>d(k.currentTarget.value),placeholder:"Search lat.md…",ref:L,spellCheck:"false",type:"search",value:f})]}),x.jsxs("div",{"aria-live":"polite",className:"search-status",children:[v&&"Searching sections…",!v&&T,!v&&!T&&p&&g.length===0&&"No matching sections."]}),g.length>0&&x.jsx("div",{className:"search-results",children:g.map(k=>x.jsxs("a",{className:"search-result",href:k.url,onClick:r,children:[x.jsx(eS,{result:k}),x.jsx("h2",{children:k.title}),k.description&&x.jsx("p",{children:k.description})]},k.sectionId))})]})}const ks={};function nS({text:u}){return u.endsWith(".md")?x.jsxs(x.Fragment,{children:[u.slice(0,-3),x.jsx("span",{children:".md"})]}):u}function Jg({className:u,graphActive:r,graphHref:l,gitEnabled:a,gitHasChanges:o,index:f,onGitToggle:d,onGraphNavigate:g,onNavigate:m,onSearchNavigate:v,route:b,searchEnabled:p}){const E=f?.logoText??Ss;return x.jsxs("div",{className:u,children:[x.jsx("a",{className:"brand",href:f?br(f.entry):"/",onClick:f?m:void 0,title:E,children:E===Ss?x.jsx("img",{alt:Ss,className:"brand-logo",src:Ny(wy)}):x.jsx(nS,{text:E})}),x.jsxs("div",{className:"sidebar-actions",children:[!r&&f?.git&&x.jsx("button",{"aria-label":`${a?"Hide":"Show"} Git changes${o?", changes available":""}`,"aria-pressed":a,className:"sidebar-git","data-has-changes":o||void 0,onClick:d,title:`${a?"Hide":"Show"} Git changes`,type:"button",children:x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[x.jsx("circle",{cx:"7",cy:"5",r:"2"}),x.jsx("circle",{cx:"7",cy:"19",r:"2"}),x.jsx("circle",{cx:"17",cy:"9",r:"2"}),x.jsx("path",{d:"M7 7v10M9 15c5 0 8-1.5 8-4"})]})}),!r&&p&&x.jsx("a",{"aria-current":b?.kind==="search"?"page":void 0,"aria-label":"Search",className:"sidebar-search",href:"/search",onClick:v,title:"Search",children:x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[x.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),x.jsx("path",{d:"m16 16 4 4"})]})}),x.jsx("a",{"aria-current":r?"page":void 0,"aria-label":"Graph",className:"sidebar-graph",href:l,onClick:g,title:"Graph",children:x.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[x.jsx("circle",{cx:"6",cy:"7",r:"2"}),x.jsx("circle",{cx:"18",cy:"6",r:"2"}),x.jsx("circle",{cx:"16",cy:"18",r:"2"}),x.jsx("circle",{cx:"7",cy:"17",r:"2"}),x.jsx("path",{d:"m8 7 8-1M17 8l-1 8M14 18l-5-1M8 9l7 7"})]})})]})]})}function iS({label:u,onToggle:r,open:l}){return x.jsxs("button",{"aria-controls":"mobile-file-navigation","aria-expanded":l,className:"mobile-navigation-trigger",onClick:r,type:"button",children:[x.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:l?x.jsxs(x.Fragment,{children:[x.jsx("path",{d:"M6 6l12 12"}),x.jsx("path",{d:"M18 6 6 18"})]}):x.jsxs(x.Fragment,{children:[x.jsx("path",{d:"M4 7h16"}),x.jsx("path",{d:"M4 12h16"}),x.jsx("path",{d:"M4 17h16"})]})}),x.jsxs("span",{className:"mobile-navigation-context",children:[x.jsx("span",{children:"Files"}),x.jsx("span",{"aria-hidden":"true",children:"›"}),x.jsx("span",{className:"mobile-navigation-current",children:u})]})]})}function aS({errors:u,onNavigate:r}){return x.jsxs("section",{"aria-label":"Validation errors",className:"document-error-panel",id:"document-errors",children:[x.jsx("div",{className:"document-error-header",children:"Validation errors"}),x.jsx("div",{className:"document-error-list",children:u.map((l,a)=>x.jsxs("a",{className:"document-error-item",href:`#${l.anchor}`,onClick:r,children:[x.jsxs("span",{className:"document-error-location",children:["Line ",l.line]}),x.jsx("span",{className:"document-error-message",children:l.message})]},`${l.anchor}-${a}`))})]})}function nn(){return`${window.location.pathname}${window.location.search}${window.location.hash}`}function rS(){const u=Cy(),r=Uy(wi()),[l,a]=P.useState(nn),[o,f]=P.useState(null),[d,g]=P.useState(null),[m,v]=P.useState({generation:0,markdownGeneration:0}),[b,p]=P.useState(""),[E,T]=P.useState(!0),[N,L]=P.useState(()=>{try{return ky(window.localStorage,r)||oa(window.location.pathname)==="/graph"}catch{return oa(window.location.pathname)==="/graph"}}),[k,X]=P.useState(!1),[K,V]=P.useState(null),[C,M]=P.useState(null),j=P.useRef(d);j.current=d;const O=P.useRef(null),ee=P.useMemo(()=>Dy(l),[l]),B=P.useMemo(()=>{const q=new URL(ee,window.location.origin),me=oa(q.pathname);if(me==="/search")return{kind:"search"};if(me==="/graph")return{kind:"graph",nodeId:Gy(q.search),target:Oy(q.search)};const ge=an(q.pathname);if(ge)return{kind:"markdown",path:ge};const Be=bi(q.pathname);if(Be){const Ye=new URLSearchParams(q.search),ot=Number(Ye.get("line")),ht=Number(Ye.get("at"));return{kind:"source",path:Be,symbol:Ql(q.hash),from:Ye.get("from")??"",line:Number.isInteger(ot)&&ot>0?ot:0,at:Number.isInteger(ht)&&ht>0?ht:0}}return null},[ee]),Q=N&&B!==null&&(B.kind==="graph"||B.kind==="markdown"||B.kind==="source"),se=B?.kind==="graph"?B.target:l,ce=B?.kind==="graph"?B.nodeId:By(new URL(l,window.location.origin)),ue=B?.kind==="markdown"?B.path:null,Ee=Object.keys(o?.git?.files??ks).length>0,Te=d?.kind==="markdown"?`${d.document.path}@${m.generation}`:null,G=Te!==null&&K===Te,I=P.useMemo(()=>d?.kind==="markdown"?Bm(E&&d.document.gitHtml?d.document.gitHtml:d.document.html,d.document.backReferences):"",[E,d]),le=B?.kind==="markdown"||B?.kind==="source"?B.path:B?.kind==="search"?"Search":"Files";P.useEffect(()=>{ic().catch(()=>{})},[]),P.useEffect(()=>{if(B?.kind!=="graph")return;let q=B.target;try{const me=new URL(q,window.location.origin);me.origin!==window.location.origin||!an(me.pathname)&&!bi(me.pathname)?q="":q=`${me.pathname}${me.search}${me.hash}`}catch{q=""}!q&&o&&(q=br(o.entry)),q&&(we(!0),window.history.replaceState(window.history.state,"",q),g(null),a(nn()))},[o,B]),P.useEffect(()=>{X(!1)},[ee]),P.useEffect(()=>{if(!k)return;const q=window.document.body,me=window.document.getElementById("mobile-file-navigation"),ge=me?.querySelector(".document-link.active");q.classList.add("mobile-navigation-open"),(ge??me)?.focus({preventScroll:!0}),ge?.scrollIntoView({block:"center",behavior:"instant"});const Be=window.matchMedia("(min-width: 64rem)"),Ye=()=>{Be.matches&&X(!1)},ot=ht=>{ht.key==="Escape"&&(X(!1),window.document.querySelector(".mobile-navigation-trigger")?.focus())};return Be.addEventListener("change",Ye),window.addEventListener("keydown",ot),()=>{q.classList.remove("mobile-navigation-open"),Be.removeEventListener("change",Ye),window.removeEventListener("keydown",ot)}},[k]),P.useEffect(()=>{const q=me=>{O.current=null,M(Fy(me.state));const ge=an(window.location.pathname),Be=j.current?.kind==="markdown"&&j.current.document.path===ge;oa(window.location.pathname)!=="/graph"&&!Be&&g(null),a(nn())};return window.addEventListener("popstate",q),()=>window.removeEventListener("popstate",q)},[]),P.useEffect(()=>{if(u)return;const q=new EventSource("/api/events"),me=ge=>{const Be=JSON.parse(ge.data);v(Ye=>{const ot=Math.max(Ye.generation,Be.generation),ht=Math.max(Ye.markdownGeneration,Be.markdownGeneration);return ot===Ye.generation&&ht===Ye.markdownGeneration?Ye:{generation:ot,markdownGeneration:ht}})};return q.addEventListener("ready",me),q.addEventListener("change",me),()=>q.close()},[u]),P.useEffect(()=>{const q=new AbortController;return Ei("/api/index",q.signal).then(f).catch(me=>p(me.message)),()=>q.abort()},[m.generation]),P.useEffect(()=>{if(!B){M(null),p("This is not a document URL.");return}if(B.kind==="search"||B.kind==="graph"){p(""),g({kind:B.kind});return}const q=new AbortController;return p(""),(B.kind==="markdown"?Ei(`/api/document?path=${encodeURIComponent(B.path)}`,q.signal).then(ge=>g({kind:"markdown",document:ge})):Ei(`/api/source?path=${encodeURIComponent(B.path)}&symbol=${encodeURIComponent(B.symbol)}&from=${encodeURIComponent(B.from)}&line=${B.line}&at=${B.at}`,q.signal).then(ge=>g({kind:"source",source:ge}))).catch(ge=>{ge.name!=="AbortError"&&(M(null),p(ge.message))}),()=>q.abort()},[m.generation,B]),P.useEffect(()=>{d&&(window.document.title=Q?"Graph · lat.md":d.kind==="search"?"Search · lat.md":d.kind==="graph"?"Graph · lat.md":d.kind==="markdown"?`${d.document.title} · lat.md`:`${d.source.focus?.symbol??d.source.path} · lat.md`)},[Q,d]),P.useLayoutEffect(()=>{if(!(!d||O.current===l)){if(Q){window.scrollTo({top:0,behavior:"instant"}),O.current=l,M(null);return}if(d.kind==="search"||d.kind==="graph"){if(C)return;window.scrollTo({top:0,behavior:"instant"}),O.current=l;return}if(C){window.scrollTo({...C,behavior:"instant"}),O.current=l,M(null);return}if(d.kind==="markdown")Vy(window.location.hash,{getElementById:q=>window.document.getElementById(q),scrollTo:q=>window.scrollTo(q)},d.document.tableOfContents.find(q=>q.depth===1)?.id);else{const q=d.source.focus?.startLine;q?window.document.getElementById(Zs(q))?.scrollIntoView({behavior:"instant",block:"center"}):window.scrollTo({top:0,behavior:"instant"})}O.current=l}},[Q,C,l,d]);function Se(){window.history.replaceState(Yy(window.history.state,{left:window.scrollX,top:window.scrollY}),"",nn())}function we(q){L(q);try{jy(window.localStorage,r,q)}catch{}}function w(q){const me=nn(),ge=d?.kind==="markdown"&&d.document.path===an(q.pathname)&&zy(new URL(window.location.href),q);if(Se(),`${q.pathname}${q.search}${q.hash}`===nn())return;O.current=null,M(null);const Ye=q.pathname==="/search"&&window.location.pathname!=="/search"?Hy(me):null;window.history.pushState(Ye,"",q),ge||g(null),a(nn())}function F(){if(qy(window.history.state)){Se(),window.history.back();return}if(!o){window.location.assign("/");return}O.current=null,M(null),window.history.replaceState(null,"",br(o.entry)),g(null),a(nn())}function J(q){q.button!==0||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||(X(!1),q.preventDefault(),w(new URL(q.currentTarget.href)))}function ne(q){if(!(q.button!==0||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey)){if(q.preventDefault(),Xy(window.location.pathname)==="close"){F();return}w(new URL(q.currentTarget.href))}}function he(q){q.button!==0||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||(q.preventDefault(),we(!N))}function be(q){if(q.button!==0||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey)return;const me=q.target,ge=me instanceof Element?me.closest("[data-section-back-references]"):null;if(ge){const ot=ge.getAttribute("aria-controls"),ht=ot?window.document.getElementById(ot):null;if(ht){const It=ge.getAttribute("aria-expanded")==="true";ge.setAttribute("aria-expanded",String(!It)),ht.hidden=It}return}const Be=me instanceof Element?me.closest("a"):null;if(!Be||Be.target||Be.hasAttribute("download"))return;const Ye=new URL(Be.href,window.location.href);Ye.origin!==window.location.origin||!an(Ye.pathname)&&!bi(Ye.pathname)||(q.preventDefault(),w(Ye))}if(Q){const q=(me,ge)=>x.jsx(Jg,{className:"graph-header",graphActive:Q,graphHref:nn(),gitEnabled:E,gitHasChanges:Ee,index:o,onGitToggle:()=>T(Be=>!Be),onGraphNavigate:he,onNavigate:J,onSearchNavigate:ne,route:B,searchEnabled:!u});return x.jsx("div",{className:"graph-shell",children:x.jsx(WE,{generation:m.generation,gitEnabled:E,header:q,markdownGeneration:m.markdownGeneration,onNavigate:w,searchEnabled:!u,selectedNodeId:ce,target:se})})}return x.jsxs("div",{className:"app-shell",children:[x.jsxs("aside",{className:"sidebar","data-mobile-navigation-open":k||void 0,children:[x.jsx(Jg,{className:"sidebar-header",graphActive:Q,graphHref:nn(),gitEnabled:E,gitHasChanges:Ee,index:o,onGitToggle:()=>T(q=>!q),onGraphNavigate:he,onNavigate:J,onSearchNavigate:ne,route:B,searchEnabled:!u}),x.jsx(iS,{label:le,onToggle:()=>X(q=>!q),open:k}),x.jsx("nav",{"aria-label":"Markdown files",id:"mobile-file-navigation",tabIndex:-1,children:o&&x.jsx(Zy,{activePath:ue,errorCounts:o.errorCounts,files:o.files,gitFiles:E?o.git?.files??ks:ks,onNavigate:J})})]}),x.jsx("main",{className:C?"main restoring-history-scroll":"main",children:b?x.jsxs("div",{className:"state error",role:"alert",children:[x.jsx("strong",{children:"Could not open this document"}),x.jsx("span",{children:b})]}):d?.kind==="search"?x.jsx(tS,{onClose:F,onNavigate:J,onScrollRestored:()=>{O.current=l,M(null)},markdownGeneration:m.markdownGeneration,restoreScroll:C}):d?.kind==="markdown"?x.jsxs("div",{className:"document-layout",children:[x.jsx(Wy,{gitEnabled:E,items:d.document.tableOfContents,onNavigate:J}),x.jsxs("div",{className:"document-column",children:[x.jsxs("div",{className:"document-header",children:[x.jsxs("div",{className:"document-metadata",children:[x.jsx("div",{className:"document-path",children:d.document.path}),d.document.frontmatter.requireCodeMention&&x.jsx("div",{className:"document-flag",title:"Every leaf section must have an @lat code reference",children:"Code mentions required"}),d.document.errors.length>0&&x.jsxs("button",{"aria-controls":"document-errors","aria-expanded":G,className:"document-error-toggle",onClick:()=>V(G?null:Te),type:"button",children:[d.document.errors.length," ",d.document.errors.length===1?"error":"errors"]})]}),G&&x.jsx(aS,{errors:d.document.errors,onNavigate:J})]}),x.jsx("article",{className:"markdown",onClick:be,dangerouslySetInnerHTML:{__html:I}})]})]}):d?.kind==="source"?x.jsx(Hm,{onContentClick:be,source:d.source},`${d.source.path}#${d.source.focus?.symbol??""}@${d.source.focus?.startLine??0}`):x.jsx("div",{className:"state",children:"Loading…"})})]})}Sy.createRoot(document.getElementById("root")).render(x.jsx(P.StrictMode,{children:x.jsx(rS,{})}));