@plebeiantech/lat.md 0.12.3-fork.13 → 0.12.3-fork.14

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 (274) hide show
  1. package/README.md +24 -0
  2. package/dist/src/cli/check-context.d.ts +56 -0
  3. package/dist/src/cli/check-context.js +215 -0
  4. package/dist/src/cli/check-coverage.js +9 -5
  5. package/dist/src/cli/check-frontmatter.js +1 -1
  6. package/dist/src/cli/check-mode.js +1 -1
  7. package/dist/src/cli/check-status.js +1 -1
  8. package/dist/src/cli/check.d.ts +19 -12
  9. package/dist/src/cli/check.js +259 -206
  10. package/dist/src/cli/context.js +1 -1
  11. package/dist/src/cli/expand.d.ts +1 -2
  12. package/dist/src/cli/expand.js +52 -5
  13. package/dist/src/cli/external.d.ts +11 -0
  14. package/dist/src/cli/external.js +185 -0
  15. package/dist/src/cli/fork-instructions.d.ts +1 -0
  16. package/dist/src/cli/fork-instructions.js +3 -2
  17. package/dist/src/cli/hook.d.ts +26 -0
  18. package/dist/src/cli/hook.js +112 -40
  19. package/dist/src/cli/index.js +55 -3
  20. package/dist/src/cli/init.d.ts +1 -0
  21. package/dist/src/cli/init.js +40 -2
  22. package/dist/src/cli/locate.js +4 -3
  23. package/dist/src/cli/refs.d.ts +2 -1
  24. package/dist/src/cli/refs.js +88 -43
  25. package/dist/src/cli/reindex.js +2 -1
  26. package/dist/src/cli/search.d.ts +12 -3
  27. package/dist/src/cli/search.js +45 -49
  28. package/dist/src/cli/section.d.ts +3 -1
  29. package/dist/src/cli/section.js +114 -38
  30. package/dist/src/code-refs.d.ts +17 -5
  31. package/dist/src/code-refs.js +246 -65
  32. package/dist/src/context.d.ts +3 -0
  33. package/dist/src/document-formats.d.ts +7 -0
  34. package/dist/src/document-formats.js +39 -0
  35. package/dist/src/extensions/alert-marker.d.ts +25 -0
  36. package/dist/src/extensions/alert-marker.js +55 -0
  37. package/dist/src/external-documents.d.ts +56 -0
  38. package/dist/src/external-documents.js +404 -0
  39. package/dist/src/external-sources.d.ts +136 -0
  40. package/dist/src/external-sources.js +1098 -0
  41. package/dist/src/fork/antigravity-hook.d.ts +47 -0
  42. package/dist/src/fork/antigravity-hook.js +424 -0
  43. package/dist/src/fork/antigravity-init.d.ts +17 -0
  44. package/dist/src/fork/antigravity-init.js +124 -0
  45. package/dist/src/fork/frontmatter-fields.d.ts +36 -0
  46. package/dist/src/fork/frontmatter-fields.js +23 -0
  47. package/dist/src/format.d.ts +5 -2
  48. package/dist/src/format.js +8 -3
  49. package/dist/src/graph-export.js +1 -1
  50. package/dist/src/lattice-model.d.ts +77 -0
  51. package/dist/src/lattice-model.js +464 -0
  52. package/dist/src/lattice.d.ts +9 -104
  53. package/dist/src/lattice.js +69 -516
  54. package/dist/src/markdown-analysis-cache.d.ts +20 -0
  55. package/dist/src/markdown-analysis-cache.js +139 -0
  56. package/dist/src/markdown-analysis-worker.d.ts +16 -0
  57. package/dist/src/markdown-analysis-worker.js +33 -0
  58. package/dist/src/markdown-analysis.d.ts +50 -0
  59. package/dist/src/markdown-analysis.js +139 -0
  60. package/dist/src/markdown-analyzer-loader.d.ts +4 -0
  61. package/dist/src/markdown-analyzer-loader.js +13 -0
  62. package/dist/src/markdown-validation.d.ts +25 -0
  63. package/dist/src/markdown-validation.js +104 -0
  64. package/dist/src/mcp/server.js +27 -11
  65. package/dist/src/parser-cache.d.ts +17 -0
  66. package/dist/src/parser-cache.js +65 -0
  67. package/dist/src/parser-import.d.ts +8 -0
  68. package/dist/src/parser-import.js +1 -0
  69. package/dist/src/parser.js +80 -5
  70. package/dist/src/path.d.ts +2 -0
  71. package/dist/src/path.js +4 -0
  72. package/dist/src/profiler.d.ts +16 -0
  73. package/dist/src/profiler.js +81 -0
  74. package/dist/src/project-analysis.d.ts +59 -0
  75. package/dist/src/project-analysis.js +233 -0
  76. package/dist/src/project-discovery.d.ts +6 -0
  77. package/dist/src/project-discovery.js +30 -0
  78. package/dist/src/repository-path.d.ts +11 -0
  79. package/dist/src/repository-path.js +52 -0
  80. package/dist/src/search/db.d.ts +1 -1
  81. package/dist/src/search/db.js +2 -2
  82. package/dist/src/search/embedder.d.ts +2 -1
  83. package/dist/src/search/embedder.js +6 -5
  84. package/dist/src/search/index.d.ts +2 -1
  85. package/dist/src/search/index.js +10 -8
  86. package/dist/src/search/query.d.ts +20 -0
  87. package/dist/src/search/query.js +67 -0
  88. package/dist/src/search/search.d.ts +3 -1
  89. package/dist/src/search/search.js +5 -2
  90. package/dist/src/source-formats.d.ts +7 -0
  91. package/dist/src/source-formats.js +26 -0
  92. package/dist/src/source-parser.d.ts +44 -4
  93. package/dist/src/source-parser.js +494 -57
  94. package/dist/src/view/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  95. package/dist/src/view/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  96. package/dist/src/view/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  97. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  98. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  99. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  100. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  101. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  102. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  103. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  104. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  105. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  106. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  107. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  108. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  109. package/dist/src/view/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  110. package/dist/src/view/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  111. package/dist/src/view/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  112. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  113. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  114. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  115. package/dist/src/view/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  116. package/dist/src/view/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  117. package/dist/src/view/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  118. package/dist/src/view/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  119. package/dist/src/view/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  120. package/dist/src/view/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  121. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  122. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  123. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  124. package/dist/src/view/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  125. package/dist/src/view/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  126. package/dist/src/view/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  127. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  128. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  129. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  130. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  131. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  132. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  133. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  134. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  135. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  136. package/dist/src/view/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  137. package/dist/src/view/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  138. package/dist/src/view/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  139. package/dist/src/view/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  140. package/dist/src/view/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  141. package/dist/src/view/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  142. package/dist/src/view/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  143. package/dist/src/view/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  144. package/dist/src/view/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  145. package/dist/src/view/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  146. package/dist/src/view/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  147. package/dist/src/view/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  148. package/dist/src/view/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  149. package/dist/src/view/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  150. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  151. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  152. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  153. package/dist/src/view/client/assets/MarkdownEditor-B7quqPb8.js +28 -0
  154. package/dist/src/view/client/assets/OrbitControls-DwcpQNja.js +1 -0
  155. package/dist/src/view/client/assets/STLLoader-CLWTKt5i.js +1 -0
  156. package/dist/src/view/client/assets/abnfDiagram-VCTEODGH-V7-T6qsl.js +1 -0
  157. package/dist/src/view/client/assets/arc-BnwR8Bu7.js +1 -0
  158. package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-u97vDna9.js +36 -0
  159. package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-DETl8e_H.js +129 -0
  160. package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-DJRAT1Ve.js +38 -0
  161. package/dist/src/view/client/assets/channel-BwQbnWCN.js +1 -0
  162. package/dist/src/view/client/assets/chunk-2Q5K7J3B-C0TmOC1Q.js +1 -0
  163. package/dist/src/view/client/assets/chunk-5VM5RSS4-dfBOrYE6.js +15 -0
  164. package/dist/src/view/client/assets/chunk-F27PBJKO-DAnks99K.js +1 -0
  165. package/dist/src/view/client/assets/chunk-IMKFNOWR-CPjB07if.js +231 -0
  166. package/dist/src/view/client/assets/chunk-JWPE2WC7-VvU_gZI6.js +1 -0
  167. package/dist/src/view/client/assets/chunk-POPQ4Y6H-DDUbVF55.js +1 -0
  168. package/dist/src/view/client/assets/chunk-SVP7TREG-BHROkr6D.js +88 -0
  169. package/dist/src/view/client/assets/chunk-TICWLB2K-95PzGIOg.js +206 -0
  170. package/dist/src/view/client/assets/chunk-XXDRQBXY-MdmuLhIs.js +1 -0
  171. package/dist/src/view/client/assets/classDiagram-ZZMXUADV-HvQKkIS-.js +1 -0
  172. package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-HvQKkIS-.js +1 -0
  173. package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-CauUf_rN.js +1 -0
  174. package/dist/src/view/client/assets/cynefin-OW5HDTMX-CeA8IKWo.js +166 -0
  175. package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-L1rtcT8l.js +62 -0
  176. package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
  177. package/dist/src/view/client/assets/dagre-GXQ25YYZ-DLQwTa3H.js +4 -0
  178. package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  179. package/dist/src/view/client/assets/diagram-S7CK7UJ4-kbKdIyXG.js +30 -0
  180. package/dist/src/view/client/assets/diagram-UQ7AKVKN-kmzp92RC.js +41 -0
  181. package/dist/src/view/client/assets/diagram-VSXAHHWV-EXJTU8qq.js +3 -0
  182. package/dist/src/view/client/assets/diagram-VX7I27RA-DAiIyMCG.js +24 -0
  183. package/dist/src/view/client/assets/diagram-Z3DM3KII-G9wz50ZV.js +24 -0
  184. package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-D2tVRCNA.js +1 -0
  185. package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-C925J5A3.js +99 -0
  186. package/dist/src/view/client/assets/flowDiagram-HODETNUW-DzoCa-Nq.js +168 -0
  187. package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-D2ebbg4p.js +292 -0
  188. package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-B4QratYy.js +106 -0
  189. package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
  190. package/dist/src/view/client/assets/index-D0ajr_Ja.css +1 -0
  191. package/dist/src/view/client/assets/index-KZcnpXJH.js +321 -0
  192. package/dist/src/view/client/assets/infoDiagram-27XIBGKW-DL4mtHkt.js +2 -0
  193. package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
  194. package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-CW4mto2d.js +70 -0
  195. package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-8R4eacFW.js +139 -0
  196. package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-Cy9ioXEJ.js +89 -0
  197. package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
  198. package/dist/src/view/client/assets/layout-C0MFuhth.js +1 -0
  199. package/dist/src/view/client/assets/linear-Dv3N4dQR.js +1 -0
  200. package/dist/src/view/client/assets/logo-small-RR_KBOAT.svg +149 -0
  201. package/dist/src/view/client/assets/maplibre-gl-DnqZgfUS.js +800 -0
  202. package/dist/src/view/client/assets/mermaid.core-bds9A7e2.js +310 -0
  203. package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-DjmGW355.js +96 -0
  204. package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
  205. package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-BWsZp0ab.js +1 -0
  206. package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-CCH2gGR-.js +39 -0
  207. package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC-CjocPJFz.js +7 -0
  208. package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-BjLeb2KF.js +1 -0
  209. package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-Ct6AoXRr.js +84 -0
  210. package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-CIpgGN_w.js +40 -0
  211. package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-DrmLFj6w.js +162 -0
  212. package/dist/src/view/client/assets/sizeCapture-INFHLROL-BdFMe2Lr.js +1 -0
  213. package/dist/src/view/client/assets/stateDiagram-D77RDMKH-Zd9F1goW.js +1 -0
  214. package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-ByIKCftl.js +1 -0
  215. package/dist/src/view/client/assets/swimlanes-42K2YHIH-a7VFwi00.js +1 -0
  216. package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-CzxaUHB-.js +8 -0
  217. package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
  218. package/dist/src/view/client/assets/timeline-definition-24CTP7MA-BExPu6X5.js +120 -0
  219. package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-PC1MU3si.js +34 -0
  220. package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-DNWqU3fa.js +78 -0
  221. package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-E1uA28_D.js +7 -0
  222. package/dist/src/view/client/index.html +2 -2
  223. package/dist/src/view/client-shell.d.ts +2 -0
  224. package/dist/src/view/client-shell.js +5 -0
  225. package/dist/src/view/diagnostics.d.ts +3 -2
  226. package/dist/src/view/diagnostics.js +49 -58
  227. package/dist/src/view/document-edit.d.ts +8 -0
  228. package/dist/src/view/document-edit.js +25 -0
  229. package/dist/src/view/document-route.d.ts +12 -0
  230. package/dist/src/view/document-route.js +93 -0
  231. package/dist/src/view/document-tree.d.ts +18 -0
  232. package/dist/src/view/document-tree.js +139 -0
  233. package/dist/src/view/external-document-tree.d.ts +3 -0
  234. package/dist/src/view/external-document-tree.js +674 -0
  235. package/dist/src/view/git-diff.js +187 -0
  236. package/dist/src/view/git.js +1 -1
  237. package/dist/src/view/graph.d.ts +3 -2
  238. package/dist/src/view/graph.js +94 -7
  239. package/dist/src/view/highlight.d.ts +10 -2
  240. package/dist/src/view/highlight.js +4540 -1360
  241. package/dist/src/view/markdown.d.ts +3 -2
  242. package/dist/src/view/markdown.js +214 -53
  243. package/dist/src/view/protocol.d.ts +59 -6
  244. package/dist/src/view/references.d.ts +10 -25
  245. package/dist/src/view/references.js +117 -107
  246. package/dist/src/view/repository.d.ts +13 -3
  247. package/dist/src/view/repository.js +234 -15
  248. package/dist/src/view/search.d.ts +1 -1
  249. package/dist/src/view/search.js +3 -7
  250. package/dist/src/view/server.d.ts +11 -2
  251. package/dist/src/view/server.js +212 -70
  252. package/dist/src/view/source-target.js +5 -8
  253. package/dist/src/view/static-build.d.ts +1 -0
  254. package/dist/src/view/static-build.js +245 -42
  255. package/dist/src/view/static-protocol.d.ts +19 -2
  256. package/dist/src/view/store.d.ts +16 -3
  257. package/dist/src/view/store.js +228 -36
  258. package/dist/src/view/table-of-contents.d.ts +2 -2
  259. package/dist/src/view/table-of-contents.js +2 -22
  260. package/dist/src/walk.d.ts +5 -3
  261. package/dist/src/walk.js +102 -8
  262. package/package.json +46 -8
  263. package/plugins/lat-md/README.md +61 -0
  264. package/plugins/lat-md/hooks.json +38 -0
  265. package/plugins/lat-md/plugin.json +9 -0
  266. package/plugins/lat-md/rules/AGENTS.md +118 -0
  267. package/plugins/lat-md/skills/lat-md/SKILL.md +178 -0
  268. package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +182 -0
  269. package/templates/AGENTS.md +15 -3
  270. package/templates/cursor-rules.md +12 -3
  271. package/templates/skill/SKILL.md +22 -1
  272. package/dist/src/view/client/assets/index-C3iaZyYT.css +0 -1
  273. package/dist/src/view/client/assets/index-KWi67IMz.js +0 -334
  274. package/dist/src/view/client/assets/logo-CNF8zs47.svg +0 -182
@@ -0,0 +1,321 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./OrbitControls-DwcpQNja.js","./three.module-PDSP0dbZ.js","./STLLoader-CLWTKt5i.js"])))=>i.map(i=>d[i]);
2
+ (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 Uy(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Ms={exports:{}},xr={};var Am;function ky(){if(Am)return xr;Am=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 h in o)h!=="key"&&(f[h]=o[h])}else f=o;return o=f.ref,{$$typeof:u,type:a,key:d,ref:o!==void 0?o:null,props:f}}return xr.Fragment=r,xr.jsx=l,xr.jsxs=l,xr}var Nm;function jy(){return Nm||(Nm=1,Ms.exports=ky()),Ms.exports}var E=jy(),zs={exports:{}},pe={};var Cm;function By(){if(Cm)return pe;Cm=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"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),S=Symbol.iterator;function w(x){return x===null||typeof x!="object"?null:(x=S&&x[S]||x["@@iterator"],typeof x=="function"?x:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,j={};function Y(x,D,J){this.props=x,this.context=D,this.refs=j,this.updater=J||C}Y.prototype.isReactComponent={},Y.prototype.setState=function(x,D){if(typeof x!="object"&&typeof x!="function"&&x!=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,x,D,"setState")},Y.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function Z(){}Z.prototype=Y.prototype;function V(x,D,J){this.props=x,this.context=D,this.refs=j,this.updater=J||C}var N=V.prototype=new Z;N.constructor=V,R(N,Y.prototype),N.isPureReactComponent=!0;var L=Array.isArray;function B(){}var U={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function K(x,D,J){var ie=J.ref;return{$$typeof:u,type:x,key:D,ref:ie!==void 0?ie:null,props:J}}function P(x,D){return K(x.type,D,x.props)}function oe(x){return typeof x=="object"&&x!==null&&x.$$typeof===u}function se(x){var D={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(J){return D[J]})}var Ce=/\/+/g;function xe(x,D){return typeof x=="object"&&x!==null&&x.key!=null?se(""+x.key):D.toString(36)}function ue(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(B,B):(x.status="pending",x.then(function(D){x.status==="pending"&&(x.status="fulfilled",x.value=D)},function(D){x.status==="pending"&&(x.status="rejected",x.reason=D)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function O(x,D,J,ie,me){var be=typeof x;(be==="undefined"||be==="boolean")&&(x=null);var Re=!1;if(x===null)Re=!0;else switch(be){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(x.$$typeof){case u:case r:Re=!0;break;case b:return Re=x._init,O(Re(x._payload),D,J,ie,me)}}if(Re)return me=me(x),Re=ie===""?"."+xe(x,0):ie,L(me)?(J="",Re!=null&&(J=Re.replace(Ce,"$&/")+"/"),O(me,D,J,"",function(fn){return fn})):me!=null&&(oe(me)&&(me=P(me,J+(me.key==null||x&&x.key===me.key?"":(""+me.key).replace(Ce,"$&/")+"/")+Re)),D.push(me)),1;Re=0;var rt=ie===""?".":ie+":";if(L(x))for(var Fe=0;Fe<x.length;Fe++)ie=x[Fe],be=rt+xe(ie,Fe),Re+=O(ie,D,J,be,me);else if(Fe=w(x),typeof Fe=="function")for(x=Fe.call(x),Fe=0;!(ie=x.next()).done;)ie=ie.value,be=rt+xe(ie,Fe++),Re+=O(ie,D,J,be,me);else if(be==="object"){if(typeof x.then=="function")return O(ue(x),D,J,ie,me);throw D=String(x),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return Re}function I(x,D,J){if(x==null)return x;var ie=[],me=0;return O(x,ie,"","",function(be){return D.call(J,be,me++)}),ie}function ne(x){if(x._status===-1){var D=x._result;D=D(),D.then(function(J){(x._status===0||x._status===-1)&&(x._status=1,x._result=J)},function(J){(x._status===0||x._status===-1)&&(x._status=2,x._result=J)}),x._status===-1&&(x._status=0,x._result=D)}if(x._status===1)return x._result.default;throw x._result}var fe=typeof reportError=="function"?reportError:function(x){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x=="object"&&x!==null&&typeof x.message=="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",x);return}console.error(x)},ge={map:I,forEach:function(x,D,J){I(x,function(){D.apply(this,arguments)},J)},count:function(x){var D=0;return I(x,function(){D++}),D},toArray:function(x){return I(x,function(D){return D})||[]},only:function(x){if(!oe(x))throw Error("React.Children.only expected to receive a single React element child.");return x}};return pe.Activity=v,pe.Children=ge,pe.Component=Y,pe.Fragment=l,pe.Profiler=o,pe.PureComponent=V,pe.StrictMode=a,pe.Suspense=m,pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,pe.__COMPILER_RUNTIME={__proto__:null,c:function(x){return U.H.useMemoCache(x)}},pe.cache=function(x){return function(){return x.apply(null,arguments)}},pe.cacheSignal=function(){return null},pe.cloneElement=function(x,D,J){if(x==null)throw Error("The argument must be a React element, but you passed "+x+".");var ie=R({},x.props),me=x.key;if(D!=null)for(be in D.key!==void 0&&(me=""+D.key),D)!W.call(D,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&D.ref===void 0||(ie[be]=D[be]);var be=arguments.length-2;if(be===1)ie.children=J;else if(1<be){for(var Re=Array(be),rt=0;rt<be;rt++)Re[rt]=arguments[rt+2];ie.children=Re}return K(x.type,me,ie)},pe.createContext=function(x){return x={$$typeof:d,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:f,_context:x},x},pe.createElement=function(x,D,J){var ie,me={},be=null;if(D!=null)for(ie in D.key!==void 0&&(be=""+D.key),D)W.call(D,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(me[ie]=D[ie]);var Re=arguments.length-2;if(Re===1)me.children=J;else if(1<Re){for(var rt=Array(Re),Fe=0;Fe<Re;Fe++)rt[Fe]=arguments[Fe+2];me.children=rt}if(x&&x.defaultProps)for(ie in Re=x.defaultProps,Re)me[ie]===void 0&&(me[ie]=Re[ie]);return K(x,be,me)},pe.createRef=function(){return{current:null}},pe.forwardRef=function(x){return{$$typeof:h,render:x}},pe.isValidElement=oe,pe.lazy=function(x){return{$$typeof:b,_payload:{_status:-1,_result:x},_init:ne}},pe.memo=function(x,D){return{$$typeof:p,type:x,compare:D===void 0?null:D}},pe.startTransition=function(x){var D=U.T,J={};U.T=J;try{var ie=x(),me=U.S;me!==null&&me(J,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(B,fe)}catch(be){fe(be)}finally{D!==null&&J.types!==null&&(D.types=J.types),U.T=D}},pe.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},pe.use=function(x){return U.H.use(x)},pe.useActionState=function(x,D,J){return U.H.useActionState(x,D,J)},pe.useCallback=function(x,D){return U.H.useCallback(x,D)},pe.useContext=function(x){return U.H.useContext(x)},pe.useDebugValue=function(){},pe.useDeferredValue=function(x,D){return U.H.useDeferredValue(x,D)},pe.useEffect=function(x,D){return U.H.useEffect(x,D)},pe.useEffectEvent=function(x){return U.H.useEffectEvent(x)},pe.useId=function(){return U.H.useId()},pe.useImperativeHandle=function(x,D,J){return U.H.useImperativeHandle(x,D,J)},pe.useInsertionEffect=function(x,D){return U.H.useInsertionEffect(x,D)},pe.useLayoutEffect=function(x,D){return U.H.useLayoutEffect(x,D)},pe.useMemo=function(x,D){return U.H.useMemo(x,D)},pe.useOptimistic=function(x,D){return U.H.useOptimistic(x,D)},pe.useReducer=function(x,D,J){return U.H.useReducer(x,D,J)},pe.useRef=function(x){return U.H.useRef(x)},pe.useState=function(x){return U.H.useState(x)},pe.useSyncExternalStore=function(x,D,J){return U.H.useSyncExternalStore(x,D,J)},pe.useTransition=function(){return U.H.useTransition()},pe.version="19.2.8",pe}var Rm;function pc(){return Rm||(Rm=1,zs.exports=By()),zs.exports}var q=pc(),Gs={exports:{}},_r={},Os={exports:{}},Us={};var Dm;function Hy(){return Dm||(Dm=1,(function(u){function r(O,I){var ne=O.length;O.push(I);e:for(;0<ne;){var fe=ne-1>>>1,ge=O[fe];if(0<o(ge,I))O[fe]=I,O[ne]=ge,ne=fe;else break e}}function l(O){return O.length===0?null:O[0]}function a(O){if(O.length===0)return null;var I=O[0],ne=O.pop();if(ne!==I){O[0]=ne;e:for(var fe=0,ge=O.length,x=ge>>>1;fe<x;){var D=2*(fe+1)-1,J=O[D],ie=D+1,me=O[ie];if(0>o(J,ne))ie<ge&&0>o(me,J)?(O[fe]=me,O[ie]=ne,fe=ie):(O[fe]=J,O[D]=ne,fe=D);else if(ie<ge&&0>o(me,ne))O[fe]=me,O[ie]=ne,fe=ie;else break e}}return I}function o(O,I){var ne=O.sortIndex-I.sortIndex;return ne!==0?ne:O.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,h=d.now();u.unstable_now=function(){return d.now()-h}}var m=[],p=[],b=1,v=null,S=3,w=!1,C=!1,R=!1,j=!1,Y=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function N(O){for(var I=l(p);I!==null;){if(I.callback===null)a(p);else if(I.startTime<=O)a(p),I.sortIndex=I.expirationTime,r(m,I);else break;I=l(p)}}function L(O){if(R=!1,N(O),!C)if(l(m)!==null)C=!0,B||(B=!0,se());else{var I=l(p);I!==null&&ue(L,I.startTime-O)}}var B=!1,U=-1,W=5,K=-1;function P(){return j?!0:!(u.unstable_now()-K<W)}function oe(){if(j=!1,B){var O=u.unstable_now();K=O;var I=!0;try{e:{C=!1,R&&(R=!1,Z(U),U=-1),w=!0;var ne=S;try{t:{for(N(O),v=l(m);v!==null&&!(v.expirationTime>O&&P());){var fe=v.callback;if(typeof fe=="function"){v.callback=null,S=v.priorityLevel;var ge=fe(v.expirationTime<=O);if(O=u.unstable_now(),typeof ge=="function"){v.callback=ge,N(O),I=!0;break t}v===l(m)&&a(m),N(O)}else a(m);v=l(m)}if(v!==null)I=!0;else{var x=l(p);x!==null&&ue(L,x.startTime-O),I=!1}}break e}finally{v=null,S=ne,w=!1}I=void 0}}finally{I?se():B=!1}}}var se;if(typeof V=="function")se=function(){V(oe)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,xe=Ce.port2;Ce.port1.onmessage=oe,se=function(){xe.postMessage(null)}}else se=function(){Y(oe,0)};function ue(O,I){U=Y(function(){O(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(O){O.callback=null},u.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<O?Math.floor(1e3/O):5},u.unstable_getCurrentPriorityLevel=function(){return S},u.unstable_next=function(O){switch(S){case 1:case 2:case 3:var I=3;break;default:I=S}var ne=S;S=I;try{return O()}finally{S=ne}},u.unstable_requestPaint=function(){j=!0},u.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var ne=S;S=O;try{return I()}finally{S=ne}},u.unstable_scheduleCallback=function(O,I,ne){var fe=u.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?fe+ne:fe):ne=fe,O){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=ne+ge,O={id:b++,callback:I,priorityLevel:O,startTime:ne,expirationTime:ge,sortIndex:-1},ne>fe?(O.sortIndex=ne,r(p,O),l(m)===null&&O===l(p)&&(R?(Z(U),U=-1):R=!0,ue(L,ne-fe))):(O.sortIndex=ge,r(m,O),C||w||(C=!0,B||(B=!0,se()))),O},u.unstable_shouldYield=P,u.unstable_wrapCallback=function(O){var I=S;return function(){var ne=S;S=I;try{return O.apply(this,arguments)}finally{S=ne}}}})(Us)),Us}var Lm;function qy(){return Lm||(Lm=1,Os.exports=Hy()),Os.exports}var ks={exports:{}},dt={};var Mm;function Fy(){if(Mm)return dt;Mm=1;var u=pc();function r(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function 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,p,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:p,implementation:b}}var d=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,dt.createPortal=function(m,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return f(m,p,null,b)},dt.flushSync=function(m){var p=d.T,b=a.p;try{if(d.T=null,a.p=2,m)return m()}finally{d.T=p,a.p=b,a.d.f()}},dt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},dt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},dt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var b=p.as,v=h(b,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:S,fetchPriority:w}):b==="script"&&a.d.X(m,{crossOrigin:v,integrity:S,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},dt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=h(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},dt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,v=h(b,p.crossOrigin);a.d.L(m,b,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},dt.preloadModule=function(m,p){if(typeof m=="string")if(p){var b=h(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},dt.requestFormReset=function(m){a.d.r(m)},dt.unstable_batchedUpdates=function(m,p){return m(p)},dt.useFormState=function(m,p,b){return d.H.useFormState(m,p,b)},dt.useFormStatus=function(){return d.H.useHostTransitionStatus()},dt.version="19.2.8",dt}var zm;function Yy(){if(zm)return ks.exports;zm=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(),ks.exports=Fy(),ks.exports}var Gm;function $y(){if(Gm)return _r;Gm=1;var u=qy(),r=pc(),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 h(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 p(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 g=!1,y=s.child;y;){if(y===n){g=!0,n=s,i=c;break}if(y===i){g=!0,i=s,n=c;break}y=y.sibling}if(!g){for(y=c.child;y;){if(y===n){g=!0,n=c,i=s;break}if(y===i){g=!0,i=c,n=s;break}y=y.sibling}if(!g)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 v=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),V=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var Ce=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case Y:return"Profiler";case j:return"StrictMode";case L:return"Suspense";case B:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case V:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case N:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var ue=Array.isArray,O=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,ne={pending:!1,data:null,method:null,action:null},fe=[],ge=-1;function x(e){return{current:e}}function D(e){0>ge||(e.current=fe[ge],fe[ge]=null,ge--)}function J(e,t){ge++,fe[ge]=e.current,e.current=t}var ie=x(null),me=x(null),be=x(null),Re=x(null);function rt(e,t){switch(J(be,t),J(me,e),J(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kh(t),e=Ih(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(ie),J(ie,e)}function Fe(){D(ie),D(me),D(be)}function fn(e){e.memoizedState!==null&&J(Re,e);var t=ie.current,n=Ih(t,e.type);t!==n&&(J(me,e),J(ie,n))}function Un(e){me.current===e&&(D(ie),D(me)),Re.current===e&&(D(Re),Er._currentValue=ne)}var zi,kr;function tn(e){if(zi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zi=t&&t[1]||"",kr=-1<n.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+zi+e+kr}var Gi=!1;function dn(e,t){if(!e||Gi)return"";Gi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(k){var G=k}Reflect.construct(e,[],X)}else{try{X.call()}catch(k){G=k}e.call(X.prototype)}}else{try{throw Error()}catch(k){G=k}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(k){if(k&&G&&typeof k.stack=="string")return[k.stack,G.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(),g=c[0],y=c[1];if(g&&y){var T=g.split(`
5
+ `),z=y.split(`
6
+ `);for(s=i=0;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;for(;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;if(i===T.length||s===z.length)for(i=T.length-1,s=z.length-1;1<=i&&0<=s&&T[i]!==z[s];)s--;for(;1<=i&&0<=s;i--,s--)if(T[i]!==z[s]){if(i!==1||s!==1)do if(i--,s--,0>s||T[i]!==z[s]){var H=`
7
+ `+T[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{Gi=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?tn(n):""}function jr(e,t){switch(e.tag){case 26:case 27:case 5:return tn(e.type);case 16:return tn("Lazy");case 13:return e.child!==t&&t!==null?tn("Suspense Fallback"):tn("Suspense");case 19:return tn("SuspenseList");case 0:case 15:return dn(e.type,!1);case 11:return dn(e.type.render,!1);case 1:return dn(e.type,!0);case 31:return tn("Activity");default:return""}}function Da(e){try{var t="",n=null;do t+=jr(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
8
+ Error generating stack: `+i.message+`
9
+ `+i.stack}}var nn=Object.prototype.hasOwnProperty,Oi=u.unstable_scheduleCallback,Ui=u.unstable_cancelCallback,yu=u.unstable_shouldYield,Br=u.unstable_requestPaint,F=u.unstable_now,Ee=u.unstable_getCurrentPriorityLevel,$e=u.unstable_ImmediatePriority,Se=u.unstable_UserBlockingPriority,Ze=u.unstable_NormalPriority,nt=u.unstable_LowPriority,Mt=u.unstable_IdlePriority,La=u.log,bp=u.unstable_setDisableYieldValue,Ma=null,Tt=null;function kn(e){if(typeof La=="function"&&bp(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Ma,e)}catch{}}var xt=Math.clz32?Math.clz32:wp,Ep=Math.log,Sp=Math.LN2;function wp(e){return e>>>=0,e===0?32:31-(Ep(e)/Sp|0)|0}var Hr=256,qr=262144,Fr=4194304;function ci(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 Yr(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var s=0,c=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var y=i&134217727;return y!==0?(i=y&~c,i!==0?s=ci(i):(g&=y,g!==0?s=ci(g):n||(n=y&~e,n!==0&&(s=ci(n))))):(y=i&~c,y!==0?s=ci(y):g!==0?s=ci(g):n||(n=i&~e,n!==0&&(s=ci(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 za(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tp(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 Rc(){var e=Fr;return Fr<<=1,(Fr&62914560)===0&&(Fr=4194304),e}function bu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ga(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xp(e,t,n,i,s,c){var g=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,T=e.expirationTimes,z=e.hiddenUpdates;for(n=g&~n;0<n;){var H=31-xt(n),X=1<<H;y[H]=0,T[H]=-1;var G=z[H];if(G!==null)for(z[H]=null,H=0;H<G.length;H++){var k=G[H];k!==null&&(k.lane&=-536870913)}n&=~X}i!==0&&Dc(e,i,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(g&~t))}function Dc(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-xt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function Lc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-xt(n),s=1<<i;s&t|e[i]&t&&(e[i]|=t),n&=~s}}function Mc(e,t){var n=t&-t;return n=(n&42)!==0?1:Eu(n),(n&(e.suspendedLanes|t))!==0?0:n}function Eu(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 Su(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function zc(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:bm(e.type))}function Gc(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var jn=Math.random().toString(36).slice(2),lt="__reactFiber$"+jn,pt="__reactProps$"+jn,ki="__reactContainer$"+jn,wu="__reactEvents$"+jn,_p="__reactListeners$"+jn,Ap="__reactHandles$"+jn,Oc="__reactResources$"+jn,Oa="__reactMarker$"+jn;function Tu(e){delete e[lt],delete e[pt],delete e[wu],delete e[_p],delete e[Ap]}function ji(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ki]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=im(e);e!==null;){if(n=e[lt])return n;e=im(e)}return t}e=n,n=e.parentNode}return null}function Bi(e){if(e=e[lt]||e[ki]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ua(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Hi(e){var t=e[Oc];return t||(t=e[Oc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[Oa]=!0}var Uc=new Set,kc={};function fi(e,t){qi(e,t),qi(e+"Capture",t)}function qi(e,t){for(kc[e]=t,e=0;e<t.length;e++)Uc.add(t[e])}var Np=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]*$"),jc={},Bc={};function Cp(e){return nn.call(Bc,e)?!0:nn.call(jc,e)?!1:Np.test(e)?Bc[e]=!0:(jc[e]=!0,!1)}function $r(e,t,n){if(Cp(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 Vr(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 hn(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 Hc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rp(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(g){n=""+g,c.call(this,g)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xu(e){if(!e._valueTracker){var t=Hc(e)?"checked":"value";e._valueTracker=Rp(e,t,""+e[t])}}function qc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Hc(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Xr(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 Dp=/[\n"\\]/g;function Gt(e){return e.replace(Dp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _u(e,t,n,i,s,c,g,y){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Au(e,g,zt(t)):n!=null?Au(e,g,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 Fc(e,t,n,i,s,c,g,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)){xu(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,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),xu(e)}function Au(e,t,n){t==="number"&&Xr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Fi(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 Yc(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 $c(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(a(92));if(ue(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),xu(e)}function Yi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lp=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 Vc(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||Lp.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&&Vc(e,s,i)}else for(var c in t)t.hasOwnProperty(c)&&Vc(e,c,t[c])}function Nu(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 Mp=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"]]),zp=/^[\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 Zr(e){return zp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function mn(){}var Cu=null;function Ru(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $i=null,Vi=null;function Zc(e){var t=Bi(e);if(t&&(e=t.stateNode)){var n=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(_u(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="'+Gt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var s=i[pt]||null;if(!s)throw Error(a(90));_u(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&&qc(i)}break e;case"textarea":Yc(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Fi(e,!!n.multiple,t,!1)}}}var Du=!1;function Qc(e,t,n){if(Du)return e(t,n);Du=!0;try{var i=e(t);return i}finally{if(Du=!1,($i!==null||Vi!==null)&&(Gl(),$i&&(t=$i,e=Vi,Vi=$i=null,Zc(t),e)))for(t=0;t<e.length;t++)Zc(e[t])}}function ka(e,t){var n=e.stateNode;if(n===null)return null;var i=n[pt]||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 gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lu=!1;if(gn)try{var ja={};Object.defineProperty(ja,"passive",{get:function(){Lu=!0}}),window.addEventListener("test",ja,ja),window.removeEventListener("test",ja,ja)}catch{Lu=!1}var Bn=null,Mu=null,Qr=null;function Kc(){if(Qr)return Qr;var e,t=Mu,n=t.length,i,s="value"in Bn?Bn.value:Bn.textContent,c=s.length;for(e=0;e<n&&t[e]===s[e];e++);var g=n-e;for(i=1;i<=g&&t[n-i]===s[c-i];i++);return Qr=s.slice(e,1<i?1-i:void 0)}function Kr(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 Ir(){return!0}function Ic(){return!1}function vt(e){function t(n,i,s,c,g){this._reactName=n,this._targetInst=s,this.type=i,this.nativeEvent=c,this.target=g,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)?Ir:Ic,this.isPropagationStopped=Ic,this}return v(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=Ir)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ir)},persist:function(){},isPersistent:Ir}),t}var di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jr=vt(di),Ba=v({},di,{view:0,detail:0}),Gp=vt(Ba),zu,Gu,Ha,Wr=v({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uu,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!==Ha&&(Ha&&e.type==="mousemove"?(zu=e.screenX-Ha.screenX,Gu=e.screenY-Ha.screenY):Gu=zu=0,Ha=e),zu)},movementY:function(e){return"movementY"in e?e.movementY:Gu}}),Jc=vt(Wr),Op=v({},Wr,{dataTransfer:0}),Up=vt(Op),kp=v({},Ba,{relatedTarget:0}),Ou=vt(kp),jp=v({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),Bp=vt(jp),Hp=v({},di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qp=vt(Hp),Fp=v({},di,{data:0}),Wc=vt(Fp),Yp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$p={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"},Vp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vp[e])?!!t[e]:!1}function Uu(){return Xp}var Zp=v({},Ba,{key:function(e){if(e.key){var t=Yp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Kr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$p[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uu,charCode:function(e){return e.type==="keypress"?Kr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qp=vt(Zp),Kp=v({},Wr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pc=vt(Kp),Ip=v({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uu}),Jp=vt(Ip),Wp=v({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pp=vt(Wp),ev=v({},Wr,{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}),tv=vt(ev),nv=v({},di,{newState:0,oldState:0}),iv=vt(nv),av=[9,13,27,32],ku=gn&&"CompositionEvent"in window,qa=null;gn&&"documentMode"in document&&(qa=document.documentMode);var rv=gn&&"TextEvent"in window&&!qa,ef=gn&&(!ku||qa&&8<qa&&11>=qa),tf=" ",nf=!1;function af(e,t){switch(e){case"keyup":return av.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function lv(e,t){switch(e){case"compositionend":return rf(t);case"keypress":return t.which!==32?null:(nf=!0,tf);case"textInput":return e=t.data,e===tf&&nf?null:e;default:return null}}function uv(e,t){if(Xi)return e==="compositionend"||!ku&&af(e,t)?(e=Kc(),Qr=Mu=Bn=null,Xi=!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 ef&&t.locale!=="ko"?null:t.data;default:return null}}var ov={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 lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ov[e.type]:t==="textarea"}function uf(e,t,n,i){$i?Vi?Vi.push(i):Vi=[i]:$i=i,t=ql(t,"onChange"),0<t.length&&(n=new Jr("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Fa=null,Ya=null;function sv(e){Yh(e,0)}function Pr(e){var t=Ua(e);if(qc(t))return e}function of(e,t){if(e==="change")return t}var sf=!1;if(gn){var ju;if(gn){var Bu="oninput"in document;if(!Bu){var cf=document.createElement("div");cf.setAttribute("oninput","return;"),Bu=typeof cf.oninput=="function"}ju=Bu}else ju=!1;sf=ju&&(!document.documentMode||9<document.documentMode)}function ff(){Fa&&(Fa.detachEvent("onpropertychange",df),Ya=Fa=null)}function df(e){if(e.propertyName==="value"&&Pr(Ya)){var t=[];uf(t,Ya,e,Ru(e)),Qc(sv,t)}}function cv(e,t,n){e==="focusin"?(ff(),Fa=t,Ya=n,Fa.attachEvent("onpropertychange",df)):e==="focusout"&&ff()}function fv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pr(Ya)}function dv(e,t){if(e==="click")return Pr(t)}function hv(e,t){if(e==="input"||e==="change")return Pr(t)}function mv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:mv;function $a(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(!nn.call(t,s)||!_t(e[s],t[s]))return!1}return!0}function hf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mf(e,t){var n=hf(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=hf(n)}}function gf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xr(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=Xr(e.document)}return t}function Hu(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 gv=gn&&"documentMode"in document&&11>=document.documentMode,Zi=null,qu=null,Va=null,Fu=!1;function vf(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fu||Zi==null||Zi!==Xr(i)||(i=Zi,"selectionStart"in i&&Hu(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}),Va&&$a(Va,i)||(Va=i,i=ql(qu,"onSelect"),0<i.length&&(t=new Jr("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Zi)))}function hi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qi={animationend:hi("Animation","AnimationEnd"),animationiteration:hi("Animation","AnimationIteration"),animationstart:hi("Animation","AnimationStart"),transitionrun:hi("Transition","TransitionRun"),transitionstart:hi("Transition","TransitionStart"),transitioncancel:hi("Transition","TransitionCancel"),transitionend:hi("Transition","TransitionEnd")},Yu={},yf={};gn&&(yf=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function mi(e){if(Yu[e])return Yu[e];if(!Qi[e])return e;var t=Qi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yf)return Yu[e]=t[n];return e}var bf=mi("animationend"),Ef=mi("animationiteration"),Sf=mi("animationstart"),pv=mi("transitionrun"),vv=mi("transitionstart"),yv=mi("transitioncancel"),wf=mi("transitionend"),Tf=new Map,$u="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(" ");$u.push("scrollEnd");function Qt(e,t){Tf.set(e,t),fi(t,[e])}var el=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)},Ot=[],Ki=0,Vu=0;function tl(){for(var e=Ki,t=Vu=Ki=0;t<e;){var n=Ot[t];Ot[t++]=null;var i=Ot[t];Ot[t++]=null;var s=Ot[t];Ot[t++]=null;var c=Ot[t];if(Ot[t++]=null,i!==null&&s!==null){var g=i.pending;g===null?s.next=s:(s.next=g.next,g.next=s),i.pending=s}c!==0&&xf(n,s,c)}}function nl(e,t,n,i){Ot[Ki++]=e,Ot[Ki++]=t,Ot[Ki++]=n,Ot[Ki++]=i,Vu|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Xu(e,t,n,i){return nl(e,t,n,i),il(e)}function gi(e,t){return nl(e,null,null,t),il(e)}function xf(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-xt(n),e=c.hiddenUpdates,i=e[s],i===null?e[s]=[t]:i.push(t),t.lane=n|536870912),c):null}function il(e){if(50<hr)throw hr=0,ns=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ii={};function bv(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 At(e,t,n,i){return new bv(e,t,n,i)}function Zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pn(e,t){var n=e.alternate;return n===null?(n=At(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 _f(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 al(e,t,n,i,s,c){var g=0;if(i=e,typeof e=="function")Zu(e)&&(g=1);else if(typeof e=="string")g=xy(e,n,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=At(31,n,t,s),e.elementType=K,e.lanes=c,e;case R:return pi(n.children,s,c,t);case j:g=8,s|=24;break;case Y:return e=At(12,n,t,s|2),e.elementType=Y,e.lanes=c,e;case L:return e=At(13,n,t,s),e.elementType=L,e.lanes=c,e;case B:return e=At(19,n,t,s),e.elementType=B,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:g=10;break e;case Z:g=9;break e;case N:g=11;break e;case U:g=14;break e;case W:g=16,i=null;break e}g=29,n=Error(a(130,e===null?"null":typeof e,"")),i=null}return t=At(g,n,t,s),t.elementType=e,t.type=i,t.lanes=c,t}function pi(e,t,n,i){return e=At(7,e,i,t),e.lanes=n,e}function Qu(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function Af(e){var t=At(18,null,null,0);return t.stateNode=e,t}function Ku(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nf=new WeakMap;function Ut(e,t){if(typeof e=="object"&&e!==null){var n=Nf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Da(t)},Nf.set(e,t),t)}return{value:e,source:t,stack:Da(t)}}var Ji=[],Wi=0,rl=null,Xa=0,kt=[],jt=0,Hn=null,an=1,rn="";function vn(e,t){Ji[Wi++]=Xa,Ji[Wi++]=rl,rl=e,Xa=t}function Cf(e,t,n){kt[jt++]=an,kt[jt++]=rn,kt[jt++]=Hn,Hn=e;var i=an;e=rn;var s=32-xt(i)-1;i&=~(1<<s),n+=1;var c=32-xt(t)+s;if(30<c){var g=s-s%5;c=(i&(1<<g)-1).toString(32),i>>=g,s-=g,an=1<<32-xt(t)+s|n<<s|i,rn=c+e}else an=1<<c|n<<s|i,rn=e}function Iu(e){e.return!==null&&(vn(e,1),Cf(e,1,0))}function Ju(e){for(;e===rl;)rl=Ji[--Wi],Ji[Wi]=null,Xa=Ji[--Wi],Ji[Wi]=null;for(;e===Hn;)Hn=kt[--jt],kt[jt]=null,rn=kt[--jt],kt[jt]=null,an=kt[--jt],kt[jt]=null}function Rf(e,t){kt[jt++]=an,kt[jt++]=rn,kt[jt++]=Hn,an=t.id,rn=t.overflow,Hn=e}var ut=null,He=null,Ne=!1,qn=null,Bt=!1,Wu=Error(a(519));function Fn(e){var t=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Za(Ut(t,e)),Wu}function Df(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[lt]=e,t[pt]=i,n){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(n=0;n<gr.length;n++)Te(gr[n],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),Fc(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),$c(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||Zh(t.textContent,n)?(i.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),i.onScroll!=null&&Te("scroll",t),i.onScrollEnd!=null&&Te("scrollend",t),i.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||Fn(e,!0)}function Lf(e){for(ut=e.return;ut;)switch(ut.tag){case 5:case 31:case 13:Bt=!1;return;case 27:case 3:Bt=!0;return;default:ut=ut.return}}function Pi(e){if(e!==ut)return!1;if(!Ne)return Lf(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")||vs(e.type,e.memoizedProps)),n=!n),n&&He&&Fn(e),Lf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));He=nm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));He=nm(e)}else t===27?(t=He,ni(e.type)?(e=ws,ws=null,He=e):He=t):He=ut?qt(e.stateNode.nextSibling):null;return!0}function vi(){He=ut=null,Ne=!1}function Pu(){var e=qn;return e!==null&&(St===null?St=e:St.push.apply(St,e),qn=null),e}function Za(e){qn===null?qn=[e]:qn.push(e)}var eo=x(null),yi=null,yn=null;function Yn(e,t,n){J(eo,t._currentValue),t._currentValue=n}function bn(e){e._currentValue=eo.current,D(eo)}function to(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 no(e,t,n,i){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var g=s.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=s;for(var T=0;T<t.length;T++)if(y.context===t[T]){c.lanes|=n,y=c.alternate,y!==null&&(y.lanes|=n),to(c.return,n,e),i||(g=null);break e}c=y.next}}else if(s.tag===18){if(g=s.return,g===null)throw Error(a(341));g.lanes|=n,c=g.alternate,c!==null&&(c.lanes|=n),to(g,n,e),g=null}else g=s.child;if(g!==null)g.return=s;else for(g=s;g!==null;){if(g===e){g=null;break}if(s=g.sibling,s!==null){s.return=g.return,g=s;break}g=g.return}s=g}}function ea(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 g=s.alternate;if(g===null)throw Error(a(387));if(g=g.memoizedProps,g!==null){var y=s.type;_t(s.pendingProps.value,g.value)||(e!==null?e.push(y):e=[y])}}else if(s===Re.current){if(g=s.alternate,g===null)throw Error(a(387));g.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Er):e=[Er])}s=s.return}e!==null&&no(t,e,n,i),t.flags|=262144}function ll(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bi(e){yi=e,yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ot(e){return Mf(yi,e)}function ul(e,t){return yi===null&&bi(e),Mf(e,t)}function Mf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},yn===null){if(e===null)throw Error(a(308));yn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else yn=yn.next=t;return n}var Ev=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()})}},Sv=u.unstable_scheduleCallback,wv=u.unstable_NormalPriority,Ie={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function io(){return{controller:new Ev,data:new Map,refCount:0}}function Qa(e){e.refCount--,e.refCount===0&&Sv(wv,function(){e.controller.abort()})}var Ka=null,ao=0,ta=0,na=null;function Tv(e,t){if(Ka===null){var n=Ka=[];ao=0,ta=os(),na={status:"pending",value:void 0,then:function(i){n.push(i)}}}return ao++,t.then(zf,zf),t}function zf(){if(--ao===0&&Ka!==null){na!==null&&(na.status="fulfilled");var e=Ka;Ka=null,ta=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xv(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 Gf=O.S;O.S=function(e,t){vh=F(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Tv(e,t),Gf!==null&&Gf(e,t)};var Ei=x(null);function ro(){var e=Ei.current;return e!==null?e:je.pooledCache}function ol(e,t){t===null?J(Ei,Ei.current):J(Ei,t.pool)}function Of(){var e=ro();return e===null?null:{parent:Ie._currentValue,pool:e}}var ia=Error(a(460)),lo=Error(a(474)),sl=Error(a(542)),cl={then:function(){}};function Uf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function kf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bf(e),e;default:if(typeof t.status=="string")t.then(mn,mn);else{if(e=je,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,Bf(e),e}throw wi=t,ia}}function Si(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(wi=n,ia):n}}var wi=null;function jf(){if(wi===null)throw Error(a(459));var e=wi;return wi=null,e}function Bf(e){if(e===ia||e===sl)throw Error(a(483))}var aa=null,Ia=0;function fl(e){var t=Ia;return Ia+=1,aa===null&&(aa=[]),kf(aa,e,t)}function Ja(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function dl(e,t){throw t.$$typeof===S?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Hf(e){function t(A,_){if(e){var M=A.deletions;M===null?(A.deletions=[_],A.flags|=16):M.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=pn(A,_),A.index=0,A.sibling=null,A}function c(A,_,M){return A.index=M,e?(M=A.alternate,M!==null?(M=M.index,M<_?(A.flags|=67108866,_):M):(A.flags|=67108866,_)):(A.flags|=1048576,_)}function g(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function y(A,_,M,$){return _===null||_.tag!==6?(_=Qu(M,A.mode,$),_.return=A,_):(_=s(_,M),_.return=A,_)}function T(A,_,M,$){var ce=M.type;return ce===R?H(A,_,M.props.children,$,M.key):_!==null&&(_.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===W&&Si(ce)===_.type)?(_=s(_,M.props),Ja(_,M),_.return=A,_):(_=al(M.type,M.key,M.props,null,A.mode,$),Ja(_,M),_.return=A,_)}function z(A,_,M,$){return _===null||_.tag!==4||_.stateNode.containerInfo!==M.containerInfo||_.stateNode.implementation!==M.implementation?(_=Ku(M,A.mode,$),_.return=A,_):(_=s(_,M.children||[]),_.return=A,_)}function H(A,_,M,$,ce){return _===null||_.tag!==7?(_=pi(M,A.mode,$,ce),_.return=A,_):(_=s(_,M),_.return=A,_)}function X(A,_,M){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Qu(""+_,A.mode,M),_.return=A,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case w:return M=al(_.type,_.key,_.props,null,A.mode,M),Ja(M,_),M.return=A,M;case C:return _=Ku(_,A.mode,M),_.return=A,_;case W:return _=Si(_),X(A,_,M)}if(ue(_)||se(_))return _=pi(_,A.mode,M,null),_.return=A,_;if(typeof _.then=="function")return X(A,fl(_),M);if(_.$$typeof===V)return X(A,ul(A,_),M);dl(A,_)}return null}function G(A,_,M,$){var ce=_!==null?_.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return ce!==null?null:y(A,_,""+M,$);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case w:return M.key===ce?T(A,_,M,$):null;case C:return M.key===ce?z(A,_,M,$):null;case W:return M=Si(M),G(A,_,M,$)}if(ue(M)||se(M))return ce!==null?null:H(A,_,M,$,null);if(typeof M.then=="function")return G(A,_,fl(M),$);if(M.$$typeof===V)return G(A,_,ul(A,M),$);dl(A,M)}return null}function k(A,_,M,$,ce){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return A=A.get(M)||null,y(_,A,""+$,ce);if(typeof $=="object"&&$!==null){switch($.$$typeof){case w:return A=A.get($.key===null?M:$.key)||null,T(_,A,$,ce);case C:return A=A.get($.key===null?M:$.key)||null,z(_,A,$,ce);case W:return $=Si($),k(A,_,M,$,ce)}if(ue($)||se($))return A=A.get(M)||null,H(_,A,$,ce,null);if(typeof $.then=="function")return k(A,_,M,fl($),ce);if($.$$typeof===V)return k(A,_,M,ul(_,$),ce);dl(_,$)}return null}function ae(A,_,M,$){for(var ce=null,De=null,re=_,ye=_=0,Ae=null;re!==null&&ye<M.length;ye++){re.index>ye?(Ae=re,re=null):Ae=re.sibling;var Le=G(A,re,M[ye],$);if(Le===null){re===null&&(re=Ae);break}e&&re&&Le.alternate===null&&t(A,re),_=c(Le,_,ye),De===null?ce=Le:De.sibling=Le,De=Le,re=Ae}if(ye===M.length)return n(A,re),Ne&&vn(A,ye),ce;if(re===null){for(;ye<M.length;ye++)re=X(A,M[ye],$),re!==null&&(_=c(re,_,ye),De===null?ce=re:De.sibling=re,De=re);return Ne&&vn(A,ye),ce}for(re=i(re);ye<M.length;ye++)Ae=k(re,A,ye,M[ye],$),Ae!==null&&(e&&Ae.alternate!==null&&re.delete(Ae.key===null?ye:Ae.key),_=c(Ae,_,ye),De===null?ce=Ae:De.sibling=Ae,De=Ae);return e&&re.forEach(function(ui){return t(A,ui)}),Ne&&vn(A,ye),ce}function de(A,_,M,$){if(M==null)throw Error(a(151));for(var ce=null,De=null,re=_,ye=_=0,Ae=null,Le=M.next();re!==null&&!Le.done;ye++,Le=M.next()){re.index>ye?(Ae=re,re=null):Ae=re.sibling;var ui=G(A,re,Le.value,$);if(ui===null){re===null&&(re=Ae);break}e&&re&&ui.alternate===null&&t(A,re),_=c(ui,_,ye),De===null?ce=ui:De.sibling=ui,De=ui,re=Ae}if(Le.done)return n(A,re),Ne&&vn(A,ye),ce;if(re===null){for(;!Le.done;ye++,Le=M.next())Le=X(A,Le.value,$),Le!==null&&(_=c(Le,_,ye),De===null?ce=Le:De.sibling=Le,De=Le);return Ne&&vn(A,ye),ce}for(re=i(re);!Le.done;ye++,Le=M.next())Le=k(re,A,ye,Le.value,$),Le!==null&&(e&&Le.alternate!==null&&re.delete(Le.key===null?ye:Le.key),_=c(Le,_,ye),De===null?ce=Le:De.sibling=Le,De=Le);return e&&re.forEach(function(Oy){return t(A,Oy)}),Ne&&vn(A,ye),ce}function ke(A,_,M,$){if(typeof M=="object"&&M!==null&&M.type===R&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case w:e:{for(var ce=M.key;_!==null;){if(_.key===ce){if(ce=M.type,ce===R){if(_.tag===7){n(A,_.sibling),$=s(_,M.props.children),$.return=A,A=$;break e}}else if(_.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===W&&Si(ce)===_.type){n(A,_.sibling),$=s(_,M.props),Ja($,M),$.return=A,A=$;break e}n(A,_);break}else t(A,_);_=_.sibling}M.type===R?($=pi(M.props.children,A.mode,$,M.key),$.return=A,A=$):($=al(M.type,M.key,M.props,null,A.mode,$),Ja($,M),$.return=A,A=$)}return g(A);case C:e:{for(ce=M.key;_!==null;){if(_.key===ce)if(_.tag===4&&_.stateNode.containerInfo===M.containerInfo&&_.stateNode.implementation===M.implementation){n(A,_.sibling),$=s(_,M.children||[]),$.return=A,A=$;break e}else{n(A,_);break}else t(A,_);_=_.sibling}$=Ku(M,A.mode,$),$.return=A,A=$}return g(A);case W:return M=Si(M),ke(A,_,M,$)}if(ue(M))return ae(A,_,M,$);if(se(M)){if(ce=se(M),typeof ce!="function")throw Error(a(150));return M=ce.call(M),de(A,_,M,$)}if(typeof M.then=="function")return ke(A,_,fl(M),$);if(M.$$typeof===V)return ke(A,_,ul(A,M),$);dl(A,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,_!==null&&_.tag===6?(n(A,_.sibling),$=s(_,M),$.return=A,A=$):(n(A,_),$=Qu(M,A.mode,$),$.return=A,A=$),g(A)):n(A,_)}return function(A,_,M,$){try{Ia=0;var ce=ke(A,_,M,$);return aa=null,ce}catch(re){if(re===ia||re===sl)throw re;var De=At(29,re,null,A.mode);return De.lanes=$,De.return=A,De}}}var Ti=Hf(!0),qf=Hf(!1),$n=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oo(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 Vn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Me&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,t=il(e),xf(e,null,n),t}return nl(e,i,t,n),il(e)}function Wa(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,Lc(e,n)}}function so(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 g={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=g:c=c.next=g,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 co=!1;function Pa(){if(co){var e=na;if(e!==null)throw e}}function er(e,t,n,i){co=!1;var s=e.updateQueue;$n=!1;var c=s.firstBaseUpdate,g=s.lastBaseUpdate,y=s.shared.pending;if(y!==null){s.shared.pending=null;var T=y,z=T.next;T.next=null,g===null?c=z:g.next=z,g=T;var H=e.alternate;H!==null&&(H=H.updateQueue,y=H.lastBaseUpdate,y!==g&&(y===null?H.firstBaseUpdate=z:y.next=z,H.lastBaseUpdate=T))}if(c!==null){var X=s.baseState;g=0,H=z=T=null,y=c;do{var G=y.lane&-536870913,k=G!==y.lane;if(k?(_e&G)===G:(i&G)===G){G!==0&&G===ta&&(co=!0),H!==null&&(H=H.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ae=e,de=y;G=t;var ke=n;switch(de.tag){case 1:if(ae=de.payload,typeof ae=="function"){X=ae.call(ke,X,G);break e}X=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=de.payload,G=typeof ae=="function"?ae.call(ke,X,G):ae,G==null)break e;X=v({},X,G);break e;case 2:$n=!0}}G=y.callback,G!==null&&(e.flags|=64,k&&(e.flags|=8192),k=s.callbacks,k===null?s.callbacks=[G]:k.push(G))}else k={lane:G,tag:y.tag,payload:y.payload,callback:y.callback,next:null},H===null?(z=H=k,T=X):H=H.next=k,g|=G;if(y=y.next,y===null){if(y=s.shared.pending,y===null)break;k=y,y=k.next,k.next=null,s.lastBaseUpdate=k,s.shared.pending=null}}while(!0);H===null&&(T=X),s.baseState=T,s.firstBaseUpdate=z,s.lastBaseUpdate=H,c===null&&(s.shared.lanes=0),Jn|=g,e.lanes=g,e.memoizedState=X}}function Ff(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function Yf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ff(n[e],t)}var ra=x(null),hl=x(0);function $f(e,t){e=Cn,J(hl,e),J(ra,t),Cn=e|t.baseLanes}function fo(){J(hl,Cn),J(ra,ra.current)}function ho(){Cn=hl.current,D(ra),D(hl)}var Nt=x(null),Ht=null;function Zn(e){var t=e.alternate;J(Qe,Qe.current&1),J(Nt,e),Ht===null&&(t===null||ra.current!==null||t.memoizedState!==null)&&(Ht=e)}function mo(e){J(Qe,Qe.current),J(Nt,e),Ht===null&&(Ht=e)}function Vf(e){e.tag===22?(J(Qe,Qe.current),J(Nt,e),Ht===null&&(Ht=e)):Qn()}function Qn(){J(Qe,Qe.current),J(Nt,Nt.current)}function Ct(e){D(Nt),Ht===e&&(Ht=null),D(Qe)}var Qe=x(0);function ml(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Es(n)||Ss(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 En=0,ve=null,Oe=null,Je=null,gl=!1,la=!1,xi=!1,pl=0,tr=0,ua=null,_v=0;function Ve(){throw Error(a(321))}function go(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 po(e,t,n,i,s,c){return En=c,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Cd:Lo,xi=!1,c=n(i,s),xi=!1,la&&(c=Zf(t,n,i,s)),Xf(e),c}function Xf(e){O.H=ar;var t=Oe!==null&&Oe.next!==null;if(En=0,Je=Oe=ve=null,gl=!1,tr=0,ua=null,t)throw Error(a(300));e===null||We||(e=e.dependencies,e!==null&&ll(e)&&(We=!0))}function Zf(e,t,n,i){ve=e;var s=0;do{if(la&&(ua=null),tr=0,la=!1,25<=s)throw Error(a(301));if(s+=1,Je=Oe=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}O.H=Rd,c=t(n,i)}while(la);return c}function Av(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?nr(t):t,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(ve.flags|=1024),t}function vo(){var e=pl!==0;return pl=0,e}function yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bo(e){if(gl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gl=!1}En=0,Je=Oe=ve=null,la=!1,tr=pl=0,ua=null}function gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?ve.memoizedState=Je=e:Je=Je.next=e,Je}function Ke(){if(Oe===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=Je===null?ve.memoizedState:Je.next;if(t!==null)Je=t,Oe=e;else{if(e===null)throw ve.alternate===null?Error(a(467)):Error(a(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},Je===null?ve.memoizedState=Je=e:Je=Je.next=e}return Je}function vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nr(e){var t=tr;return tr+=1,ua===null&&(ua=[]),e=kf(ua,e,t),t=ve,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Cd:Lo),e}function yl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return nr(e);if(e.$$typeof===V)return ot(e)}throw Error(a(438,String(e)))}function Eo(e){var t=null,n=ve.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=ve.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=vl(),ve.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]=P;return t.index++,n}function Sn(e,t){return typeof t=="function"?t(e):t}function bl(e){var t=Ke();return So(t,Oe,e)}function So(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 g=s.next;s.next=c.next,c.next=g}t.baseQueue=s=c,i.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var y=g=null,T=null,z=t,H=!1;do{var X=z.lane&-536870913;if(X!==z.lane?(_e&X)===X:(En&X)===X){var G=z.revertLane;if(G===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),X===ta&&(H=!0);else if((En&G)===G){z=z.next,G===ta&&(H=!0);continue}else X={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(y=T=X,g=c):T=T.next=X,ve.lanes|=G,Jn|=G;X=z.action,xi&&n(c,X),c=z.hasEagerState?z.eagerState:n(c,X)}else G={lane:X,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(y=T=G,g=c):T=T.next=G,ve.lanes|=X,Jn|=X;z=z.next}while(z!==null&&z!==t);if(T===null?g=c:T.next=y,!_t(c,e.memoizedState)&&(We=!0,H&&(n=na,n!==null)))throw n;e.memoizedState=c,e.baseState=g,e.baseQueue=T,i.lastRenderedState=c}return s===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function wo(e){var t=Ke(),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 g=s=s.next;do c=e(c,g.action),g=g.next;while(g!==s);_t(c,t.memoizedState)||(We=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function Qf(e,t,n){var i=ve,s=Ke(),c=Ne;if(c){if(n===void 0)throw Error(a(407));n=n()}else n=t();var g=!_t((Oe||s).memoizedState,n);if(g&&(s.memoizedState=n,We=!0),s=s.queue,_o(Jf.bind(null,i,s,e),[e]),s.getSnapshot!==t||g||Je!==null&&Je.memoizedState.tag&1){if(i.flags|=2048,oa(9,{destroy:void 0},If.bind(null,i,s,n,t),null),je===null)throw Error(a(349));c||(En&127)!==0||Kf(i,t,n)}return n}function Kf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t=vl(),ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function If(e,t,n,i){t.value=n,t.getSnapshot=i,Wf(t)&&Pf(e)}function Jf(e,t,n){return n(function(){Wf(t)&&Pf(e)})}function Wf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_t(e,n)}catch{return!0}}function Pf(e){var t=gi(e,2);t!==null&&wt(t,e,2)}function To(e){var t=gt();if(typeof e=="function"){var n=e;if(e=n(),xi){kn(!0);try{n()}finally{kn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:e},t}function ed(e,t,n,i){return e.baseState=n,So(e,Oe,typeof i=="function"?i:Sn)}function Nv(e,t,n,i,s){if(wl(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(g){c.listeners.push(g)}};O.T!==null?n(!0):c.isTransition=!1,i(c),n=t.pending,n===null?(c.next=t.pending=c,td(t,c)):(c.next=n.next,t.pending=n.next=c)}}function td(e,t){var n=t.action,i=t.payload,s=e.state;if(t.isTransition){var c=O.T,g={};O.T=g;try{var y=n(s,i),T=O.S;T!==null&&T(g,y),nd(e,t,y)}catch(z){xo(e,t,z)}finally{c!==null&&g.types!==null&&(c.types=g.types),O.T=c}}else try{c=n(s,i),nd(e,t,c)}catch(z){xo(e,t,z)}}function nd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){id(e,t,i)},function(i){return xo(e,t,i)}):id(e,t,n)}function id(e,t,n){t.status="fulfilled",t.value=n,ad(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,td(e,n)))}function xo(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,ad(t),t=t.next;while(t!==i)}e.action=null}function ad(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rd(e,t){return t}function ld(e,t){if(Ne){var n=je.formState;if(n!==null){e:{var i=ve;if(Ne){if(He){t:{for(var s=He,c=Bt;s.nodeType!==8;){if(!c){s=null;break t}if(s=qt(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){He=qt(s.nextSibling),i=s.data==="F!";break e}}Fn(i)}i=!1}i&&(t=n[0])}}return n=gt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rd,lastRenderedState:t},n.queue=i,n=_d.bind(null,ve,i),i.dispatch=n,i=To(!1),c=Do.bind(null,ve,!1,i.queue),i=gt(),s={state:t,dispatch:null,action:e,pending:null},i.queue=s,n=Nv.bind(null,ve,s,c,n),s.dispatch=n,i.memoizedState=e,[t,n,!1]}function ud(e){var t=Ke();return od(t,Oe,e)}function od(e,t,n){if(t=So(e,t,rd)[0],e=bl(Sn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=nr(t)}catch(g){throw g===ia?sl:g}else i=t;t=Ke();var s=t.queue,c=s.dispatch;return n!==t.memoizedState&&(ve.flags|=2048,oa(9,{destroy:void 0},Cv.bind(null,s,n),null)),[i,c,e]}function Cv(e,t){e.action=t}function sd(e){var t=Ke(),n=Oe;if(n!==null)return od(t,n,e);Ke(),t=t.memoizedState,n=Ke();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function oa(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=ve.updateQueue,t===null&&(t=vl(),ve.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 cd(){return Ke().memoizedState}function El(e,t,n,i){var s=gt();ve.flags|=e,s.memoizedState=oa(1|t,{destroy:void 0},n,i===void 0?null:i)}function Sl(e,t,n,i){var s=Ke();i=i===void 0?null:i;var c=s.memoizedState.inst;Oe!==null&&i!==null&&go(i,Oe.memoizedState.deps)?s.memoizedState=oa(t,c,n,i):(ve.flags|=e,s.memoizedState=oa(1|t,c,n,i))}function fd(e,t){El(8390656,8,e,t)}function _o(e,t){Sl(2048,8,e,t)}function Rv(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=vl(),ve.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function dd(e){var t=Ke().memoizedState;return Rv({ref:t,nextImpl:e}),function(){if((Me&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function hd(e,t){return Sl(4,2,e,t)}function md(e,t){return Sl(4,4,e,t)}function gd(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 pd(e,t,n){n=n!=null?n.concat([e]):null,Sl(4,4,gd.bind(null,t,e),n)}function Ao(){}function vd(e,t){var n=Ke();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&go(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function yd(e,t){var n=Ke();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&go(t,i[1]))return i[0];if(i=e(),xi){kn(!0);try{e()}finally{kn(!1)}}return n.memoizedState=[i,t],i}function No(e,t,n){return n===void 0||(En&1073741824)!==0&&(_e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=bh(),ve.lanes|=e,Jn|=e,n)}function bd(e,t,n,i){return _t(n,t)?n:ra.current!==null?(e=No(e,n,i),_t(e,t)||(We=!0),e):(En&42)===0||(En&1073741824)!==0&&(_e&261930)===0?(We=!0,e.memoizedState=n):(e=bh(),ve.lanes|=e,Jn|=e,t)}function Ed(e,t,n,i,s){var c=I.p;I.p=c!==0&&8>c?c:8;var g=O.T,y={};O.T=y,Do(e,!1,t,n);try{var T=s(),z=O.S;if(z!==null&&z(y,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var H=xv(T,i);ir(e,t,H,Lt(e))}else ir(e,t,i,Lt(e))}catch(X){ir(e,t,{then:function(){},status:"rejected",reason:X},Lt())}finally{I.p=c,g!==null&&y.types!==null&&(g.types=y.types),O.T=g}}function Dv(){}function Co(e,t,n,i){if(e.tag!==5)throw Error(a(476));var s=Sd(e).queue;Ed(e,s,t,ne,n===null?Dv:function(){return wd(e),n(i)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wd(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),ir(e,t.next.queue,{},Lt())}function Ro(){return ot(Er)}function Td(){return Ke().memoizedState}function xd(){return Ke().memoizedState}function Lv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Lt();e=Vn(n);var i=Xn(t,e,n);i!==null&&(wt(i,t,n),Wa(i,t,n)),t={cache:io()},e.payload=t;return}t=t.return}}function Mv(e,t,n){var i=Lt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},wl(e)?Ad(t,n):(n=Xu(e,t,n,i),n!==null&&(wt(n,e,i),Nd(n,t,i)))}function _d(e,t,n){var i=Lt();ir(e,t,n,i)}function ir(e,t,n,i){var s={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(wl(e))Ad(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var g=t.lastRenderedState,y=c(g,n);if(s.hasEagerState=!0,s.eagerState=y,_t(y,g))return nl(e,t,s,0),je===null&&tl(),!1}catch{}if(n=Xu(e,t,s,i),n!==null)return wt(n,e,i),Nd(n,t,i),!0}return!1}function Do(e,t,n,i){if(i={lane:2,revertLane:os(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},wl(e)){if(t)throw Error(a(479))}else t=Xu(e,n,i,2),t!==null&&wt(t,e,2)}function wl(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Ad(e,t){la=gl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Nd(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Lc(e,n)}}var ar={readContext:ot,use:yl,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};ar.useEffectEvent=Ve;var Cd={readContext:ot,use:yl,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:fd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,El(4194308,4,gd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return El(4194308,4,e,t)},useInsertionEffect:function(e,t){El(4,2,e,t)},useMemo:function(e,t){var n=gt();t=t===void 0?null:t;var i=e();if(xi){kn(!0);try{e()}finally{kn(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=gt();if(n!==void 0){var s=n(t);if(xi){kn(!0);try{n(t)}finally{kn(!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=Mv.bind(null,ve,e),[i.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:function(e){e=To(e);var t=e.queue,n=_d.bind(null,ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ao,useDeferredValue:function(e,t){var n=gt();return No(n,e,t)},useTransition:function(){var e=To(!1);return e=Ed.bind(null,ve,e.queue,!0,!1),gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=ve,s=gt();if(Ne){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),je===null)throw Error(a(349));(_e&127)!==0||Kf(i,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,fd(Jf.bind(null,i,c,e),[e]),i.flags|=2048,oa(9,{destroy:void 0},If.bind(null,i,c,n,t),null),n},useId:function(){var e=gt(),t=je.identifierPrefix;if(Ne){var n=rn,i=an;n=(i&~(1<<32-xt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=pl++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=_v++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ro,useFormState:ld,useActionState:ld,useOptimistic:function(e){var t=gt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Do.bind(null,ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:Eo,useCacheRefresh:function(){return gt().memoizedState=Lv.bind(null,ve)},useEffectEvent:function(e){var t=gt(),n={impl:e};return t.memoizedState=n,function(){if((Me&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Lo={readContext:ot,use:yl,useCallback:vd,useContext:ot,useEffect:_o,useImperativeHandle:pd,useInsertionEffect:hd,useLayoutEffect:md,useMemo:yd,useReducer:bl,useRef:cd,useState:function(){return bl(Sn)},useDebugValue:Ao,useDeferredValue:function(e,t){var n=Ke();return bd(n,Oe.memoizedState,e,t)},useTransition:function(){var e=bl(Sn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:nr(e),t]},useSyncExternalStore:Qf,useId:Td,useHostTransitionStatus:Ro,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var n=Ke();return ed(n,Oe,e,t)},useMemoCache:Eo,useCacheRefresh:xd};Lo.useEffectEvent=dd;var Rd={readContext:ot,use:yl,useCallback:vd,useContext:ot,useEffect:_o,useImperativeHandle:pd,useInsertionEffect:hd,useLayoutEffect:md,useMemo:yd,useReducer:wo,useRef:cd,useState:function(){return wo(Sn)},useDebugValue:Ao,useDeferredValue:function(e,t){var n=Ke();return Oe===null?No(n,e,t):bd(n,Oe.memoizedState,e,t)},useTransition:function(){var e=wo(Sn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:nr(e),t]},useSyncExternalStore:Qf,useId:Td,useHostTransitionStatus:Ro,useFormState:sd,useActionState:sd,useOptimistic:function(e,t){var n=Ke();return Oe!==null?ed(n,Oe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Eo,useCacheRefresh:xd};Rd.useEffectEvent=dd;function Mo(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zo={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Lt(),s=Vn(i);s.payload=t,n!=null&&(s.callback=n),t=Xn(e,s,i),t!==null&&(wt(t,e,i),Wa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Lt(),s=Vn(i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Xn(e,s,i),t!==null&&(wt(t,e,i),Wa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Lt(),i=Vn(n);i.tag=2,t!=null&&(i.callback=t),t=Xn(e,i,n),t!==null&&(wt(t,e,n),Wa(t,e,n))}};function Dd(e,t,n,i,s,c,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,g):t.prototype&&t.prototype.isPureReactComponent?!$a(n,i)||!$a(s,c):!0}function Ld(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&&zo.enqueueReplaceState(t,t.state,null)}function _i(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=v({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function Md(e){el(e)}function zd(e){console.error(e)}function Gd(e){el(e)}function Tl(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Od(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 Go(e,t,n){return n=Vn(n),n.tag=3,n.payload={element:null},n.callback=function(){Tl(e,t)},n}function Ud(e){return e=Vn(e),e.tag=3,e}function kd(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(){Od(t,n,i)}}var g=n.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Od(t,n,i),typeof s!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var y=i.stack;this.componentDidCatch(i.value,{componentStack:y!==null?y:""})})}function zv(e,t,n,i,s){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&ea(t,n,s,!0),n=Nt.current,n!==null){switch(n.tag){case 31:case 13:return Ht===null?Ol():n.alternate===null&&Xe===0&&(Xe=3),n.flags&=-257,n.flags|=65536,n.lanes=s,i===cl?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),rs(e,i,s)),!1;case 22:return n.flags|=65536,i===cl?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)),rs(e,i,s)),!1}throw Error(a(435,n.tag))}return rs(e,i,s),Ol(),!1}if(Ne)return t=Nt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Wu&&(e=Error(a(422),{cause:i}),Za(Ut(e,n)))):(i!==Wu&&(t=Error(a(423),{cause:i}),Za(Ut(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=Ut(i,n),s=Go(e.stateNode,i,s),so(e,s),Xe!==4&&(Xe=2)),!1;var c=Error(a(520),{cause:i});if(c=Ut(c,n),dr===null?dr=[c]:dr.push(c),Xe!==4&&(Xe=2),t===null)return!0;i=Ut(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=Go(n.stateNode,i,e),so(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"&&(Wn===null||!Wn.has(c))))return n.flags|=65536,s&=-s,n.lanes|=s,s=Ud(s),kd(s,e,n,i),so(n,s),!1}n=n.return}while(n!==null);return!1}var Oo=Error(a(461)),We=!1;function st(e,t,n,i){t.child=e===null?qf(t,null,n,i):Ti(t,e.child,n,i)}function jd(e,t,n,i,s){n=n.render;var c=t.ref;if("ref"in i){var g={};for(var y in i)y!=="ref"&&(g[y]=i[y])}else g=i;return bi(t),i=po(e,t,n,g,c,s),y=vo(),e!==null&&!We?(yo(e,t,s),wn(e,t,s)):(Ne&&y&&Iu(t),t.flags|=1,st(e,t,i,s),t.child)}function Bd(e,t,n,i,s){if(e===null){var c=n.type;return typeof c=="function"&&!Zu(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,Hd(e,t,c,i,s)):(e=al(n.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Yo(e,s)){var g=c.memoizedProps;if(n=n.compare,n=n!==null?n:$a,n(g,i)&&e.ref===t.ref)return wn(e,t,s)}return t.flags|=1,e=pn(c,i),e.ref=t.ref,e.return=t,t.child=e}function Hd(e,t,n,i,s){if(e!==null){var c=e.memoizedProps;if($a(c,i)&&e.ref===t.ref)if(We=!1,t.pendingProps=i=c,Yo(e,s))(e.flags&131072)!==0&&(We=!0);else return t.lanes=e.lanes,wn(e,t,s)}return Uo(e,t,n,i,s)}function qd(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 Fd(e,t,c,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ol(t,c!==null?c.cachePool:null),c!==null?$f(t,c):fo(),Vf(t);else return i=t.lanes=536870912,Fd(e,t,c!==null?c.baseLanes|n:n,n,i)}else c!==null?(ol(t,c.cachePool),$f(t,c),Qn(),t.memoizedState=null):(e!==null&&ol(t,null),fo(),Qn());return st(e,t,s,n),t.child}function rr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fd(e,t,n,i,s){var c=ro();return c=c===null?null:{parent:Ie._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&ol(t,null),fo(),Vf(t),e!==null&&ea(e,t,i,!0),t.childLanes=s,null}function xl(e,t){return t=Al({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yd(e,t,n){return Ti(t,e.child,null,n),e=xl(t,t.pendingProps),e.flags|=2,Ct(t),t.memoizedState=null,e}function Gv(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=xl(t,i),t.lanes=536870912,rr(null,e);if(mo(t),(e=He)?(e=tm(e,Bt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hn!==null?{id:an,overflow:rn}:null,retryLane:536870912,hydrationErrors:null},n=Af(e),n.return=t,t.child=n,ut=t,He=null)):e=null,e===null)throw Fn(t);return t.lanes=536870912,null}return xl(t,i)}var c=e.memoizedState;if(c!==null){var g=c.dehydrated;if(mo(t),s)if(t.flags&256)t.flags&=-257,t=Yd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(We||ea(e,t,n,!1),s=(n&e.childLanes)!==0,We||s){if(i=je,i!==null&&(g=Mc(i,n),g!==0&&g!==c.retryLane))throw c.retryLane=g,gi(e,g),wt(i,e,g),Oo;Ol(),t=Yd(e,t,n)}else e=c.treeContext,He=qt(g.nextSibling),ut=t,Ne=!0,qn=null,Bt=!1,e!==null&&Rf(t,e),t=xl(t,i),t.flags|=4096;return t}return e=pn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _l(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 Uo(e,t,n,i,s){return bi(t),n=po(e,t,n,i,void 0,s),i=vo(),e!==null&&!We?(yo(e,t,s),wn(e,t,s)):(Ne&&i&&Iu(t),t.flags|=1,st(e,t,n,s),t.child)}function $d(e,t,n,i,s,c){return bi(t),t.updateQueue=null,n=Zf(t,i,n,s),Xf(e),i=vo(),e!==null&&!We?(yo(e,t,c),wn(e,t,c)):(Ne&&i&&Iu(t),t.flags|=1,st(e,t,n,c),t.child)}function Vd(e,t,n,i,s){if(bi(t),t.stateNode===null){var c=Ii,g=n.contextType;typeof g=="object"&&g!==null&&(c=ot(g)),c=new n(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=zo,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},uo(t),g=n.contextType,c.context=typeof g=="object"&&g!==null?ot(g):Ii,c.state=t.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(Mo(t,n,g,i),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(g=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),g!==c.state&&zo.enqueueReplaceState(c,c.state,null),er(t,i,c,s),Pa(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,T=_i(n,y);c.props=T;var z=c.context,H=n.contextType;g=Ii,typeof H=="object"&&H!==null&&(g=ot(H));var X=n.getDerivedStateFromProps;H=typeof X=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,H||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||z!==g)&&Ld(t,c,i,g),$n=!1;var G=t.memoizedState;c.state=G,er(t,i,c,s),Pa(),z=t.memoizedState,y||G!==z||$n?(typeof X=="function"&&(Mo(t,n,X,i),z=t.memoizedState),(T=$n||Dd(t,n,T,i,G,z,g))?(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=z),c.props=i,c.state=z,c.context=g,i=T):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,oo(e,t),g=t.memoizedProps,H=_i(n,g),c.props=H,X=t.pendingProps,G=c.context,z=n.contextType,T=Ii,typeof z=="object"&&z!==null&&(T=ot(z)),y=n.getDerivedStateFromProps,(z=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(g!==X||G!==T)&&Ld(t,c,i,T),$n=!1,G=t.memoizedState,c.state=G,er(t,i,c,s),Pa();var k=t.memoizedState;g!==X||G!==k||$n||e!==null&&e.dependencies!==null&&ll(e.dependencies)?(typeof y=="function"&&(Mo(t,n,y,i),k=t.memoizedState),(H=$n||Dd(t,n,H,i,G,k,T)||e!==null&&e.dependencies!==null&&ll(e.dependencies))?(z||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,k,T),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,k,T)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=k),c.props=i,c.state=k,c.context=T,i=H):(typeof c.componentDidUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),i=!1)}return c=i,_l(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=Ti(t,e.child,null,s),t.child=Ti(t,null,n,s)):st(e,t,n,s),t.memoizedState=c.state,e=t.child):e=wn(e,t,s),e}function Xd(e,t,n,i){return vi(),t.flags|=256,st(e,t,n,i),t.child}var ko={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jo(e){return{baseLanes:e,cachePool:Of()}}function Bo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Dt),e}function Zd(e,t,n){var i=t.pendingProps,s=!1,c=(t.flags&128)!==0,g;if((g=c)||(g=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),g&&(s=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(s?Zn(t):Qn(),(e=He)?(e=tm(e,Bt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hn!==null?{id:an,overflow:rn}:null,retryLane:536870912,hydrationErrors:null},n=Af(e),n.return=t,t.child=n,ut=t,He=null)):e=null,e===null)throw Fn(t);return Ss(e)?t.lanes=32:t.lanes=536870912,null}var y=i.children;return i=i.fallback,s?(Qn(),s=t.mode,y=Al({mode:"hidden",children:y},s),i=pi(i,s,n,null),y.return=t,i.return=t,y.sibling=i,t.child=y,i=t.child,i.memoizedState=jo(n),i.childLanes=Bo(e,g,n),t.memoizedState=ko,rr(null,i)):(Zn(t),Ho(t,y))}var T=e.memoizedState;if(T!==null&&(y=T.dehydrated,y!==null)){if(c)t.flags&256?(Zn(t),t.flags&=-257,t=qo(e,t,n)):t.memoizedState!==null?(Qn(),t.child=e.child,t.flags|=128,t=null):(Qn(),y=i.fallback,s=t.mode,i=Al({mode:"visible",children:i.children},s),y=pi(y,s,n,null),y.flags|=2,i.return=t,y.return=t,i.sibling=y,t.child=i,Ti(t,e.child,null,n),i=t.child,i.memoizedState=jo(n),i.childLanes=Bo(e,g,n),t.memoizedState=ko,t=rr(null,i));else if(Zn(t),Ss(y)){if(g=y.nextSibling&&y.nextSibling.dataset,g)var z=g.dgst;g=z,i=Error(a(419)),i.stack="",i.digest=g,Za({value:i,source:null,stack:null}),t=qo(e,t,n)}else if(We||ea(e,t,n,!1),g=(n&e.childLanes)!==0,We||g){if(g=je,g!==null&&(i=Mc(g,n),i!==0&&i!==T.retryLane))throw T.retryLane=i,gi(e,i),wt(g,e,i),Oo;Es(y)||Ol(),t=qo(e,t,n)}else Es(y)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,He=qt(y.nextSibling),ut=t,Ne=!0,qn=null,Bt=!1,e!==null&&Rf(t,e),t=Ho(t,i.children),t.flags|=4096);return t}return s?(Qn(),y=i.fallback,s=t.mode,T=e.child,z=T.sibling,i=pn(T,{mode:"hidden",children:i.children}),i.subtreeFlags=T.subtreeFlags&65011712,z!==null?y=pn(z,y):(y=pi(y,s,n,null),y.flags|=2),y.return=t,i.return=t,i.sibling=y,t.child=i,rr(null,i),i=t.child,y=e.child.memoizedState,y===null?y=jo(n):(s=y.cachePool,s!==null?(T=Ie._currentValue,s=s.parent!==T?{parent:T,pool:T}:s):s=Of(),y={baseLanes:y.baseLanes|n,cachePool:s}),i.memoizedState=y,i.childLanes=Bo(e,g,n),t.memoizedState=ko,rr(e.child,i)):(Zn(t),n=e.child,e=n.sibling,n=pn(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=n,t.memoizedState=null,n)}function Ho(e,t){return t=Al({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Al(e,t){return e=At(22,e,null,t),e.lanes=0,e}function qo(e,t,n){return Ti(t,e.child,null,n),e=Ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qd(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),to(e.return,t,n)}function Fo(e,t,n,i,s,c){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:s,treeForkCount:c}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=i,g.tail=n,g.tailMode=s,g.treeForkCount=c)}function Kd(e,t,n){var i=t.pendingProps,s=i.revealOrder,c=i.tail;i=i.children;var g=Qe.current,y=(g&2)!==0;if(y?(g=g&1|2,t.flags|=128):g&=1,J(Qe,g),st(e,t,i,n),i=Ne?Xa:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qd(e,n,t);else if(e.tag===19)Qd(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&&ml(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Fo(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&&ml(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Fo(t,!0,n,null,c,i);break;case"together":Fo(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(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=pn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ll(e)))}function Ov(e,t,n){switch(t.tag){case 3:rt(t,t.stateNode.containerInfo),Yn(t,Ie,e.memoizedState.cache),vi();break;case 27:case 5:fn(t);break;case 4:rt(t,t.stateNode.containerInfo);break;case 10:Yn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mo(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Zn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Zd(e,t,n):(Zn(t),e=wn(e,t,n),e!==null?e.sibling:null);Zn(t);break;case 19:var s=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(ea(e,t,n,!1),i=(n&t.childLanes)!==0),s){if(i)return Kd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),J(Qe,Qe.current),i)break;return null;case 22:return t.lanes=0,qd(e,t,n,t.pendingProps);case 24:Yn(t,Ie,e.memoizedState.cache)}return wn(e,t,n)}function Id(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)We=!0;else{if(!Yo(e,n)&&(t.flags&128)===0)return We=!1,Ov(e,t,n);We=(e.flags&131072)!==0}else We=!1,Ne&&(t.flags&1048576)!==0&&Cf(t,Xa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Si(t.elementType),t.type=e,typeof e=="function")Zu(e)?(i=_i(e,i),t.tag=1,t=Vd(null,t,e,i,n)):(t.tag=0,t=Uo(null,t,e,i,n));else{if(e!=null){var s=e.$$typeof;if(s===N){t.tag=11,t=jd(null,t,e,i,n);break e}else if(s===U){t.tag=14,t=Bd(null,t,e,i,n);break e}}throw t=xe(e)||e,Error(a(306,t,""))}}return t;case 0:return Uo(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,s=_i(i,t.pendingProps),Vd(e,t,i,s,n);case 3:e:{if(rt(t,t.stateNode.containerInfo),e===null)throw Error(a(387));i=t.pendingProps;var c=t.memoizedState;s=c.element,oo(e,t),er(t,i,null,n);var g=t.memoizedState;if(i=g.cache,Yn(t,Ie,i),i!==c.cache&&no(t,[Ie],n,!0),Pa(),i=g.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Xd(e,t,i,n);break e}else if(i!==s){s=Ut(Error(a(424)),t),Za(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=qt(e.firstChild),ut=t,Ne=!0,qn=null,Bt=!0,n=qf(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vi(),i===s){t=wn(e,t,n);break e}st(e,t,i,n)}t=t.child}return t;case 26:return _l(e,t),e===null?(n=um(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,i=Fl(be.current).createElement(n),i[lt]=t,i[pt]=e,ct(i,n,e),it(i),t.stateNode=i):t.memoizedState=um(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fn(t),e===null&&Ne&&(i=t.stateNode=am(t.type,t.pendingProps,be.current),ut=t,Bt=!0,s=He,ni(t.type)?(ws=s,He=qt(i.firstChild)):He=s),st(e,t,t.pendingProps.children,n),_l(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((s=i=He)&&(i=fy(i,t.type,t.pendingProps,Bt),i!==null?(t.stateNode=i,ut=t,He=qt(i.firstChild),Bt=!1,s=!0):s=!1),s||Fn(t)),fn(t),s=t.type,c=t.pendingProps,g=e!==null?e.memoizedProps:null,i=c.children,vs(s,c)?i=null:g!==null&&vs(s,g)&&(t.flags|=32),t.memoizedState!==null&&(s=po(e,t,Av,null,null,n),Er._currentValue=s),_l(e,t),st(e,t,i,n),t.child;case 6:return e===null&&Ne&&((e=n=He)&&(n=dy(n,t.pendingProps,Bt),n!==null?(t.stateNode=n,ut=t,He=null,e=!0):e=!1),e||Fn(t)),null;case 13:return Zd(e,t,n);case 4:return rt(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ti(t,null,i,n):st(e,t,i,n),t.child;case 11:return jd(e,t,t.type,t.pendingProps,n);case 7:return st(e,t,t.pendingProps,n),t.child;case 8:return st(e,t,t.pendingProps.children,n),t.child;case 12:return st(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Yn(t,t.type,i.value),st(e,t,i.children,n),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,bi(t),s=ot(s),i=i(s),t.flags|=1,st(e,t,i,n),t.child;case 14:return Bd(e,t,t.type,t.pendingProps,n);case 15:return Hd(e,t,t.type,t.pendingProps,n);case 19:return Kd(e,t,n);case 31:return Gv(e,t,n);case 22:return qd(e,t,n,t.pendingProps);case 24:return bi(t),i=ot(Ie),e===null?(s=ro(),s===null&&(s=je,c=io(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=n),s=c),t.memoizedState={parent:i,cache:s},uo(t),Yn(t,Ie,s)):((e.lanes&n)!==0&&(oo(e,t),er(t,null,null,n),Pa()),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),Yn(t,Ie,i)):(i=c.cache,Yn(t,Ie,i),i!==s.cache&&no(t,[Ie],n,!0))),st(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Tn(e){e.flags|=4}function $o(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(Th())e.flags|=8192;else throw wi=cl,lo}else e.flags&=-16777217}function Jd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!dm(t))if(Th())e.flags|=8192;else throw wi=cl,lo}function Nl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Rc():536870912,e.lanes|=t,da|=t)}function lr(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 Uv(e,t,n){var i=t.pendingProps;switch(Ju(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),bn(Ie),Fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pi(t)?Tn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Pu())),qe(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(Tn(t),c!==null?(qe(t),Jd(t,c)):(qe(t),$o(t,s,null,i,n))):c?c!==e.memoizedState?(Tn(t),qe(t),Jd(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Tn(t),qe(t),$o(t,s,e,i,n)),null;case 27:if(Un(t),n=be.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Tn(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return qe(t),null}e=ie.current,Pi(t)?Df(t):(e=am(s,i,n),t.stateNode=e,Tn(t))}return qe(t),null;case 5:if(Un(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Tn(t);else{if(!i){if(t.stateNode===null)throw Error(a(166));return qe(t),null}if(c=ie.current,Pi(t))Df(t);else{var g=Fl(be.current);switch(c){case 1:c=g.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=g.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=g.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=g.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=g.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?g.createElement("select",{is:i.is}):g.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?g.createElement(s,{is:i.is}):g.createElement(s)}}c[lt]=t,c[pt]=i;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)c.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=c;e:switch(ct(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&&Tn(t)}}return qe(t),$o(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Tn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(a(166));if(e=be.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,s=ut,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Zh(e.nodeValue,n)),e||Fn(t,!0)}else e=Fl(e).createTextNode(i),e[lt]=t,t.stateNode=e}return qe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Pi(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[lt]=t}else vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else n=Pu(),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=Pi(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[lt]=t}else vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),s=!1}else s=Pu(),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),Nl(t,t.updateQueue),qe(t),null);case 4:return Fe(),e===null&&ds(t.stateNode.containerInfo),qe(t),null;case 10:return bn(t.type),qe(t),null;case 19:if(D(Qe),i=t.memoizedState,i===null)return qe(t),null;if(s=(t.flags&128)!==0,c=i.rendering,c===null)if(s)lr(i,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=ml(e),c!==null){for(t.flags|=128,lr(i,!1),e=c.updateQueue,t.updateQueue=e,Nl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_f(n,e),n=n.sibling;return J(Qe,Qe.current&1|2),Ne&&vn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&F()>Ml&&(t.flags|=128,s=!0,lr(i,!1),t.lanes=4194304)}else{if(!s)if(e=ml(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Nl(t,e),lr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Ne)return qe(t),null}else 2*F()-i.renderingStartTime>Ml&&n!==536870912&&(t.flags|=128,s=!0,lr(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=F(),e.sibling=null,n=Qe.current,J(Qe,s?n&1|2:n&1),Ne&&vn(t,i.treeForkCount),e):(qe(t),null);case 22:case 23:return Ct(t),ho(),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&&Nl(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&&D(Ei),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bn(Ie),qe(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function kv(e,t){switch(Ju(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bn(Ie),Fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Un(t),null;case 31:if(t.memoizedState!==null){if(Ct(t),t.alternate===null)throw Error(a(340));vi()}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));vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Qe),null;case 4:return Fe(),null;case 10:return bn(t.type),null;case 22:case 23:return Ct(t),ho(),e!==null&&D(Ei),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return bn(Ie),null;case 25:return null;default:return null}}function Wd(e,t){switch(Ju(t),t.tag){case 3:bn(Ie),Fe();break;case 26:case 27:case 5:Un(t);break;case 4:Fe();break;case 31:t.memoizedState!==null&&Ct(t);break;case 13:Ct(t);break;case 19:D(Qe);break;case 10:bn(t.type);break;case 22:case 23:Ct(t),ho(),e!==null&&D(Ei);break;case 24:bn(Ie)}}function ur(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,g=n.inst;i=c(),g.destroy=i}n=n.next}while(n!==s)}}catch(y){Ge(t,t.return,y)}}function Kn(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 g=i.inst,y=g.destroy;if(y!==void 0){g.destroy=void 0,s=t;var T=n,z=y;try{z()}catch(H){Ge(s,T,H)}}}i=i.next}while(i!==c)}}catch(H){Ge(t,t.return,H)}}function Pd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Yf(t,n)}catch(i){Ge(e,e.return,i)}}}function eh(e,t,n){n.props=_i(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Ge(e,t,i)}}function or(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){Ge(e,t,s)}}function ln(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(s){Ge(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){Ge(e,t,s)}else n.current=null}function th(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){Ge(e,e.return,s)}}function Vo(e,t,n){try{var i=e.stateNode;ry(i,e.type,n,t),i[pt]=t}catch(s){Ge(e,e.return,s)}}function nh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ni(e.type)||e.tag===4}function Xo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nh(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&&ni(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 Zo(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=mn));else if(i!==4&&(i===27&&ni(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zo(e,t,n),e=e.sibling;e!==null;)Zo(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&&ni(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 ih(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ct(t,i,n),t[lt]=e,t[pt]=n}catch(c){Ge(e,e.return,c)}}var xn=!1,Pe=!1,Qo=!1,ah=typeof WeakSet=="function"?WeakSet:Set,at=null;function jv(e,t){if(e=e.containerInfo,gs=Kl,e=pf(e),Hu(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 g=0,y=-1,T=-1,z=0,H=0,X=e,G=null;t:for(;;){for(var k;X!==n||s!==0&&X.nodeType!==3||(y=g+s),X!==c||i!==0&&X.nodeType!==3||(T=g+i),X.nodeType===3&&(g+=X.nodeValue.length),(k=X.firstChild)!==null;)G=X,X=k;for(;;){if(X===e)break t;if(G===n&&++z===s&&(y=g),G===c&&++H===i&&(T=g),(k=X.nextSibling)!==null)break;X=G,G=X.parentNode}X=k}n=y===-1||T===-1?null:{start:y,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(ps={focusedElem:e,selectionRange:n},Kl=!1,at=t;at!==null;)if(t=at,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,at=e;else for(;at!==null;){switch(t=at,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 ae=_i(n.type,s);e=i.getSnapshotBeforeUpdate(ae,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(de){Ge(n,n.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)bs(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bs(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,at=e;break}at=t.return}}function rh(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:An(e,n),i&4&&ur(5,n);break;case 1:if(An(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(g){Ge(n,n.return,g)}else{var s=_i(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){Ge(n,n.return,g)}}i&64&&Pd(n),i&512&&or(n,n.return);break;case 3:if(An(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{Yf(e,t)}catch(g){Ge(n,n.return,g)}}break;case 27:t===null&&i&4&&ih(n);case 26:case 5:An(e,n),t===null&&i&4&&th(n),i&512&&or(n,n.return);break;case 12:An(e,n);break;case 31:An(e,n),i&4&&oh(e,n);break;case 13:An(e,n),i&4&&sh(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zv.bind(null,n),hy(e,n))));break;case 22:if(i=n.memoizedState!==null||xn,!i){t=t!==null&&t.memoizedState!==null||Pe,s=xn;var c=Pe;xn=i,(Pe=t)&&!c?Nn(e,n,(n.subtreeFlags&8772)!==0):An(e,n),xn=s,Pe=c}break;case 30:break;default:An(e,n)}}function lh(e){var t=e.alternate;t!==null&&(e.alternate=null,lh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tu(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 Ye=null,yt=!1;function _n(e,t,n){for(n=n.child;n!==null;)uh(e,t,n),n=n.sibling}function uh(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Ma,n)}catch{}switch(n.tag){case 26:Pe||ln(n,t),_n(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Pe||ln(n,t);var i=Ye,s=yt;ni(n.type)&&(Ye=n.stateNode,yt=!1),_n(e,t,n),vr(n.stateNode),Ye=i,yt=s;break;case 5:Pe||ln(n,t);case 6:if(i=Ye,s=yt,Ye=null,_n(e,t,n),Ye=i,yt=s,Ye!==null)if(yt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(n.stateNode)}catch(c){Ge(n,t,c)}else try{Ye.removeChild(n.stateNode)}catch(c){Ge(n,t,c)}break;case 18:Ye!==null&&(yt?(e=Ye,Ph(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ea(e)):Ph(Ye,n.stateNode));break;case 4:i=Ye,s=yt,Ye=n.stateNode.containerInfo,yt=!0,_n(e,t,n),Ye=i,yt=s;break;case 0:case 11:case 14:case 15:Kn(2,n,t),Pe||Kn(4,n,t),_n(e,t,n);break;case 1:Pe||(ln(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&eh(n,t,i)),_n(e,t,n);break;case 21:_n(e,t,n);break;case 22:Pe=(i=Pe)||n.memoizedState!==null,_n(e,t,n),Pe=i;break;default:_n(e,t,n)}}function oh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ea(e)}catch(n){Ge(t,t.return,n)}}}function sh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ea(e)}catch(n){Ge(t,t.return,n)}}function Bv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ah),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ah),t;default:throw Error(a(435,e.tag))}}function Rl(e,t){var n=Bv(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var s=Qv.bind(null,e,i);i.then(s,s)}})}function bt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var s=n[i],c=e,g=t,y=g;e:for(;y!==null;){switch(y.tag){case 27:if(ni(y.type)){Ye=y.stateNode,yt=!1;break e}break;case 5:Ye=y.stateNode,yt=!1;break e;case 3:case 4:Ye=y.stateNode.containerInfo,yt=!0;break e}y=y.return}if(Ye===null)throw Error(a(160));uh(c,g,s),Ye=null,yt=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ch(t,e),t=t.sibling}var Kt=null;function ch(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bt(t,e),Et(e),i&4&&(Kn(3,e,e.return),ur(3,e),Kn(5,e,e.return));break;case 1:bt(t,e),Et(e),i&512&&(Pe||n===null||ln(n,n.return)),i&64&&xn&&(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=Kt;if(bt(t,e),Et(e),i&512&&(Pe||n===null||ln(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[Oa]||c[lt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(i),s.head.insertBefore(c,s.querySelector("head > title"))),ct(c,i,n),c[lt]=e,it(c),i=c;break e;case"link":var g=cm("link","href",s).get(i+(n.href||""));if(g){for(var y=0;y<g.length;y++)if(c=g[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)){g.splice(y,1);break t}}c=s.createElement(i),ct(c,i,n),s.head.appendChild(c);break;case"meta":if(g=cm("meta","content",s).get(i+(n.content||""))){for(y=0;y<g.length;y++)if(c=g[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)){g.splice(y,1);break t}}c=s.createElement(i),ct(c,i,n),s.head.appendChild(c);break;default:throw Error(a(468,i))}c[lt]=e,it(c),i=c}e.stateNode=i}else fm(s,e.type,e.stateNode);else e.stateNode=sm(s,i,e.memoizedProps);else c!==i?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,i===null?fm(s,e.type,e.stateNode):sm(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Vo(e,e.memoizedProps,n.memoizedProps)}break;case 27:bt(t,e),Et(e),i&512&&(Pe||n===null||ln(n,n.return)),n!==null&&i&4&&Vo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bt(t,e),Et(e),i&512&&(Pe||n===null||ln(n,n.return)),e.flags&32){s=e.stateNode;try{Yi(s,"")}catch(ae){Ge(e,e.return,ae)}}i&4&&e.stateNode!=null&&(s=e.memoizedProps,Vo(e,s,n!==null?n.memoizedProps:s)),i&1024&&(Qo=!0);break;case 6:if(bt(t,e),Et(e),i&4){if(e.stateNode===null)throw Error(a(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(ae){Ge(e,e.return,ae)}}break;case 3:if(Vl=null,s=Kt,Kt=Yl(t.containerInfo),bt(t,e),Kt=s,Et(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ea(t.containerInfo)}catch(ae){Ge(e,e.return,ae)}Qo&&(Qo=!1,fh(e));break;case 4:i=Kt,Kt=Yl(e.stateNode.containerInfo),bt(t,e),Et(e),Kt=i;break;case 12:bt(t,e),Et(e);break;case 31:bt(t,e),Et(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Rl(e,i)));break;case 13:bt(t,e),Et(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ll=F()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Rl(e,i)));break;case 22:s=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,z=xn,H=Pe;if(xn=z||s,Pe=H||T,bt(t,e),Pe=H,xn=z,Et(e),i&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||T||xn||Pe||Ai(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(c=T.stateNode,s)g=c.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{y=T.stateNode;var X=T.memoizedProps.style,G=X!=null&&X.hasOwnProperty("display")?X.display:null;y.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ae){Ge(T,T.return,ae)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=s?"":T.memoizedProps}catch(ae){Ge(T,T.return,ae)}}}else if(t.tag===18){if(n===null){T=t;try{var k=T.stateNode;s?em(k,!0):em(T.stateNode,!1)}catch(ae){Ge(T,T.return,ae)}}}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,Rl(e,n))));break;case 19:bt(t,e),Et(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Rl(e,i)));break;case 30:break;case 21:break;default:bt(t,e),Et(e)}}function Et(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(nh(i)){n=i;break}i=i.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var s=n.stateNode,c=Xo(e);Cl(e,c,s);break;case 5:var g=n.stateNode;n.flags&32&&(Yi(g,""),n.flags&=-33);var y=Xo(e);Cl(e,y,g);break;case 3:case 4:var T=n.stateNode.containerInfo,z=Xo(e);Zo(e,z,T);break;default:throw Error(a(161))}}catch(H){Ge(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;fh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function An(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rh(e,t.alternate,t),t=t.sibling}function Ai(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kn(4,t,t.return),Ai(t);break;case 1:ln(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&eh(t,t.return,n),Ai(t);break;case 27:vr(t.stateNode);case 26:case 5:ln(t,t.return),Ai(t);break;case 22:t.memoizedState===null&&Ai(t);break;case 30:Ai(t);break;default:Ai(t)}e=e.sibling}}function Nn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,s=e,c=t,g=c.flags;switch(c.tag){case 0:case 11:case 15:Nn(s,c,n),ur(4,c);break;case 1:if(Nn(s,c,n),i=c,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(z){Ge(i,i.return,z)}if(i=c,s=i.updateQueue,s!==null){var y=i.stateNode;try{var T=s.shared.hiddenCallbacks;if(T!==null)for(s.shared.hiddenCallbacks=null,s=0;s<T.length;s++)Ff(T[s],y)}catch(z){Ge(i,i.return,z)}}n&&g&64&&Pd(c),or(c,c.return);break;case 27:ih(c);case 26:case 5:Nn(s,c,n),n&&i===null&&g&4&&th(c),or(c,c.return);break;case 12:Nn(s,c,n);break;case 31:Nn(s,c,n),n&&g&4&&oh(s,c);break;case 13:Nn(s,c,n),n&&g&4&&sh(s,c);break;case 22:c.memoizedState===null&&Nn(s,c,n),or(c,c.return);break;case 30:break;default:Nn(s,c,n)}t=t.sibling}}function Ko(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&&Qa(n))}function Io(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qa(e))}function It(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dh(e,t,n,i),t=t.sibling}function dh(e,t,n,i){var s=t.flags;switch(t.tag){case 0:case 11:case 15:It(e,t,n,i),s&2048&&ur(9,t);break;case 1:It(e,t,n,i);break;case 3:It(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&&Qa(e)));break;case 12:if(s&2048){It(e,t,n,i),e=t.stateNode;try{var c=t.memoizedProps,g=c.id,y=c.onPostCommit;typeof y=="function"&&y(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Ge(t,t.return,T)}}else It(e,t,n,i);break;case 31:It(e,t,n,i);break;case 13:It(e,t,n,i);break;case 23:break;case 22:c=t.stateNode,g=t.alternate,t.memoizedState!==null?c._visibility&2?It(e,t,n,i):sr(e,t):c._visibility&2?It(e,t,n,i):(c._visibility|=2,sa(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Ko(g,t);break;case 24:It(e,t,n,i),s&2048&&Io(t.alternate,t);break;default:It(e,t,n,i)}}function sa(e,t,n,i,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,g=t,y=n,T=i,z=g.flags;switch(g.tag){case 0:case 11:case 15:sa(c,g,y,T,s),ur(8,g);break;case 23:break;case 22:var H=g.stateNode;g.memoizedState!==null?H._visibility&2?sa(c,g,y,T,s):sr(c,g):(H._visibility|=2,sa(c,g,y,T,s)),s&&z&2048&&Ko(g.alternate,g);break;case 24:sa(c,g,y,T,s),s&&z&2048&&Io(g.alternate,g);break;default:sa(c,g,y,T,s)}t=t.sibling}}function sr(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:sr(n,i),s&2048&&Ko(i.alternate,i);break;case 24:sr(n,i),s&2048&&Io(i.alternate,i);break;default:sr(n,i)}t=t.sibling}}var cr=8192;function ca(e,t,n){if(e.subtreeFlags&cr)for(e=e.child;e!==null;)hh(e,t,n),e=e.sibling}function hh(e,t,n){switch(e.tag){case 26:ca(e,t,n),e.flags&cr&&e.memoizedState!==null&&_y(n,Kt,e.memoizedState,e.memoizedProps);break;case 5:ca(e,t,n);break;case 3:case 4:var i=Kt;Kt=Yl(e.stateNode.containerInfo),ca(e,t,n),Kt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=cr,cr=16777216,ca(e,t,n),cr=i):ca(e,t,n));break;default:ca(e,t,n)}}function mh(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 fr(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];at=i,ph(i,e)}mh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gh(e),e=e.sibling}function gh(e){switch(e.tag){case 0:case 11:case 15:fr(e),e.flags&2048&&Kn(9,e,e.return);break;case 3:fr(e);break;case 12:fr(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)):fr(e);break;default:fr(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];at=i,ph(i,e)}mh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kn(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 ph(e,t){for(;at!==null;){var n=at;switch(n.tag){case 0:case 11:case 15:Kn(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:Qa(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,at=i;else e:for(n=e;at!==null;){i=at;var s=i.sibling,c=i.return;if(lh(i),i===n){at=null;break e}if(s!==null){s.return=c,at=s;break e}at=c}}}var Hv={getCacheForType:function(e){var t=ot(Ie),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ot(Ie).controller.signal}},qv=typeof WeakMap=="function"?WeakMap:Map,Me=0,je=null,we=null,_e=0,ze=0,Rt=null,In=!1,fa=!1,Jo=!1,Cn=0,Xe=0,Jn=0,Ni=0,Wo=0,Dt=0,da=0,dr=null,St=null,Po=!1,Ll=0,vh=0,Ml=1/0,zl=null,Wn=null,et=0,Pn=null,ha=null,Rn=0,es=0,ts=null,yh=null,hr=0,ns=null;function Lt(){return(Me&2)!==0&&_e!==0?_e&-_e:O.T!==null?os():zc()}function bh(){if(Dt===0)if((_e&536870912)===0||Ne){var e=qr;qr<<=1,(qr&3932160)===0&&(qr=262144),Dt=e}else Dt=536870912;return e=Nt.current,e!==null&&(e.flags|=32),Dt}function wt(e,t,n){(e===je&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(ma(e,0),ei(e,_e,Dt,!1)),Ga(e,n),((Me&2)===0||e!==je)&&(e===je&&((Me&2)===0&&(Ni|=n),Xe===4&&ei(e,_e,Dt,!1)),un(e))}function Eh(e,t,n){if((Me&6)!==0)throw Error(a(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||za(e,t),s=i?$v(e,t):as(e,t,!0),c=i;do{if(s===0){fa&&!i&&ei(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Fv(n)){s=as(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var y=e;s=dr;var T=y.current.memoizedState.isDehydrated;if(T&&(ma(y,g).flags|=256),g=as(y,g,!1),g!==2){if(Jo&&!T){y.errorRecoveryDisabledLanes|=c,Ni|=c,s=4;break e}c=St,St=s,c!==null&&(St===null?St=c:St.push.apply(St,c))}s=g}if(c=!1,s!==2)continue}}if(s===1){ma(e,0),ei(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:ei(i,t,Dt,!In);break e;case 2:St=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(s=Ll+300-F(),10<s)){if(ei(i,t,Dt,!In),Yr(i,0,!0)!==0)break e;Rn=t,i.timeoutHandle=Jh(Sh.bind(null,i,n,St,zl,Po,t,Dt,Ni,da,In,c,"Throttled",-0,0),s);break e}Sh(i,n,St,zl,Po,t,Dt,Ni,da,In,c,null,-0,0)}}break}while(!0);un(e)}function Sh(e,t,n,i,s,c,g,y,T,z,H,X,G,k){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mn},hh(t,c,X);var ae=(c&62914560)===c?Ll-F():(c&4194048)===c?vh-F():0;if(ae=Ay(X,ae),ae!==null){Rn=c,e.cancelPendingCommit=ae(Rh.bind(null,e,t,c,n,i,s,g,y,T,H,X,null,G,k)),ei(e,c,g,!z);return}}Rh(e,t,c,n,i,s,g,y,T)}function Fv(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 ei(e,t,n,i){t&=~Wo,t&=~Ni,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var s=t;0<s;){var c=31-xt(s),g=1<<c;i[c]=-1,s&=~g}n!==0&&Dc(e,n,t)}function Gl(){return(Me&6)===0?(mr(0),!1):!0}function is(){if(we!==null){if(ze===0)var e=we.return;else e=we,yn=yi=null,bo(e),aa=null,Ia=0,e=we;for(;e!==null;)Wd(e.alternate,e),e=e.return;we=null}}function ma(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,oy(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Rn=0,is(),je=e,we=n=pn(e.current,null),_e=t,ze=0,Rt=null,In=!1,fa=za(e,t),Jo=!1,da=Dt=Wo=Ni=Jn=Xe=0,St=dr=null,Po=!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-xt(i),c=1<<s;t|=e[s],i&=~c}return Cn=t,tl(),n}function wh(e,t){ve=null,O.H=ar,t===ia||t===sl?(t=jf(),ze=3):t===lo?(t=jf(),ze=4):ze=t===Oo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Rt=t,we===null&&(Xe=1,Tl(e,Ut(t,e.current)))}function Th(){var e=Nt.current;return e===null?!0:(_e&4194048)===_e?Ht===null:(_e&62914560)===_e||(_e&536870912)!==0?e===Ht:!1}function xh(){var e=O.H;return O.H=ar,e===null?ar:e}function _h(){var e=O.A;return O.A=Hv,e}function Ol(){Xe=4,In||(_e&4194048)!==_e&&Nt.current!==null||(fa=!0),(Jn&134217727)===0&&(Ni&134217727)===0||je===null||ei(je,_e,Dt,!1)}function as(e,t,n){var i=Me;Me|=2;var s=xh(),c=_h();(je!==e||_e!==t)&&(zl=null,ma(e,t)),t=!1;var g=Xe;e:do try{if(ze!==0&&we!==null){var y=we,T=Rt;switch(ze){case 8:is(),g=6;break e;case 3:case 2:case 9:case 6:Nt.current===null&&(t=!0);var z=ze;if(ze=0,Rt=null,ga(e,y,T,z),n&&fa){g=0;break e}break;default:z=ze,ze=0,Rt=null,ga(e,y,T,z)}}Yv(),g=Xe;break}catch(H){wh(e,H)}while(!0);return t&&e.shellSuspendCounter++,yn=yi=null,Me=i,O.H=s,O.A=c,we===null&&(je=null,_e=0,tl()),g}function Yv(){for(;we!==null;)Ah(we)}function $v(e,t){var n=Me;Me|=2;var i=xh(),s=_h();je!==e||_e!==t?(zl=null,Ml=F()+500,ma(e,t)):fa=za(e,t);e:do try{if(ze!==0&&we!==null){t=we;var c=Rt;t:switch(ze){case 1:ze=0,Rt=null,ga(e,t,c,1);break;case 2:case 9:if(Uf(c)){ze=0,Rt=null,Nh(t);break}t=function(){ze!==2&&ze!==9||je!==e||(ze=7),un(e)},c.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Uf(c)?(ze=0,Rt=null,Nh(t)):(ze=0,Rt=null,ga(e,t,c,7));break;case 5:var g=null;switch(we.tag){case 26:g=we.memoizedState;case 5:case 27:var y=we;if(g?dm(g):y.stateNode.complete){ze=0,Rt=null;var T=y.sibling;if(T!==null)we=T;else{var z=y.return;z!==null?(we=z,Ul(z)):we=null}break t}}ze=0,Rt=null,ga(e,t,c,5);break;case 6:ze=0,Rt=null,ga(e,t,c,6);break;case 8:is(),Xe=6;break e;default:throw Error(a(462))}}Vv();break}catch(H){wh(e,H)}while(!0);return yn=yi=null,O.H=i,O.A=s,Me=n,we!==null?0:(je=null,_e=0,tl(),Xe)}function Vv(){for(;we!==null&&!yu();)Ah(we)}function Ah(e){var t=Id(e.alternate,e,Cn);e.memoizedProps=e.pendingProps,t===null?Ul(e):we=t}function Nh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$d(n,t,t.pendingProps,t.type,void 0,_e);break;case 11:t=$d(n,t,t.pendingProps,t.type.render,t.ref,_e);break;case 5:bo(t);default:Wd(n,t),t=we=_f(t,Cn),t=Id(n,t,Cn)}e.memoizedProps=e.pendingProps,t===null?Ul(e):we=t}function ga(e,t,n,i){yn=yi=null,bo(t),aa=null,Ia=0;var s=t.return;try{if(zv(e,s,t,n,_e)){Xe=1,Tl(e,Ut(n,e.current)),we=null;return}}catch(c){if(s!==null)throw we=s,c;Xe=1,Tl(e,Ut(n,e.current)),we=null;return}t.flags&32768?(Ne||i===1?e=!0:fa||(_e&536870912)!==0?e=!1:(In=e=!0,(i===2||i===9||i===3||i===6)&&(i=Nt.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ch(t,e)):Ul(t)}function Ul(e){var t=e;do{if((t.flags&32768)!==0){Ch(t,In);return}e=t.return;var n=Uv(t.alternate,t,Cn);if(n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);Xe===0&&(Xe=5)}function Ch(e,t){do{var n=kv(e.alternate,e);if(n!==null){n.flags&=32767,we=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=n}while(e!==null);Xe=6,we=null}function Rh(e,t,n,i,s,c,g,y,T){e.cancelPendingCommit=null;do kl();while(et!==0);if((Me&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(c=t.lanes|t.childLanes,c|=Vu,xp(e,n,c,g,y,T),e===je&&(we=je=null,_e=0),ha=t,Pn=e,Rn=n,es=c,ts=s,yh=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Kv(Ze,function(){return Gh(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=O.T,O.T=null,s=I.p,I.p=2,g=Me,Me|=4;try{jv(e,t,n)}finally{Me=g,I.p=s,O.T=i}}et=1,Dh(),Lh(),Mh()}}function Dh(){if(et===1){et=0;var e=Pn,t=ha,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=O.T,O.T=null;var i=I.p;I.p=2;var s=Me;Me|=4;try{ch(t,e);var c=ps,g=pf(e.containerInfo),y=c.focusedElem,T=c.selectionRange;if(g!==y&&y&&y.ownerDocument&&gf(y.ownerDocument.documentElement,y)){if(T!==null&&Hu(y)){var z=T.start,H=T.end;if(H===void 0&&(H=z),"selectionStart"in y)y.selectionStart=z,y.selectionEnd=Math.min(H,y.value.length);else{var X=y.ownerDocument||document,G=X&&X.defaultView||window;if(G.getSelection){var k=G.getSelection(),ae=y.textContent.length,de=Math.min(T.start,ae),ke=T.end===void 0?de:Math.min(T.end,ae);!k.extend&&de>ke&&(g=ke,ke=de,de=g);var A=mf(y,de),_=mf(y,ke);if(A&&_&&(k.rangeCount!==1||k.anchorNode!==A.node||k.anchorOffset!==A.offset||k.focusNode!==_.node||k.focusOffset!==_.offset)){var M=X.createRange();M.setStart(A.node,A.offset),k.removeAllRanges(),de>ke?(k.addRange(M),k.extend(_.node,_.offset)):(M.setEnd(_.node,_.offset),k.addRange(M))}}}}for(X=[],k=y;k=k.parentNode;)k.nodeType===1&&X.push({element:k,left:k.scrollLeft,top:k.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<X.length;y++){var $=X[y];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Kl=!!gs,ps=gs=null}finally{Me=s,I.p=i,O.T=n}}e.current=t,et=2}}function Lh(){if(et===2){et=0;var e=Pn,t=ha,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=O.T,O.T=null;var i=I.p;I.p=2;var s=Me;Me|=4;try{rh(e,t.alternate,t)}finally{Me=s,I.p=i,O.T=n}}et=3}}function Mh(){if(et===4||et===3){et=0,Br();var e=Pn,t=ha,n=Rn,i=yh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?et=5:(et=0,ha=Pn=null,zh(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Wn=null),Su(n),t=t.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Ma,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=O.T,s=I.p,I.p=2,O.T=null;try{for(var c=e.onRecoverableError,g=0;g<i.length;g++){var y=i[g];c(y.value,{componentStack:y.stack})}}finally{O.T=t,I.p=s}}(Rn&3)!==0&&kl(),un(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===ns?hr++:(hr=0,ns=e):hr=0,mr(0)}}function zh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qa(t)))}function kl(){return Dh(),Lh(),Mh(),Gh()}function Gh(){if(et!==5)return!1;var e=Pn,t=es;es=0;var n=Su(Rn),i=O.T,s=I.p;try{I.p=32>n?32:n,O.T=null,n=ts,ts=null;var c=Pn,g=Rn;if(et=0,ha=Pn=null,Rn=0,(Me&6)!==0)throw Error(a(331));var y=Me;if(Me|=4,gh(c.current),dh(c,c.current,g,n),Me=y,mr(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Ma,c)}catch{}return!0}finally{I.p=s,O.T=i,zh(e,t)}}function Oh(e,t,n){t=Ut(n,t),t=Go(e.stateNode,t,2),e=Xn(e,t,2),e!==null&&(Ga(e,2),un(e))}function Ge(e,t,n){if(e.tag===3)Oh(e,e,n);else for(;t!==null;){if(t.tag===3){Oh(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Wn===null||!Wn.has(i))){e=Ut(n,e),n=Ud(2),i=Xn(t,n,2),i!==null&&(kd(n,i,t,e),Ga(i,2),un(i));break}}t=t.return}}function rs(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new qv;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)||(Jo=!0,s.add(n),e=Xv.bind(null,e,t,n),t.then(e,e))}function Xv(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,je===e&&(_e&n)===n&&(Xe===4||Xe===3&&(_e&62914560)===_e&&300>F()-Ll?(Me&2)===0&&ma(e,0):Wo|=n,da===_e&&(da=0)),un(e)}function Uh(e,t){t===0&&(t=Rc()),e=gi(e,t),e!==null&&(Ga(e,t),un(e))}function Zv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Uh(e,n)}function Qv(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),Uh(e,n)}function Kv(e,t){return Oi(e,t)}var jl=null,pa=null,ls=!1,Bl=!1,us=!1,ti=0;function un(e){e!==pa&&e.next===null&&(pa===null?jl=pa=e:pa=pa.next=e),Bl=!0,ls||(ls=!0,Jv())}function mr(e,t){if(!us&&Bl){us=!0;do for(var n=!1,i=jl;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var c=0;else{var g=i.suspendedLanes,y=i.pingedLanes;c=(1<<31-xt(42|e)+1)-1,c&=s&~(g&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Hh(i,c))}else c=_e,c=Yr(i,i===je?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||za(i,c)||(n=!0,Hh(i,c));i=i.next}while(n);us=!1}}function Iv(){kh()}function kh(){Bl=ls=!1;var e=0;ti!==0&&uy()&&(e=ti);for(var t=F(),n=null,i=jl;i!==null;){var s=i.next,c=jh(i,t);c===0?(i.next=null,n===null?jl=s:n.next=s,s===null&&(pa=n)):(n=i,(e!==0||(c&3)!==0)&&(Bl=!0)),i=s}et!==0&&et!==5||mr(e),ti!==0&&(ti=0)}function jh(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var g=31-xt(c),y=1<<g,T=s[g];T===-1?((y&n)===0||(y&i)!==0)&&(s[g]=Tp(y,t)):T<=t&&(e.expiredLanes|=y),c&=~y}if(t=je,n=_e,n=Yr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ui(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||za(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&Ui(i),Su(n)){case 2:case 8:n=Se;break;case 32:n=Ze;break;case 268435456:n=Mt;break;default:n=Ze}return i=Bh.bind(null,e),n=Oi(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&Ui(i),e.callbackPriority=2,e.callbackNode=null,2}function Bh(e,t){if(et!==0&&et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(kl()&&e.callbackNode!==n)return null;var i=_e;return i=Yr(e,e===je?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Eh(e,i,t),jh(e,F()),e.callbackNode!=null&&e.callbackNode===n?Bh.bind(null,e):null)}function Hh(e,t){if(kl())return null;Eh(e,t,!0)}function Jv(){sy(function(){(Me&6)!==0?Oi($e,Iv):kh()})}function os(){if(ti===0){var e=ta;e===0&&(e=Hr,Hr<<=1,(Hr&261888)===0&&(Hr=256)),ti=e}return ti}function qh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zr(""+e)}function Fh(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 Wv(e,t,n,i,s){if(t==="submit"&&n&&n.stateNode===s){var c=qh((s[pt]||null).action),g=i.submitter;g&&(t=(t=g[pt]||null)?qh(t.formAction):g.getAttribute("formAction"),t!==null&&(c=t,g=null));var y=new Jr("action","action",null,i,s);e.push({event:y,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ti!==0){var T=g?Fh(s,g):new FormData(s);Co(n,{pending:!0,data:T,method:s.method,action:c},null,T)}}else typeof c=="function"&&(y.preventDefault(),T=g?Fh(s,g):new FormData(s),Co(n,{pending:!0,data:T,method:s.method,action:c},c,T))},currentTarget:s}]})}}for(var ss=0;ss<$u.length;ss++){var cs=$u[ss],Pv=cs.toLowerCase(),ey=cs[0].toUpperCase()+cs.slice(1);Qt(Pv,"on"+ey)}Qt(bf,"onAnimationEnd"),Qt(Ef,"onAnimationIteration"),Qt(Sf,"onAnimationStart"),Qt("dblclick","onDoubleClick"),Qt("focusin","onFocus"),Qt("focusout","onBlur"),Qt(pv,"onTransitionRun"),Qt(vv,"onTransitionStart"),Qt(yv,"onTransitionCancel"),Qt(wf,"onTransitionEnd"),qi("onMouseEnter",["mouseout","mouseover"]),qi("onMouseLeave",["mouseout","mouseover"]),qi("onPointerEnter",["pointerout","pointerover"]),qi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gr="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(" "),ty=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gr));function Yh(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 g=i.length-1;0<=g;g--){var y=i[g],T=y.instance,z=y.currentTarget;if(y=y.listener,T!==c&&s.isPropagationStopped())break e;c=y,s.currentTarget=z;try{c(s)}catch(H){el(H)}s.currentTarget=null,c=T}else for(g=0;g<i.length;g++){if(y=i[g],T=y.instance,z=y.currentTarget,y=y.listener,T!==c&&s.isPropagationStopped())break e;c=y,s.currentTarget=z;try{c(s)}catch(H){el(H)}s.currentTarget=null,c=T}}}}function Te(e,t){var n=t[wu];n===void 0&&(n=t[wu]=new Set);var i=e+"__bubble";n.has(i)||($h(t,e,2,!1),n.add(i))}function fs(e,t,n){var i=0;t&&(i|=4),$h(n,e,i,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function ds(e){if(!e[Hl]){e[Hl]=!0,Uc.forEach(function(n){n!=="selectionchange"&&(ty.has(n)||fs(n,!1,e),fs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,fs("selectionchange",!1,t))}}function $h(e,t,n,i){switch(bm(t)){case 2:var s=Ry;break;case 8:s=Dy;break;default:s=Ns}n=s.bind(null,t,n,e),s=void 0,!Lu||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 hs(e,t,n,i,s){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var g=i.tag;if(g===3||g===4){var y=i.stateNode.containerInfo;if(y===s)break;if(g===4)for(g=i.return;g!==null;){var T=g.tag;if((T===3||T===4)&&g.stateNode.containerInfo===s)return;g=g.return}for(;y!==null;){if(g=ji(y),g===null)return;if(T=g.tag,T===5||T===6||T===26||T===27){i=c=g;continue e}y=y.parentNode}}i=i.return}Qc(function(){var z=c,H=Ru(n),X=[];e:{var G=Tf.get(e);if(G!==void 0){var k=Jr,ae=e;switch(e){case"keypress":if(Kr(n)===0)break e;case"keydown":case"keyup":k=Qp;break;case"focusin":ae="focus",k=Ou;break;case"focusout":ae="blur",k=Ou;break;case"beforeblur":case"afterblur":k=Ou;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":k=Jc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":k=Up;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":k=Jp;break;case bf:case Ef:case Sf:k=Bp;break;case wf:k=Pp;break;case"scroll":case"scrollend":k=Gp;break;case"wheel":k=tv;break;case"copy":case"cut":case"paste":k=qp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":k=Pc;break;case"toggle":case"beforetoggle":k=iv}var de=(t&4)!==0,ke=!de&&(e==="scroll"||e==="scrollend"),A=de?G!==null?G+"Capture":null:G;de=[];for(var _=z,M;_!==null;){var $=_;if(M=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||M===null||A===null||($=ka(_,A),$!=null&&de.push(pr(_,$,M))),ke)break;_=_.return}0<de.length&&(G=new k(G,ae,null,n,H),X.push({event:G,listeners:de}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",G&&n!==Cu&&(ae=n.relatedTarget||n.fromElement)&&(ji(ae)||ae[ki]))break e;if((k||G)&&(G=H.window===H?H:(G=H.ownerDocument)?G.defaultView||G.parentWindow:window,k?(ae=n.relatedTarget||n.toElement,k=z,ae=ae?ji(ae):null,ae!==null&&(ke=f(ae),de=ae.tag,ae!==ke||de!==5&&de!==27&&de!==6)&&(ae=null)):(k=null,ae=z),k!==ae)){if(de=Jc,$="onMouseLeave",A="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(de=Pc,$="onPointerLeave",A="onPointerEnter",_="pointer"),ke=k==null?G:Ua(k),M=ae==null?G:Ua(ae),G=new de($,_+"leave",k,n,H),G.target=ke,G.relatedTarget=M,$=null,ji(H)===z&&(de=new de(A,_+"enter",ae,n,H),de.target=M,de.relatedTarget=ke,$=de),ke=$,k&&ae)t:{for(de=ny,A=k,_=ae,M=0,$=A;$;$=de($))M++;$=0;for(var ce=_;ce;ce=de(ce))$++;for(;0<M-$;)A=de(A),M--;for(;0<$-M;)_=de(_),$--;for(;M--;){if(A===_||_!==null&&A===_.alternate){de=A;break t}A=de(A),_=de(_)}de=null}else de=null;k!==null&&Vh(X,G,k,de,!1),ae!==null&&ke!==null&&Vh(X,ke,ae,de,!0)}}e:{if(G=z?Ua(z):window,k=G.nodeName&&G.nodeName.toLowerCase(),k==="select"||k==="input"&&G.type==="file")var De=of;else if(lf(G))if(sf)De=hv;else{De=fv;var re=cv}else k=G.nodeName,!k||k.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?z&&Nu(z.elementType)&&(De=of):De=dv;if(De&&(De=De(e,z))){uf(X,De,n,H);break e}re&&re(e,G,z),e==="focusout"&&z&&G.type==="number"&&z.memoizedProps.value!=null&&Au(G,"number",G.value)}switch(re=z?Ua(z):window,e){case"focusin":(lf(re)||re.contentEditable==="true")&&(Zi=re,qu=z,Va=null);break;case"focusout":Va=qu=Zi=null;break;case"mousedown":Fu=!0;break;case"contextmenu":case"mouseup":case"dragend":Fu=!1,vf(X,n,H);break;case"selectionchange":if(gv)break;case"keydown":case"keyup":vf(X,n,H)}var ye;if(ku)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Xi?af(e,n)&&(Ae="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ae="onCompositionStart");Ae&&(ef&&n.locale!=="ko"&&(Xi||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Xi&&(ye=Kc()):(Bn=H,Mu="value"in Bn?Bn.value:Bn.textContent,Xi=!0)),re=ql(z,Ae),0<re.length&&(Ae=new Wc(Ae,e,null,n,H),X.push({event:Ae,listeners:re}),ye?Ae.data=ye:(ye=rf(n),ye!==null&&(Ae.data=ye)))),(ye=rv?lv(e,n):uv(e,n))&&(Ae=ql(z,"onBeforeInput"),0<Ae.length&&(re=new Wc("onBeforeInput","beforeinput",null,n,H),X.push({event:re,listeners:Ae}),re.data=ye)),Wv(X,e,z,n,H)}Yh(X,t)})}function pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ql(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=ka(e,n),s!=null&&i.unshift(pr(e,s,c)),s=ka(e,t),s!=null&&i.push(pr(e,s,c))),e.tag===3)return i;e=e.return}return[]}function ny(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vh(e,t,n,i,s){for(var c=t._reactName,g=[];n!==null&&n!==i;){var y=n,T=y.alternate,z=y.stateNode;if(y=y.tag,T!==null&&T===i)break;y!==5&&y!==26&&y!==27||z===null||(T=z,s?(z=ka(n,c),z!=null&&g.unshift(pr(n,z,T))):s||(z=ka(n,c),z!=null&&g.push(pr(n,z,T)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var iy=/\r\n?/g,ay=/\u0000|\uFFFD/g;function Xh(e){return(typeof e=="string"?e:""+e).replace(iy,`
10
+ `).replace(ay,"")}function Zh(e,t){return t=Xh(t),Xh(e)===t}function Ue(e,t,n,i,s,c){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Yi(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Yi(e,""+i);break;case"className":Vr(e,"class",i);break;case"tabIndex":Vr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Vr(e,n,i);break;case"style":Xc(e,i,c);break;case"data":if(t!=="object"){Vr(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=Zr(""+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"&&Ue(e,t,"name",s.name,s,null),Ue(e,t,"formEncType",s.formEncType,s,null),Ue(e,t,"formMethod",s.formMethod,s,null),Ue(e,t,"formTarget",s.formTarget,s,null)):(Ue(e,t,"encType",s.encType,s,null),Ue(e,t,"method",s.method,s,null),Ue(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Zr(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=mn);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("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=Zr(""+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":Te("beforetoggle",e),Te("toggle",e),$r(e,"popover",i);break;case"xlinkActuate":hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":hn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":hn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":hn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":hn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":$r(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=Mp.get(n)||n,$r(e,n,i))}}function ms(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"?Yi(e,i):(typeof i=="number"||typeof i=="bigint")&&Yi(e,""+i);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"onClick":i!=null&&(e.onclick=mn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kc.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[pt]||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,""):$r(e,n,i)}}}function ct(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var i=!1,s=!1,c;for(c in n)if(n.hasOwnProperty(c)){var g=n[c];if(g!=null)switch(c){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Ue(e,t,c,g,n,null)}}s&&Ue(e,t,"srcSet",n.srcSet,n,null),i&&Ue(e,t,"src",n.src,n,null);return;case"input":Te("invalid",e);var y=c=g=s=null,T=null,z=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":g=H;break;case"checked":T=H;break;case"defaultChecked":z=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:Ue(e,t,i,H,n,null)}}Fc(e,c,y,T,z,g,s,!1);return;case"select":Te("invalid",e),i=g=c=null;for(s in n)if(n.hasOwnProperty(s)&&(y=n[s],y!=null))switch(s){case"value":c=y;break;case"defaultValue":g=y;break;case"multiple":i=y;default:Ue(e,t,s,y,n,null)}t=c,n=g,e.multiple=!!i,t!=null?Fi(e,!!i,t,!1):n!=null&&Fi(e,!!i,n,!0);return;case"textarea":Te("invalid",e),c=s=i=null;for(g in n)if(n.hasOwnProperty(g)&&(y=n[g],y!=null))switch(g){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:Ue(e,t,g,y,n,null)}$c(e,i,s,c);return;case"option":for(T in n)n.hasOwnProperty(T)&&(i=n[T],i!=null)&&(T==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Ue(e,t,T,i,n,null));return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(i=0;i<gr.length;i++)Te(gr[i],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("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(z in n)if(n.hasOwnProperty(z)&&(i=n[z],i!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Ue(e,t,z,i,n,null)}return;default:if(Nu(t)){for(H in n)n.hasOwnProperty(H)&&(i=n[H],i!==void 0&&ms(e,t,H,i,n,void 0));return}}for(y in n)n.hasOwnProperty(y)&&(i=n[y],i!=null&&Ue(e,t,y,i,n,null))}function ry(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,g=null,y=null,T=null,z=null,H=null;for(k in n){var X=n[k];if(n.hasOwnProperty(k)&&X!=null)switch(k){case"checked":break;case"value":break;case"defaultValue":T=X;default:i.hasOwnProperty(k)||Ue(e,t,k,null,i,X)}}for(var G in i){var k=i[G];if(X=n[G],i.hasOwnProperty(G)&&(k!=null||X!=null))switch(G){case"type":c=k;break;case"name":s=k;break;case"checked":z=k;break;case"defaultChecked":H=k;break;case"value":g=k;break;case"defaultValue":y=k;break;case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(137,t));break;default:k!==X&&Ue(e,t,G,k,i,X)}}_u(e,g,y,T,z,H,c,s);return;case"select":k=g=y=G=null;for(c in n)if(T=n[c],n.hasOwnProperty(c)&&T!=null)switch(c){case"value":break;case"multiple":k=T;default:i.hasOwnProperty(c)||Ue(e,t,c,null,i,T)}for(s in i)if(c=i[s],T=n[s],i.hasOwnProperty(s)&&(c!=null||T!=null))switch(s){case"value":G=c;break;case"defaultValue":y=c;break;case"multiple":g=c;default:c!==T&&Ue(e,t,s,c,i,T)}t=y,n=g,i=k,G!=null?Fi(e,!!n,G,!1):!!i!=!!n&&(t!=null?Fi(e,!!n,t,!0):Fi(e,!!n,n?[]:"",!1));return;case"textarea":k=G=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:Ue(e,t,y,null,i,s)}for(g in i)if(s=i[g],c=n[g],i.hasOwnProperty(g)&&(s!=null||c!=null))switch(g){case"value":G=s;break;case"defaultValue":k=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(a(91));break;default:s!==c&&Ue(e,t,g,s,i,c)}Yc(e,G,k);return;case"option":for(var ae in n)G=n[ae],n.hasOwnProperty(ae)&&G!=null&&!i.hasOwnProperty(ae)&&(ae==="selected"?e.selected=!1:Ue(e,t,ae,null,i,G));for(T in i)G=i[T],k=n[T],i.hasOwnProperty(T)&&G!==k&&(G!=null||k!=null)&&(T==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Ue(e,t,T,G,i,k));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 de in n)G=n[de],n.hasOwnProperty(de)&&G!=null&&!i.hasOwnProperty(de)&&Ue(e,t,de,null,i,G);for(z in i)if(G=i[z],k=n[z],i.hasOwnProperty(z)&&G!==k&&(G!=null||k!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(a(137,t));break;default:Ue(e,t,z,G,i,k)}return;default:if(Nu(t)){for(var ke in n)G=n[ke],n.hasOwnProperty(ke)&&G!==void 0&&!i.hasOwnProperty(ke)&&ms(e,t,ke,void 0,i,G);for(H in i)G=i[H],k=n[H],!i.hasOwnProperty(H)||G===k||G===void 0&&k===void 0||ms(e,t,H,G,i,k);return}}for(var A in n)G=n[A],n.hasOwnProperty(A)&&G!=null&&!i.hasOwnProperty(A)&&Ue(e,t,A,null,i,G);for(X in i)G=i[X],k=n[X],!i.hasOwnProperty(X)||G===k||G==null&&k==null||Ue(e,t,X,G,i,k)}function Qh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ly(){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,g=s.initiatorType,y=s.duration;if(c&&y&&Qh(g)){for(g=0,y=s.responseEnd,i+=1;i<n.length;i++){var T=n[i],z=T.startTime;if(z>y)break;var H=T.transferSize,X=T.initiatorType;H&&Qh(X)&&(T=T.responseEnd,g+=H*(T<y?1:(y-z)/(T-z)))}if(--i,t+=8*(c+g)/(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 gs=null,ps=null;function Fl(e){return e.nodeType===9?e:e.ownerDocument}function Kh(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 Ih(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 vs(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 ys=null;function uy(){var e=window.event;return e&&e.type==="popstate"?e===ys?!1:(ys=e,!0):(ys=null,!1)}var Jh=typeof setTimeout=="function"?setTimeout:void 0,oy=typeof clearTimeout=="function"?clearTimeout:void 0,Wh=typeof Promise=="function"?Promise:void 0,sy=typeof queueMicrotask=="function"?queueMicrotask:typeof Wh<"u"?function(e){return Wh.resolve(null).then(e).catch(cy)}:Jh;function cy(e){setTimeout(function(){throw e})}function ni(e){return e==="head"}function Ph(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),Ea(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")vr(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,vr(n);for(var c=n.firstChild;c;){var g=c.nextSibling,y=c.nodeName;c[Oa]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=g}}else n==="body"&&vr(e.ownerDocument.body);n=s}while(n);Ea(t)}function em(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 bs(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":bs(n),Tu(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function fy(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[Oa])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=qt(e.nextSibling),e===null)break}return null}function dy(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=qt(e.nextSibling),e===null))return null;return e}function tm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qt(e.nextSibling),e===null))return null;return e}function Es(e){return e.data==="$?"||e.data==="$~"}function Ss(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hy(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 qt(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 ws=null;function nm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return qt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function im(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 am(e,t,n){switch(t=Fl(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 vr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tu(e)}var Ft=new Map,rm=new Set;function Yl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Dn=I.d;I.d={f:my,r:gy,D:py,C:vy,L:yy,m:by,X:Sy,S:Ey,M:wy};function my(){var e=Dn.f(),t=Gl();return e||t}function gy(e){var t=Bi(e);t!==null&&t.tag===5&&t.type==="form"?wd(t):Dn.r(e)}var va=typeof document>"u"?null:document;function lm(e,t,n){var i=va;if(i&&typeof t=="string"&&t){var s=Gt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),rm.has(s)||(rm.add(s),e={rel:e,crossOrigin:n,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),ct(t,"link",e),it(t),i.head.appendChild(t)))}}function py(e){Dn.D(e),lm("dns-prefetch",e,null)}function vy(e,t){Dn.C(e,t),lm("preconnect",e,t)}function yy(e,t,n){Dn.L(e,t,n);var i=va;if(i&&e&&t){var s='link[rel="preload"][as="'+Gt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Gt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Gt(n.imageSizes)+'"]')):s+='[href="'+Gt(e)+'"]';var c=s;switch(t){case"style":c=ya(e);break;case"script":c=ba(e)}Ft.has(c)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ft.set(c,e),i.querySelector(s)!==null||t==="style"&&i.querySelector(yr(c))||t==="script"&&i.querySelector(br(c))||(t=i.createElement("link"),ct(t,"link",e),it(t),i.head.appendChild(t)))}}function by(e,t){Dn.m(e,t);var n=va;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Gt(i)+'"][href="'+Gt(e)+'"]',c=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ba(e)}if(!Ft.has(c)&&(e=v({rel:"modulepreload",href:e},t),Ft.set(c,e),n.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(br(c)))return}i=n.createElement("link"),ct(i,"link",e),it(i),n.head.appendChild(i)}}}function Ey(e,t,n){Dn.S(e,t,n);var i=va;if(i&&e){var s=Hi(i).hoistableStyles,c=ya(e);t=t||"default";var g=s.get(c);if(!g){var y={loading:0,preload:null};if(g=i.querySelector(yr(c)))y.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ft.get(c))&&Ts(e,n);var T=g=i.createElement("link");it(T),ct(T,"link",e),T._p=new Promise(function(z,H){T.onload=z,T.onerror=H}),T.addEventListener("load",function(){y.loading|=1}),T.addEventListener("error",function(){y.loading|=2}),y.loading|=4,$l(g,t,i)}g={type:"stylesheet",instance:g,count:1,state:y},s.set(c,g)}}}function Sy(e,t){Dn.X(e,t);var n=va;if(n&&e){var i=Hi(n).hoistableScripts,s=ba(e),c=i.get(s);c||(c=n.querySelector(br(s)),c||(e=v({src:e,async:!0},t),(t=Ft.get(s))&&xs(e,t),c=n.createElement("script"),it(c),ct(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function wy(e,t){Dn.M(e,t);var n=va;if(n&&e){var i=Hi(n).hoistableScripts,s=ba(e),c=i.get(s);c||(c=n.querySelector(br(s)),c||(e=v({src:e,async:!0,type:"module"},t),(t=Ft.get(s))&&xs(e,t),c=n.createElement("script"),it(c),ct(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function um(e,t,n,i){var s=(s=be.current)?Yl(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=ya(n.href),n=Hi(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=ya(n.href);var c=Hi(s).hoistableStyles,g=c.get(e);if(g||(s=s.ownerDocument||s,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,g),(c=s.querySelector(yr(e)))&&!c._p&&(g.instance=c,g.state.loading=5),Ft.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},Ft.set(e,n),c||Ty(s,e,n,g.state))),t&&i===null)throw Error(a(528,""));return g}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=ba(n),n=Hi(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 ya(e){return'href="'+Gt(e)+'"'}function yr(e){return'link[rel="stylesheet"]['+e+"]"}function om(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function Ty(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}),ct(t,"link",n),it(t),e.head.appendChild(t))}function ba(e){return'[src="'+Gt(e)+'"]'}function br(e){return"script[async]"+e}function sm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Gt(n.href)+'"]');if(i)return t.instance=i,it(i),i;var s=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),it(i),ct(i,"style",s),$l(i,n.precedence,e),t.instance=i;case"stylesheet":s=ya(n.href);var c=e.querySelector(yr(s));if(c)return t.state.loading|=4,t.instance=c,it(c),c;i=om(n),(s=Ft.get(s))&&Ts(i,s),c=(e.ownerDocument||e).createElement("link"),it(c);var g=c;return g._p=new Promise(function(y,T){g.onload=y,g.onerror=T}),ct(c,"link",i),t.state.loading|=4,$l(c,n.precedence,e),t.instance=c;case"script":return c=ba(n.src),(s=e.querySelector(br(c)))?(t.instance=s,it(s),s):(i=n,(s=Ft.get(c))&&(i=v({},n),xs(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),it(s),ct(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,$l(i,n.precedence,e));return t.instance}function $l(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,g=0;g<i.length;g++){var y=i[g];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 Ts(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function xs(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vl=null;function cm(e,t,n){if(Vl===null){var i=new Map,s=Vl=new Map;s.set(n,i)}else s=Vl,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[Oa]||c[lt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var g=c.getAttribute(t)||"";g=e+g;var y=i.get(g);y?y.push(c):i.set(g,[c])}}return i}function fm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function xy(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 dm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _y(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=ya(i.href),c=t.querySelector(yr(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xl.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,it(c);return}c=t.ownerDocument||t,i=om(i),(s=Ft.get(s))&&Ts(i,s),c=c.createElement("link"),it(c);var g=c;g._p=new Promise(function(y,T){g.onload=y,g.onerror=T}),ct(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=Xl.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var _s=0;function Ay(e,t){return e.stylesheets&&e.count===0&&Ql(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Ql(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&_s===0&&(_s=62500*ly());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ql(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>_s?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Xl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ql(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zl=null;function Ql(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zl=new Map,t.forEach(Ny,e),Zl=null,Xl.call(e))}function Ny(e,t){if(!(t.state.loading&4)){var n=Zl.get(e);if(n)var i=n.get(null);else{n=new Map,Zl.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var g=s[c];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(n.set(g.dataset.precedence,g),i=g)}i&&n.set(null,i)}s=t.instance,g=s.getAttribute("data-precedence"),c=n.get(g)||i,c===i&&n.set(null,s),n.set(g,s),this.count++,i=Xl.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 Er={$$typeof:V,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Cy(e,t,n,i,s,c,g,y,T){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=bu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bu(0),this.hiddenUpdates=bu(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function hm(e,t,n,i,s,c,g,y,T,z,H,X){return e=new Cy(e,t,n,g,T,z,H,X,y),t=1,c===!0&&(t|=24),c=At(3,null,null,t),e.current=c,c.stateNode=e,t=io(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:n,cache:t},uo(c),e}function mm(e){return e?(e=Ii,e):Ii}function gm(e,t,n,i,s,c){s=mm(s),i.context===null?i.context=s:i.pendingContext=s,i=Vn(t),i.payload={element:n},c=c===void 0?null:c,c!==null&&(i.callback=c),n=Xn(e,i,t),n!==null&&(wt(n,e,t),Wa(n,e,t))}function pm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function As(e,t){pm(e,t),(e=e.alternate)&&pm(e,t)}function vm(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&wt(t,e,67108864),As(e,67108864)}}function ym(e){if(e.tag===13||e.tag===31){var t=Lt();t=Eu(t);var n=gi(e,t);n!==null&&wt(n,e,t),As(e,t)}}var Kl=!0;function Ry(e,t,n,i){var s=O.T;O.T=null;var c=I.p;try{I.p=2,Ns(e,t,n,i)}finally{I.p=c,O.T=s}}function Dy(e,t,n,i){var s=O.T;O.T=null;var c=I.p;try{I.p=8,Ns(e,t,n,i)}finally{I.p=c,O.T=s}}function Ns(e,t,n,i){if(Kl){var s=Cs(i);if(s===null)hs(e,t,i,Il,n),Em(e,i);else if(My(s,e,t,n,i))i.stopPropagation();else if(Em(e,i),t&4&&-1<Ly.indexOf(e)){for(;s!==null;){var c=Bi(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var g=ci(c.pendingLanes);if(g!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;g;){var T=1<<31-xt(g);y.entanglements[1]|=T,g&=~T}un(c),(Me&6)===0&&(Ml=F()+500,mr(0))}}break;case 31:case 13:y=gi(c,2),y!==null&&wt(y,c,2),Gl(),As(c,2)}if(c=Cs(i),c===null&&hs(e,t,i,Il,n),c===s)break;s=c}s!==null&&i.stopPropagation()}else hs(e,t,i,null,n)}}function Cs(e){return e=Ru(e),Rs(e)}var Il=null;function Rs(e){if(Il=null,e=ji(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=h(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 Il=e,null}function bm(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(Ee()){case $e:return 2;case Se:return 8;case Ze:case nt:return 32;case Mt:return 268435456;default:return 32}default:return 32}}var Ds=!1,ii=null,ai=null,ri=null,Sr=new Map,wr=new Map,li=[],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 Em(e,t){switch(e){case"focusin":case"focusout":ii=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":Sr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wr.delete(t.pointerId)}}function Tr(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=Bi(t),t!==null&&vm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function My(e,t,n,i,s){switch(t){case"focusin":return ii=Tr(ii,e,t,n,i,s),!0;case"dragenter":return ai=Tr(ai,e,t,n,i,s),!0;case"mouseover":return ri=Tr(ri,e,t,n,i,s),!0;case"pointerover":var c=s.pointerId;return Sr.set(c,Tr(Sr.get(c)||null,e,t,n,i,s)),!0;case"gotpointercapture":return c=s.pointerId,wr.set(c,Tr(wr.get(c)||null,e,t,n,i,s)),!0}return!1}function Sm(e){var t=ji(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,Gc(e.priority,function(){ym(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Gc(e.priority,function(){ym(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 Jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cs(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Cu=i,n.target.dispatchEvent(i),Cu=null}else return t=Bi(n),t!==null&&vm(t),e.blockedOn=n,!1;t.shift()}return!0}function wm(e,t,n){Jl(e)&&n.delete(t)}function zy(){Ds=!1,ii!==null&&Jl(ii)&&(ii=null),ai!==null&&Jl(ai)&&(ai=null),ri!==null&&Jl(ri)&&(ri=null),Sr.forEach(wm),wr.forEach(wm)}function Wl(e,t){e.blockedOn===t&&(e.blockedOn=null,Ds||(Ds=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,zy)))}var Pl=null;function Tm(e){Pl!==e&&(Pl=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){Pl===e&&(Pl=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(Rs(i||n)===null)continue;break}var c=Bi(n);c!==null&&(e.splice(t,3),t-=3,Co(c,{pending:!0,data:s,method:n.method,action:i},i,s))}}))}function Ea(e){function t(T){return Wl(T,e)}ii!==null&&Wl(ii,e),ai!==null&&Wl(ai,e),ri!==null&&Wl(ri,e),Sr.forEach(t),wr.forEach(t);for(var n=0;n<li.length;n++){var i=li[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<li.length&&(n=li[0],n.blockedOn===null);)Sm(n),n.blockedOn===null&&li.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],g=s[pt]||null;if(typeof c=="function")g||Tm(n);else if(g){var y=null;if(c&&c.hasAttribute("formAction")){if(s=c,g=c[pt]||null)y=g.formAction;else if(Rs(s)!==null)continue}else y=g.action;typeof y=="function"?n[i+1]=y:(n.splice(i,3),i-=3),Tm(n)}}}function xm(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(g){return s=g})},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 Ls(e){this._internalRoot=e}eu.prototype.render=Ls.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current,i=Lt();gm(n,i,e,t,null,null)},eu.prototype.unmount=Ls.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gm(e.current,2,null,e,null,null),Gl(),t[ki]=null}};function eu(e){this._internalRoot=e}eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=zc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<li.length&&t!==0&&t<li[n].priority;n++);li.splice(n,0,e),n===0&&Sm(e)}};var _m=r.version;if(_m!=="19.2.8")throw Error(a(527,_m,"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=p(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Gy={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{Ma=tu.inject(Gy),Tt=tu}catch{}}return _r.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,i="",s=Md,c=zd,g=Gd;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&&(g=t.onRecoverableError)),t=hm(e,1,!1,null,null,n,i,null,s,c,g,xm),e[ki]=t.current,ds(e),new Ls(t)},_r.hydrateRoot=function(e,t,n){if(!o(e))throw Error(a(299));var i=!1,s="",c=Md,g=zd,y=Gd,T=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&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=hm(e,1,!0,t,n??null,i,s,T,c,g,y,xm),t.context=mm(null),n=t.current,i=Lt(),i=Eu(i),s=Vn(i),s.callback=null,Xn(n,s,i),n=i,t.current.lanes=n,Ga(t,n),un(t),e[ki]=t.current,ds(e),new eu(t)},_r.version="19.2.8",_r}var Om;function Vy(){if(Om)return Gs.exports;Om=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(),Gs.exports=$y(),Gs.exports}var Xy=Vy();const Zy="modulepreload",Qy=function(u,r){return new URL(u,r).href},Um={},Li=function(r,l,a){let o=Promise.resolve();if(l&&l.length>0){let p=function(b){return Promise.all(b.map(v=>Promise.resolve(v).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");o=p(l.map(b=>{if(b=Qy(b,a),b in Um)return;Um[b]=!0;const v=b.endsWith(".css"),S=v?'[rel="stylesheet"]':"";if(a)for(let C=d.length-1;C>=0;C--){const R=d[C];if(R.href===b&&(!v||R.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${S}`))return;const w=document.createElement("link");if(w.rel=v?"stylesheet":Zy,v||(w.as="script"),w.crossOrigin="",w.href=b,m&&w.setAttribute("nonce",m),document.head.appendChild(w),v)return new Promise((C,R)=>{w.addEventListener("load",C),w.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${b}`)))})}))}function f(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return o.then(d=>{for(const h of d||[])h.status==="rejected"&&f(h.reason);return r().catch(f)})},js="lat.md",Ky=""+new URL("logo-small-RR_KBOAT.svg",import.meta.url).href,Iy=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function Tg(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 Iy.compare(l.name,a.name)||l.name.localeCompare(a.name)}).map(l=>l.kind==="directory"?{...l,children:Tg(l.children,`${l.path}/${l.name}.md`)}:l)}function Jy(u){const r=`${u.path}/${u.name}.md`;return u.children.find(l=>l.kind==="file"&&l.path===r)??null}function Wy(u){u&&(u.open=!0)}function ic(u,r){return u.kind==="file"?r[u.path]??0:u.children.reduce((l,a)=>l+ic(a,r),0)}function ac(u,r){if(u.kind==="file")return r[u.path]??null;let l=null;for(const a of u.children){const o=ac(a,r);if(o==="modified")return"modified";o==="new"&&(l="new")}return l}function xg(u){const r=new Map;for(const l of u){const a=l.path.split("/").filter(Boolean);if(a.length===0)continue;let o=r;for(let d=0;d<a.length-1;d++){const h=a[d],m=a.slice(0,d+1).join("/"),p=o.get(h);if(p?.kind==="file")break;const b=p??{kind:"directory",name:h,path:m,children:new Map};o.set(h,b),o=b.children}const f=a[a.length-1];o.set(f,{kind:"file",name:f,path:l.path,...l.externalTarget?{externalTarget:l.externalTarget}:{},...l.externalPathTarget?{externalPathTarget:l.externalPathTarget}:{}})}return Tg(r,"lat.md")}function Py(u){return xg(u.map(r=>({path:r})))}function eb(u){if(u.length===0)return[];const[r]=xg(u.map(l=>({path:`@external/${l.handle}/${l.path}`,externalTarget:l.target,externalPathTarget:`${l.handle}:${l.path}`})));return r?.kind==="directory"?r.children:[]}function tb(u){const r=u.toLowerCase();return r.endsWith(".md")?"markdown":r.endsWith(".rst")?"restructuredtext":r.endsWith(".adoc")||r.endsWith(".asciidoc")?"asciidoc":null}function _g(u){return tb(u)!==null}function Gn(){return typeof window>"u"?null:window.__LAT_STATIC_VIEW__?.basePath??null}function nb(){return Gn()!==null}function ib(u,r=Gn()){return!r||!u.startsWith("/assets/")?u:`${r}${u.slice(1)}`}function Di(u){const r=Gn();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 Ag(u){const r=Gn();return r?`${r}${u.replace(/^\//,"")}`:null}const rc="/docs/",du=".md";function ab(u){return u.split("/").map(encodeURIComponent).join("/")}function rb(u){if(!u.startsWith(rc))return null;try{const r=u.slice(rc.length).split("/").map(decodeURIComponent).join("/");return r&&!r.endsWith("/")?r:null}catch{return null}}function lb(u,r=""){const l=u.endsWith(du)?u.slice(0,-du.length):u;return`${rc}${ab(l)}${r?`#${encodeURIComponent(r)}`:""}`}function ub(u){const r=rb(u);return!r||r.toLowerCase().endsWith(du)?null:`${r}${du}`}const km="/code/",lc="/external/";function hu(u){const r=lb(u);return Ag(r.slice(1))??r}function sn(u){return ub(Di(u))}function ob(u){const r=u.indexOf(":"),l=u.indexOf("#",r+1),a=u.slice(0,r),o=l===-1?u.slice(r+1):u.slice(r+1,l),f=l===-1?"":u.slice(l+1),d=o.split("/").map(encodeURIComponent).join("/"),h=`external/${encodeURIComponent(a)}/${d}/`;return`${Ag(h)??`${lc}${encodeURIComponent(a)}/${d}`}${f?`#${encodeURIComponent(f)}`:""}`}function sb(u){const r=new URL(u,"http://lat.local"),l=Pt(r.pathname,r.hash);return sn(r.pathname)||l&&_g(l.path)?`${r.pathname}${r.search}`:`${r.pathname}${r.search}${r.hash}`}function cb(u,r){const l=Pt(u.pathname,u.hash),a=Pt(r.pathname,r.hash);return(sn(u.pathname)!==null||l!==null&&a!==null)&&u.origin===r.origin&&u.pathname===r.pathname&&u.search===r.search}function Pt(u,r=""){if(u=Di(u),!u.startsWith(lc))return null;try{const l=u.slice(lc.length).split("/").map(decodeURIComponent),a=l.shift()??"",o=l.join("/");if(!a||!o)return null;const f=Or(r);return{handle:a,path:o,fragment:f,identity:`${a}:${o}${f?`#${f}`:""}`}}catch{return null}}function Mi(u){if(u=Di(u),!u.startsWith(km))return null;try{return u.slice(km.length).split("/").map(decodeURIComponent).join("/")}catch{return null}}function Or(u){if(!u)return"";try{return decodeURIComponent(u.slice(1))}catch{return u.slice(1)}}function fb(u){return new URLSearchParams(u).get("q")??""}function db(u){return u?`/search?${new URLSearchParams({q:u})}`:"/search"}function hb(u){return new URLSearchParams(u).get("node")??""}function mb(u){return new URLSearchParams(u).get("target")??""}function gb(u){return`lat.ui.graph-mode:${u??"/"}`}function pb(u,r){return u.getItem(r)==="true"}function vb(u,r,l){l?u.setItem(r,"true"):u.removeItem(r)}function Ng(u){const r=Number(u);return Number.isInteger(r)&&r>0?r:0}function yb(u,r){const l=sn(u.pathname);if(l!==null)return`document:${l}`;const a=Pt(u.pathname,u.hash);if(a)return r==="document"||r===void 0&&_g(a.path)?`external-document:${a.handle}:${a.path}`:`external-source:${a.identity}`;const o=Mi(u.pathname);if(o===null)return"";const f=Ng(u.searchParams.get("at"));if(f>0)return`code-ref:${o}:${f}`;const d=Or(u.hash);return`source:${o}${d?`#${d}`:""}`}function Bs(u){return`${u.pathname}${u.search}${u.hash}`}function uc(u,r){const l=sn(r.pathname);if(l!==null){const m=u.nodes.find(p=>p.kind==="document"&&p.documentPath===l);return m?{nodeId:m.id,target:Bs(r)}:null}const a=Pt(r.pathname,r.hash);if(a){const m=[`external-document:${a.handle}:${a.path}`,`external-source:${a.identity}`],p=u.nodes.find(b=>m.includes(b.id));return p?{nodeId:p.id,target:Bs(r)}:null}const o=Mi(r.pathname);if(o===null)return null;const f=Ng(r.searchParams.get("at")),d=Or(r.hash);let h;return f>0&&(h=u.nodes.find(m=>m.kind==="code-reference"&&m.sourcePath===o&&m.line===f)),!h&&d&&(h=u.nodes.find(m=>m.kind==="source"&&m.sourcePath===o&&m.symbol===d)),!h&&!d&&f===0&&(h=u.nodes.find(m=>m.kind==="source"&&m.sourcePath===o&&!m.symbol)),h?{nodeId:h.id,target:Bs(r)}:null}function Cg(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 oc(u,r,l,a){if(!l)return r.url;const o=Cg(l,r.url,a),f=o?uc(u,o):null;return f?.nodeId===r.id?f.target:r.url}const Rg="latSearchReturnTo",Dg="latScrollPosition";function bb(u){return{[Rg]:u}}function Eb(u){if(!u||typeof u!="object")return null;const r=u[Rg];return typeof r=="string"&&r.startsWith("/")?r:null}function Sb(u,r){return{...u&&typeof u=="object"&&!Array.isArray(u)?u:{},[Dg]:r}}function wb(u){if(!u||typeof u!="object")return null;const r=u[Dg];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 Tb(u){return u?"clear":"close"}function xb(u){return u==="/search"?"close":"open"}function _b(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 Lg(u,r,l){if(!u.externalTarget)return u.path===r;const a=l?.split("#",1)[0]??null;return a===u.externalTarget||a===u.externalPathTarget}function Mg(u,r,l){return u.kind==="file"?Lg(u,r,l):u.children.some(a=>Mg(a,r,l))}function jm(u){return u.externalTarget?ob(u.externalTarget):hu(u.path)}function sc({activePath:u,activeExternalTarget:r,errorCounts:l,gitFiles:a,node:o,onNavigate:f}){if(o.kind==="directory"){const m=Jy(o),p=ic(o,l),b=ac(o,a);return E.jsxs("details",{className:"tree-directory",open:Mg(o,u,r)||void 0,children:[E.jsx("summary",{children:m?E.jsxs("a",{href:jm(m),onClick:v=>{Wy(v.currentTarget.closest("details")),f(v)},children:[E.jsx("span",{className:"document-link-name",children:o.name}),(p>0||b)&&E.jsx(Hs,{errorCount:p,gitStatus:b})]}):E.jsxs("span",{children:[E.jsx("span",{className:"document-link-name",children:o.name}),(p>0||b)&&E.jsx(Hs,{errorCount:p,gitStatus:b})]})}),E.jsx("div",{className:"tree-children",children:o.children.map(v=>E.jsx(sc,{activePath:u,activeExternalTarget:r,errorCounts:l,gitFiles:a,node:v,onNavigate:f},v.path))})]})}const d=ic(o,l),h=ac(o,a);return E.jsxs("a",{className:Lg(o,u,r)?"document-link active":"document-link",href:jm(o),onClick:f,children:[E.jsx("span",{className:"document-link-name",children:o.name.replace(/\.md$/i,"")}),(d>0||h)&&E.jsx(Hs,{errorCount:d,gitStatus:h})]})}function Hs({errorCount:u,gitStatus:r}){const a=[u>0?`${u} validation ${u===1?"error":"errors"}`:"",r?`${r} in Git`:""].filter(Boolean).join("; ");return E.jsx("span",{"aria-label":a,className:`document-state-disc${u>0?" has-errors":""}${r?` git-${r}`:""}`,role:"img",title:a})}function Ab({activePath:u,activeExternalTarget:r,errorCounts:l,externalFiles:a,files:o,gitFiles:f,onNavigate:d}){const h=q.useMemo(()=>Py(o),[o]),m=q.useMemo(()=>eb(a),[a]);return E.jsxs("div",{className:"file-tree",children:[h.map(p=>E.jsx(sc,{activePath:u,activeExternalTarget:r,errorCounts:l,gitFiles:f,node:p,onNavigate:d},p.path)),m.length>0&&E.jsxs("div",{className:"file-tree-section-label",children:[E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[E.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),E.jsx("path",{d:"M3.5 12h17M12 3.5c2.2 2.3 3.4 5.1 3.4 8.5s-1.2 6.2-3.4 8.5M12 3.5C9.8 5.8 8.6 8.6 8.6 12s1.2 6.2 3.4 8.5"})]}),E.jsx("span",{children:"External sources"})]}),m.map(p=>E.jsx(sc,{activePath:u,activeExternalTarget:r,errorCounts:l,gitFiles:f,node:p,onNavigate:d},p.path))]},u??r??void 0)}const Nb="https://tiles.openfreemap.org/styles/liberty",Ar="lat-document-geometry",Cb="lat-document-geometry-fill",Rb="lat-document-geometry-line",Db="lat-document-geometry-point";let Lb=0;function gu(u){let r=null;return()=>{if(!r){const a=u().catch(o=>{throw r===a&&(r=null),o});r=a}return r}}const Mb=gu(()=>Li(()=>import("./maplibre-gl-DnqZgfUS.js").then(u=>u.m),[],import.meta.url)),zb=gu(()=>Li(()=>import("./index-BnENo9bV.js"),[],import.meta.url)),Gb=gu(async()=>{const{default:u}=await Li(async()=>{const{default:r}=await import("./mermaid.core-bds9A7e2.js").then(l=>l.cb);return{default:r}},[],import.meta.url);return u.initialize({maxTextSize:5e4,securityLevel:"strict",startOnLoad:!1,suppressErrorRendering:!0,theme:"neutral"}),u}),Ob=gu(async()=>{const[u,{OrbitControls:r},{STLLoader:l}]=await Promise.all([Li(()=>import("./three.module-PDSP0dbZ.js"),[],import.meta.url),Li(()=>import("./OrbitControls-DwcpQNja.js"),__vite__mapDeps([0,1]),import.meta.url),Li(()=>import("./STLLoader-CLWTKt5i.js"),__vite__mapDeps([2,1]),import.meta.url)]);return{OrbitControls:r,STLLoader:l,three:u}});function Ub(){return`lat-mermaid-${Lb++}`}function Ta(u){return u instanceof Error?u.message:String(u)}function kb(u){const r=JSON.parse(u);if(!r||typeof r!="object"||!("type"in r)||typeof r.type!="string")throw new Error("expected a GeoJSON object with a type");return r}function jb(u,r){const l=JSON.parse(u);if(l.type!=="Topology"||!l.objects)throw new Error("expected a TopoJSON Topology with objects");const a=l,o=[];for(const f of Object.values(l.objects)){const d=r.feature(a,f);d.type==="FeatureCollection"?o.push(...d.features):o.push(d)}return{type:"FeatureCollection",features:o}}function Bb(u){let r=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;const f=h=>{if(Array.isArray(h)){if(h.length>=2&&typeof h[0]=="number"&&typeof h[1]=="number"){const[m,p]=h;Number.isFinite(m)&&Number.isFinite(p)&&(r=Math.min(r,m),l=Math.min(l,p),a=Math.max(a,m),o=Math.max(o,p));return}for(const m of h)f(m)}},d=h=>{if(!h||typeof h!="object")return;const m=h;if(m.type==="FeatureCollection")for(const p of m.features??[])d(p);else if(m.type==="Feature")d(m.geometry);else if(m.type==="GeometryCollection")for(const p of m.geometries??[])d(p);else f(m.coordinates)};return d(u),Number.isFinite(r)?[[r,l],[a,o]]:null}function Hb(){return{version:8,sources:{},layers:[]}}function qb(u,r,l){u.getSource(Ar)||(u.addSource(Ar,{type:"geojson",data:r}),u.addLayer({id:Cb,type:"fill",source:Ar,filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":l,"fill-opacity":.24}}),u.addLayer({id:Rb,type:"line",source:Ar,filter:["any",["==",["geometry-type"],"LineString"],["==",["geometry-type"],"Polygon"]],paint:{"line-color":l,"line-opacity":.94,"line-width":3}}),u.addLayer({id:Db,type:"circle",source:Ar,filter:["==",["geometry-type"],"Point"],paint:{"circle-color":l,"circle-opacity":.9,"circle-radius":6,"circle-stroke-color":"#ffffff","circle-stroke-width":2}}))}function Fb(u,r){if(!r){u.jumpTo({center:[0,0],zoom:1});return}const[[l,a],[o,f]]=r;if(l===o&&a===f){u.jumpTo({center:[l,a],zoom:12});return}u.fitBounds(r,{duration:0,maxZoom:12,padding:36})}function Yb(u,r){if(!/^\s*solid(?:\s|$)/i.test(u)||!/\bfacet\s+normal\b/i.test(u))throw new Error("expected an ASCII STL solid with facets");const l=new r().parse(u);if(l.getAttribute("position").count<3)throw l.dispose(),new Error("the STL model has no triangles");return l}const $b=new Set(["a","circle","clipPath","defs","desc","div","ellipse","feBlend","feColorMatrix","feComposite","feDropShadow","feFlood","feGaussianBlur","feMerge","feMergeNode","feOffset","filter","foreignObject","g","image","line","linearGradient","marker","mask","p","path","pattern","polygon","polyline","radialGradient","rect","small","span","stop","style","svg","text","title","tspan","use"]);function Vb(u){return u.startsWith("--")?u:(u.startsWith("-ms-")&&(u=u.slice(1)),u.replace(/-([a-z])/g,(r,l)=>l.toUpperCase()))}function Xb(u){const r=u.style,l={};for(let a=0;a<r.length;a++){const o=r.item(a);l[Vb(o)]=r.getPropertyValue(o)}return l}function Zb(u){return u==="class"?"className":u==="for"?"htmlFor":u==="tabindex"?"tabIndex":u==="xlink:href"?"xlinkHref":u==="xml:space"?"xmlSpace":u.startsWith("aria-")||u.startsWith("data-")?u:u.replace(/[-:]([a-z])/g,(r,l)=>l.toUpperCase())}function Qb(u){return!/^\s*(?:javascript|vbscript|data):/i.test(u)}function zg(u){if(u.nodeType===Node.TEXT_NODE)return{type:"text",value:u.textContent??""};if(u.nodeType!==Node.ELEMENT_NODE)return null;const r=u,l=r.localName;if(!$b.has(l))return null;const a={};for(const o of Array.from(r.attributes)){const f=Zb(o.name);/^on/i.test(f)||(f==="href"||f==="xlinkHref")&&!Qb(o.value)||(a[f]=f==="style"?Xb(r):o.value)}return{type:"element",tagName:l,properties:a,children:Array.from(r.childNodes).map(zg).filter(o=>o!==null)}}function Kb(u){const r=new DOMParser().parseFromString(u,"image/svg+xml");if(r.querySelector("parsererror"))throw new Error("Mermaid returned invalid SVG");const a=zg(r.documentElement);if(!a||a.type!=="element"||a.tagName!=="svg")throw new Error("Mermaid did not return an SVG document");return a}function Gg(u,r){return u.type==="text"?u.value:q.createElement(u.tagName,{...u.properties,key:r},u.children.map((l,a)=>Gg(l,`${r}.${a}`)))}function vc({fallback:u,label:r,message:l,onRetry:a}){return E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"markdown-diagram-error markdown-map-error",role:"alert",children:[E.jsxs("span",{children:["Could not render ",r,": ",l]}),E.jsx("button",{className:"markdown-diagram-retry",onClick:a,type:"button",children:"Retry"})]}),u]})}function Ib({fallback:u,source:r}){const l=q.useRef(null),[a,o]=q.useState(0),[f,d]=q.useState(""),[h,m]=q.useState(null);return q.useEffect(()=>{let p=!0;return d(""),m(null),Gb().then(b=>b.render(Ub(),r)).then(b=>{p&&m({root:Kb(b.svg),bind:b.bindFunctions})}).catch(b=>{p&&d(Ta(b))}),()=>{p=!1}},[a,r]),q.useLayoutEffect(()=>{h?.bind&&l.current&&h.bind(l.current)},[h]),f?E.jsx(vc,{fallback:u,label:"Mermaid diagram",message:f,onRetry:()=>o(p=>p+1)}):h?E.jsx("div",{"aria-label":"Mermaid diagram",className:"markdown-diagram markdown-mermaid",ref:l,role:"img",children:Gg(h.root,"svg")}):u}function Jb({fallback:u,kind:r,source:l}){const a=q.useRef(null),o=q.useRef(null),[f,d]=q.useState(0),[h,m]=q.useState(""),[p,b]=q.useState("loading"),v=r==="topojson"?"TopoJSON map":"GeoJSON map";return q.useLayoutEffect(()=>{let S=!0,w=null,C=null;return m(""),b("loading"),Promise.all([Mb(),r==="topojson"?zb():Promise.resolve(null)]).then(([R,j])=>{if(!S||!a.current||!o.current)return;const Y=r==="topojson"?jb(l,j):kb(l),Z=getComputedStyle(o.current).getPropertyValue("--link").trim()||"#0969da";C=new R.Map({attributionControl:{compact:!1},container:a.current,scrollZoom:!1,style:Nb}),C.addControl(new R.NavigationControl({showCompass:!1}),"top-left"),Fb(C,Bb(Y));let V=!1,N=!1;const L=U=>{S&&m(Ta(U))},B=U=>{!S||V||N||!C||(N=!0,b("fallback"),o.current?.setAttribute("title",`Basemap unavailable; showing supplied geometry only: ${Ta(U)}`),C.setStyle(Hb(),{diff:!1}))};w=window.setTimeout(()=>B(new Error("OpenFreeMap request timed out")),1e4),C.on("style.load",()=>{if(!(!S||!C))try{qb(C,Y,Z),V=!0,w!==null&&window.clearTimeout(w),w=null,b(N?"fallback":"ready"),N||o.current?.removeAttribute("title")}catch(U){L(U)}}),C.on("error",U=>B(U.error))}).catch(R=>{S&&m(Ta(R))}),()=>{S=!1,w!==null&&window.clearTimeout(w),C?.remove()}},[f,r,l]),h?E.jsx(vc,{fallback:u,label:v,message:h,onRetry:()=>d(S=>S+1)}):E.jsxs("figure",{"aria-busy":p==="loading","aria-label":v,className:"markdown-diagram markdown-map","data-basemap-status":p,ref:o,children:[E.jsx("div",{className:"markdown-map-canvas",ref:a}),p==="loading"&&E.jsxs("div",{className:"markdown-map-status",role:"status",children:["Loading ",v,"…"]})]})}function Wb({modules:u,onError:r,source:l}){const a=q.useRef(null),o=q.useRef(null);return q.useLayoutEffect(()=>{if(!a.current||!o.current)return;const f=[];try{const{OrbitControls:d,STLLoader:h,three:m}=u,p=Yb(l,h);f.push(()=>p.dispose()),p.computeBoundingBox();const b=p.boundingBox.getCenter(new m.Vector3);p.translate(-b.x,-b.y,-b.z),p.computeBoundingBox(),p.computeBoundingSphere();const v=Math.max(p.boundingSphere?.radius??0,.001),S=new m.Scene,w=new m.PerspectiveCamera(42,1,v/100,v*100),C=v*3.2;w.position.set(C,C*.72,C),w.lookAt(0,0,0);const R=new m.WebGLRenderer({antialias:!0,alpha:!0,canvas:a.current});f.push(()=>R.dispose()),R.setPixelRatio(Math.min(window.devicePixelRatio||1,2));const j=a.current.closest(".markdown-stl"),Y=j&&getComputedStyle(j).getPropertyValue("--link").trim()||"#0070f3",Z=new m.MeshStandardMaterial({color:new m.Color().setStyle(Y),metalness:.08,roughness:.72});f.push(()=>Z.dispose()),S.add(new m.Mesh(p,Z)),S.add(new m.HemisphereLight(16777215,7829367,2.25));const V=new m.DirectionalLight(16777215,2.5);V.position.set(C,C*1.5,C),S.add(V);const N=new m.GridHelper(v*4,12,7829367,11184810);f.push(()=>{if(N.geometry.dispose(),Array.isArray(N.material))for(const K of N.material)K.dispose();else N.material.dispose()}),N.position.y=p.boundingBox?.min.y??-v,S.add(N);const L=new d(w,a.current);L.target.set(0,0,0),L.enableDamping=!1,L.maxDistance=v*12,L.minDistance=v*1.1,L.listenToKeyEvents(a.current),L.update(),f.push(()=>{L.stopListenToKeyEvents(),L.dispose()});const B=()=>R.render(S,w),U=()=>{if(!o.current)return;const K=Math.max(o.current.clientWidth,1),P=Math.max(o.current.clientHeight,1);w.aspect=K/P,w.updateProjectionMatrix(),R.setSize(K,P,!1),B()},W=new ResizeObserver(U);W.observe(o.current),f.push(()=>W.disconnect()),L.addEventListener("change",B),f.push(()=>L.removeEventListener("change",B)),U()}catch(d){for(const h of f.splice(0).reverse())h();r(d)}return()=>{for(const d of f.splice(0).reverse())d()}},[u,r,l]),E.jsx("div",{className:"markdown-stl-viewport",ref:o,children:E.jsx("canvas",{"aria-label":"Interactive 3D model. Drag to rotate and scroll to zoom.",ref:a,tabIndex:0})})}function Pb({fallback:u,source:r}){const[l,a]=q.useState(0),[o,f]=q.useState(""),[d,h]=q.useState(null);q.useEffect(()=>{let p=!0;return f(""),h(null),Ob().then(b=>{p&&h(b)}).catch(b=>{p&&f(Ta(b))}),()=>{p=!1}},[l,r]);const m=q.useCallback(p=>{f(Ta(p))},[]);return o?E.jsx(vc,{fallback:u,label:"ASCII STL model",message:o,onRetry:()=>a(p=>p+1)}):d?E.jsxs("figure",{"aria-label":"ASCII STL 3D model",className:"markdown-diagram markdown-stl",children:[E.jsx(Wb,{modules:d,onError:m,source:r}),E.jsx("figcaption",{className:"markdown-stl-caption",children:"Drag to rotate · Scroll to zoom"})]}):u}function e0(u){switch(u.kind){case"mermaid":return E.jsx(Ib,{fallback:u.fallback,source:u.source});case"geojson":case"topojson":return E.jsx(Jb,{...u,kind:u.kind});case"stl":return E.jsx(Pb,{fallback:u.fallback,source:u.source})}}function t0(u,r){return r&&r.writeText(u).catch(()=>{}),u}function n0(u){return`/api/section?query=${encodeURIComponent(u)}`}function Og(u,r,l,a){const o=new URL(u);return o.hash=r,l(o),a&&a.writeText(o.href).catch(()=>{}),o}const i0=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function a0(u){return/^(?:aria|data)[A-Z]/.test(u)?u.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`):u==="xLinkHref"?"xlinkHref":u}function r0(u){const r={};for(const l of u.split(";")){const a=l.indexOf(":");if(a<0)continue;const o=l.slice(0,a).trim(),f=l.slice(a+1).trim();if(!o||!f)continue;const d=o.startsWith("--")?o:o.replace(/-([a-z])/g,(h,m)=>m.toUpperCase());r[d]=f}return r}function l0(u,r){if(!(/^on/i.test(u)||u==="dangerouslySetInnerHTML"||u==="srcDoc")&&!(["href","src","action","formAction"].includes(u)&&typeof r=="string"&&/^\s*(?:javascript|vbscript):/i.test(r)))return u==="style"&&typeof r=="string"?r0(r):Array.isArray(r)?r.join(" "):r}function u0(u,r){const l={key:r};for(const[a,o]of Object.entries(u.properties)){const f=a0(a),d=l0(f,o);d!==void 0&&(l[f]=d)}return l}function Ug(u){return u.type==="text"?u.value:u.children.map(Ug).join("")}function o0(u){if(u.tagName!=="pre")return null;const r=u.properties.className,l=Array.isArray(r)?r.map(String):typeof r=="string"?r.split(/\s+/):[];return l.includes("markdown-mermaid-source")?"mermaid":l.includes("markdown-geojson-source")?"geojson":l.includes("markdown-topojson-source")?"topojson":l.includes("markdown-stl-source")?"stl":null}function s0({reference:u}){const r=u.path.slice(u.path.lastIndexOf(".")),l=new Map([[".ts",["code-language-ts","TS"]],[".tsx",["code-language-ts","TS"]],[".js",["code-language-js","JS"]],[".jsx",["code-language-js","JS"]],[".py",["code-language-py","PY"]],[".rs",["code-language-rs","RS"]],[".go",["code-language-go","GO"]],[".c",["code-language-c","C"]],[".h",["code-language-c","C"]],[".dart",["code-language-dart","DART"]],[".java",["code-language-java","JAVA"]]]).get(r.toLowerCase())??["","</>"];return E.jsxs("div",{className:"section-back-reference-item section-back-reference-code",children:[E.jsxs("a",{className:"section-back-reference-location",href:u.url,children:[E.jsx("span",{"aria-hidden":"true",className:["code-link-language",l[0]].filter(Boolean).join(" "),children:l[1]}),E.jsxs("span",{children:[u.path,":",u.line]})]}),E.jsx("code",{children:u.snippet})]})}function c0({reference:u}){return E.jsxs("div",{className:"section-back-reference-item section-back-reference-markdown",children:[E.jsx("a",{className:"section-back-reference-location",href:u.url,children:u.breadcrumbs.map((r,l)=>E.jsxs("span",{className:"section-back-reference-breadcrumb",children:[l>0&&E.jsx("span",{"aria-hidden":"true",children:"›"}),E.jsx("span",{className:"section-back-reference-breadcrumb-label",children:r})]},l))}),E.jsx("div",{className:"section-back-reference-paragraph",children:E.jsx(mu,{nodes:u.paragraphTree.children})})]})}function f0({heading:u,index:r,onCopySectionLink:l,onShowSectionOutput:a,section:o,sectionOutputEnabled:f}){const[d,h]=q.useState(!1),m=o.references.length,p=`section-back-references-${r}`,b=m===1?"1 reference":`${m} references`,v=S=>w=>{w.stopPropagation(),S()};return E.jsxs(E.Fragment,{children:[q.createElement(u.tagName,u.properties,u.children,E.jsxs("button",{"aria-controls":p,"aria-expanded":d,"aria-label":`Section menu${m>0?`, ${b}`:""}`,className:"section-back-reference-toggle",onClick:v(()=>h(S=>!S)),type:"button",children:[E.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",children:E.jsx("path",{d:"M2.5 4h11M2.5 8h11M2.5 12h11"})}),m>0&&E.jsx("span",{className:"section-back-reference-count",children:m})]},"section-menu-toggle")),E.jsxs("section",{"aria-label":`References to ${o.sectionId}`,className:"section-back-reference-panel",hidden:!d,id:p,children:[m>0?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"section-back-reference-header",children:"Referenced from"}),E.jsx("div",{className:"section-back-reference-list",children:o.references.map((S,w)=>S.kind==="markdown"?E.jsx(c0,{reference:S},`markdown-${S.sectionId}-${w}`):E.jsx(s0,{reference:S},`code-${S.path}-${S.line}`))})]}):E.jsx("div",{className:"section-back-reference-empty",children:"No references to this section"}),E.jsxs("div",{className:"section-back-reference-actions",children:[E.jsx("button",{className:"section-back-reference-action",onClick:v(()=>l?.(o.headingId)),type:"button",children:"Copy link to the section"}),E.jsx("button",{className:"section-back-reference-action",onClick:v(()=>t0(o.sectionId,window.navigator.clipboard)),type:"button",children:"Copy section ID"}),f&&E.jsxs("button",{className:"section-back-reference-action",onClick:v(()=>a?.(o.sectionId)),type:"button",children:["Show ",E.jsx("code",{children:"lat section"})," output"]})]})]})]})}function d0({context:u,node:r,path:l}){const a=u0(r,l),o=i0.has(r.tagName)?void 0:r.children.map((m,p)=>yc(m,`${l}.${p}`,u)),f=o0(r);if(f)return E.jsx(e0,{fallback:q.createElement(r.tagName,a,o),kind:f,source:r.children.map(Ug).join("")},l);const d=/^h[1-6]$/.test(r.tagName)&&typeof r.properties.id=="string"?r.properties.id:null,h=d?u?.sections.get(d):null;return h?E.jsx(f0,{heading:{children:o,properties:a,tagName:r.tagName},index:h.index,onCopySectionLink:u?.onCopySectionLink,onShowSectionOutput:u?.onShowSectionOutput,section:h.section,sectionOutputEnabled:u?.sectionOutputEnabled??!0},l):q.createElement(r.tagName,a,o)}function yc(u,r,l){return u.type==="text"?u.value:E.jsx(d0,{context:l,node:u,path:r},r)}function mu({nodes:u}){return E.jsx(E.Fragment,{children:u.map((r,l)=>yc(r,String(l)))})}function bc({backReferences:u=[],onClick:r,onCopySectionLink:l,onShowSectionOutput:a,sectionOutputEnabled:o=!0,tree:f}){const d={sections:new Map(u.map((h,m)=>[h.headingId,{index:m,section:h}])),sectionOutputEnabled:o,onCopySectionLink:l,onShowSectionOutput:a};return E.jsx("article",{className:"markdown",onClick:r,children:f.children.map((h,m)=>yc(h,String(m),d))})}function h0({mode:u,onChange:r}){return E.jsx("div",{"aria-label":"Document presentation",className:"document-mode-switch",role:"group",children:["view","edit"].map(l=>E.jsxs("button",{"aria-pressed":u===l,onClick:()=>r(l),type:"button",children:[l==="edit"&&E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",children:[E.jsx("path",{d:"m3 10.8.5-2.5 5.8-5.8 1.4 1.4-5.8 5.8-2.9.1Z"}),E.jsx("path",{d:"m8.5 3.3 1.4 1.4"})]}),E.jsx("span",{children:l})]},l))})}function m0(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 g0(u,r){return u===1?0:Math.max(0,u-r)}function p0({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),h=Math.max(0,r-o);return o+Math.max(0,h-d)}function v0({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 Bm(){return E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[E.jsx("path",{d:"M9 6h11"}),E.jsx("path",{d:"M12 12h8"}),E.jsx("path",{d:"M15 18h5"}),E.jsx("path",{d:"M5 6v.01"}),E.jsx("path",{d:"M8 12v.01"}),E.jsx("path",{d:"M11 18v.01"})]})}function y0({gitEnabled:u,items:r,onNavigate:l}){const a=q.useMemo(()=>r.map(v=>v.id),[r]),o=r.filter(v=>v.depth>1).map(v=>v.depth),f=o.length>0?Math.min(...o):2,[d,h]=q.useState(a[0]??""),[m,p]=q.useState(!1),b=q.useRef(null);return q.useEffect(()=>{p(!1)},[a]),q.useEffect(()=>{if(!m)return;const v=S=>{S.key==="Escape"&&p(!1)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[m]),q.useEffect(()=>{let v=0;const S=()=>{window.cancelAnimationFrame(v),v=window.requestAnimationFrame(()=>{const w=new Map(a.flatMap(j=>{const Y=window.document.getElementById(j);return Y?[[j,Y.getBoundingClientRect().top]]:[]})),C=window.document.scrollingElement,R=p0({scrollTop:C?.scrollTop??window.scrollY,viewportHeight:C?.clientHeight??window.innerHeight,scrollHeight:C?.scrollHeight??window.document.documentElement.scrollHeight});h(m0(a,w,R))})};return S(),window.addEventListener("scroll",S,{passive:!0}),window.addEventListener("resize",S),()=>{window.cancelAnimationFrame(v),window.removeEventListener("scroll",S),window.removeEventListener("resize",S)}},[a]),q.useEffect(()=>{const v=b.current,S=v?.querySelector('[aria-current="location"]');if(!v||!S||v.clientHeight===0)return;const w=v.getBoundingClientRect(),C=S.getBoundingClientRect(),R=v0({containerHeight:v.clientHeight,contentHeight:v.scrollHeight,itemHeight:C.height,itemTop:v.scrollTop+C.top-w.top});Math.abs(v.scrollTop-R)<1||v.scrollTo({behavior:"smooth",top:R})},[d,m]),r.length===0?null:E.jsxs("aside",{className:"document-toc","data-expanded":m||void 0,children:[E.jsxs("div",{className:"document-toc-title document-toc-heading",children:[E.jsx(Bm,{}),E.jsx("span",{children:"On this page"})]}),E.jsxs("button",{"aria-controls":"document-table-of-contents","aria-expanded":m,className:"document-toc-title document-toc-toggle",onClick:()=>p(v=>!v),type:"button",children:[E.jsx(Bm,{}),E.jsx("span",{children:"On this page"}),E.jsx("span",{"aria-hidden":"true",className:"document-toc-chevron",children:"›"})]}),E.jsx("nav",{"aria-label":"On this page",className:"document-toc-list",id:"document-table-of-contents",ref:b,children:r.map(v=>{const S=u&&v.hasGitChanges;return E.jsxs("a",{"aria-current":d===v.id?"location":void 0,className:"document-toc-link","data-depth":v.depth,href:`#${encodeURIComponent(v.id)}`,onClick:w=>{h(v.id),p(!1),l(w),v.depth===1&&w.defaultPrevented&&window.scrollTo({top:0,behavior:"instant"})},style:{"--toc-depth":g0(v.depth,f)},children:[E.jsx("span",{className:"document-toc-link-label",children:v.title}),(S||v.errorCount>0)&&E.jsxs("span",{className:"document-toc-states",children:[S&&E.jsx("span",{"aria-label":"Git changes",className:"document-toc-state git",role:"img",title:"Git changes"}),v.errorCount>0&&E.jsx("span",{"aria-label":`${v.errorCount} validation ${v.errorCount===1?"error":"errors"}`,className:"document-toc-state error",role:"img",title:`${v.errorCount} validation ${v.errorCount===1?"error":"errors"}`})]})]},v.id)})})]})}function b0(u){return JSON.stringify([u.path,u.symbol,u.from,u.line,u.at])}let nu=null;const E0=15e3;class S0 extends Error{name="TimeoutError"}class Hm extends Error{name="NetworkError"}function w0(u){return u instanceof TypeError||typeof u=="object"&&u!==null&&"name"in u&&u.name==="AbortError"}async function on(u,r,l={}){const a=new AbortController;let o=!1;const f=()=>a.abort();r?.aborted?a.abort():r?.addEventListener("abort",f,{once:!0});const d=globalThis.setTimeout(()=>{o=!0,a.abort()},E0),h=(l.method??"GET").toUpperCase(),m=h==="GET"||h==="HEAD"?2:1;try{for(let p=0;p<m;p++)try{const b=await fetch(u,{...l,signal:a.signal}),v=await b.json();if(!b.ok)throw new Error(v&&typeof v=="object"&&"error"in v?v.error:"Request failed");return v}catch(b){if(o)throw new S0("The server did not respond in time. Try again.");if(a.signal.aborted||!w0(b))throw b;if(p+1<m)continue;throw new Hm("The server connection was interrupted. Try again.")}throw new Hm("The server connection was interrupted. Try again.")}finally{globalThis.clearTimeout(d),r?.removeEventListener("abort",f)}}function Nw(u,r){return Gn()?Promise.reject(new Error("Static views cannot edit documents")):on(`/api/document-source?path=${encodeURIComponent(u)}`,r)}function Cw(u,r,l){return Gn()?Promise.reject(new Error("Static views cannot edit documents")):on(`/api/document?path=${encodeURIComponent(u)}`,l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}function Ri(u){const r=Gn();return r?new URL(`${r}${u}`,window.location.origin).toString():u}function T0(){return nu||(nu=on(Ri("data/manifest.json")).catch(u=>{throw nu=null,u})),nu}function qm(u){const r=Number(u);return Number.isInteger(r)&&r>0?r:0}async function cn(u,r){if(!Gn())return on(u,r);const l=await T0(),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:qm(a.searchParams.get("line")),at:qm(a.searchParams.get("at"))},d=l.sources[b0(f)];if(!d)throw new Error("Static view data not found");const[h,m]=await Promise.all([on(Ri(d.file),r),on(Ri(d.view),r)]);return{...h,...m}}else if(a.pathname==="/api/external"){const f=l.externals[a.searchParams.get("target")??""];if(!f)throw new Error("Static external data not found");if(f.kind==="markdown")return await on(Ri(f.document),r);const[d,h]=await Promise.all([on(Ri(f.file),r),on(Ri(f.view),r)]);return{...h,source:{...d,...h.source}}}if(!o)throw new Error("Static view data not found");return on(Ri(o),r)}var iu={exports:{}},Fm;function x0(){if(Fm)return iu.exports;Fm=1;var u=typeof Reflect=="object"?Reflect:null,r=u&&typeof u.apply=="function"?u.apply:function(L,B,U){return Function.prototype.apply.call(L,B,U)},l;u&&typeof u.ownKeys=="function"?l=u.ownKeys:Object.getOwnPropertySymbols?l=function(L){return Object.getOwnPropertyNames(L).concat(Object.getOwnPropertySymbols(L))}:l=function(L){return Object.getOwnPropertyNames(L)};function a(N){console&&console.warn&&console.warn(N)}var o=Number.isNaN||function(L){return L!==L};function f(){f.init.call(this)}iu.exports=f,iu.exports.once=Y,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var d=10;function h(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(N){if(typeof N!="number"||N<0||o(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");d=N}}),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(L){if(typeof L!="number"||L<0||o(L))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+L+".");return this._maxListeners=L,this};function m(N){return N._maxListeners===void 0?f.defaultMaxListeners:N._maxListeners}f.prototype.getMaxListeners=function(){return m(this)},f.prototype.emit=function(L){for(var B=[],U=1;U<arguments.length;U++)B.push(arguments[U]);var W=L==="error",K=this._events;if(K!==void 0)W=W&&K.error===void 0;else if(!W)return!1;if(W){var P;if(B.length>0&&(P=B[0]),P instanceof Error)throw P;var oe=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw oe.context=P,oe}var se=K[L];if(se===void 0)return!1;if(typeof se=="function")r(se,this,B);else for(var Ce=se.length,xe=C(se,Ce),U=0;U<Ce;++U)r(xe[U],this,B);return!0};function p(N,L,B,U){var W,K,P;if(h(B),K=N._events,K===void 0?(K=N._events=Object.create(null),N._eventsCount=0):(K.newListener!==void 0&&(N.emit("newListener",L,B.listener?B.listener:B),K=N._events),P=K[L]),P===void 0)P=K[L]=B,++N._eventsCount;else if(typeof P=="function"?P=K[L]=U?[B,P]:[P,B]:U?P.unshift(B):P.push(B),W=m(N),W>0&&P.length>W&&!P.warned){P.warned=!0;var oe=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(L)+" listeners added. Use emitter.setMaxListeners() to increase limit");oe.name="MaxListenersExceededWarning",oe.emitter=N,oe.type=L,oe.count=P.length,a(oe)}return N}f.prototype.addListener=function(L,B){return p(this,L,B,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(L,B){return p(this,L,B,!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 v(N,L,B){var U={fired:!1,wrapFn:void 0,target:N,type:L,listener:B},W=b.bind(U);return W.listener=B,U.wrapFn=W,W}f.prototype.once=function(L,B){return h(B),this.on(L,v(this,L,B)),this},f.prototype.prependOnceListener=function(L,B){return h(B),this.prependListener(L,v(this,L,B)),this},f.prototype.removeListener=function(L,B){var U,W,K,P,oe;if(h(B),W=this._events,W===void 0)return this;if(U=W[L],U===void 0)return this;if(U===B||U.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete W[L],W.removeListener&&this.emit("removeListener",L,U.listener||B));else if(typeof U!="function"){for(K=-1,P=U.length-1;P>=0;P--)if(U[P]===B||U[P].listener===B){oe=U[P].listener,K=P;break}if(K<0)return this;K===0?U.shift():R(U,K),U.length===1&&(W[L]=U[0]),W.removeListener!==void 0&&this.emit("removeListener",L,oe||B)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(L){var B,U,W;if(U=this._events,U===void 0)return this;if(U.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):U[L]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete U[L]),this;if(arguments.length===0){var K=Object.keys(U),P;for(W=0;W<K.length;++W)P=K[W],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(B=U[L],typeof B=="function")this.removeListener(L,B);else if(B!==void 0)for(W=B.length-1;W>=0;W--)this.removeListener(L,B[W]);return this};function S(N,L,B){var U=N._events;if(U===void 0)return[];var W=U[L];return W===void 0?[]:typeof W=="function"?B?[W.listener||W]:[W]:B?j(W):C(W,W.length)}f.prototype.listeners=function(L){return S(this,L,!0)},f.prototype.rawListeners=function(L){return S(this,L,!1)},f.listenerCount=function(N,L){return typeof N.listenerCount=="function"?N.listenerCount(L):w.call(N,L)},f.prototype.listenerCount=w;function w(N){var L=this._events;if(L!==void 0){var B=L[N];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function C(N,L){for(var B=new Array(L),U=0;U<L;++U)B[U]=N[U];return B}function R(N,L){for(;L+1<N.length;L++)N[L]=N[L+1];N.pop()}function j(N){for(var L=new Array(N.length),B=0;B<L.length;++B)L[B]=N[B].listener||N[B];return L}function Y(N,L){return new Promise(function(B,U){function W(P){N.removeListener(L,K),U(P)}function K(){typeof N.removeListener=="function"&&N.removeListener("error",W),B([].slice.call(arguments))}V(N,L,K,{once:!0}),L!=="error"&&Z(N,W,{once:!0})})}function Z(N,L,B){typeof N.on=="function"&&V(N,"error",L,B)}function V(N,L,B,U){if(typeof N.on=="function")U.once?N.once(L,B):N.on(L,B);else if(typeof N.addEventListener=="function")N.addEventListener(L,function W(K){U.once&&N.removeEventListener(L,W),B(K)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}return iu.exports}var kg=x0();function _0(){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 tt=_0;typeof Object.assign=="function"&&(tt=Object.assign);function Vt(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 ft(u){return typeof u=="object"&&u!==null}function jg(u){let r;for(r in u)return!1;return!0}function Yt(u,r,l){Object.defineProperty(u,r,{enumerable:!1,configurable:!1,writable:!0,value:l})}function Jt(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 Ym(u){return!(!ft(u)||u.attributes&&!Array.isArray(u.attributes))}function A0(){let u=Math.floor(Math.random()*256)&255;return()=>u++}function zn(){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 Na(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Ec extends Error{constructor(r){super(),this.name="GraphError",this.message=r}}class te extends Ec{constructor(r){super(r),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,te.prototype.constructor)}}class ee extends Ec{constructor(r){super(r),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ee.prototype.constructor)}}class he extends Ec{constructor(r){super(r),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,he.prototype.constructor)}}function Bg(u,r){this.key=u,this.attributes=r,this.clear()}Bg.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 Hg(u,r){this.key=u,this.attributes=r,this.clear()}Hg.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function qg(u,r){this.key=u,this.attributes=r,this.clear()}qg.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ca(u,r,l,a,o){this.key=r,this.attributes=o,this.undirected=u,this.source=l,this.target=a}Ca.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)};Ca.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};Ca.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]};Ca.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 Fg=0,Yg=1,N0=2,$g=3;function On(u,r,l,a,o,f,d){let h,m,p,b;if(a=""+a,l===Fg){if(h=u._nodes.get(a),!h)throw new ee(`Graph.${r}: could not find the "${a}" node in the graph.`);p=o,b=f}else if(l===$g){if(o=""+o,m=u._edges.get(o),!m)throw new ee(`Graph.${r}: could not find the "${o}" edge in the graph.`);const v=m.source.key,S=m.target.key;if(a===v)h=m.target;else if(a===S)h=m.source;else throw new ee(`Graph.${r}: the "${a}" node is not attached to the "${o}" edge (${v}, ${S}).`);p=f,b=d}else{if(m=u._edges.get(a),!m)throw new ee(`Graph.${r}: could not find the "${a}" edge in the graph.`);l===Yg?h=m.source:h=m.target,p=o,b=f}return[h,p,b]}function C0(u,r,l){u.prototype[r]=function(a,o,f){const[d,h]=On(this,r,l,a,o,f);return d.attributes[h]}}function R0(u,r,l){u.prototype[r]=function(a,o){const[f]=On(this,r,l,a,o);return f.attributes}}function D0(u,r,l){u.prototype[r]=function(a,o,f){const[d,h]=On(this,r,l,a,o,f);return d.attributes.hasOwnProperty(h)}}function L0(u,r,l){u.prototype[r]=function(a,o,f,d){const[h,m,p]=On(this,r,l,a,o,f,d);return h.attributes[m]=p,this.emit("nodeAttributesUpdated",{key:h.key,type:"set",attributes:h.attributes,name:m}),this}}function M0(u,r,l){u.prototype[r]=function(a,o,f,d){const[h,m,p]=On(this,r,l,a,o,f,d);if(typeof p!="function")throw new te(`Graph.${r}: updater should be a function.`);const b=h.attributes,v=p(b[m]);return b[m]=v,this.emit("nodeAttributesUpdated",{key:h.key,type:"set",attributes:h.attributes,name:m}),this}}function z0(u,r,l){u.prototype[r]=function(a,o,f){const[d,h]=On(this,r,l,a,o,f);return delete d.attributes[h],this.emit("nodeAttributesUpdated",{key:d.key,type:"remove",attributes:d.attributes,name:h}),this}}function G0(u,r,l){u.prototype[r]=function(a,o,f){const[d,h]=On(this,r,l,a,o,f);if(!ft(h))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return d.attributes=h,this.emit("nodeAttributesUpdated",{key:d.key,type:"replace",attributes:d.attributes}),this}}function O0(u,r,l){u.prototype[r]=function(a,o,f){const[d,h]=On(this,r,l,a,o,f);if(!ft(h))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return tt(d.attributes,h),this.emit("nodeAttributesUpdated",{key:d.key,type:"merge",attributes:d.attributes,data:h}),this}}function U0(u,r,l){u.prototype[r]=function(a,o,f){const[d,h]=On(this,r,l,a,o,f);if(typeof h!="function")throw new te(`Graph.${r}: provided updater is not a function.`);return d.attributes=h(d.attributes),this.emit("nodeAttributesUpdated",{key:d.key,type:"update",attributes:d.attributes}),this}}const k0=[{name:u=>`get${u}Attribute`,attacher:C0},{name:u=>`get${u}Attributes`,attacher:R0},{name:u=>`has${u}Attribute`,attacher:D0},{name:u=>`set${u}Attribute`,attacher:L0},{name:u=>`update${u}Attribute`,attacher:M0},{name:u=>`remove${u}Attribute`,attacher:z0},{name:u=>`replace${u}Attributes`,attacher:G0},{name:u=>`merge${u}Attributes`,attacher:O0},{name:u=>`update${u}Attributes`,attacher:U0}];function j0(u){k0.forEach(function({name:r,attacher:l}){l(u,r("Node"),Fg),l(u,r("Source"),Yg),l(u,r("Target"),N0),l(u,r("Opposite"),$g)})}function B0(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new he(`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,h=""+o;if(o=arguments[2],f=Vt(this,d,h,l),!f)throw new ee(`Graph.${r}: could not find an edge for the given path ("${d}" - "${h}").`)}else{if(l!=="mixed")throw new he(`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 ee(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return f.attributes[o]}}function H0(u,r,l){u.prototype[r]=function(a){let o;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new he(`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=Vt(this,f,d,l),!o)throw new ee(`Graph.${r}: could not find an edge for the given path ("${f}" - "${d}").`)}else{if(l!=="mixed")throw new he(`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 ee(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return o.attributes}}function q0(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new he(`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,h=""+o;if(o=arguments[2],f=Vt(this,d,h,l),!f)throw new ee(`Graph.${r}: could not find an edge for the given path ("${d}" - "${h}").`)}else{if(l!=="mixed")throw new he(`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 ee(`Graph.${r}: could not find the "${a}" edge in the graph.`)}return f.attributes.hasOwnProperty(o)}}function F0(u,r,l){u.prototype[r]=function(a,o,f){let d;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new he(`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 h=""+a,m=""+o;if(o=arguments[2],f=arguments[3],d=Vt(this,h,m,l),!d)throw new ee(`Graph.${r}: could not find an edge for the given path ("${h}" - "${m}").`)}else{if(l!=="mixed")throw new he(`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 ee(`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 Y0(u,r,l){u.prototype[r]=function(a,o,f){let d;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new he(`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 h=""+a,m=""+o;if(o=arguments[2],f=arguments[3],d=Vt(this,h,m,l),!d)throw new ee(`Graph.${r}: could not find an edge for the given path ("${h}" - "${m}").`)}else{if(l!=="mixed")throw new he(`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 ee(`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 $0(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new he(`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,h=""+o;if(o=arguments[2],f=Vt(this,d,h,l),!f)throw new ee(`Graph.${r}: could not find an edge for the given path ("${d}" - "${h}").`)}else{if(l!=="mixed")throw new he(`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 ee(`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 V0(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new he(`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,h=""+o;if(o=arguments[2],f=Vt(this,d,h,l),!f)throw new ee(`Graph.${r}: could not find an edge for the given path ("${d}" - "${h}").`)}else{if(l!=="mixed")throw new he(`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 ee(`Graph.${r}: could not find the "${a}" edge in the graph.`)}if(!ft(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 X0(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new he(`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,h=""+o;if(o=arguments[2],f=Vt(this,d,h,l),!f)throw new ee(`Graph.${r}: could not find an edge for the given path ("${d}" - "${h}").`)}else{if(l!=="mixed")throw new he(`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 ee(`Graph.${r}: could not find the "${a}" edge in the graph.`)}if(!ft(o))throw new te(`Graph.${r}: provided attributes are not a plain object.`);return tt(f.attributes,o),this.emit("edgeAttributesUpdated",{key:f.key,type:"merge",attributes:f.attributes,data:o}),this}}function Z0(u,r,l){u.prototype[r]=function(a,o){let f;if(this.type!=="mixed"&&l!=="mixed"&&l!==this.type)throw new he(`Graph.${r}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new he(`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,h=""+o;if(o=arguments[2],f=Vt(this,d,h,l),!f)throw new ee(`Graph.${r}: could not find an edge for the given path ("${d}" - "${h}").`)}else{if(l!=="mixed")throw new he(`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 ee(`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 Q0=[{name:u=>`get${u}Attribute`,attacher:B0},{name:u=>`get${u}Attributes`,attacher:H0},{name:u=>`has${u}Attribute`,attacher:q0},{name:u=>`set${u}Attribute`,attacher:F0},{name:u=>`update${u}Attribute`,attacher:Y0},{name:u=>`remove${u}Attribute`,attacher:$0},{name:u=>`replace${u}Attributes`,attacher:V0},{name:u=>`merge${u}Attributes`,attacher:X0},{name:u=>`update${u}Attributes`,attacher:Z0}];function K0(u){Q0.forEach(function({name:r,attacher:l}){l(u,r("Edge"),"mixed"),l(u,r("DirectedEdge"),"directed"),l(u,r("UndirectedEdge"),"undirected")})}const I0=[{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 J0(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 W0(u,r,l,a){let o,f,d,h=!1;for(const m in r)if(m!==a){o=r[m];do{if(f=o.source,d=o.target,h=l(o.key,o.attributes,f.key,d.key,f.attributes,d.attributes,o.undirected),u&&h)return o.key;o=o.next}while(o!==void 0)}}function qs(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 P0(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 eE(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 Fs(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 tE(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,h,m;for(;h=f.next(),h.done!==!0;)m=h.value,m.undirected===o&&(a[d++]=m.key);return a}function Vg(u,r,l,a){if(r.size===0)return;const o=l!=="mixed"&&l!==r.type,f=l==="undirected";let d,h,m=!1;const p=r._edges.values();for(;d=p.next(),d.done!==!0;){if(h=d.value,o&&h.undirected!==f)continue;const{key:b,attributes:v,source:S,target:w}=h;if(m=a(b,v,S.key,w.key,S.attributes,w.attributes,h.undirected),u&&m)return b}}function nE(u,r){if(u.size===0)return Na();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 Sc(u,r,l,a,o,f){const d=r?W0:J0;let h;if(l!=="undirected"&&(a!=="out"&&(h=d(u,o.in,f),u&&h)||a!=="in"&&(h=d(u,o.out,f,a?void 0:o.key),u&&h))||l!=="directed"&&(h=d(u,o.undirected,f),u&&h))return h}function iE(u,r,l,a){const o=[];return Sc(!1,u,r,l,a,function(f){o.push(f)}),o}function aE(u,r,l){let a=Na();return u!=="undirected"&&(r!=="out"&&typeof l.in<"u"&&(a=zn(a,qs(l.in))),r!=="in"&&typeof l.out<"u"&&(a=zn(a,qs(l.out,r?void 0:l.key)))),u!=="directed"&&typeof l.undirected<"u"&&(a=zn(a,qs(l.undirected))),a}function wc(u,r,l,a,o,f,d){const h=l?eE:P0;let m;if(r!=="undirected"&&(typeof o.in<"u"&&a!=="out"&&(m=h(u,o.in,f,d),u&&m)||typeof o.out<"u"&&a!=="in"&&(a||o.key!==f)&&(m=h(u,o.out,f,d),u&&m))||r!=="directed"&&typeof o.undirected<"u"&&(m=h(u,o.undirected,f,d),u&&m))return m}function rE(u,r,l,a,o){const f=[];return wc(!1,u,r,l,a,o,function(d){f.push(d)}),f}function lE(u,r,l,a){let o=Na();return u!=="undirected"&&(typeof l.in<"u"&&r!=="out"&&a in l.in&&(o=zn(o,Fs(l.in,a))),typeof l.out<"u"&&r!=="in"&&a in l.out&&(r||l.key!==a)&&(o=zn(o,Fs(l.out,a)))),u!=="directed"&&typeof l.undirected<"u"&&a in l.undirected&&(o=zn(o,Fs(l.undirected,a))),o}function uE(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 tE(this,a);if(arguments.length===1){f=""+f;const h=this._nodes.get(f);if(typeof h>"u")throw new ee(`Graph.${l}: could not find the "${f}" node in the graph.`);return iE(this.multi,a==="mixed"?this.type:a,o,h)}if(arguments.length===2){f=""+f,d=""+d;const h=this._nodes.get(f);if(!h)throw new ee(`Graph.${l}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(d))throw new ee(`Graph.${l}: could not find the "${d}" target node in the graph.`);return rE(a,this.multi,o,h,d)}throw new te(`Graph.${l}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function oE(u,r){const{name:l,type:a,direction:o}=r,f="forEach"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[f]=function(p,b,v){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return v=p,Vg(!1,this,a,v);if(arguments.length===2){p=""+p,v=b;const S=this._nodes.get(p);if(typeof S>"u")throw new ee(`Graph.${f}: could not find the "${p}" node in the graph.`);return Sc(!1,this.multi,a==="mixed"?this.type:a,o,S,v)}if(arguments.length===3){p=""+p,b=""+b;const S=this._nodes.get(p);if(!S)throw new ee(`Graph.${f}: could not find the "${p}" source node in the graph.`);if(!this._nodes.has(b))throw new ee(`Graph.${f}: could not find the "${b}" target node in the graph.`);return wc(!1,a,this.multi,o,S,b,v)}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 p=Array.prototype.slice.call(arguments),b=p.pop();let v;if(p.length===0){let S=0;a!=="directed"&&(S+=this.undirectedSize),a!=="undirected"&&(S+=this.directedSize),v=new Array(S);let w=0;p.push((C,R,j,Y,Z,V,N)=>{v[w++]=b(C,R,j,Y,Z,V,N)})}else v=[],p.push((S,w,C,R,j,Y,Z)=>{v.push(b(S,w,C,R,j,Y,Z))});return this[f].apply(this,p),v};const h="filter"+l[0].toUpperCase()+l.slice(1);u.prototype[h]=function(){const p=Array.prototype.slice.call(arguments),b=p.pop(),v=[];return p.push((S,w,C,R,j,Y,Z)=>{b(S,w,C,R,j,Y,Z)&&v.push(S)}),this[f].apply(this,p),v};const m="reduce"+l[0].toUpperCase()+l.slice(1);u.prototype[m]=function(){let p=Array.prototype.slice.call(arguments);if(p.length<2||p.length>4)throw new te(`Graph.${m}: invalid number of arguments (expecting 2, 3 or 4 and got ${p.length}).`);if(typeof p[p.length-1]=="function"&&typeof p[p.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,v;p.length===2?(b=p[0],v=p[1],p=[]):p.length===3?(b=p[1],v=p[2],p=[p[0]]):p.length===4&&(b=p[2],v=p[3],p=[p[0],p[1]]);let S=v;return p.push((w,C,R,j,Y,Z,V)=>{S=b(S,w,C,R,j,Y,Z,V)}),this[f].apply(this,p),S}}function sE(u,r){const{name:l,type:a,direction:o}=r,f="find"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[f]=function(m,p,b){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return b=m,Vg(!0,this,a,b);if(arguments.length===2){m=""+m,b=p;const v=this._nodes.get(m);if(typeof v>"u")throw new ee(`Graph.${f}: could not find the "${m}" node in the graph.`);return Sc(!0,this.multi,a==="mixed"?this.type:a,o,v,b)}if(arguments.length===3){m=""+m,p=""+p;const v=this._nodes.get(m);if(!v)throw new ee(`Graph.${f}: could not find the "${m}" source node in the graph.`);if(!this._nodes.has(p))throw new ee(`Graph.${f}: could not find the "${p}" target node in the graph.`);return wc(!0,a,this.multi,o,v,p,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),p=m.pop();return m.push((v,S,w,C,R,j,Y)=>p(v,S,w,C,R,j,Y)),!!this[f].apply(this,m)};const h="every"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[h]=function(){const m=Array.prototype.slice.call(arguments),p=m.pop();return m.push((v,S,w,C,R,j,Y)=>!p(v,S,w,C,R,j,Y)),!this[f].apply(this,m)}}function cE(u,r){const{name:l,type:a,direction:o}=r,f=l.slice(0,-1)+"Entries";u.prototype[f]=function(d,h){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return Na();if(!arguments.length)return nE(this,a);if(arguments.length===1){d=""+d;const m=this._nodes.get(d);if(!m)throw new ee(`Graph.${f}: could not find the "${d}" node in the graph.`);return aE(a,o,m)}if(arguments.length===2){d=""+d,h=""+h;const m=this._nodes.get(d);if(!m)throw new ee(`Graph.${f}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(h))throw new ee(`Graph.${f}: could not find the "${h}" target node in the graph.`);return lE(a,o,m,h)}throw new te(`Graph.${f}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function fE(u){I0.forEach(r=>{uE(u,r),oE(u,r),sE(u,r),cE(u,r)})}const dE=[{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 pu(){this.A=null,this.B=null}pu.prototype.wrap=function(u){this.A===null?this.A=u:this.B===null&&(this.B=u)};pu.prototype.has=function(u){return this.A!==null&&u in this.A||this.B!==null&&u in this.B};function Nr(u,r,l,a,o){for(const f in a){const d=a[f],h=d.source,m=d.target,p=h===l?m:h;if(r&&r.has(p.key))continue;const b=o(p.key,p.attributes);if(u&&b)return p.key}}function Tc(u,r,l,a,o){if(r!=="mixed"){if(r==="undirected")return Nr(u,null,a,a.undirected,o);if(typeof l=="string")return Nr(u,null,a,a[l],o)}const f=new pu;let d;if(r!=="undirected"){if(l!=="out"){if(d=Nr(u,null,a,a.in,o),u&&d)return d;f.wrap(a.in)}if(l!=="in"){if(d=Nr(u,f,a,a.out,o),u&&d)return d;f.wrap(a.out)}}if(r!=="directed"&&(d=Nr(u,f,a,a.undirected,o),u&&d))return d}function hE(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 Tc(!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 h=l[a[f++]],m=h.source,p=h.target;if(d=m===r?p:m,u&&u.has(d.key)){d=null;continue}}while(d===null);return{done:!1,value:{neighbor:d.key,attributes:d.attributes}}}}}function mE(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=Na();const o=new pu;return u!=="undirected"&&(r!=="out"&&(a=zn(a,Cr(o,l,l.in))),r!=="in"&&(a=zn(a,Cr(o,l,l.out)))),u!=="directed"&&(a=zn(a,Cr(o,l,l.undirected))),a}function gE(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 ee(`Graph.${l}: could not find the "${f}" node in the graph.`);return hE(a==="mixed"?this.type:a,o,d)}}function pE(u,r){const{name:l,type:a,direction:o}=r,f="forEach"+l[0].toUpperCase()+l.slice(1,-1);u.prototype[f]=function(p,b){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;p=""+p;const v=this._nodes.get(p);if(typeof v>"u")throw new ee(`Graph.${f}: could not find the "${p}" node in the graph.`);Tc(!1,a==="mixed"?this.type:a,o,v,b)};const d="map"+l[0].toUpperCase()+l.slice(1);u.prototype[d]=function(p,b){const v=[];return this[f](p,(S,w)=>{v.push(b(S,w))}),v};const h="filter"+l[0].toUpperCase()+l.slice(1);u.prototype[h]=function(p,b){const v=[];return this[f](p,(S,w)=>{b(S,w)&&v.push(S)}),v};const m="reduce"+l[0].toUpperCase()+l.slice(1);u.prototype[m]=function(p,b,v){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 S=v;return this[f](p,(w,C)=>{S=b(S,w,C)}),S}}function vE(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(p,b){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;p=""+p;const v=this._nodes.get(p);if(typeof v>"u")throw new ee(`Graph.${d}: could not find the "${p}" node in the graph.`);return Tc(!0,a==="mixed"?this.type:a,o,v,b)};const h="some"+f;u.prototype[h]=function(p,b){return!!this[d](p,b)};const m="every"+f;u.prototype[m]=function(p,b){return!this[d](p,(S,w)=>!b(S,w))}}function yE(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 Na();d=""+d;const h=this._nodes.get(d);if(typeof h>"u")throw new ee(`Graph.${f}: could not find the "${d}" node in the graph.`);return mE(a==="mixed"?this.type:a,o,h)}}function bE(u){dE.forEach(r=>{gE(u,r),pE(u,r),vE(u,r),yE(u,r)})}function au(u,r,l,a,o){const f=a._nodes.values(),d=a.type;let h,m,p,b,v,S;for(;h=f.next(),h.done!==!0;){let w=!1;if(m=h.value,d!=="undirected"){b=m.out;for(p in b){v=b[p];do S=v.target,w=!0,o(m.key,S.key,m.attributes,S.attributes,v.key,v.attributes,v.undirected),v=v.next;while(v)}}if(d!=="directed"){b=m.undirected;for(p in b)if(!(r&&m.key>p)){v=b[p];do S=v.target,S.key!==p&&(S=v.source),w=!0,o(m.key,S.key,m.attributes,S.attributes,v.key,v.attributes,v.undirected),v=v.next;while(v)}}l&&!w&&o(m.key,null,m.attributes,null,null,null,null)}}function EE(u,r){const l={key:u};return jg(r.attributes)||(l.attributes=tt({},r.attributes)),l}function SE(u,r,l){const a={key:r,source:l.source.key,target:l.target.key};return jg(l.attributes)||(a.attributes=tt({},l.attributes)),u==="mixed"&&l.undirected&&(a.undirected=!0),a}function wE(u){if(!ft(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&&(!ft(u.attributes)||u.attributes===null))throw new te("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function TE(u){if(!ft(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&&(!ft(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 xE=A0(),_E=new Set(["directed","undirected","mixed"]),$m=new Set(["domain","_events","_eventsCount","_maxListeners"]),AE=[{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"}],NE={allowSelfLoops:!0,multi:!1,type:"mixed"};function CE(u,r,l){if(l&&!ft(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 he(`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 Vm(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 Xg(u,r,l,a,o,f,d,h){if(!a&&u.type==="undirected")throw new he(`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 he(`Graph.${r}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(h&&!ft(h))throw new te(`Graph.${r}: invalid attributes. Expecting an object but got "${h}"`);if(f=""+f,d=""+d,h=h||{},!u.allowSelfLoops&&f===d)throw new he(`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),p=u._nodes.get(d);if(!m)throw new ee(`Graph.${r}: source node "${f}" not found.`);if(!p)throw new ee(`Graph.${r}: target node "${d}" not found.`);const b={key:null,undirected:a,source:f,target:d,attributes:h};if(l)o=u._edgeKeyGenerator();else if(o=""+o,u._edges.has(o))throw new he(`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 he(`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 v=new Ca(a,o,m,p,h);u._edges.set(o,v);const S=f===d;return a?(m.undirectedDegree++,p.undirectedDegree++,S&&(m.undirectedLoops++,u._undirectedSelfLoopCount++)):(m.outDegree++,p.inDegree++,S&&(m.directedLoops++,u._directedSelfLoopCount++)),u.multi?v.attachMulti():v.attach(),a?u._undirectedSize++:u._directedSize++,b.key=o,u.emit("edgeAdded",b),o}function RE(u,r,l,a,o,f,d,h,m){if(!a&&u.type==="undirected")throw new he(`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 he(`Graph.${r}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(h){if(m){if(typeof h!="function")throw new te(`Graph.${r}: invalid updater function. Expecting a function but got "${h}"`)}else if(!ft(h))throw new te(`Graph.${r}: invalid attributes. Expecting an object but got "${h}"`)}f=""+f,d=""+d;let p;if(m&&(p=h,h=void 0),!u.allowSelfLoops&&f===d)throw new he(`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),v=u._nodes.get(d),S,w;if(!l&&(S=u._edges.get(o),S)){if((S.source.key!==f||S.target.key!==d)&&(!a||S.source.key!==d||S.target.key!==f))throw new he(`Graph.${r}: inconsistency detected when attempting to merge the "${o}" edge with "${f}" source & "${d}" target vs. ("${S.source.key}", "${S.target.key}").`);w=S}if(!w&&!u.multi&&b&&(w=a?b.undirected[d]:b.out[d]),w){const Z=[w.key,!1,!1,!1];if(m?!p:!h)return Z;if(m){const V=w.attributes;w.attributes=p(V),u.emit("edgeAttributesUpdated",{type:"replace",key:w.key,attributes:w.attributes})}else tt(w.attributes,h),u.emit("edgeAttributesUpdated",{type:"merge",key:w.key,attributes:w.attributes,data:h});return Z}h=h||{},m&&p&&(h=p(h));const C={key:null,undirected:a,source:f,target:d,attributes:h};if(l)o=u._edgeKeyGenerator();else if(o=""+o,u._edges.has(o))throw new he(`Graph.${r}: the "${o}" edge already exists in the graph.`);let R=!1,j=!1;b||(b=Vm(u,f,{}),R=!0,f===d&&(v=b,j=!0)),v||(v=Vm(u,d,{}),j=!0),S=new Ca(a,o,b,v,h),u._edges.set(o,S);const Y=f===d;return a?(b.undirectedDegree++,v.undirectedDegree++,Y&&(b.undirectedLoops++,u._undirectedSelfLoopCount++)):(b.outDegree++,v.inDegree++,Y&&(b.directedLoops++,u._directedSelfLoopCount++)),u.multi?S.attachMulti():S.attach(),a?u._undirectedSize++:u._directedSize++,C.key=o,u.emit("edgeAdded",C),[o,!0,R,j]}function Sa(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 Be extends kg.EventEmitter{constructor(r){if(super(),r=tt({},NE,r),typeof r.multi!="boolean")throw new te(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${r.multi}".`);if(!_E.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"?Bg:r.type==="directed"?Hg:qg;Yt(this,"NodeDataClass",l);const a="geid_"+xE()+"_";let o=0;const f=()=>{let d;do d=a+o++;while(this._edges.has(d));return d};Yt(this,"_attributes",{}),Yt(this,"_nodes",new Map),Yt(this,"_edges",new Map),Yt(this,"_directedSize",0),Yt(this,"_undirectedSize",0),Yt(this,"_directedSelfLoopCount",0),Yt(this,"_undirectedSelfLoopCount",0),Yt(this,"_edgeKeyGenerator",f),Yt(this,"_options",r),$m.forEach(d=>Yt(this,d,this[d])),Jt(this,"order",()=>this._nodes.size),Jt(this,"size",()=>this._edges.size),Jt(this,"directedSize",()=>this._directedSize),Jt(this,"undirectedSize",()=>this._undirectedSize),Jt(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Jt(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Jt(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Jt(this,"multi",this._options.multi),Jt(this,"type",this._options.type),Jt(this,"allowSelfLoops",this._options.allowSelfLoops),Jt(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 he("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 ee(`Graph.directedEdge: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(l))throw new ee(`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 he("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 ee(`Graph.undirectedEdge: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(l))throw new ee(`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 he("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 ee(`Graph.edge: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(l))throw new ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`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 ee(`Graph.isSelfLoop: could not find the "${r}" edge in the graph.`);return l.source===l.target}addNode(r,l){return CE(this,r,l).key}mergeNode(r,l){if(l&&!ft(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&&(tt(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 ee(`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 Sa(this,a),a=a.next;while(a)}for(const o in l.in){a=l.in[o];do Sa(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const o in l.undirected){a=l.undirected[o];do Sa(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=Vt(this,a,o,this.type),!l)throw new ee(`Graph.dropEdge: could not find the "${a}" -> "${o}" edge in the graph.`)}else if(r=""+r,l=this._edges.get(r),!l)throw new ee(`Graph.dropEdge: could not find the "${r}" edge in the graph.`);return Sa(this,l),this}dropDirectedEdge(r,l){if(arguments.length<2)throw new he("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 he("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=Vt(this,r,l,"directed");if(!a)throw new ee(`Graph.dropDirectedEdge: could not find a "${r}" -> "${l}" edge in the graph.`);return Sa(this,a),this}dropUndirectedEdge(r,l){if(arguments.length<2)throw new he("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 he("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=Vt(this,r,l,"undirected");if(!a)throw new ee(`Graph.dropUndirectedEdge: could not find a "${r}" -> "${l}" edge in the graph.`);return Sa(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(!ft(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(!ft(r))throw new te("Graph.mergeAttributes: provided attributes are not a plain object.");return tt(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&&!Ym(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&&!Ym(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,h;for(;o=a.next(),o.done!==!0;)f=o.value,d=f.source,h=f.target,f.attributes=r(f.key,f.attributes,d.key,h.key,d.attributes,h.attributes,f.undirected);this.emit("eachEdgeAttributesUpdated",{hints:l||null})}forEachAdjacencyEntry(r){if(typeof r!="function")throw new te("Graph.forEachAdjacencyEntry: expecting a callback.");au(!1,!1,!1,this,r)}forEachAdjacencyEntryWithOrphans(r){if(typeof r!="function")throw new te("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");au(!1,!1,!0,this,r)}forEachAssymetricAdjacencyEntry(r){if(typeof r!="function")throw new te("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");au(!1,!0,!1,this,r)}forEachAssymetricAdjacencyEntryWithOrphans(r){if(typeof r!="function")throw new te("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");au(!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++]=EE(f,o)});const a=new Array(this._edges.size);return l=0,this._edges.forEach((o,f)=>{a[l++]=SE(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 Be)return r.forEachNode((m,p)=>{l?this.mergeNode(m,p):this.addNode(m,p)}),r.forEachEdge((m,p,b,v,S,w,C)=>{l?C?this.mergeUndirectedEdgeWithKey(m,b,v,p):this.mergeDirectedEdgeWithKey(m,b,v,p):C?this.addUndirectedEdgeWithKey(m,b,v,p):this.addDirectedEdgeWithKey(m,b,v,p)}),this;if(!ft(r))throw new te("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(r.attributes){if(!ft(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,h;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],wE(d);const{key:m,attributes:p}=d;l?this.mergeNode(m,p):this.addNode(m,p)}}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++){h=f[a],TE(h);const{source:p,target:b,attributes:v,undirected:S=m}=h;let w;"key"in h?(w=l?S?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:S?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,w.call(this,h.key,p,b,v)):(w=l?S?this.mergeUndirectedEdge:this.mergeDirectedEdge:S?this.addUndirectedEdge:this.addDirectedEdge,w.call(this,p,b,v))}}return this}nullCopy(r){const l=new Be(tt({},this._options,r));return l.replaceAttributes(tt({},this.getAttributes())),l}emptyCopy(r){const l=this.nullCopy(r);return this._nodes.forEach((a,o)=>{const f=tt({},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 he(`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 he("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 he("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,Xg(l,"copy",!1,f.undirected,f.key,f.source.key,f.target.key,tt({},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 h=f.undirected?"--":"->";let m="",p=f.source.key,b=f.target.key,v;f.undirected&&p>b&&(v=p,p=b,b=v);const S=`(${p})${h}(${b})`;d.startsWith("geid_")?this.multi&&(typeof a[S]>"u"?a[S]=0:a[S]++,m+=`${a[S]}. `):m+=`[${d}]: `,m+=S,l[m]=f.attributes});const o={};for(const f in this)this.hasOwnProperty(f)&&!$m.has(f)&&typeof this[f]!="function"&&typeof f!="symbol"&&(o[f]=this[f]);return o.attributes=this._attributes,o.nodes=r,o.edges=l,Yt(o,"constructor",this.constructor),o}}typeof Symbol<"u"&&(Be.prototype[Symbol.for("nodejs.util.inspect.custom")]=Be.prototype.inspect);AE.forEach(u=>{["add","merge","update"].forEach(r=>{const l=u.name(r),a=r==="add"?Xg:RE;u.generateKey?Be.prototype[l]=function(o,f,d){return a(this,l,!0,(u.type||this.type)==="undirected",null,o,f,d,r==="update")}:Be.prototype[l]=function(o,f,d,h){return a(this,l,!1,(u.type||this.type)==="undirected",o,f,d,h,r==="update")}})});j0(Be);K0(Be);fE(Be);bE(Be);class Zg extends Be{constructor(r){const l=tt({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 Qg extends Be{constructor(r){const l=tt({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 Kg extends Be{constructor(r){const l=tt({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 xc extends Be{constructor(r){const l=tt({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 Ig extends Be{constructor(r){const l=tt({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 Ra(u){u.from=function(r,l){const a=tt({},r.options,l),o=new u(a);return o.import(r),o}}Ra(Be);Ra(Zg);Ra(Qg);Ra(Kg);Ra(xc);Ra(Ig);Be.Graph=Be;Be.DirectedGraph=Zg;Be.UndirectedGraph=Qg;Be.MultiGraph=Kg;Be.MultiDirectedGraph=xc;Be.MultiUndirectedGraph=Ig;Be.InvalidArgumentsGraphError=te;Be.NotFoundGraphError=ee;Be.UsageGraphError=he;function DE(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 Gr(u){var r=DE(u,"string");return typeof r=="symbol"?r:r+""}function ht(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")}function Xm(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,Gr(a.key),a)}}function mt(u,r,l){return r&&Xm(u.prototype,r),l&&Xm(u,l),Object.defineProperty(u,"prototype",{writable:!1}),u}function _a(u){return _a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_a(u)}function Jg(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jg=function(){return!!u})()}function LE(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function ME(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 LE(u)}function Xt(u,r,l){return r=_a(r),ME(u,Jg()?Reflect.construct(r,l||[],_a(u).constructor):r.apply(u,l))}function cc(u,r){return cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,a){return l.__proto__=a,l},cc(u,r)}function Zt(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&&cc(u,r)}function zE(u){if(Array.isArray(u))return u}function GE(u,r){var l=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(l!=null){var a,o,f,d,h=[],m=!0,p=!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)&&(h.push(a.value),h.length!==r);m=!0);}catch(b){p=!0,o=b}finally{try{if(!m&&l.return!=null&&(d=l.return(),Object(d)!==d))return}finally{if(p)throw o}}return h}}function fc(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 Wg(u,r){if(u){if(typeof u=="string")return fc(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)?fc(u,r):void 0}}function OE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aa(u,r){return zE(u)||GE(u,r)||Wg(u,r)||OE()}var Ys={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"},Pg=new Int8Array(4),$s=new Int32Array(Pg.buffer,0,1),UE=new Float32Array(Pg.buffer,0,1),kE=/^\s*rgba?\s*\(/,jE=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function BE(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(kE.test(u)){var f=u.match(jE);f&&(r=+f[1],l=+f[2],a=+f[3],f[4]&&(o=+f[4]))}return{r,g:l,b:a,a:o}}var xa={};for(var ru in Ys)xa[ru]=Ur(Ys[ru]),xa[Ys[ru]]=xa[ru];function ep(u,r,l,a,o){return $s[0]=a<<24|l<<16|r<<8|u,$s[0]=$s[0]&4278190079,UE[0]}function Ur(u){if(u=u.toLowerCase(),typeof xa[u]<"u")return xa[u];var r=BE(u),l=r.r,a=r.g,o=r.b,f=r.a;f=f*255|0;var d=ep(l,a,o,f);return xa[u]=d,d}var Vs={};function tp(u){if(typeof Vs[u]<"u")return Vs[u];var r=(u&16711680)>>>16,l=(u&65280)>>>8,a=u&255,o=255,f=ep(r,l,a,o);return Vs[u]=f,f}function Zm(u,r,l,a){return l+(r<<8)+(u<<16)}function Qm(u,r,l,a,o,f){var d=Math.floor(l/f*o),h=Math.floor(u.drawingBufferHeight/f-a/f*o),m=new Uint8Array(4);u.bindFramebuffer(u.FRAMEBUFFER,r),u.readPixels(d,h,1,1,u.RGBA,u.UNSIGNED_BYTE,m);var p=Aa(m,4),b=p[0],v=p[1],S=p[2],w=p[3];return[b,v,S,w]}function Q(u,r,l){return(r=Gr(r))in u?Object.defineProperty(u,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):u[r]=l,u}function Km(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 le(u){for(var r=1;r<arguments.length;r++){var l=arguments[r]!=null?arguments[r]:{};r%2?Km(Object(l),!0).forEach(function(a){Q(u,a,l[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(l)):Km(Object(l)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(l,a))})}return u}function HE(u,r){for(;!{}.hasOwnProperty.call(u,r)&&(u=_a(u))!==null;);return u}function dc(){return dc=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(u,r,l){var a=HE(u,r);if(a){var o=Object.getOwnPropertyDescriptor(a,r);return o.get?o.get.call(arguments.length<3?u:l):o.value}},dc.apply(null,arguments)}function np(u,r,l,a){var o=dc(_a(u.prototype),r,l);return typeof o=="function"?function(f){return o.apply(l,f)}:o}function qE(u){return u.normalized?1:u.size}function Xs(u){var r=0;return u.forEach(function(l){return r+=qE(l)}),r}function ip(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:
12
+ `.concat(d,`
13
+ `).concat(l))}return o}function FE(u,r){return ip("VERTEX",u,r)}function YE(u,r){return ip("FRAGMENT",u,r)}function $E(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 Im(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 Jm=`#define PICKING_MODE
14
+ `,VE=Q(Q(Q(Q(Q(Q(Q(Q({},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),ap=(function(){function u(r,l,a){ht(this,u),Q(this,"array",new Float32Array),Q(this,"constantArray",new Float32Array),Q(this,"capacity",0),Q(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=Xs(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,Jm+o.VERTEX_SHADER_SOURCE,Jm+o.FRAGMENT_SHADER_SOURCE,l):null,this.isInstanced){var f=Xs(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 h=this.CONSTANT_DATA[d];if(h.length!==f)throw new Error("Program: error while getting constant data (one vector has ".concat(h.length," items instead of ").concat(f,")"));for(var m=0;m<h.length;m++)this.constantArray[d*f+m]=h[m]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return mt(u,[{key:"kill",value:function(){Im(this.normalProgram),this.pickProgram&&(Im(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(l,a,o,f,d){var h=this.getDefinition(),m=a.createBuffer();if(m===null)throw new Error("Program: error while creating the WebGL buffer.");var p=FE(a,o),b=YE(a,f),v=$E(a,[p,b]),S={};h.UNIFORMS.forEach(function(R){var j=a.getUniformLocation(v,R);j&&(S[R]=j)});var w={};h.ATTRIBUTES.forEach(function(R){w[R.name]=a.getAttribLocation(v,R.name)});var C;if("CONSTANT_ATTRIBUTES"in h&&(h.CONSTANT_ATTRIBUTES.forEach(function(R){w[R.name]=a.getAttribLocation(v,R.name)}),C=a.createBuffer(),C===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:l,program:v,gl:a,frameBuffer:d,buffer:m,constantBuffer:C||{},uniformLocations:S,attributeLocations:w,isPicking:l==="pick",vertexShader:p,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(h){return o+=a.bindAttribute(h,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(h){return o+=a.bindAttribute(h,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(h){return o+=a.bindAttribute(h,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=VE[l.type];if(typeof d!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(l.type,'"'));var h=a.attributeLocations[l.name],m=a.gl;if(h!==-1){m.enableVertexAttribArray(h);var p=this.isInstanced?(f?this.ATTRIBUTES_ITEMS_COUNT:Xs(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(m.vertexAttribPointer(h,l.size,l.type,l.normalized||!1,p,o),this.isInstanced&&f)if(m instanceof WebGL2RenderingContext)m.vertexAttribDivisor(h,1);else{var b=m.getExtension("ANGLE_instanced_arrays");b&&b.vertexAttribDivisorANGLE(h,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 h=d.getExtension("ANGLE_instanced_arrays");h&&h.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(le(le({},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)}}}])})(),XE=(function(u){function r(){return ht(this,r),Xt(this,r,arguments)}return Zt(r,u),mt(r,[{key:"kill",value:function(){np(r,"kill",this)([])}},{key:"process",value:function(a,o,f){var d=o*this.STRIDE;if(f.hidden){for(var h=d+this.STRIDE;d<h;d++)this.array[d]=0;return}return this.processVisibleItem(tp(a),d,f)}}])})(ap),_c=(function(u){function r(){var l;ht(this,r);for(var a=arguments.length,o=new Array(a),f=0;f<a;f++)o[f]=arguments[f];return l=Xt(this,r,[].concat(o)),Q(l,"drawLabel",void 0),l}return Zt(r,u),mt(r,[{key:"kill",value:function(){np(r,"kill",this)([])}},{key:"process",value:function(a,o,f,d,h){var m=o*this.STRIDE;if(h.hidden||f.hidden||d.hidden){for(var p=m+this.STRIDE;m<p;m++)this.array[m]=0;return}return this.processVisibleItem(tp(a),m,f,d,h)}}])})(ap);function ZE(u,r){return(function(){function l(a,o,f){ht(this,l),Q(this,"drawLabel",r),this.programs=u.map(function(d){return new d(a,o,f)})}return mt(l,[{key:"reallocate",value:function(o){this.programs.forEach(function(f){return f.reallocate(o)})}},{key:"process",value:function(o,f,d,h,m){this.programs.forEach(function(p){return p.process(o,f,d,h,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 QE(u,r,l,a,o){var f=o.edgeLabelSize,d=o.edgeLabelFont,h=o.edgeLabelWeight,m=o.edgeLabelColor.attribute?r[o.edgeLabelColor.attribute]||o.edgeLabelColor.color||"#000":o.edgeLabelColor.color,p=r.label;if(p){u.fillStyle=m,u.font="".concat(h," ").concat(f,"px ").concat(d);var b=l.size,v=a.size,S=l.x,w=l.y,C=a.x,R=a.y,j=(S+C)/2,Y=(w+R)/2,Z=C-S,V=R-w,N=Math.sqrt(Z*Z+V*V);if(!(N<b+v)){S+=Z*b/N,w+=V*b/N,C-=Z*v/N,R-=V*v/N,j=(S+C)/2,Y=(w+R)/2,Z=C-S,V=R-w,N=Math.sqrt(Z*Z+V*V);var L=u.measureText(p).width;if(L>N){var B="…";for(p=p+B,L=u.measureText(p).width;L>N&&p.length>1;)p=p.slice(0,-2)+B,L=u.measureText(p).width;if(p.length<4)return}var U;Z>0?V>0?U=Math.acos(Z/N):U=Math.asin(V/N):V>0?U=Math.acos(Z/N)+Math.PI:U=Math.asin(Z/N)+Math.PI/2,u.save(),u.translate(j,Y),u.rotate(U),u.fillText(p,-L/2,r.size/2+f),u.restore()}}}function rp(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 KE(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 h=u.measureText(r.label).width,m=Math.round(h+5),p=Math.round(a+2*d),b=Math.max(r.size,a/2)+d,v=Math.asin(p/2/b),S=Math.sqrt(Math.abs(Math.pow(b,2)-Math.pow(p/2,2)));u.beginPath(),u.moveTo(r.x+S,r.y+p/2),u.lineTo(r.x+b+m,r.y+p/2),u.lineTo(r.x+b+m,r.y-p/2),u.lineTo(r.x+S,r.y-p/2),u.arc(r.x,r.y,b,v,-v),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,rp(u,r,l)}var IE=`
15
+ precision highp float;
16
+
17
+ varying vec4 v_color;
18
+ varying vec2 v_diffVector;
19
+ varying float v_radius;
20
+
21
+ uniform float u_correctionRatio;
22
+
23
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
24
+
25
+ void main(void) {
26
+ float border = u_correctionRatio * 2.0;
27
+ float dist = length(v_diffVector) - v_radius + border;
28
+
29
+ // No antialiasing for picking mode:
30
+ #ifdef PICKING_MODE
31
+ if (dist > border)
32
+ gl_FragColor = transparent;
33
+ else
34
+ gl_FragColor = v_color;
35
+
36
+ #else
37
+ float t = 0.0;
38
+ if (dist > border)
39
+ t = 1.0;
40
+ else if (dist > 0.0)
41
+ t = dist / border;
42
+
43
+ gl_FragColor = mix(v_color, transparent, t);
44
+ #endif
45
+ }
46
+ `,JE=IE,WE=`
47
+ attribute vec4 a_id;
48
+ attribute vec4 a_color;
49
+ attribute vec2 a_position;
50
+ attribute float a_size;
51
+ attribute float a_angle;
52
+
53
+ uniform mat3 u_matrix;
54
+ uniform float u_sizeRatio;
55
+ uniform float u_correctionRatio;
56
+
57
+ varying vec4 v_color;
58
+ varying vec2 v_diffVector;
59
+ varying float v_radius;
60
+ varying float v_border;
61
+
62
+ const float bias = 255.0 / 254.0;
63
+
64
+ void main() {
65
+ float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
66
+ vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
67
+ vec2 position = a_position + diffVector;
68
+ gl_Position = vec4(
69
+ (u_matrix * vec3(position, 1)).xy,
70
+ 0,
71
+ 1
72
+ );
73
+
74
+ v_diffVector = diffVector;
75
+ v_radius = size / 2.0;
76
+
77
+ #ifdef PICKING_MODE
78
+ // For picking mode, we use the ID as the color:
79
+ v_color = a_id;
80
+ #else
81
+ // For normal mode, we use the color:
82
+ v_color = a_color;
83
+ #endif
84
+
85
+ v_color.a *= bias;
86
+ }
87
+ `,PE=WE,lp=WebGLRenderingContext,Wm=lp.UNSIGNED_BYTE,Zs=lp.FLOAT,eS=["u_sizeRatio","u_correctionRatio","u_matrix"],vu=(function(u){function r(){return ht(this,r),Xt(this,r,arguments)}return Zt(r,u),mt(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:PE,FRAGMENT_SHADER_SOURCE:JE,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:eS,ATTRIBUTES:[{name:"a_position",size:2,type:Zs},{name:"a_size",size:1,type:Zs},{name:"a_color",size:4,type:Wm,normalized:!0},{name:"a_id",size:4,type:Wm,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Zs}],CONSTANT_DATA:[[r.ANGLE_1],[r.ANGLE_2],[r.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,o,f){var d=this.array,h=Ur(f.color);d[o++]=f.x,d[o++]=f.y,d[o++]=f.size,d[o++]=h,d[o++]=a}},{key:"setUniforms",value:function(a,o){var f=o.gl,d=o.uniformLocations,h=d.u_sizeRatio,m=d.u_correctionRatio,p=d.u_matrix;f.uniform1f(m,a.correctionRatio),f.uniform1f(h,a.sizeRatio),f.uniformMatrix3fv(p,!1,a.matrix)}}])})(XE);Q(vu,"ANGLE_1",0);Q(vu,"ANGLE_2",2*Math.PI/3);Q(vu,"ANGLE_3",4*Math.PI/3);var tS=`
88
+ precision mediump float;
89
+
90
+ varying vec4 v_color;
91
+
92
+ void main(void) {
93
+ gl_FragColor = v_color;
94
+ }
95
+ `,nS=tS,iS=`
96
+ attribute vec2 a_position;
97
+ attribute vec2 a_normal;
98
+ attribute float a_radius;
99
+ attribute vec3 a_barycentric;
100
+
101
+ #ifdef PICKING_MODE
102
+ attribute vec4 a_id;
103
+ #else
104
+ attribute vec4 a_color;
105
+ #endif
106
+
107
+ uniform mat3 u_matrix;
108
+ uniform float u_sizeRatio;
109
+ uniform float u_correctionRatio;
110
+ uniform float u_minEdgeThickness;
111
+ uniform float u_lengthToThicknessRatio;
112
+ uniform float u_widenessToThicknessRatio;
113
+
114
+ varying vec4 v_color;
115
+
116
+ const float bias = 255.0 / 254.0;
117
+
118
+ void main() {
119
+ float minThickness = u_minEdgeThickness;
120
+
121
+ float normalLength = length(a_normal);
122
+ vec2 unitNormal = a_normal / normalLength;
123
+
124
+ // These first computations are taken from edge.vert.glsl and
125
+ // edge.clamped.vert.glsl. Please read it to get better comments on what's
126
+ // happening:
127
+ float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
128
+ float webGLThickness = pixelsThickness * u_correctionRatio;
129
+ float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
130
+ float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
131
+ float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
132
+
133
+ float da = a_barycentric.x;
134
+ float db = a_barycentric.y;
135
+ float dc = a_barycentric.z;
136
+
137
+ vec2 delta = vec2(
138
+ da * (webGLNodeRadius * unitNormal.y)
139
+ + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
140
+ + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
141
+
142
+ da * (-webGLNodeRadius * unitNormal.x)
143
+ + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
144
+ + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
145
+ );
146
+
147
+ vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
148
+
149
+ gl_Position = vec4(position, 0, 1);
150
+
151
+ #ifdef PICKING_MODE
152
+ // For picking mode, we use the ID as the color:
153
+ v_color = a_id;
154
+ #else
155
+ // For normal mode, we use the color:
156
+ v_color = a_color;
157
+ #endif
158
+
159
+ v_color.a *= bias;
160
+ }
161
+ `,aS=iS,up=WebGLRenderingContext,Pm=up.UNSIGNED_BYTE,lu=up.FLOAT,rS=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],op={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function sp(u){var r=le(le({},op),{});return(function(l){function a(){return ht(this,a),Xt(this,a,arguments)}return Zt(a,l),mt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:aS,FRAGMENT_SHADER_SOURCE:nS,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:rS,ATTRIBUTES:[{name:"a_position",size:2,type:lu},{name:"a_normal",size:2,type:lu},{name:"a_radius",size:1,type:lu},{name:"a_color",size:4,type:Pm,normalized:!0},{name:"a_id",size:4,type:Pm,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:lu}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(f,d,h,m,p){if(r.extremity==="source"){var b=[m,h];h=b[0],m=b[1]}var v=p.size||1,S=m.size||1,w=h.x,C=h.y,R=m.x,j=m.y,Y=Ur(p.color),Z=R-w,V=j-C,N=Z*Z+V*V,L=0,B=0;N&&(N=1/Math.sqrt(N),L=-V*N*v,B=Z*N*v);var U=this.array;U[d++]=R,U[d++]=j,U[d++]=-L,U[d++]=-B,U[d++]=S,U[d++]=Y,U[d++]=f}},{key:"setUniforms",value:function(f,d){var h=d.gl,m=d.uniformLocations,p=m.u_matrix,b=m.u_sizeRatio,v=m.u_correctionRatio,S=m.u_minEdgeThickness,w=m.u_lengthToThicknessRatio,C=m.u_widenessToThicknessRatio;h.uniformMatrix3fv(p,!1,f.matrix),h.uniform1f(b,f.sizeRatio),h.uniform1f(v,f.correctionRatio),h.uniform1f(S,f.minEdgeThickness),h.uniform1f(w,r.lengthToThicknessRatio),h.uniform1f(C,r.widenessToThicknessRatio)}}])})(_c)}sp();var lS=`
162
+ precision mediump float;
163
+
164
+ varying vec4 v_color;
165
+ varying vec2 v_normal;
166
+ varying float v_thickness;
167
+ varying float v_feather;
168
+
169
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
170
+
171
+ void main(void) {
172
+ // We only handle antialiasing for normal mode:
173
+ #ifdef PICKING_MODE
174
+ gl_FragColor = v_color;
175
+ #else
176
+ float dist = length(v_normal) * v_thickness;
177
+
178
+ float t = smoothstep(
179
+ v_thickness - v_feather,
180
+ v_thickness,
181
+ dist
182
+ );
183
+
184
+ gl_FragColor = mix(v_color, transparent, t);
185
+ #endif
186
+ }
187
+ `,cp=lS,uS=`
188
+ attribute vec4 a_id;
189
+ attribute vec4 a_color;
190
+ attribute vec2 a_normal;
191
+ attribute float a_normalCoef;
192
+ attribute vec2 a_positionStart;
193
+ attribute vec2 a_positionEnd;
194
+ attribute float a_positionCoef;
195
+ attribute float a_radius;
196
+ attribute float a_radiusCoef;
197
+
198
+ uniform mat3 u_matrix;
199
+ uniform float u_zoomRatio;
200
+ uniform float u_sizeRatio;
201
+ uniform float u_pixelRatio;
202
+ uniform float u_correctionRatio;
203
+ uniform float u_minEdgeThickness;
204
+ uniform float u_lengthToThicknessRatio;
205
+ uniform float u_feather;
206
+
207
+ varying vec4 v_color;
208
+ varying vec2 v_normal;
209
+ varying float v_thickness;
210
+ varying float v_feather;
211
+
212
+ const float bias = 255.0 / 254.0;
213
+
214
+ void main() {
215
+ float minThickness = u_minEdgeThickness;
216
+
217
+ float radius = a_radius * a_radiusCoef;
218
+ vec2 normal = a_normal * a_normalCoef;
219
+ vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
220
+
221
+ float normalLength = length(normal);
222
+ vec2 unitNormal = normal / normalLength;
223
+
224
+ // These first computations are taken from edge.vert.glsl. Please read it to
225
+ // get better comments on what's happening:
226
+ float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
227
+ float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
228
+
229
+ // Here, we move the point to leave space for the arrow head:
230
+ float direction = sign(radius);
231
+ float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
232
+ float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
233
+
234
+ vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
235
+
236
+ // Here is the proper position of the vertex
237
+ gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
238
+
239
+ v_thickness = webGLThickness / u_zoomRatio;
240
+
241
+ v_normal = unitNormal;
242
+
243
+ v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
244
+
245
+ #ifdef PICKING_MODE
246
+ // For picking mode, we use the ID as the color:
247
+ v_color = a_id;
248
+ #else
249
+ // For normal mode, we use the color:
250
+ v_color = a_color;
251
+ #endif
252
+
253
+ v_color.a *= bias;
254
+ }
255
+ `,oS=uS,fp=WebGLRenderingContext,eg=fp.UNSIGNED_BYTE,Ci=fp.FLOAT,sS=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],cS={lengthToThicknessRatio:op.lengthToThicknessRatio};function dp(u){var r=le(le({},cS),{});return(function(l){function a(){return ht(this,a),Xt(this,a,arguments)}return Zt(a,l),mt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:oS,FRAGMENT_SHADER_SOURCE:cp,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:sS,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ci},{name:"a_positionEnd",size:2,type:Ci},{name:"a_normal",size:2,type:Ci},{name:"a_color",size:4,type:eg,normalized:!0},{name:"a_id",size:4,type:eg,normalized:!0},{name:"a_radius",size:1,type:Ci}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ci},{name:"a_normalCoef",size:1,type:Ci},{name:"a_radiusCoef",size:1,type:Ci}],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,h,m,p){var b=p.size||1,v=h.x,S=h.y,w=m.x,C=m.y,R=Ur(p.color),j=w-v,Y=C-S,Z=m.size||1,V=j*j+Y*Y,N=0,L=0;V&&(V=1/Math.sqrt(V),N=-Y*V*b,L=j*V*b);var B=this.array;B[d++]=v,B[d++]=S,B[d++]=w,B[d++]=C,B[d++]=N,B[d++]=L,B[d++]=R,B[d++]=f,B[d++]=Z}},{key:"setUniforms",value:function(f,d){var h=d.gl,m=d.uniformLocations,p=m.u_matrix,b=m.u_zoomRatio,v=m.u_feather,S=m.u_pixelRatio,w=m.u_correctionRatio,C=m.u_sizeRatio,R=m.u_minEdgeThickness,j=m.u_lengthToThicknessRatio;h.uniformMatrix3fv(p,!1,f.matrix),h.uniform1f(b,f.zoomRatio),h.uniform1f(C,f.sizeRatio),h.uniform1f(w,f.correctionRatio),h.uniform1f(S,f.pixelRatio),h.uniform1f(v,f.antiAliasingFeather),h.uniform1f(R,f.minEdgeThickness),h.uniform1f(j,r.lengthToThicknessRatio)}}])})(_c)}dp();function hp(u){return ZE([dp(),sp()])}var fS=hp(),dS=fS,hS=`
256
+ attribute vec4 a_id;
257
+ attribute vec4 a_color;
258
+ attribute vec2 a_normal;
259
+ attribute float a_normalCoef;
260
+ attribute vec2 a_positionStart;
261
+ attribute vec2 a_positionEnd;
262
+ attribute float a_positionCoef;
263
+
264
+ uniform mat3 u_matrix;
265
+ uniform float u_sizeRatio;
266
+ uniform float u_zoomRatio;
267
+ uniform float u_pixelRatio;
268
+ uniform float u_correctionRatio;
269
+ uniform float u_minEdgeThickness;
270
+ uniform float u_feather;
271
+
272
+ varying vec4 v_color;
273
+ varying vec2 v_normal;
274
+ varying float v_thickness;
275
+ varying float v_feather;
276
+
277
+ const float bias = 255.0 / 254.0;
278
+
279
+ void main() {
280
+ float minThickness = u_minEdgeThickness;
281
+
282
+ vec2 normal = a_normal * a_normalCoef;
283
+ vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
284
+
285
+ float normalLength = length(normal);
286
+ vec2 unitNormal = normal / normalLength;
287
+
288
+ // We require edges to be at least "minThickness" pixels thick *on screen*
289
+ // (so we need to compensate the size ratio):
290
+ float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
291
+
292
+ // Then, we need to retrieve the normalized thickness of the edge in the WebGL
293
+ // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
294
+ // ratio:
295
+ float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
296
+
297
+ // Here is the proper position of the vertex
298
+ gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
299
+
300
+ // For the fragment shader though, we need a thickness that takes the "magic"
301
+ // correction ratio into account (as in webGLThickness), but so that the
302
+ // antialiasing effect does not depend on the zoom level. So here's yet
303
+ // another thickness version:
304
+ v_thickness = webGLThickness / u_zoomRatio;
305
+
306
+ v_normal = unitNormal;
307
+
308
+ v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
309
+
310
+ #ifdef PICKING_MODE
311
+ // For picking mode, we use the ID as the color:
312
+ v_color = a_id;
313
+ #else
314
+ // For normal mode, we use the color:
315
+ v_color = a_color;
316
+ #endif
317
+
318
+ v_color.a *= bias;
319
+ }
320
+ `,mS=hS,mp=WebGLRenderingContext,tg=mp.UNSIGNED_BYTE,Rr=mp.FLOAT,gS=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],pS=(function(u){function r(){return ht(this,r),Xt(this,r,arguments)}return Zt(r,u),mt(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:mS,FRAGMENT_SHADER_SOURCE:cp,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:gS,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Rr},{name:"a_positionEnd",size:2,type:Rr},{name:"a_normal",size:2,type:Rr},{name:"a_color",size:4,type:tg,normalized:!0},{name:"a_id",size:4,type:tg,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Rr},{name:"a_normalCoef",size:1,type:Rr}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,o,f,d,h){var m=h.size||1,p=f.x,b=f.y,v=d.x,S=d.y,w=Ur(h.color),C=v-p,R=S-b,j=C*C+R*R,Y=0,Z=0;j&&(j=1/Math.sqrt(j),Y=-R*j*m,Z=C*j*m);var V=this.array;V[o++]=p,V[o++]=b,V[o++]=v,V[o++]=S,V[o++]=Y,V[o++]=Z,V[o++]=w,V[o++]=a}},{key:"setUniforms",value:function(a,o){var f=o.gl,d=o.uniformLocations,h=d.u_matrix,m=d.u_zoomRatio,p=d.u_feather,b=d.u_pixelRatio,v=d.u_correctionRatio,S=d.u_sizeRatio,w=d.u_minEdgeThickness;f.uniformMatrix3fv(h,!1,a.matrix),f.uniform1f(m,a.zoomRatio),f.uniform1f(S,a.sizeRatio),f.uniform1f(v,a.correctionRatio),f.uniform1f(b,a.pixelRatio),f.uniform1f(p,a.antiAliasingFeather),f.uniform1f(w,a.minEdgeThickness)}}])})(_c),Ac=(function(u){function r(){var l;return ht(this,r),l=Xt(this,r),l.rawEmitter=l,l}return Zt(r,u),mt(r)})(kg.EventEmitter),Qs,ng;function vS(){return ng||(ng=1,Qs=function(r){return r!==null&&typeof r=="object"&&typeof r.addUndirectedEdgeWithKey=="function"&&typeof r.dropNode=="function"&&typeof r.multi=="boolean"}),Qs}var yS=vS();const bS=Uy(yS);var ES=function(r){return r},SS=function(r){return r*r},wS=function(r){return r*(2-r)},TS=function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},xS=function(r){return r*r*r},_S=function(r){return--r*r*r+1},AS=function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},NS={linear:ES,quadraticIn:SS,quadraticOut:wS,quadraticInOut:TS,cubicIn:xS,cubicOut:_S,cubicInOut:AS},CS={easing:"quadraticInOut",duration:150};function Wt(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function uu(u,r,l){return u[0]=r,u[4]=typeof l=="number"?l:r,u}function ig(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 ag(u,r,l){return u[6]=r,u[7]=l,u}function oi(u,r){var l=u[0],a=u[1],o=u[2],f=u[3],d=u[4],h=u[5],m=u[6],p=u[7],b=u[8],v=r[0],S=r[1],w=r[2],C=r[3],R=r[4],j=r[5],Y=r[6],Z=r[7],V=r[8];return u[0]=v*l+S*f+w*m,u[1]=v*a+S*d+w*p,u[2]=v*o+S*h+w*b,u[3]=C*l+R*f+j*m,u[4]=C*a+R*d+j*p,u[5]=C*o+R*h+j*b,u[6]=Y*l+Z*f+V*m,u[7]=Y*a+Z*d+V*p,u[8]=Y*o+Z*h+V*b,u}function hc(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],h=u[6],m=u[7],p=r.x,b=r.y;return{x:p*a+b*f+h*l,y:p*o+b*d+m*l}}function RS(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,h=u.x,m=u.y,p=r.width,b=r.height,v=Wt(),S=Math.min(p,b)-2*a,w=RS(r,l);return o?(oi(v,ag(Wt(),h,m)),oi(v,uu(Wt(),d)),oi(v,ig(Wt(),f)),oi(v,uu(Wt(),p/S/2/w,b/S/2/w))):(oi(v,uu(Wt(),2*(S/p)*w,2*(S/b)*w)),oi(v,ig(Wt(),-f)),oi(v,uu(Wt(),1/d)),oi(v,ag(Wt(),-h,-m))),v}function DS(u,r,l){var a=hc(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 LS(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 h=d.x,m=d.y;h<r&&(r=h),h>l&&(l=h),m<a&&(a=m),m>o&&(o=m)}),{x:[r,l],y:[a,o]}}function MS(u){if(!bS(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 zS(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 rg(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function lg(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 ug(u){var r=Aa(u.x,2),l=r[0],a=r[1],o=Aa(u.y,2),f=o[0],d=o[1],h=Math.max(a-l,d-f),m=(a+l)/2,p=(d+f)/2;(h===0||Math.abs(h)===1/0||isNaN(h))&&(h=1),isNaN(m)&&(m=0),isNaN(p)&&(p=0);var b=function(S){return{x:.5+(S.x-m)/h,y:.5+(S.y-p)/h}};return b.applyTo=function(v){v.x=.5+(v.x-m)/h,v.y=.5+(v.y-p)/h},b.inverse=function(v){return{x:m+h*(v.x-.5),y:p+h*(v.y-.5)}},b.ratio=h,b}function mc(u){"@babel/helpers - typeof";return mc=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},mc(u)}function og(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 Ks(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:QE,defaultDrawNodeLabel:rp,defaultDrawNodeHover:KE,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:{}},GS={circle:vu},OS={arrow:dS,line:pS};function Is(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 US(u){var r=Ks({},Nc,u);return r.nodeProgramClasses=Ks({},GS,r.nodeProgramClasses),r.edgeProgramClasses=Ks({},OS,r.edgeProgramClasses),r}var ou=1.5,sg=(function(u){function r(){var l;return ht(this,r),l=Xt(this,r),Q(l,"x",.5),Q(l,"y",.5),Q(l,"angle",0),Q(l,"ratio",1),Q(l,"minRatio",null),Q(l,"maxRatio",null),Q(l,"enabledZooming",!0),Q(l,"enabledPanning",!0),Q(l,"enabledRotation",!0),Q(l,"clean",null),Q(l,"nextFrame",null),Q(l,"previousState",null),Q(l,"enabled",!0),l.previousState=l.getState(),l}return Zt(r,u),mt(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(le(le({},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(w){return o.animate(a,f,w)});if(this.enabled){var h=le(le({},CS),f),m=this.validateState(a),p=typeof h.easing=="function"?h.easing:NS[h.easing],b=Date.now(),v=this.getState(),S=function(){var C=(Date.now()-b)/h.duration;if(C>=1){o.nextFrame=null,o.setState(m),o.animationCallback&&(o.animationCallback.call(null),o.animationCallback=void 0);return}var R=p(C),j={};typeof m.x=="number"&&(j.x=v.x+(m.x-v.x)*R),typeof m.y=="number"&&(j.y=v.y+(m.y-v.y)*R),o.enabledRotation&&typeof m.angle=="number"&&(j.angle=v.angle+(m.angle-v.angle)*R),typeof m.ratio=="number"&&(j.ratio=v.ratio+(m.ratio-v.ratio)*R),o.setState(j),o.nextFrame=requestAnimationFrame(S)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(S)):S(),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||ou)},a):this.animate({ratio:this.ratio/ou})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||ou)},a):this.animate({ratio:this.ratio*ou})}},{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)}}])})(Ac);function en(u,r){var l=r.getBoundingClientRect();return{x:u.clientX-l.left,y:u.clientY-l.top}}function Ln(u,r){var l=le(le({},en(u,r)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){l.sigmaDefaultPrevented=!0},original:u});return l}function Lr(u){var r="x"in u?u:le(le({},u.touches[0]||u.previousTouches[0]),{},{original:u.original,sigmaDefaultPrevented:u.sigmaDefaultPrevented,preventSigmaDefault:function(){u.sigmaDefaultPrevented=!0,r.sigmaDefaultPrevented=!0}});return r}function kS(u,r){return le(le({},Ln(u,r)),{},{delta:gp(u)})}var jS=2;function fu(u){for(var r=[],l=0,a=Math.min(u.length,jS);l<a;l++)r.push(u[l]);return r}function Mr(u,r,l){var a={touches:fu(u.touches).map(function(o){return en(o,l)}),previousTouches:r.map(function(o){return en(o,l)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){a.sigmaDefaultPrevented=!0},original:u};return a}function gp(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 pp=(function(u){function r(l,a){var o;return ht(this,r),o=Xt(this,r),o.container=l,o.renderer=a,o}return Zt(r,u),mt(r)})(Ac),BS=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],HS=BS.reduce(function(u,r){return le(le({},u),{},Q({},r,Nc[r]))},{}),qS=(function(u){function r(l,a){var o;return ht(this,r),o=Xt(this,r,[l,a]),Q(o,"enabled",!0),Q(o,"draggedEvents",0),Q(o,"downStartTime",null),Q(o,"lastMouseX",null),Q(o,"lastMouseY",null),Q(o,"isMouseDown",!1),Q(o,"isMoving",!1),Q(o,"movingTimeout",null),Q(o,"startCameraState",null),Q(o,"clicks",0),Q(o,"doubleClickTimeout",null),Q(o,"currentWheelDirection",0),Q(o,"settings",HS),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 Zt(r,u),mt(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",Ln(a,this.container))}}},{key:"handleRightClick",value:function(a){this.enabled&&this.emit("rightClick",Ln(a,this.container))}},{key:"handleDoubleClick",value:function(a){if(this.enabled){a.preventDefault(),a.stopPropagation();var o=Ln(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(en(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=en(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",Ln(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=en(a,this.container),h=d.x,m=d.y,p=f.getState(),b=f.getPreviousState()||{x:0,y:0};this.isMoving?f.animate({x:p.x+this.settings.inertiaRatio*(p.x-b.x),y:p.y+this.settings.inertiaRatio*(p.y-b.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==h||this.lastMouseY!==m)&&f.setState({x:p.x,y:p.y}),this.isMoving=!1,setTimeout(function(){var v=o.draggedEvents>0;o.draggedEvents=0,v&&o.renderer.getSetting("hideEdgesOnMove")&&o.renderer.refresh()},0),this.emit("mouseup",Ln(a,this.container))}}},{key:"handleMove",value:function(a){var o=this;if(this.enabled){var f=Ln(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(),h=en(a,this.container),m=h.x,p=h.y,b=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),v=this.renderer.viewportToFramedGraph({x:m,y:p}),S=b.x-v.x,w=b.y-v.y,C=d.getState(),R=C.x+S,j=C.y+w;d.setState({x:R,y:j}),this.lastMouseX=m,this.lastMouseY=p,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",Ln(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",Ln(a,this.container))}},{key:"handleWheel",value:function(a){var o=this,f=this.renderer.getCamera();if(!(!this.enabled||!f.enabledZooming)){var d=gp(a);if(d){var h=kS(a,this.container);if(this.emit("wheel",h),h.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var m=f.getState().ratio,p=d>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,b=f.getBoundedRatio(m*p),v=d>0?1:-1,S=Date.now();m!==b&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===v&&this.lastWheelTriggerTime&&S-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(f.animate(this.renderer.getViewportZoomedState(en(a,this.container),b),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){o.currentWheelDirection=0}),this.currentWheelDirection=v,this.lastWheelTriggerTime=S))}}}},{key:"setSettings",value:function(a){this.settings=a}}])})(pp),FS=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],YS=FS.reduce(function(u,r){return le(le({},u),{},Q({},r,Nc[r]))},{}),$S=(function(u){function r(l,a){var o;return ht(this,r),o=Xt(this,r,[l,a]),Q(o,"enabled",!0),Q(o,"isMoving",!1),Q(o,"hasMoved",!1),Q(o,"touchMode",0),Q(o,"startTouchesPositions",[]),Q(o,"lastTouches",[]),Q(o,"lastTap",null),Q(o,"settings",YS),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 Zt(r,u),mt(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=fu(a.touches);if(this.touchMode=f.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=f.map(function(w){return en(w,o.container)}),this.touchMode===2){var d=Aa(this.startTouchesPositions,2),h=d[0],m=h.x,p=h.y,b=d[1],v=b.x,S=b.y;this.startTouchesAngle=Math.atan2(S-p,v-m),this.startTouchesDistance=Math.sqrt(Math.pow(v-m,2)+Math.pow(S-p,2))}this.emit("touchdown",Mr(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",Mr(a,this.lastTouches,this.container)),!a.touches.length){var h=en(this.lastTouches[0],this.container),m=this.startTouchesPositions[0],p=Math.pow(h.x-m.x,2)+Math.pow(h.y-m.y,2);if(!a.touches.length&&p<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var b=Mr(a,this.lastTouches,this.container);if(this.emit("doubletap",b),this.lastTap=null,!b.sigmaDefaultPrevented){var v=this.renderer.getCamera(),S=v.getBoundedRatio(v.getState().ratio/this.settings.doubleClickZoomingRatio);v.animate(this.renderer.getViewportZoomedState(h,S),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var w=Mr(a,this.lastTouches,this.container);this.emit("tap",w),this.lastTap={time:Date.now(),position:w.touches[0]||w.previousTouches[0]}}}this.lastTouches=fu(a.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(a){var o=this;if(!(!this.enabled||!this.startTouchesPositions.length)){a.preventDefault();var f=fu(a.touches),d=f.map(function(x){return en(x,o.container)}),h=this.lastTouches;this.lastTouches=f,this.lastTouchesPositions=d;var m=Mr(a,h,this.container);if(this.emit("touchmove",m),!m.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=d.some(function(x,D){var J=o.startTouchesPositions[D];return J&&(x.x!==J.x||x.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 p=this.renderer.getCamera(),b=this.startCameraState,v=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var S=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),w=S.x,C=S.y,R=this.renderer.viewportToFramedGraph(d[0]),j=R.x,Y=R.y;p.setState({x:b.x+w-j,y:b.y+C-Y});break}case 2:{var Z={x:.5,y:.5,angle:0,ratio:1},V=d[0],N=V.x,L=V.y,B=d[1],U=B.x,W=B.y,K=Math.atan2(W-L,U-N)-this.startTouchesAngle,P=Math.hypot(W-L,U-N)/this.startTouchesDistance,oe=p.getBoundedRatio(b.ratio/P);Z.ratio=oe,Z.angle=b.angle+K;var se=this.getDimensions(),Ce=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:b}),xe=Math.min(se.width,se.height)-2*v,ue=xe/se.width,O=xe/se.height,I=oe/xe,ne=N-xe/2/ue,fe=L-xe/2/O,ge=[ne*Math.cos(-Z.angle)-fe*Math.sin(-Z.angle),fe*Math.cos(-Z.angle)+ne*Math.sin(-Z.angle)];ne=ge[0],fe=ge[1],Z.x=Ce.x-ne*I,Z.y=Ce.y+fe*I,p.setState(Z);break}}}}}},{key:"setSettings",value:function(a){this.settings=a}}])})(pp);function VS(u){if(Array.isArray(u))return fc(u)}function XS(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function ZS(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
321
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cg(u){return VS(u)||XS(u)||Wg(u)||ZS()}function QS(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 Js(u,r){if(u==null)return{};var l,a,o=QS(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 fg=(function(){function u(r,l){ht(this,u),this.key=r,this.size=l}return mt(u,null,[{key:"compare",value:function(l,a){return l.size>a.size?-1:l.size<a.size||l.key>a.key?1:-1}}])})(),dg=(function(){function u(){ht(this,u),Q(this,"width",0),Q(this,"height",0),Q(this,"cellSize",0),Q(this,"columns",0),Q(this,"rows",0),Q(this,"cells",{})}return mt(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 fg(l,a),d=this.getIndex(o),h=this.cells[d];h||(h=[],this.cells[d]=h),h.push(f)}},{key:"organize",value:function(){for(var l in this.cells){var a=this.cells[l];a.sort(fg.compare)}}},{key:"getLabelsToDisplay",value:function(l,a){var o=this.cellSize*this.cellSize,f=o/l/l,d=f*a/o,h=Math.ceil(d),m=[];for(var p in this.cells)for(var b=this.cells[p],v=0;v<Math.min(h,b.length);v++)m.push(b[v].key);return m}}])})();function KS(u){var r=u.graph,l=u.hoveredNode,a=u.highlightedNodes,o=u.displayedNodeLabels,f=[];return r.forEachEdge(function(d,h,m,p){(m===l||p===l||a.has(m)||a.has(p)||o.has(m)&&o.has(p))&&f.push(d)}),f}var hg=150,mg=50,Mn=Object.prototype.hasOwnProperty;function IS(u,r,l){if(!Mn.call(l,"x")||!Mn.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),Mn.call(l,"hidden")||(l.hidden=!1),Mn.call(l,"highlighted")||(l.highlighted=!1),Mn.call(l,"forceLabel")||(l.forceLabel=!1),(!l.type||l.type==="")&&(l.type=u.defaultNodeType),l.zIndex||(l.zIndex=0),l}function JS(u,r,l){return l.color||(l.color=u.defaultEdgeColor),l.label||(l.label=""),l.size||(l.size=.5),Mn.call(l,"hidden")||(l.hidden=!1),Mn.call(l,"forceLabel")||(l.forceLabel=!1),(!l.type||l.type==="")&&(l.type=u.defaultEdgeType),l.zIndex||(l.zIndex=0),l}var WS=(function(u){function r(l,a){var o,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(ht(this,r),o=Xt(this,r),Q(o,"elements",{}),Q(o,"canvasContexts",{}),Q(o,"webGLContexts",{}),Q(o,"pickingLayers",new Set),Q(o,"textures",{}),Q(o,"frameBuffers",{}),Q(o,"activeListeners",{}),Q(o,"labelGrid",new dg),Q(o,"nodeDataCache",{}),Q(o,"edgeDataCache",{}),Q(o,"nodeProgramIndex",{}),Q(o,"edgeProgramIndex",{}),Q(o,"nodesWithForcedLabels",new Set),Q(o,"edgesWithForcedLabels",new Set),Q(o,"nodeExtent",{x:[0,1],y:[0,1]}),Q(o,"nodeZExtent",[1/0,-1/0]),Q(o,"edgeZExtent",[1/0,-1/0]),Q(o,"matrix",Wt()),Q(o,"invMatrix",Wt()),Q(o,"correctionRatio",1),Q(o,"customBBox",null),Q(o,"normalizationFunction",ug({x:[0,1],y:[0,1]})),Q(o,"graphToViewportRatio",1),Q(o,"itemIDsIndex",{}),Q(o,"nodeIndices",{}),Q(o,"edgeIndices",{}),Q(o,"width",0),Q(o,"height",0),Q(o,"pixelRatio",rg()),Q(o,"pickingDownSizingRatio",2*o.pixelRatio),Q(o,"displayedNodeLabels",new Set),Q(o,"displayedEdgeLabels",new Set),Q(o,"highlightedNodes",new Set),Q(o,"hoveredNode",null),Q(o,"hoveredEdge",null),Q(o,"renderFrame",null),Q(o,"renderHighlightedNodesFrame",null),Q(o,"needToProcess",!1),Q(o,"checkEdgesEventsFrame",null),Q(o,"nodePrograms",{}),Q(o,"nodeHoverPrograms",{}),Q(o,"edgePrograms",{}),o.settings=US(f),Is(o.settings),MS(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 h in o.settings.edgeProgramClasses)o.registerEdgeProgram(h,o.settings.edgeProgramClasses[h]);return o.camera=new sg,o.bindCameraHandlers(),o.mouseCaptor=new qS(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new $S(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return Zt(r,u),mt(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=Js(o,[a].map(Gr));f.kill(),this.nodePrograms=d}if(this.nodeHoverPrograms[a]){var h=this.nodeHoverPrograms,m=h[a],p=Js(h,[a].map(Gr));m.kill(),this.nodePrograms=p}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var o=this.edgePrograms,f=o[a],d=Js(o,[a].map(Gr));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 h=o.createTexture();return o.bindFramebuffer(o.FRAMEBUFFER,f),o.bindTexture(o.TEXTURE_2D,h),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,h,0),this.textures[a]=h,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=Qm(this.webGLContexts.nodes,this.frameBuffers.nodes,o,f,this.pixelRatio,this.pickingDownSizingRatio),h=Zm.apply(void 0,cg(d)),m=this.itemIDsIndex[h];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=Lr(f),h={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}},m=a.getNodeAtPosition(d);if(m&&a.hoveredNode!==m&&!a.nodeDataCache[m].hidden){a.hoveredNode&&a.emit("leaveNode",le(le({},h),{},{node:a.hoveredNode})),a.hoveredNode=m,a.emit("enterNode",le(le({},h),{},{node:m})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(d)!==a.hoveredNode){var p=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",le(le({},h),{},{node:p})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var b=a.hoveredNode?null:a.getEdgeAtPoint(h.event.x,h.event.y);b!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",le(le({},h),{},{edge:a.hoveredEdge})),b&&a.emit("enterEdge",le(le({},h),{},{edge:b})),a.hoveredEdge=b)}},this.activeListeners.handleMoveBody=function(f){var d=Lr(f);a.emit("moveBody",{event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(f){var d=Lr(f),h={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",le(le({},h),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",le(le({},h),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",le({},h))},this.activeListeners.handleEnter=function(f){var d=Lr(f),h={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}};a.emit("enterStage",le({},h))};var o=function(d){return function(h){var m=Lr(h),p={event:m,preventSigmaDefault:function(){m.preventSigmaDefault()}},b=a.getNodeAtPosition(m);if(b)return a.emit("".concat(d,"Node"),le(le({},p),{},{node:b}));if(a.settings.enableEdgeEvents){var v=a.getEdgeAtPoint(m.x,m.y);if(v)return a.emit("".concat(d,"Edge"),le(le({},p),{},{edge:v}))}return a.emit("".concat(d,"Stage"),p)}};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 h,m=(h=d.hints)===null||h===void 0?void 0:h.attributes;a.graph.forEachNode(function(b){return a.updateNode(b)});var p=!m||m.some(function(b){return f.has(b)});a.refresh({partialGraph:{nodes:o.nodes()},skipIndexation:!p,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(d){var h,m=(h=d.hints)===null||h===void 0?void 0:h.attributes;a.graph.forEachEdge(function(b){return a.updateEdge(b)});var p=m&&["zIndex","type"].some(function(b){return m?.includes(b)});a.refresh({partialGraph:{edges:o.edges()},skipIndexation:!p,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(d){var h=d.key;a.addNode(h),a.refresh({partialGraph:{nodes:[h]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(d){var h=d.key;a.refresh({partialGraph:{nodes:[h]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(d){var h=d.key;a.removeNode(h),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(d){var h=d.key;a.addEdge(h),a.refresh({partialGraph:{edges:[h]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(d){var h=d.key;a.refresh({partialGraph:{edges:[h]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(d){var h=d.key;a.removeEdge(h),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=Qm(this.webGLContexts.edges,this.frameBuffers.edges,a,o,this.pixelRatio,this.pickingDownSizingRatio),d=Zm.apply(void 0,cg(f)),h=this.itemIDsIndex[d];return h&&h.type==="edge"?h.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=LS(this.graph),!this.settings.autoRescale){var h=d.width,m=d.height,p=this.nodeExtent,b=p.x,v=p.y;this.nodeExtent={x:[(b[0]+b[1])/2-h/2,(b[0]+b[1])/2+h/2],y:[(v[0]+v[1])/2-m/2,(v[0]+v[1])/2+m/2]}}this.normalizationFunction=ug(this.customBBox||this.nodeExtent);var S=new sg,w=Dr(S.getState(),d,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(d,f.labelGridCellSize);for(var C={},R={},j={},Y={},Z=1,V=o.nodes(),N=0,L=V.length;N<L;N++){var B=V[N],U=this.nodeDataCache[B],W=o.getNodeAttributes(B);U.x=W.x,U.y=W.y,this.normalizationFunction.applyTo(U),typeof U.label=="string"&&!U.hidden&&this.labelGrid.add(B,U.size,this.framedGraphToViewport(U,{matrix:w})),C[U.type]=(C[U.type]||0)+1}this.labelGrid.organize();for(var K in this.nodePrograms){if(!Mn.call(this.nodePrograms,K))throw new Error('Sigma: could not find a suitable program for node type "'.concat(K,'"!'));this.nodePrograms[K].reallocate(C[K]||0),C[K]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(V=lg(this.nodeZExtent,function(me){return a.nodeDataCache[me].zIndex},V));for(var P=0,oe=V.length;P<oe;P++){var se=V[P];R[se]=Z,Y[R[se]]={type:"node",id:se},Z++;var Ce=this.nodeDataCache[se];this.addNodeToProgram(se,R[se],C[Ce.type]++)}for(var xe={},ue=o.edges(),O=0,I=ue.length;O<I;O++){var ne=ue[O],fe=this.edgeDataCache[ne];xe[fe.type]=(xe[fe.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(ue=lg(this.edgeZExtent,function(me){return a.edgeDataCache[me].zIndex},ue));for(var ge in this.edgePrograms){if(!Mn.call(this.edgePrograms,ge))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(ge,'"!'));this.edgePrograms[ge].reallocate(xe[ge]||0),xe[ge]=0}for(var x=0,D=ue.length;x<D;x++){var J=ue[x];j[J]=Z,Y[j[J]]={type:"edge",id:J},Z++;var ie=this.edgeDataCache[J];this.addEdgeToProgram(J,j[J],xe[ie.type]++)}return this.itemIDsIndex=Y,this.nodeIndices=R,this.edgeIndices=j,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&&mc(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 h in a.edgeProgramClasses)f.edgeProgramClasses[h]||this.unregisterEdgeProgram(h)}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 p in a.nodeProgramClasses)f.nodeProgramClasses[p]||this.unregisterNodeProgram(p)}}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,h=o.boundaries,m=le({},a),p=h||this.nodeExtent,b=Aa(p.x,2),v=b[0],S=b[1],w=Aa(p.y,2),C=w[0],R=w[1],j=[this.graphToViewport({x:v,y:C},{cameraState:a}),this.graphToViewport({x:S,y:C},{cameraState:a}),this.graphToViewport({x:v,y:R},{cameraState:a}),this.graphToViewport({x:S,y:R},{cameraState:a})],Y=1/0,Z=-1/0,V=1/0,N=-1/0;j.forEach(function(xe){var ue=xe.x,O=xe.y;Y=Math.min(Y,ue),Z=Math.max(Z,ue),V=Math.min(V,O),N=Math.max(N,O)});var L=Z-Y,B=N-V,U=this.getDimensions(),W=U.width,K=U.height,P=0,oe=0;if(L>=W?Z<W-d?P=Z-(W-d):Y>d&&(P=Y-d):Z>W+d?P=Z-(W+d):Y<-d&&(P=Y+d),B>=K?N<K-d?oe=N-(K-d):V>d&&(oe=V-d):N>K+d?oe=N-(K+d):V<-d&&(oe=V+d),P||oe){var se=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),Ce=this.viewportToFramedGraph({x:P,y:oe},{cameraState:a});P=Ce.x-se.x,oe=Ce.y-se.y,m.x+=P,m.y+=oe}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);og(o,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var f=this.canvasContexts.labels,d=0,h=o.length;d<h;d++){var m=o[d],p=this.nodeDataCache[m];if(!this.displayedNodeLabels.has(m)&&!p.hidden){var b=this.framedGraphToViewport(p),v=b.x,S=b.y,w=this.scaleSize(p.size);if(!(!p.forceLabel&&w<this.settings.labelRenderedSizeThreshold)&&!(v<-hg||v>this.width+hg||S<-mg||S>this.height+mg)){this.displayedNodeLabels.add(m);var C=this.settings.defaultDrawNodeLabel,R=this.nodePrograms[p.type],j=R?.drawLabel||C;j(f,le(le({key:m},p),{},{size:w,x:v,y:S}),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=KS({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});og(o,this.edgesWithForcedLabels);for(var f=new Set,d=0,h=o.length;d<h;d++){var m=o[d],p=this.graph.extremities(m),b=this.nodeDataCache[p[0]],v=this.nodeDataCache[p[1]],S=this.edgeDataCache[m];if(!f.has(m)&&!(S.hidden||b.hidden||v.hidden)){var w=this.settings.defaultDrawEdgeLabel,C=this.edgePrograms[S.type],R=C?.drawLabel||w;R(a,le(le({key:m},S),{},{size:this.scaleSize(S.size)}),le(le(le({key:p[0]},b),this.framedGraphToViewport(b)),{},{size:this.scaleSize(b.size)}),le(le(le({key:p[1]},v),this.framedGraphToViewport(v)),{},{size:this.scaleSize(v.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(w){var C=a.nodeDataCache[w],R=a.framedGraphToViewport(C),j=R.x,Y=R.y,Z=a.scaleSize(C.size),V=a.settings.defaultDrawNodeHover,N=a.nodePrograms[C.type],L=N?.drawHover||V;L(o,le(le({key:w},C),{},{size:Z,x:j,y:Y}),a.settings)},d=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&d.push(this.hoveredNode),this.highlightedNodes.forEach(function(S){S!==a.hoveredNode&&d.push(S)}),d.forEach(function(S){return f(S)});var h={};d.forEach(function(S){var w=a.nodeDataCache[S].type;h[w]=(h[w]||0)+1});for(var m in this.nodeHoverPrograms)this.nodeHoverPrograms[m].reallocate(h[m]||0),h[m]=0;d.forEach(function(S){var w=a.nodeDataCache[S];a.nodeHoverPrograms[w.type].process(0,h[w.type]++,w)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var p=this.getRenderParams();for(var b in this.nodeHoverPrograms){var v=this.nodeHoverPrograms[b];v.render(p)}}},{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(j){return a.resetWebGLTexture(j)}),!this.graph.order)return o();var f=this.mouseCaptor,d=this.camera.isAnimated()||f.isMoving||f.draggedEvents||f.currentWheelDirection,h=this.camera.getState(),m=this.getDimensions(),p=this.getGraphDimensions(),b=this.getStagePadding();this.matrix=Dr(h,m,p,b),this.invMatrix=Dr(h,m,p,b,!0),this.correctionRatio=DS(this.matrix,h,m),this.graphToViewportRatio=this.getGraphToViewportRatio();var v=this.getRenderParams();for(var S in this.nodePrograms){var w=this.nodePrograms[S];w.render(v)}if(!this.settings.hideEdgesOnMove||!d)for(var C in this.edgePrograms){var R=this.edgePrograms[C];R.render(v)}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=IS(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=JS(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 dg,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],h=this.nodePrograms[d.type];if(!h)throw new Error('Sigma: could not find a suitable program for node type "'.concat(d.type,'"!'));h.process(o,f,d),this.nodeProgramIndex[a]=f}},{key:"addEdgeToProgram",value:function(a,o,f){var d=this.edgeDataCache[a],h=this.edgePrograms[d.type];if(!h)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(d.type,'"!'));var m=this.graph.extremities(a),p=this.nodeDataCache[m[0]],b=this.nodeDataCache[m[1]];h.process(o,f,p,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=zS(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=le({preserveDrawingBuffer:!1,antialias:!1},o),h;h=f.getContext("webgl2",d),h||(h=f.getContext("webgl",d)),h||(h=f.getContext("experimental-webgl",d));var m=h;if(this.webGLContexts[a]=m,m.blendFunc(m.ONE,m.ONE_MINUS_SRC_ALPHA),o.picking){this.pickingLayers.add(a);var p=m.createFramebuffer();if(!p)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=p}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 le({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,o){var f=le({},this.settings);return this.settings[a]=o,Is(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=le({},this.settings);return this.settings=le(le({},this.settings),a),Is(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=rg(),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 h=this.elements[d];h.style.width=this.width+"px",h.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 p in this.webGLContexts){this.elements[p].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[p].setAttribute("height",this.height*this.pixelRatio+"px");var b=this.webGLContexts[p];if(b.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(p)){var v=this.textures[p];v&&b.deleteTexture(v)}}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,h=!a||!a.partialGraph;if(h)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(N){return o.addNode(N)}),this.graph.forEachEdge(function(N){return o.addEdge(N)});else{for(var m,p,b=((m=a.partialGraph)===null||m===void 0?void 0:m.nodes)||[],v=0,S=b?.length||0;v<S;v++){var w=b[v];if(this.updateNode(w),f){var C=this.nodeProgramIndex[w];if(C===void 0)throw new Error('Sigma: node "'.concat(w,`" can't be repaint`));this.addNodeToProgram(w,this.nodeIndices[w],C)}}for(var R=(a==null||(p=a.partialGraph)===null||p===void 0?void 0:p.edges)||[],j=0,Y=R.length;j<Y;j++){var Z=R[j];if(this.updateEdge(Z),f){var V=this.edgeProgramIndex[Z];if(V===void 0)throw new Error('Sigma: edge "'.concat(Z,`" can't be repaint`));this.addEdgeToProgram(Z,this.edgeIndices[Z],V)}}}return(h||!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(le(le({},a),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(a,o){var f=this.camera.getState(),d=f.ratio,h=f.angle,m=f.x,p=f.y,b=this.settings,v=b.minCameraRatio,S=b.maxCameraRatio;typeof S=="number"&&(o=Math.min(o,S)),typeof v=="number"&&(o=Math.max(o,v));var w=o/d,C={x:this.width/2,y:this.height/2},R=this.viewportToFramedGraph(a),j=this.viewportToFramedGraph(C);return{angle:h,x:(R.x-j.x)*(1-w)+m,y:(R.y-j.y)*(1-w)+p,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,h=hc(d,a);return{x:(1+h.x)*this.width/2,y:(1-h.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,h=hc(d,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(h.x)&&(h.x=0),isNaN(h.y)&&(h.y=0),h}},{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),h=this.graphToViewport(o),m=Math.sqrt(Math.pow(d.x-h.x,2)+Math.pow(d.y-h.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 h in this.elements)this.killLayer(h);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}}])})(Ac),PS=WS;function ew(u,r){const l=r.getElementById(u);return l?{elementId:u,top:l.getBoundingClientRect().top}:null}function tw(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 gg=5;function nw(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-gg),h=a?u:Math.min(u,f+gg);return{startLine:d,endLine:h,hiddenAbove:d-1,hiddenBelow:u-h}}function iw(u,r,l,a=!1,o=!1){const f=nw(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 h=f.startLine;h<=f.endLine;h++)l&&h===r?.startLine&&d.push({kind:"context"}),d.push({kind:"line",focused:!!(r&&h>=r.startLine&&h<=r.endLine),lineNumber:h});return f.hiddenBelow>0&&d.push({kind:"expand",count:f.hiddenBelow,direction:"below"}),d}const gc=u=>`source-line-${u}`;function pg({reference:u}){return E.jsx("span",{className:"source-breadcrumbs",children:u.breadcrumbs.map((r,l)=>E.jsxs("span",{children:[l>0&&E.jsx("span",{"aria-hidden":"true",children:"›"}),r]},`${r}-${l}`))})}function aw({hasReferences:u,onContentClick:r,referencesOpen:l,setReferencesOpen:a,source:o}){return E.jsxs("section",{className:["source-context",u?"has-references":"",l?"references-open":""].filter(Boolean).join(" "),onClick:r,children:[E.jsx("div",{className:"source-context-header",children:E.jsx("span",{children:o.context?"Context":"References"})}),o.context&&E.jsxs("div",{className:"source-context-current",children:[E.jsx("a",{href:o.context.url,children:E.jsx(pg,{reference:o.context})}),E.jsx("div",{className:"source-context-paragraph",children:E.jsx(mu,{nodes:o.context.paragraphTree.children})})]}),u&&E.jsx("div",{className:"source-reference-toggle",children:E.jsxs("button",{"aria-controls":"source-other-references","aria-expanded":l,onClick:()=>a(!l),type:"button",children:[o.context?"Other references":"References",E.jsx("span",{children:o.otherReferences.length})]})}),l&&E.jsx("div",{className:"source-reference-list",id:"source-other-references",children:o.otherReferences.map(f=>E.jsxs("div",{className:"source-reference-item",children:[E.jsx("a",{href:f.url,children:E.jsx(pg,{reference:f})}),E.jsx("div",{className:"source-reference-paragraph",children:E.jsx(mu,{nodes:f.paragraphTree.children})})]},f.sectionId))})]})}function rw({count:u,direction:r,onExpand:l}){return E.jsxs("div",{className:"source-collapse",children:[E.jsx("span",{"aria-hidden":"true",children:"⋯"}),E.jsxs("button",{onClick:l,type:"button",children:["Show ",u," ",u===1?"line":"lines"," ",r]})]})}function vp({onContentClick:u,source:r}){const[l,a]=q.useState(!1),[o,f]=q.useState(!1),[d,h]=q.useState(!1),m=q.useRef(null),p=r.otherReferences.length>0,b=!!(r.context||p),v=iw(r.highlightedLines.length,r.focus,b,o,d);q.useLayoutEffect(()=>{const w=m.current;w&&(m.current=null,tw(w,{getElementById:C=>window.document.getElementById(C),scrollBy:C=>window.scrollBy(C)}))},[o]);function S(){const w=v.find(C=>C.kind==="line");w&&(m.current=ew(gc(w.lineNumber),{getElementById:C=>window.document.getElementById(C)})),f(!0)}return E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"document-metadata",children:[E.jsx("div",{className:"document-path",children:r.path}),r.focus&&E.jsxs("div",{className:"document-flag",title:r.focus.signature,children:[r.focus.kind," ",r.focus.symbol]})]}),E.jsx("div",{className:"source-code","aria-label":`Source code for ${r.path}`,children:v.map(w=>{if(w.kind==="context")return E.jsx(aw,{hasReferences:p,onContentClick:u,referencesOpen:l,setReferencesOpen:a,source:r},"context");if(w.kind==="expand")return E.jsx(rw,{count:w.count,direction:w.direction,onExpand:()=>w.direction==="above"?S():h(!0)},`expand-${w.direction}`);const C=r.highlightedLines[w.lineNumber-1];return E.jsxs("div",{className:w.focused?"source-line focused":"source-line",id:gc(w.lineNumber),children:[E.jsx("span",{className:"source-line-number","aria-hidden":"true",children:w.lineNumber}),E.jsx("code",{className:"source-line-content",children:C?E.jsx(mu,{nodes:C.children}):" "})]},w.lineNumber)})})]})}function lw(u){if(u.kind==="code-reference"){const h=(u.sourcePath?.split("/")??[]).at(-2);return h?`${h} › ${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 uw(u){const r=Number.isFinite(u)?Math.max(0,u):0;return 5+Math.log2(r+1)*1.8}function Ws(u,r){return{x:Math.cos(u)*r,y:Math.sin(u)*r}}function ow(u){const r=u.nodes.filter(v=>v.kind==="document").sort((v,S)=>v.id.localeCompare(S.id)),l=u.nodes.filter(v=>v.kind!=="document").sort((v,S)=>v.id.localeCompare(S.id)),a=new Set(r.map(v=>v.id)),o=new Set(l.map(v=>v.id)),f=new Map,d=r.length>1?Math.max(14,r.length*2.5):0;r.forEach((v,S)=>{const w=-Math.PI/2+S/Math.max(1,r.length)*Math.PI*2;f.set(v.id,Ws(w,d))});const h=new Map;for(const v of u.edges){const S=a.has(v.from)?v.from:a.has(v.to)?v.to:"",w=o.has(v.from)?v.from:o.has(v.to)?v.to:"";if(!S||!w)continue;const C=h.get(w)??new Map;C.set(S,(C.get(S)??0)+v.weight),h.set(w,C)}const m=new Map,p=[];for(const v of l){const S=[...h.get(v.id)??[]].sort((C,R)=>R[1]-C[1]||C[0].localeCompare(R[0]))[0]?.[0];if(!S){p.push(v.id);continue}const w=m.get(S)??[];w.push(v.id),m.set(S,w)}for(const[v,S]of m){const w=f.get(v)??{x:0,y:0},C=Math.atan2(w.y,w.x);let R=0,j=0;for(;R<S.length;){const Y=Math.min(12+j*4,S.length-R),Z=4+j*3.5;for(let V=0;V<Y;V++){const N=C+j*.31+V/Y*Math.PI*2,L=Ws(N,Z);f.set(S[R+V],{x:w.x+L.x,y:w.y+L.y})}R+=Y,j++}}const b=d+16;return p.forEach((v,S)=>{const w=S/Math.max(1,p.length)*Math.PI*2;f.set(v,Ws(w,b))}),f}function sw(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 h=l.get(f.to);h!==void 0&&o.get(f.from)!=="document"&&a.set(f.from,Math.max(a.get(f.from)??-1/0,h))}return a}function cw(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(([h,m])=>{if(!Number.isFinite(m))return[];const p=d===0?1:(m-l)/d;return[[h,o+p*(f-o)]]}))}function fw(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 vg(u){return!!(u&&Number.isFinite(u.x)&&Number.isFinite(u.y))}const su=new Map;let Ps=null,wa=null,si=null,ec="";const dw=220;function yp(u){return u==="document"?"document":"code"}function zr(u,r,l){return u.getPropertyValue(r).trim()||l}function tc(u,r){return/^#[\da-f]{6}$/i.test(u)?`${u}${r}`:u}const yg=(u,r,l)=>{if(!r.label)return;const a=l.labelSize,o=r.x+r.size+4,f=r.y+a/3,d=5,h=3;u.save(),u.font=`${l.labelWeight} ${a}px ${l.labelFont}`;const m=u.measureText(r.label),p=m.actualBoundingBoxAscent||a*.8,b=m.actualBoundingBoxDescent||a*.2,v=o-d,S=f-p-h,w=m.width+d*2,C=p+b+h*2,R=3;u.fillStyle="rgba(0, 0, 0, 0.8)",u.beginPath(),u.moveTo(v+R,S),u.lineTo(v+w-R,S),u.quadraticCurveTo(v+w,S,v+w,S+R),u.lineTo(v+w,S+C-R),u.quadraticCurveTo(v+w,S+C,v+w-R,S+C),u.lineTo(v+R,S+C),u.quadraticCurveTo(v,S+C,v,S+C-R),u.lineTo(v,S+R),u.quadraticCurveTo(v,S,v+R,S),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 hw({graph:u,onSelect:r,searchNodeSizes:l,selectedNodeId:a,visibleNodes:o}){const f=q.useRef(null),d=q.useRef(null),h=q.useRef(a),m=q.useRef(l),p=q.useRef(o),b=q.useRef(r);return q.useLayoutEffect(()=>{h.current=a,d.current?.refresh()},[a]),q.useEffect(()=>{p.current=o,d.current?.refresh()},[o]),q.useEffect(()=>{m.current=l,d.current?.refresh()},[l]),q.useEffect(()=>{b.current=r},[r]),q.useEffect(()=>{const v=f.current;if(!v)return;const S=window.getComputedStyle(v),w={document:zr(S,"--graph-document","#ededed"),code:zr(S,"--graph-code","#737373")},C=zr(S,"--text","#ededed"),R=zr(S,"--muted","#888888"),j=zr(S,"--panel-border","#262626"),Y=new xc,Z=ow(u);for(const K of u.nodes){const P=su.get(K.id),oe=vg(P)?P:Z.get(K.id)??fw(K.id),se=K.inDegree;Y.addNode(K.id,{...oe,label:lw(K),backlinks:se,size:uw(se),color:w[yp(K.kind)]})}for(const K of u.edges)!Y.hasNode(K.from)||!Y.hasNode(K.to)||Y.addDirectedEdgeWithKey(K.id,K.from,K.to,{color:j,size:.6+Math.log2(K.weight+1)*.45,type:"arrow",weight:K.weight});const V=()=>{Y.forEachNode((K,P)=>{const oe={x:P.x,y:P.y};vg(oe)?su.set(K,oe):su.delete(K)})};V();let N="";const L=new PS(Y,v,{defaultEdgeColor:j,defaultEdgeType:"arrow",defaultDrawNodeHover:yg,defaultDrawNodeLabel:yg,edgeProgramClasses:{arrow:hp()},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:(K,P)=>{if(!p.current.has(K))return{...P,hidden:!0};const oe=m.current?.get(K),se=oe===void 0?P:{...P,size:oe},Ce=N||h.current;return Ce&&K!==Ce&&!Y.areNeighbors(K,Ce)?{...se,color:tc(R,"48"),label:null,zIndex:0}:K===Ce?{...se,forceLabel:!0,highlighted:!0,size:se.size+2.5,zIndex:3}:{...se,forceLabel:P.backlinks>=4,zIndex:P.backlinks>=4?2:1}},edgeReducer:(K,P)=>{const[oe,se]=Y.extremities(K);if(!p.current.has(oe)||!p.current.has(se))return{...P,hidden:!0};const Ce=N||h.current;return Ce&&oe!==Ce&&se!==Ce?{...P,color:tc(j,"24"),size:.35}:Ce?{...P,color:tc(C,"70"),size:P.size+.4}:P}});d.current=L,Ps&&L.getCamera().setState(Ps),L.on("enterNode",({node:K})=>{N=K,L.refresh()}),L.on("leaveNode",()=>{N="",L.refresh()}),L.on("clickNode",({node:K})=>b.current(K));let B="",U=!1;L.on("downNode",({node:K,preventSigmaDefault:P})=>{B=K,U=!1,P()});const W=L.getMouseCaptor();return W.on("mousemovebody",K=>{if(!B)return;U=!0,K.preventSigmaDefault();const P=L.viewportToGraph(K);Y.mergeNodeAttributes(B,P)}),W.on("mouseup",()=>{B&&(su.set(B,Y.getNodeAttributes(B)),B="",U&&L.refresh())}),()=>{V(),Ps=L.getCamera().getState(),L.kill(),d.current=null}},[u]),E.jsxs("div",{className:"graph-canvas-shell",children:[E.jsx("div",{"aria-label":"Interactive Lat reference graph",className:"graph-canvas",ref:f}),E.jsx("button",{className:"graph-fit",onClick:()=>{d.current?.getCamera().animatedReset()},title:"Fit graph",type:"button",children:"Fit"})]})}function Cc(u=0,r=""){if(ec!==r&&(ec=r,wa=null,si=null),wa&&wa.generation>=u)return Promise.resolve(wa);if(si)return si.then(a=>a.generation>=u?a:Cc(u,r));const l=cn("/api/graph").then(a=>(ec===r&&(wa=a),a));return si=l,l.then(()=>{si===l&&(si=null)},()=>{si===l&&(si=null)}),l}function mw({gitEnabled:u,graph:r,node:l,onSelect:a,onShowSectionOutput:o,target:f}){const[d,h]=q.useState(null),[m,p]=q.useState(""),b=q.useRef(null),v=q.useMemo(()=>l?oc(r,l,f,window.location.origin):"",[r,l,f]),S=l?.kind==="document"?l.url:v,w=q.useMemo(()=>d?.kind==="markdown"?u&&d.document.gitTree?d.document.gitTree:d.document.tree:null,[d,u]);q.useEffect(()=>{const R=new AbortController;if(h(null),p(""),!l)return()=>R.abort();const j=new URL(S||l.url,window.location.origin),Y=Mi(j.pathname),Z=j.searchParams,V=new URLSearchParams({path:l.sourcePath??"",symbol:Y===l.sourcePath?Or(j.hash):l.symbol??"",from:Y===l.sourcePath?Z.get("from")??"":"",line:Y===l.sourcePath?Z.get("line")??"0":"0",at:Y===l.sourcePath?Z.get("at")??"0":String(l.line??0)});return(l.externalTarget?cn(`/api/external?target=${encodeURIComponent(l.externalTarget)}`,R.signal).then(L=>h(L.kind==="markdown"?{kind:"markdown",document:L.document}:{kind:"source",source:L.source})):l.kind==="document"?cn(`/api/document?path=${encodeURIComponent(l.documentPath??"")}`,R.signal).then(L=>h({kind:"markdown",document:L})):cn(`/api/source?${V}`,R.signal).then(L=>h({kind:"source",source:L}))).catch(L=>{R.signal.aborted||p(L.message)}),()=>R.abort()},[S,r.generation,l]),q.useLayoutEffect(()=>{const R=b.current;if(!R||!l||!d||(R.scrollTop=0,d.kind!=="markdown"))return;const j=new URL(v||l.url,window.location.origin).hash.slice(1);if(!j)return;let Y=j;try{Y=decodeURIComponent(j)}catch{}R.querySelector(`#${CSS.escape(Y)}`)?.scrollIntoView({block:"start",behavior:"instant"})},[d,l,v]);function C(R){if(R.button!==0||R.metaKey||R.ctrlKey||R.shiftKey||R.altKey)return;const j=R.target,Y=j instanceof Element?j.closest("a"):null;if(!Y||Y.target||Y.hasAttribute("download"))return;const Z=Y.getAttribute("href");if(!Z)return;const V=Cg(Z,v||l?.url||"/",window.location.origin);if(!V||!sn(V.pathname)&&!Mi(V.pathname)&&!Pt(V.pathname,V.hash))return;R.preventDefault();const N=uc(r,V);N&&a(N.nodeId,N.target)}return l?E.jsx("div",{className:"graph-inspector-scroll",ref:b,children:m?E.jsxs("div",{className:"state error",role:"alert",children:[E.jsx("strong",{children:"Could not open this node"}),E.jsx("span",{children:m})]}):d?.kind==="markdown"?E.jsxs("div",{className:"graph-inspector-document",onClick:C,children:[E.jsxs("div",{className:"document-metadata",children:[E.jsx("div",{className:"document-path",children:d.document.path}),d.document.frontmatter.requireCodeMention&&E.jsx("div",{className:"document-flag",children:"Code mentions required"}),d.document.errors.length>0&&E.jsxs("div",{className:"document-error-toggle",children:[d.document.errors.length," ",d.document.errors.length===1?"error":"errors"]})]}),w&&E.jsx(bc,{backReferences:d.document.backReferences,onCopySectionLink:R=>Og(new URL(S||v||l.url||"/",window.location.origin).href,R,j=>{const Y=uc(r,j);Y&&a(Y.nodeId,Y.target)},window.navigator.clipboard),onShowSectionOutput:o,sectionOutputEnabled:!!o,tree:w})]}):d?.kind==="source"?E.jsx("div",{className:"graph-inspector-source",children:E.jsx(vp,{onContentClick:C,source:d.source},`${d.source.path}#${d.source.focus?.symbol??""}@${d.source.focus?.startLine??0}`)}):E.jsx("div",{className:"state",children:"Loading node…"})}):E.jsx("div",{className:"graph-inspector-empty",children:"Choose a document or code reference in the graph."})}function gw({generation:u,gitEnabled:r,header:l,instanceId:a,markdownGeneration:o,onNavigate:f,onShowSectionOutput:d,searchEnabled:h,selectedNodeId:m,target:p}){const[b,v]=q.useState(wa),[S,w]=q.useState(""),[C,R]=q.useState(""),[j,Y]=q.useState(null),[Z,V]=q.useState(!1),[N,L]=q.useState(""),[B,U]=q.useState({document:!0,code:!0});q.useEffect(()=>{let ue=!1;return w(""),Cc(u,a).then(O=>{ue||v(O)}).catch(O=>{ue||w(O.message)}),()=>{ue=!0}},[u,a]);const W=h?C.trim():"";q.useEffect(()=>{const ue=new AbortController;if(L(""),V(!!W),!W)return Y(null),()=>ue.abort();const O=window.setTimeout(()=>{cn(`/api/search?query=${encodeURIComponent(W)}`,ue.signal).then(I=>{const ne=new Map;for(const fe of I.results)ne.set(fe.path,Math.max(ne.get(fe.path)??-1/0,fe.score));Y({pathScores:ne,query:W})}).catch(I=>{ue.signal.aborted||L(I.message)}).finally(()=>{ue.signal.aborted||V(!1)})},dw);return()=>{window.clearTimeout(O),ue.abort()}},[o,W]);const K=q.useMemo(()=>!b||!W||j?.query!==W?null:sw(b,j.pathScores),[b,W,j]),P=q.useMemo(()=>K?cw(K):null,[K]),oe=q.useMemo(()=>new Set((b?.nodes??[]).filter(ue=>B[yp(ue.kind)]&&(!K||K.has(ue.id))).map(ue=>ue.id)),[B,b,K]),se=b?.nodes.find(ue=>ue.id===m)??null,Ce=b&&se?oc(b,se,p,window.location.origin):"";function xe(ue,O=""){const I=b?.nodes.find(fe=>fe.id===ue);if(!b||!I)return;const ne=oc(b,I,O,window.location.origin);f(new URL(ne,window.location.origin))}return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"graph-topbar",children:E.jsxs("div",{className:"graph-topbar-graph",children:[l(se,Ce),E.jsx("div",{className:"graph-tools",children:h?E.jsxs("label",{className:"graph-filter",children:[E.jsx("span",{className:"visually-hidden",children:"Search graph with embeddings"}),E.jsx("input",{autoComplete:"off",onChange:ue=>R(ue.currentTarget.value),placeholder:"Search graph…",spellCheck:"false",type:"search",value:C}),E.jsx("span",{"aria-live":"polite",className:"graph-node-count",children:Z?"Searching…":`${oe.size} ${oe.size===1?"node":"nodes"}`})]}):E.jsxs("span",{className:"graph-node-count",children:[oe.size," ",oe.size===1?"node":"nodes"]})})]})}),S?E.jsxs("div",{className:"state error graph-state",role:"alert",children:[E.jsx("strong",{children:"Could not build the graph"}),E.jsx("span",{children:S})]}):b?E.jsxs("div",{className:"graph-workspace",children:[E.jsxs("section",{className:"graph-pane",children:[E.jsx(hw,{graph:b,onSelect:xe,searchNodeSizes:P,selectedNodeId:m,visibleNodes:oe}),E.jsx("div",{"aria-label":"Graph node kinds",className:"graph-kind-filters graph-legend",children:["document","code"].map(ue=>E.jsxs("label",{className:ue,children:[E.jsx("input",{checked:B[ue],onChange:O=>{const I=O.currentTarget.checked;U(ne=>({...ne,[ue]:I}))},type:"checkbox"}),E.jsx("span",{children:ue})]},ue))}),N?E.jsx("div",{className:"graph-no-results",children:N}):!Z&&oe.size===0&&E.jsx("div",{className:"graph-no-results",children:"No nodes match this search."})]}),E.jsxs("aside",{className:"graph-inspector",children:[E.jsx("div",{"aria-live":"polite",className:"visually-hidden",children:se?`Selected ${se.label}`:"No node selected"}),E.jsx(mw,{gitEnabled:r,graph:b,node:se,onSelect:xe,onShowSectionOutput:d,target:Ce})]})]}):E.jsx("div",{className:"state graph-state",children:"Loading graph…"})]})}function pw(u,r){if(u.instanceId!==r.instanceId)return r;const l=Math.max(u.generation,r.generation),a=Math.max(u.markdownGeneration,r.markdownGeneration);return l===u.generation&&a===u.markdownGeneration?u:{...u,generation:l,markdownGeneration:a}}const vw=250;function yw({result:u}){return E.jsx("span",{className:"search-result-breadcrumbs",children:u.breadcrumbs.map((r,l)=>E.jsxs("span",{children:[l>0&&E.jsx("span",{"aria-hidden":"true",children:"›"}),r]},`${r}-${l}`))})}function bw({onClose:u,onNavigate:r,onScrollRestored:l,markdownGeneration:a,restoreScroll:o}){const[f,d]=q.useState(()=>fb(window.location.search)),[h,m]=q.useState([]),[p,b]=q.useState(!1),[v,S]=q.useState(!1),[w,C]=q.useState(""),R=q.useRef(null);return q.useEffect(()=>{R.current?.focus()},[]),q.useLayoutEffect(()=>{o&&(f.trim()&&!v&&!w||(window.scrollTo({...o,behavior:"instant"}),l()))},[w,l,f,o,v]),q.useEffect(()=>{const j=Y=>{Y.key==="Escape"&&(Y.preventDefault(),Tb(f)==="clear"?d(""):u())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[u,f]),q.useEffect(()=>{const j=db(f),Y=`${window.location.pathname}${window.location.search}`;j!==Y&&window.history.replaceState(window.history.state,"",j)},[f]),q.useEffect(()=>{const j=f.trim(),Y=new AbortController;if(C(""),S(!1),b(!1),m([]),!j)return()=>Y.abort();const Z=window.setTimeout(()=>{b(!0),fetch(`/api/search?query=${encodeURIComponent(j)}`,{signal:Y.signal}).then(async V=>{const N=await V.json();if(!V.ok)throw new Error("error"in N?N.error:"Search request failed");return N}).then(V=>{m(V.results),S(!0)}).catch(V=>{Y.signal.aborted||C(V.message)}).finally(()=>{Y.signal.aborted||b(!1)})},vw);return()=>{window.clearTimeout(Z),Y.abort()}},[a,f]),E.jsxs("section",{className:"search-page",children:[E.jsxs("label",{className:"search-input-shell",children:[E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[E.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),E.jsx("path",{d:"m16 16 4 4"})]}),E.jsx("span",{className:"visually-hidden",children:"Search lat.md sections"}),E.jsx("input",{autoComplete:"off",onChange:j=>d(j.currentTarget.value),placeholder:"Search lat.md…",ref:R,spellCheck:"false",type:"search",value:f})]}),E.jsxs("div",{"aria-live":"polite",className:"search-status",children:[p&&"Searching sections…",!p&&w,!p&&!w&&v&&h.length===0&&"No matching sections."]}),h.length>0&&E.jsx("div",{className:"search-results",children:h.map(j=>E.jsxs("a",{className:"search-result",href:j.url,onClick:r,children:[E.jsx(yw,{result:j}),E.jsx("h2",{children:j.title}),j.description&&E.jsx("p",{children:j.description})]},j.sectionId))})]})}const bg="formatted";function Eg({onClose:u,sectionId:r}){const[l,a]=q.useState(null),[o,f]=q.useState(""),[d,h]=q.useState(bg),m=q.useRef(null);return q.useEffect(()=>{if(!r)return;const p=new AbortController;return a(null),f(""),h(bg),cn(n0(r),p.signal).then(a).catch(b=>{p.signal.aborted||f(b.message)}),()=>p.abort()},[r]),q.useEffect(()=>{if(!r)return;m.current?.focus();const p=b=>{b.key==="Escape"&&u()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[u,r]),r?E.jsx("div",{className:"section-output-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&u()},role:"presentation",children:E.jsxs("section",{"aria-labelledby":"section-output-title","aria-modal":"true",className:"section-output-dialog",role:"dialog",children:[E.jsxs("header",{className:"section-output-header",children:[E.jsxs("div",{className:"section-output-heading",children:[E.jsxs("div",{className:"section-output-title-line",children:[E.jsxs("h2",{id:"section-output-title",children:[E.jsx("code",{children:"lat section"})," output"]}),E.jsx("div",{"aria-label":"Section output presentation",className:"section-output-presentation",role:"group",children:["raw","formatted"].map(p=>E.jsx("button",{"aria-pressed":d===p,onClick:()=>h(p),type:"button",children:p},p))})]}),E.jsx("code",{className:"section-output-id",children:r})]}),E.jsx("button",{"aria-label":"Close section output",className:"section-output-close",onClick:u,ref:m,type:"button",children:"×"})]}),o?E.jsx("div",{className:"section-output-state error",role:"alert",children:o}):l?d==="formatted"?E.jsx("div",{className:"section-output-formatted","data-error":l.isError||void 0,children:E.jsx(bc,{tree:l.tree})}):E.jsx("pre",{className:"section-output-raw","data-error":l.isError||void 0,children:l.output}):E.jsx("div",{className:"section-output-state",children:"Running lat section…"})]})}):null}const Ew="You have unsaved changes. Discard them?";function cu(u,r){return!u||r(Ew)}function Sw(u,r){return u?(r.preventDefault(),r.returnValue="",!0):!1}const ww=q.lazy(()=>Li(()=>import("./MarkdownEditor-B7quqPb8.js"),[],import.meta.url)),nc={};function Tw({text:u}){return u.endsWith(".md")?E.jsxs(E.Fragment,{children:[u.slice(0,-3),E.jsx("span",{children:".md"})]}):u}function Sg({className:u,graphActive:r,graphHref:l,gitEnabled:a,gitHasChanges:o,index:f,onGitToggle:d,onGraphNavigate:h,onNavigate:m,onSearchNavigate:p,route:b,searchEnabled:v}){const S=f?.logoText??js;return E.jsxs("div",{className:u,children:[E.jsx("a",{className:"brand",href:f?hu(f.entry):"/",onClick:f?m:void 0,title:S,children:S===js?E.jsx("img",{alt:js,className:"brand-logo",src:ib(Ky)}):E.jsx(Tw,{text:S})}),E.jsxs("div",{className:"sidebar-actions",children:[!r&&f?.git&&E.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:E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[E.jsx("circle",{cx:"7",cy:"5",r:"2"}),E.jsx("circle",{cx:"7",cy:"19",r:"2"}),E.jsx("circle",{cx:"17",cy:"9",r:"2"}),E.jsx("path",{d:"M7 7v10M9 15c5 0 8-1.5 8-4"})]})}),!r&&v&&E.jsx("a",{"aria-current":b?.kind==="search"?"page":void 0,"aria-label":"Search",className:"sidebar-search",href:"/search",onClick:p,title:"Search",children:E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[E.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),E.jsx("path",{d:"m16 16 4 4"})]})}),E.jsx("a",{"aria-current":r?"page":void 0,"aria-label":"Graph",className:"sidebar-graph",href:l,onClick:h,title:"Graph",children:E.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[E.jsx("circle",{cx:"6",cy:"7",r:"2"}),E.jsx("circle",{cx:"18",cy:"6",r:"2"}),E.jsx("circle",{cx:"16",cy:"18",r:"2"}),E.jsx("circle",{cx:"7",cy:"17",r:"2"}),E.jsx("path",{d:"m8 7 8-1M17 8l-1 8M14 18l-5-1M8 9l7 7"})]})})]})]})}function xw({label:u,onToggle:r,open:l}){return E.jsxs("button",{"aria-controls":"mobile-file-navigation","aria-expanded":l,className:"mobile-navigation-trigger",onClick:r,type:"button",children:[E.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:l?E.jsxs(E.Fragment,{children:[E.jsx("path",{d:"M6 6l12 12"}),E.jsx("path",{d:"M18 6 6 18"})]}):E.jsxs(E.Fragment,{children:[E.jsx("path",{d:"M4 7h16"}),E.jsx("path",{d:"M4 12h16"}),E.jsx("path",{d:"M4 17h16"})]})}),E.jsxs("span",{className:"mobile-navigation-context",children:[E.jsx("span",{children:"Files"}),E.jsx("span",{"aria-hidden":"true",children:"›"}),E.jsx("span",{className:"mobile-navigation-current",children:u})]})]})}function _w({errors:u,onNavigate:r}){return E.jsxs("section",{"aria-label":"Validation errors",className:"document-error-panel",id:"document-errors",children:[E.jsx("div",{className:"document-error-header",children:"Validation errors"}),E.jsx("div",{className:"document-error-list",children:u.map((l,a)=>E.jsxs("a",{className:"document-error-item",href:`#${l.anchor}`,onClick:r,children:[E.jsxs("span",{className:"document-error-location",children:["Line ",l.line]}),E.jsx("span",{className:"document-error-message",children:l.message})]},`${l.anchor}-${a}`))})]})}function $t(){return`${window.location.pathname}${window.location.search}${window.location.hash}`}function wg(u){return u instanceof Error?u.message:String(u)}function Aw(){const u=nb(),r=gb(Gn()),[l,a]=q.useState($t),[o,f]=q.useState(null),[d,h]=q.useState(null),[m,p]=q.useState({instanceId:u?"static":"",generation:0,markdownGeneration:0}),[b,v]=q.useState(""),[S,w]=q.useState(""),[C,R]=q.useState(0),[j,Y]=q.useState(0),[Z,V]=q.useState(!0),[N,L]=q.useState(()=>{try{return pb(window.localStorage,r)||Di(window.location.pathname)==="/graph"}catch{return Di(window.location.pathname)==="/graph"}}),[B,U]=q.useState(!1),[W,K]=q.useState(null),[P,oe]=q.useState(null),[se,Ce]=q.useState("view"),[xe,ue]=q.useState(null),O=q.useRef(d);O.current=d;const I=q.useRef(!1),ne=q.useRef($t()),fe=q.useRef(0),ge=q.useRef(null),x=q.useMemo(()=>sb(l),[l]),D=q.useMemo(()=>{const F=new URL(x,window.location.origin),Ee=Di(F.pathname);if(Ee==="/search")return{kind:"search"};if(Ee==="/graph")return{kind:"graph",nodeId:hb(F.search),target:mb(F.search)};const $e=sn(F.pathname);if($e)return{kind:"markdown",path:$e};const Se=Pt(F.pathname,F.hash);if(Se)return{kind:"external",target:Se.identity};const Ze=Mi(F.pathname);if(Ze){const nt=new URLSearchParams(F.search),Mt=Number(nt.get("line")),La=Number(nt.get("at"));return{kind:"source",path:Ze,symbol:Or(F.hash),from:nt.get("from")??"",line:Number.isInteger(Mt)&&Mt>0?Mt:0,at:Number.isInteger(La)&&La>0?La:0}}return null},[x]),J=N&&D!==null&&(D.kind==="graph"||D.kind==="markdown"||D.kind==="source"||D.kind==="external"),ie=D?.kind==="graph"?D.target:l,me=D?.kind==="graph"?D.nodeId:yb(new URL(l,window.location.origin),D?.kind==="external"&&d?.kind==="markdown"?"document":D?.kind==="external"&&d?.kind==="source"?"source":void 0),be=D?.kind==="markdown"?D.path:null,Re=!u&&D?.kind==="markdown"&&se==="edit",rt=D?.kind==="external"?D.target:null,Fe=Object.keys(o?.git?.files??nc).length>0,fn=d?.kind==="markdown"?`${d.document.path}@${m.generation}`:null,Un=fn!==null&&W===fn,zi=q.useMemo(()=>d?.kind==="markdown"?Z&&d.document.gitTree?d.document.gitTree:d.document.tree:null,[Z,d]),kr=D?.kind==="markdown"||D?.kind==="source"?D.path:D?.kind==="external"?D.target:D?.kind==="search"?"Search":"Files";q.useEffect(()=>{Cc().catch(()=>{})},[]),q.useEffect(()=>{if(D?.kind!=="graph")return;let F=D.target;try{const Ee=new URL(F,window.location.origin);Ee.origin!==window.location.origin||!sn(Ee.pathname)&&!Mi(Ee.pathname)&&!Pt(Ee.pathname,Ee.hash)?F="":F=`${Ee.pathname}${Ee.search}${Ee.hash}`}catch{F=""}!F&&o&&(F=hu(o.entry)),F&&(Gi(!0),window.history.replaceState(window.history.state,"",F),fe.current++,h(null),a($t()))},[o,D]),q.useEffect(()=>{U(!1)},[x]),q.useEffect(()=>{Ce("view"),I.current=!1},[be]),q.useEffect(()=>{const F=Ee=>{Sw(I.current,Ee)};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[]),q.useEffect(()=>{if(!B)return;const F=window.document.body,Ee=window.document.getElementById("mobile-file-navigation"),$e=Ee?.querySelector(".document-link.active");F.classList.add("mobile-navigation-open"),($e??Ee)?.focus({preventScroll:!0}),$e?.scrollIntoView({block:"center",behavior:"instant"});const Se=window.matchMedia("(min-width: 64rem)"),Ze=()=>{Se.matches&&U(!1)},nt=Mt=>{Mt.key==="Escape"&&(U(!1),window.document.querySelector(".mobile-navigation-trigger")?.focus())};return Se.addEventListener("change",Ze),window.addEventListener("keydown",nt),()=>{F.classList.remove("mobile-navigation-open"),Se.removeEventListener("change",Ze),window.removeEventListener("keydown",nt)}},[B]),q.useEffect(()=>{const F=Ee=>{const $e=ne.current,Se=$t(),Ze=sn(window.location.pathname),nt=Pt(window.location.pathname,window.location.hash),Mt=O.current?.kind==="markdown"&&(O.current.document.path===Ze||O.current.document.path===(nt?`${nt.handle}:${nt.path}`:null));if(!Mt&&!cu(I.current,window.confirm.bind(window))){window.history.pushState(null,"",$e);return}Mt||(I.current=!1),ne.current=Se,ge.current=null,ue(wb(Ee.state)),Di(window.location.pathname)!=="/graph"&&!Mt&&(fe.current++,h(null)),a($t())};return window.addEventListener("popstate",F),()=>window.removeEventListener("popstate",F)},[]),q.useEffect(()=>{if(u)return;const F=new EventSource("/api/events"),Ee=Se=>{try{const Ze=JSON.parse(Se.data);if(typeof Ze.instanceId!="string"||!Number.isInteger(Ze.generation)||!Number.isInteger(Ze.markdownGeneration))return;p(nt=>pw(nt,Ze))}catch{}},$e=Se=>{Ee(Se),R(Ze=>Ze+1)};return F.addEventListener("ready",$e),F.addEventListener("change",Ee),()=>F.close()},[u]),q.useEffect(()=>{const F=new AbortController;return cn("/api/index",F.signal).then(Ee=>{f(Ee),w("")}).catch(Ee=>{F.signal.aborted||w(wg(Ee))}),()=>F.abort()},[C,m.generation]),q.useEffect(()=>{const F=++fe.current;if(!D){ue(null),h(null),v("This is not a document URL.");return}if(D.kind==="search"||D.kind==="graph"){v(""),h({kind:D.kind});return}const Ee=new AbortController;return v(""),(D.kind==="markdown"?cn(`/api/document?path=${encodeURIComponent(D.path)}`,Ee.signal).then(Se=>({kind:"markdown",document:Se})):D.kind==="external"?cn(`/api/external?target=${encodeURIComponent(D.target)}`,Ee.signal).then(Se=>Se.kind==="markdown"?{kind:"markdown",document:Se.document}:{kind:"source",source:Se.source}):cn(`/api/source?path=${encodeURIComponent(D.path)}&symbol=${encodeURIComponent(D.symbol)}&from=${encodeURIComponent(D.from)}&line=${D.line}&at=${D.at}`,Ee.signal).then(Se=>({kind:"source",source:Se}))).then(Se=>{F===fe.current&&(h(Se),v(""))}).catch(Se=>{F===fe.current&&!Ee.signal.aborted&&(h(null),ue(null),v(wg(Se)))}),()=>Ee.abort()},[C,m.generation,j,D]),q.useEffect(()=>{d&&(window.document.title=J?"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`)},[J,d]),q.useLayoutEffect(()=>{if(!(!d||ge.current===l)){if(J){window.scrollTo({top:0,behavior:"instant"}),ge.current=l,ue(null);return}if(d.kind==="search"||d.kind==="graph"){if(xe)return;window.scrollTo({top:0,behavior:"instant"}),ge.current=l;return}if(xe){window.scrollTo({...xe,behavior:"instant"}),ge.current=l,ue(null);return}if(d.kind==="markdown")_b(window.location.hash,{getElementById:F=>window.document.getElementById(F),scrollTo:F=>window.scrollTo(F)},d.document.tableOfContents.find(F=>F.depth===1)?.id);else{const F=d.source.focus?.startLine;F?window.document.getElementById(gc(F))?.scrollIntoView({behavior:"instant",block:"center"}):window.scrollTo({top:0,behavior:"instant"})}ge.current=l}},[J,xe,l,d]);function tn(){window.history.replaceState(Sb(window.history.state,{left:window.scrollX,top:window.scrollY}),"",$t())}function Gi(F){L(F);try{vb(window.localStorage,r,F)}catch{}}function dn(F){const Ee=$t(),$e=d?.kind==="markdown"&&(d.document.path===sn(F.pathname)||d.document.path===(()=>{const nt=Pt(F.pathname,F.hash);return nt?`${nt.handle}:${nt.path}`:null})())&&cb(new URL(window.location.href),F),Se=`${F.pathname}${F.search}${F.hash}`;if(Se===$t()){(!d||b)&&jr();return}if(!$e&&!cu(I.current,window.confirm.bind(window)))return;$e||(I.current=!1),tn(),ge.current=null,ue(null);const Ze=F.pathname==="/search"&&window.location.pathname!=="/search"?bb(Ee):null;window.history.pushState(Ze,"",F),ne.current=Se,$e||(fe.current++,h(null)),a($t())}function jr(){ge.current=null,fe.current++,ue(null),v(""),h(null),Y(F=>F+1)}function Da(){if(Eb(window.history.state)){tn(),window.history.back();return}if(!o){window.location.assign("/");return}ge.current=null,ue(null),window.history.replaceState(null,"",hu(o.entry)),fe.current++,h(null),a($t())}function nn(F){F.button!==0||F.metaKey||F.ctrlKey||F.shiftKey||F.altKey||(U(!1),F.preventDefault(),dn(new URL(F.currentTarget.href)))}function Oi(F){if(!(F.button!==0||F.metaKey||F.ctrlKey||F.shiftKey||F.altKey)){if(F.preventDefault(),xb(window.location.pathname)==="close"){Da();return}dn(new URL(F.currentTarget.href))}}function Ui(F){F.button!==0||F.metaKey||F.ctrlKey||F.shiftKey||F.altKey||(F.preventDefault(),!(!N&&!cu(I.current,window.confirm.bind(window)))&&(N||(I.current=!1),Gi(!N)))}function yu(F){F==="view"&&!cu(I.current,window.confirm.bind(window))||(F==="view"&&(I.current=!1),Ce(F))}function Br(F){if(F.button!==0||F.metaKey||F.ctrlKey||F.shiftKey||F.altKey)return;const Ee=F.target,$e=Ee instanceof Element?Ee.closest("a"):null;if(!$e||$e.target||$e.hasAttribute("download"))return;const Se=new URL($e.href,window.location.href);Se.origin!==window.location.origin||!sn(Se.pathname)&&!Mi(Se.pathname)&&!Pt(Se.pathname,Se.hash)||(F.preventDefault(),dn(Se))}if(J){const F=(Ee,$e)=>E.jsx(Sg,{className:"graph-header",graphActive:J,graphHref:$t(),gitEnabled:Z,gitHasChanges:Fe,index:o,onGitToggle:()=>V(Se=>!Se),onGraphNavigate:Ui,onNavigate:nn,onSearchNavigate:Oi,route:D,searchEnabled:!u});return E.jsxs("div",{className:"graph-shell",children:[E.jsx(gw,{generation:m.generation,gitEnabled:Z,header:F,instanceId:m.instanceId,markdownGeneration:m.markdownGeneration,onNavigate:dn,onShowSectionOutput:u?void 0:oe,searchEnabled:!u,selectedNodeId:me,target:ie}),E.jsx(Eg,{onClose:()=>oe(null),sectionId:P})]})}return E.jsxs("div",{className:"app-shell",children:[E.jsxs("aside",{className:"sidebar","data-mobile-navigation-open":B||void 0,children:[E.jsx(Sg,{className:"sidebar-header",graphActive:J,graphHref:$t(),gitEnabled:Z,gitHasChanges:Fe,index:o,onGitToggle:()=>V(F=>!F),onGraphNavigate:Ui,onNavigate:nn,onSearchNavigate:Oi,route:D,searchEnabled:!u}),E.jsx(xw,{label:kr,onToggle:()=>U(F=>!F),open:B}),E.jsxs("nav",{"aria-label":"Project files",id:"mobile-file-navigation",tabIndex:-1,children:[o&&E.jsx(Ab,{activePath:be,activeExternalTarget:rt,errorCounts:o.errorCounts,externalFiles:o.externalFiles,files:o.files,gitFiles:Z?o.git?.files??nc:nc,onNavigate:nn}),!o&&S&&E.jsxs("div",{className:"sidebar-index-error",role:"alert",children:[E.jsx("span",{children:S}),E.jsx("button",{onClick:()=>R(F=>F+1),type:"button",children:"Retry"})]})]})]}),E.jsx("main",{className:xe?"main restoring-history-scroll":"main",children:b?E.jsxs("div",{className:"state error",role:"alert",children:[E.jsx("strong",{children:"Could not open this document"}),E.jsx("span",{children:b}),D&&D.kind!=="search"&&D.kind!=="graph"&&E.jsx("button",{className:"state-retry",onClick:jr,type:"button",children:"Retry"})]}):d?.kind==="search"?E.jsx(bw,{onClose:Da,onNavigate:nn,onScrollRestored:()=>{ge.current=l,ue(null)},markdownGeneration:m.markdownGeneration,restoreScroll:xe}):d?.kind==="markdown"?E.jsxs("div",{className:"document-layout",children:[!Re&&E.jsx(y0,{gitEnabled:Z,items:d.document.tableOfContents,onNavigate:nn}),E.jsxs("div",{className:"document-column",children:[E.jsxs("div",{className:"document-header",children:[E.jsxs("div",{className:"document-header-line",children:[E.jsxs("div",{className:"document-metadata",children:[E.jsx("div",{className:"document-path",children:d.document.path}),d.document.frontmatter.requireCodeMention&&E.jsx("div",{className:"document-flag",title:"Every leaf section must have an @lat code reference",children:"Code mentions required"}),d.document.errors.length>0&&E.jsxs("button",{"aria-controls":"document-errors","aria-expanded":Un,className:"document-error-toggle",onClick:()=>K(Un?null:fn),type:"button",children:[d.document.errors.length," ",d.document.errors.length===1?"error":"errors"]})]}),!u&&D?.kind==="markdown"&&E.jsx(h0,{mode:se,onChange:yu})]}),Un&&E.jsx(_w,{errors:d.document.errors,onNavigate:nn})]}),Re&&D?.kind==="markdown"&&E.jsx(q.Suspense,{fallback:E.jsx("div",{className:"markdown-editor-state",children:"Loading editor…"}),children:E.jsx(ww,{active:!0,onDirtyChange:F=>{I.current=F},path:D.path,revision:m.markdownGeneration},D.path)}),!Re&&zi&&E.jsx(bc,{backReferences:d.document.backReferences,onClick:Br,onCopySectionLink:F=>Og(window.location.href,F,dn,window.navigator.clipboard),onShowSectionOutput:oe,sectionOutputEnabled:!u,tree:zi})]})]}):d?.kind==="source"?E.jsx(vp,{onContentClick:Br,source:d.source},`${d.source.path}#${d.source.focus?.symbol??""}@${d.source.focus?.startLine??0}`):E.jsx("div",{className:"state",children:"Loading…"})}),E.jsx(Eg,{onClose:()=>oe(null),sectionId:P})]})}Xy.createRoot(document.getElementById("root")).render(E.jsx(q.StrictMode,{children:E.jsx(Aw,{})}));export{Li as _,Nw as f,Uy as g,E as j,q as r,Cw as u};