bmad-studio 0.1.0 → 0.2.0

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 (1041) hide show
  1. package/package.json +17 -1
  2. package/packages/client/dist/assets/index-5nXyrx_3.css +1 -0
  3. package/packages/client/dist/assets/index-DxN3uabX.js +521 -0
  4. package/packages/client/dist/assets/inter-tight-cyrillic-400-normal-DPRou3KO.woff +0 -0
  5. package/packages/client/dist/assets/inter-tight-cyrillic-400-normal-G7BuwYWK.woff2 +0 -0
  6. package/packages/client/dist/assets/inter-tight-cyrillic-700-normal-DDZiLR3d.woff +0 -0
  7. package/packages/client/dist/assets/inter-tight-cyrillic-700-normal-DtWWjp29.woff2 +0 -0
  8. package/packages/client/dist/assets/inter-tight-cyrillic-800-normal-CC_RRmyd.woff2 +0 -0
  9. package/packages/client/dist/assets/inter-tight-cyrillic-800-normal-ChWbk4mt.woff +0 -0
  10. package/packages/client/dist/assets/inter-tight-cyrillic-ext-400-normal-CKO3cWyd.woff2 +0 -0
  11. package/packages/client/dist/assets/inter-tight-cyrillic-ext-400-normal-DiHHcP5k.woff +0 -0
  12. package/packages/client/dist/assets/inter-tight-cyrillic-ext-700-normal-BFcoPt71.woff +0 -0
  13. package/packages/client/dist/assets/inter-tight-cyrillic-ext-700-normal-D_7NT8eF.woff2 +0 -0
  14. package/packages/client/dist/assets/inter-tight-cyrillic-ext-800-normal-CzCOBUhR.woff2 +0 -0
  15. package/packages/client/dist/assets/inter-tight-cyrillic-ext-800-normal-WowoGRZX.woff +0 -0
  16. package/packages/client/dist/assets/inter-tight-greek-400-normal-BLLSFQTx.woff +0 -0
  17. package/packages/client/dist/assets/inter-tight-greek-400-normal-Br_GQm5W.woff2 +0 -0
  18. package/packages/client/dist/assets/inter-tight-greek-700-normal-DU8XoIeX.woff +0 -0
  19. package/packages/client/dist/assets/inter-tight-greek-700-normal-RgALSHS4.woff2 +0 -0
  20. package/packages/client/dist/assets/inter-tight-greek-800-normal-CxHmUlv4.woff +0 -0
  21. package/packages/client/dist/assets/inter-tight-greek-800-normal-X9eW6L67.woff2 +0 -0
  22. package/packages/client/dist/assets/inter-tight-greek-ext-400-normal-C3GMUg_S.woff2 +0 -0
  23. package/packages/client/dist/assets/inter-tight-greek-ext-400-normal-DMqR5RoS.woff +0 -0
  24. package/packages/client/dist/assets/inter-tight-greek-ext-700-normal-D0RkHJEE.woff2 +0 -0
  25. package/packages/client/dist/assets/inter-tight-greek-ext-700-normal-mW3dmpoD.woff +0 -0
  26. package/packages/client/dist/assets/inter-tight-greek-ext-800-normal-DNWjXg9N.woff2 +0 -0
  27. package/packages/client/dist/assets/inter-tight-greek-ext-800-normal-DfP-QoiQ.woff +0 -0
  28. package/packages/client/dist/assets/inter-tight-latin-400-normal-BLrFJfvD.woff +0 -0
  29. package/packages/client/dist/assets/inter-tight-latin-400-normal-iW8qmuJY.woff2 +0 -0
  30. package/packages/client/dist/assets/inter-tight-latin-700-normal-BZKd_v_8.woff2 +0 -0
  31. package/packages/client/dist/assets/inter-tight-latin-700-normal-DvYAVZQd.woff +0 -0
  32. package/packages/client/dist/assets/inter-tight-latin-800-normal-CRGCHRPv.woff2 +0 -0
  33. package/packages/client/dist/assets/inter-tight-latin-800-normal-D2te1T7i.woff +0 -0
  34. package/packages/client/dist/assets/inter-tight-latin-ext-400-normal-BQQeeQrv.woff +0 -0
  35. package/packages/client/dist/assets/inter-tight-latin-ext-400-normal-DN7wyBvd.woff2 +0 -0
  36. package/packages/client/dist/assets/inter-tight-latin-ext-700-normal-BpKPOkj3.woff2 +0 -0
  37. package/packages/client/dist/assets/inter-tight-latin-ext-700-normal-CrlzIQ10.woff +0 -0
  38. package/packages/client/dist/assets/inter-tight-latin-ext-800-normal-A39zhqaD.woff +0 -0
  39. package/packages/client/dist/assets/inter-tight-latin-ext-800-normal-DfKN99cy.woff2 +0 -0
  40. package/packages/client/dist/assets/inter-tight-vietnamese-400-normal-CqzIqjuX.woff2 +0 -0
  41. package/packages/client/dist/assets/inter-tight-vietnamese-400-normal-kSDs3Vd1.woff +0 -0
  42. package/packages/client/dist/assets/inter-tight-vietnamese-700-normal-Cn_DV52A.woff2 +0 -0
  43. package/packages/client/dist/assets/inter-tight-vietnamese-700-normal-DwHBAXeT.woff +0 -0
  44. package/packages/client/dist/assets/inter-tight-vietnamese-800-normal-CbYrLkxo.woff +0 -0
  45. package/packages/client/dist/assets/inter-tight-vietnamese-800-normal-OJoDhpMd.woff2 +0 -0
  46. package/packages/client/dist/index.html +13 -0
  47. package/packages/server/dist/app.d.ts +11 -0
  48. package/packages/server/dist/app.d.ts.map +1 -0
  49. package/packages/server/dist/app.js +85 -0
  50. package/packages/server/dist/app.js.map +1 -0
  51. package/packages/server/dist/app.test.d.ts +2 -0
  52. package/packages/server/dist/app.test.d.ts.map +1 -0
  53. package/packages/server/dist/app.test.js +72 -0
  54. package/packages/server/dist/app.test.js.map +1 -0
  55. package/packages/server/dist/core/errors.d.ts +29 -0
  56. package/packages/server/dist/core/errors.d.ts.map +1 -0
  57. package/packages/server/dist/core/errors.js +49 -0
  58. package/packages/server/dist/core/errors.js.map +1 -0
  59. package/packages/server/dist/core/errors.test.d.ts +2 -0
  60. package/packages/server/dist/core/errors.test.d.ts.map +1 -0
  61. package/packages/server/dist/core/errors.test.js +37 -0
  62. package/packages/server/dist/core/errors.test.js.map +1 -0
  63. package/packages/server/dist/core/file-store.d.ts +40 -0
  64. package/packages/server/dist/core/file-store.d.ts.map +1 -0
  65. package/packages/server/dist/core/file-store.js +160 -0
  66. package/packages/server/dist/core/file-store.js.map +1 -0
  67. package/packages/server/dist/core/file-store.test.d.ts +2 -0
  68. package/packages/server/dist/core/file-store.test.d.ts.map +1 -0
  69. package/packages/server/dist/core/file-store.test.js +75 -0
  70. package/packages/server/dist/core/file-store.test.js.map +1 -0
  71. package/packages/server/dist/core/project-detector.d.ts +14 -0
  72. package/packages/server/dist/core/project-detector.d.ts.map +1 -0
  73. package/packages/server/dist/core/project-detector.js +67 -0
  74. package/packages/server/dist/core/project-detector.js.map +1 -0
  75. package/packages/server/dist/core/project-detector.test.d.ts +2 -0
  76. package/packages/server/dist/core/project-detector.test.d.ts.map +1 -0
  77. package/packages/server/dist/core/project-detector.test.js +73 -0
  78. package/packages/server/dist/core/project-detector.test.js.map +1 -0
  79. package/packages/server/dist/core/websocket.d.ts +16 -0
  80. package/packages/server/dist/core/websocket.d.ts.map +1 -0
  81. package/packages/server/dist/core/websocket.js +30 -0
  82. package/packages/server/dist/core/websocket.js.map +1 -0
  83. package/packages/server/dist/core/websocket.test.d.ts +2 -0
  84. package/packages/server/dist/core/websocket.test.d.ts.map +1 -0
  85. package/packages/server/dist/core/websocket.test.js +64 -0
  86. package/packages/server/dist/core/websocket.test.js.map +1 -0
  87. package/packages/server/dist/core/write-service.d.ts +12 -0
  88. package/packages/server/dist/core/write-service.d.ts.map +1 -0
  89. package/packages/server/dist/core/write-service.js +61 -0
  90. package/packages/server/dist/core/write-service.js.map +1 -0
  91. package/packages/server/dist/core/write-service.test.d.ts +2 -0
  92. package/packages/server/dist/core/write-service.test.d.ts.map +1 -0
  93. package/packages/server/dist/core/write-service.test.js +69 -0
  94. package/packages/server/dist/core/write-service.test.js.map +1 -0
  95. package/packages/server/dist/index.d.ts +2 -0
  96. package/packages/server/dist/index.d.ts.map +1 -0
  97. package/packages/server/dist/index.js +88 -0
  98. package/packages/server/dist/index.js.map +1 -0
  99. package/packages/server/dist/parsers/agent-parser.d.ts +4 -0
  100. package/packages/server/dist/parsers/agent-parser.d.ts.map +1 -0
  101. package/packages/server/dist/parsers/agent-parser.js +88 -0
  102. package/packages/server/dist/parsers/agent-parser.js.map +1 -0
  103. package/packages/server/dist/parsers/agent-parser.test.d.ts +2 -0
  104. package/packages/server/dist/parsers/agent-parser.test.d.ts.map +1 -0
  105. package/packages/server/dist/parsers/agent-parser.test.js +66 -0
  106. package/packages/server/dist/parsers/agent-parser.test.js.map +1 -0
  107. package/packages/server/dist/parsers/config-parser.d.ts +14 -0
  108. package/packages/server/dist/parsers/config-parser.d.ts.map +1 -0
  109. package/packages/server/dist/parsers/config-parser.js +39 -0
  110. package/packages/server/dist/parsers/config-parser.js.map +1 -0
  111. package/packages/server/dist/parsers/config-parser.test.d.ts +2 -0
  112. package/packages/server/dist/parsers/config-parser.test.d.ts.map +1 -0
  113. package/packages/server/dist/parsers/config-parser.test.js +56 -0
  114. package/packages/server/dist/parsers/config-parser.test.js.map +1 -0
  115. package/packages/server/dist/parsers/csv-parser.d.ts +4 -0
  116. package/packages/server/dist/parsers/csv-parser.d.ts.map +1 -0
  117. package/packages/server/dist/parsers/csv-parser.js +50 -0
  118. package/packages/server/dist/parsers/csv-parser.js.map +1 -0
  119. package/packages/server/dist/parsers/csv-parser.test.d.ts +2 -0
  120. package/packages/server/dist/parsers/csv-parser.test.d.ts.map +1 -0
  121. package/packages/server/dist/parsers/csv-parser.test.js +44 -0
  122. package/packages/server/dist/parsers/csv-parser.test.js.map +1 -0
  123. package/packages/server/dist/parsers/ide-config-parser.d.ts +9 -0
  124. package/packages/server/dist/parsers/ide-config-parser.d.ts.map +1 -0
  125. package/packages/server/dist/parsers/ide-config-parser.js +28 -0
  126. package/packages/server/dist/parsers/ide-config-parser.js.map +1 -0
  127. package/packages/server/dist/parsers/ide-config-parser.test.d.ts +2 -0
  128. package/packages/server/dist/parsers/ide-config-parser.test.d.ts.map +1 -0
  129. package/packages/server/dist/parsers/ide-config-parser.test.js +32 -0
  130. package/packages/server/dist/parsers/ide-config-parser.test.js.map +1 -0
  131. package/packages/server/dist/parsers/index-builder.d.ts +20 -0
  132. package/packages/server/dist/parsers/index-builder.d.ts.map +1 -0
  133. package/packages/server/dist/parsers/index-builder.js +155 -0
  134. package/packages/server/dist/parsers/index-builder.js.map +1 -0
  135. package/packages/server/dist/parsers/index-builder.test.d.ts +2 -0
  136. package/packages/server/dist/parsers/index-builder.test.d.ts.map +1 -0
  137. package/packages/server/dist/parsers/index-builder.test.js +57 -0
  138. package/packages/server/dist/parsers/index-builder.test.js.map +1 -0
  139. package/packages/server/dist/parsers/package-parser.d.ts +4 -0
  140. package/packages/server/dist/parsers/package-parser.d.ts.map +1 -0
  141. package/packages/server/dist/parsers/package-parser.js +29 -0
  142. package/packages/server/dist/parsers/package-parser.js.map +1 -0
  143. package/packages/server/dist/parsers/package-parser.test.d.ts +2 -0
  144. package/packages/server/dist/parsers/package-parser.test.d.ts.map +1 -0
  145. package/packages/server/dist/parsers/package-parser.test.js +34 -0
  146. package/packages/server/dist/parsers/package-parser.test.js.map +1 -0
  147. package/packages/server/dist/parsers/skill-parser.d.ts +4 -0
  148. package/packages/server/dist/parsers/skill-parser.d.ts.map +1 -0
  149. package/packages/server/dist/parsers/skill-parser.js +21 -0
  150. package/packages/server/dist/parsers/skill-parser.js.map +1 -0
  151. package/packages/server/dist/parsers/skill-parser.test.d.ts +2 -0
  152. package/packages/server/dist/parsers/skill-parser.test.d.ts.map +1 -0
  153. package/packages/server/dist/parsers/skill-parser.test.js +48 -0
  154. package/packages/server/dist/parsers/skill-parser.test.js.map +1 -0
  155. package/packages/server/dist/parsers/team-parser.d.ts +4 -0
  156. package/packages/server/dist/parsers/team-parser.d.ts.map +1 -0
  157. package/packages/server/dist/parsers/team-parser.js +108 -0
  158. package/packages/server/dist/parsers/team-parser.js.map +1 -0
  159. package/packages/server/dist/parsers/team-parser.test.d.ts +2 -0
  160. package/packages/server/dist/parsers/team-parser.test.d.ts.map +1 -0
  161. package/packages/server/dist/parsers/team-parser.test.js +142 -0
  162. package/packages/server/dist/parsers/team-parser.test.js.map +1 -0
  163. package/packages/server/dist/parsers/workflow-parser.d.ts +4 -0
  164. package/packages/server/dist/parsers/workflow-parser.d.ts.map +1 -0
  165. package/packages/server/dist/parsers/workflow-parser.js +266 -0
  166. package/packages/server/dist/parsers/workflow-parser.js.map +1 -0
  167. package/packages/server/dist/parsers/workflow-parser.test.d.ts +2 -0
  168. package/packages/server/dist/parsers/workflow-parser.test.d.ts.map +1 -0
  169. package/packages/server/dist/parsers/workflow-parser.test.js +318 -0
  170. package/packages/server/dist/parsers/workflow-parser.test.js.map +1 -0
  171. package/packages/server/dist/plugins/agents-plugin.d.ts +3 -0
  172. package/packages/server/dist/plugins/agents-plugin.d.ts.map +1 -0
  173. package/packages/server/dist/plugins/agents-plugin.js +121 -0
  174. package/packages/server/dist/plugins/agents-plugin.js.map +1 -0
  175. package/packages/server/dist/plugins/agents-plugin.test.d.ts +2 -0
  176. package/packages/server/dist/plugins/agents-plugin.test.d.ts.map +1 -0
  177. package/packages/server/dist/plugins/agents-plugin.test.js +94 -0
  178. package/packages/server/dist/plugins/agents-plugin.test.js.map +1 -0
  179. package/packages/server/dist/plugins/commands-plugin.d.ts +16 -0
  180. package/packages/server/dist/plugins/commands-plugin.d.ts.map +1 -0
  181. package/packages/server/dist/plugins/commands-plugin.js +38 -0
  182. package/packages/server/dist/plugins/commands-plugin.js.map +1 -0
  183. package/packages/server/dist/plugins/datasources-plugin.d.ts +3 -0
  184. package/packages/server/dist/plugins/datasources-plugin.d.ts.map +1 -0
  185. package/packages/server/dist/plugins/datasources-plugin.js +211 -0
  186. package/packages/server/dist/plugins/datasources-plugin.js.map +1 -0
  187. package/packages/server/dist/plugins/files-plugin.d.ts +3 -0
  188. package/packages/server/dist/plugins/files-plugin.d.ts.map +1 -0
  189. package/packages/server/dist/plugins/files-plugin.js +77 -0
  190. package/packages/server/dist/plugins/files-plugin.js.map +1 -0
  191. package/packages/server/dist/plugins/files-plugin.test.d.ts +2 -0
  192. package/packages/server/dist/plugins/files-plugin.test.d.ts.map +1 -0
  193. package/packages/server/dist/plugins/files-plugin.test.js +107 -0
  194. package/packages/server/dist/plugins/files-plugin.test.js.map +1 -0
  195. package/packages/server/dist/plugins/modules-plugin.d.ts +3 -0
  196. package/packages/server/dist/plugins/modules-plugin.d.ts.map +1 -0
  197. package/packages/server/dist/plugins/modules-plugin.js +531 -0
  198. package/packages/server/dist/plugins/modules-plugin.js.map +1 -0
  199. package/packages/server/dist/plugins/modules-plugin.test.d.ts +2 -0
  200. package/packages/server/dist/plugins/modules-plugin.test.d.ts.map +1 -0
  201. package/packages/server/dist/plugins/modules-plugin.test.js +233 -0
  202. package/packages/server/dist/plugins/modules-plugin.test.js.map +1 -0
  203. package/packages/server/dist/plugins/outputs-plugin.d.ts +3 -0
  204. package/packages/server/dist/plugins/outputs-plugin.d.ts.map +1 -0
  205. package/packages/server/dist/plugins/outputs-plugin.js +75 -0
  206. package/packages/server/dist/plugins/outputs-plugin.js.map +1 -0
  207. package/packages/server/dist/plugins/outputs-plugin.test.d.ts +2 -0
  208. package/packages/server/dist/plugins/outputs-plugin.test.d.ts.map +1 -0
  209. package/packages/server/dist/plugins/outputs-plugin.test.js +79 -0
  210. package/packages/server/dist/plugins/outputs-plugin.test.js.map +1 -0
  211. package/packages/server/dist/plugins/overview-plugin.d.ts +3 -0
  212. package/packages/server/dist/plugins/overview-plugin.d.ts.map +1 -0
  213. package/packages/server/dist/plugins/overview-plugin.js +70 -0
  214. package/packages/server/dist/plugins/overview-plugin.js.map +1 -0
  215. package/packages/server/dist/plugins/search-plugin.d.ts +3 -0
  216. package/packages/server/dist/plugins/search-plugin.d.ts.map +1 -0
  217. package/packages/server/dist/plugins/search-plugin.js +46 -0
  218. package/packages/server/dist/plugins/search-plugin.js.map +1 -0
  219. package/packages/server/dist/plugins/settings-plugin.d.ts +3 -0
  220. package/packages/server/dist/plugins/settings-plugin.d.ts.map +1 -0
  221. package/packages/server/dist/plugins/settings-plugin.js +37 -0
  222. package/packages/server/dist/plugins/settings-plugin.js.map +1 -0
  223. package/packages/server/dist/plugins/settings-plugin.test.d.ts +2 -0
  224. package/packages/server/dist/plugins/settings-plugin.test.d.ts.map +1 -0
  225. package/packages/server/dist/plugins/settings-plugin.test.js +72 -0
  226. package/packages/server/dist/plugins/settings-plugin.test.js.map +1 -0
  227. package/packages/server/dist/plugins/skills-plugin.d.ts +3 -0
  228. package/packages/server/dist/plugins/skills-plugin.d.ts.map +1 -0
  229. package/packages/server/dist/plugins/skills-plugin.js +72 -0
  230. package/packages/server/dist/plugins/skills-plugin.js.map +1 -0
  231. package/packages/server/dist/plugins/teams-plugin.d.ts +3 -0
  232. package/packages/server/dist/plugins/teams-plugin.d.ts.map +1 -0
  233. package/packages/server/dist/plugins/teams-plugin.js +162 -0
  234. package/packages/server/dist/plugins/teams-plugin.js.map +1 -0
  235. package/packages/server/dist/plugins/teams-plugin.test.d.ts +2 -0
  236. package/packages/server/dist/plugins/teams-plugin.test.d.ts.map +1 -0
  237. package/packages/server/dist/plugins/teams-plugin.test.js +128 -0
  238. package/packages/server/dist/plugins/teams-plugin.test.js.map +1 -0
  239. package/packages/server/dist/plugins/validation-plugin.d.ts +3 -0
  240. package/packages/server/dist/plugins/validation-plugin.d.ts.map +1 -0
  241. package/packages/server/dist/plugins/validation-plugin.js +102 -0
  242. package/packages/server/dist/plugins/validation-plugin.js.map +1 -0
  243. package/packages/server/dist/plugins/validation-plugin.test.d.ts +2 -0
  244. package/packages/server/dist/plugins/validation-plugin.test.d.ts.map +1 -0
  245. package/packages/server/dist/plugins/validation-plugin.test.js +161 -0
  246. package/packages/server/dist/plugins/validation-plugin.test.js.map +1 -0
  247. package/packages/server/dist/plugins/workflows-plugin.d.ts +3 -0
  248. package/packages/server/dist/plugins/workflows-plugin.d.ts.map +1 -0
  249. package/packages/server/dist/plugins/workflows-plugin.js +219 -0
  250. package/packages/server/dist/plugins/workflows-plugin.js.map +1 -0
  251. package/packages/server/dist/plugins/workflows-plugin.test.d.ts +2 -0
  252. package/packages/server/dist/plugins/workflows-plugin.test.d.ts.map +1 -0
  253. package/packages/server/dist/plugins/workflows-plugin.test.js +115 -0
  254. package/packages/server/dist/plugins/workflows-plugin.test.js.map +1 -0
  255. package/packages/server/dist/static.d.ts +3 -0
  256. package/packages/server/dist/static.d.ts.map +1 -0
  257. package/packages/server/dist/static.js +23 -0
  258. package/packages/server/dist/static.js.map +1 -0
  259. package/packages/shared/src/agents.ts +4 -0
  260. package/packages/shared/src/connections.ts +11 -8
  261. package/packages/shared/src/index.ts +1 -0
  262. package/packages/shared/src/types.test.ts +4 -3
  263. package/.prettierrc +0 -8
  264. package/CONTRIBUTING.md +0 -109
  265. package/_bmad/_config/agent-manifest.csv +0 -11
  266. package/_bmad/_config/bmad-help.csv +0 -57
  267. package/_bmad/_config/files-manifest.csv +0 -646
  268. package/_bmad/_config/ides/claude-code.yaml +0 -5
  269. package/_bmad/_config/manifest.yaml +0 -42
  270. package/_bmad/_config/skill-manifest.csv +0 -48
  271. package/_bmad/_config/task-manifest.csv +0 -1
  272. package/_bmad/_config/tool-manifest.csv +0 -1
  273. package/_bmad/_config/workflow-manifest.csv +0 -1
  274. package/_bmad/bmb/config.yaml +0 -13
  275. package/_bmad/bmb/module-help.csv +0 -7
  276. package/_bmad/bmb/skills/bmad-agent-builder/SKILL.md +0 -65
  277. package/_bmad/bmb/skills/bmad-agent-builder/assets/SKILL-template.md +0 -97
  278. package/_bmad/bmb/skills/bmad-agent-builder/assets/autonomous-wake.md +0 -37
  279. package/_bmad/bmb/skills/bmad-agent-builder/assets/init-template.md +0 -47
  280. package/_bmad/bmb/skills/bmad-agent-builder/assets/memory-system.md +0 -129
  281. package/_bmad/bmb/skills/bmad-agent-builder/assets/quality-report-template.md +0 -282
  282. package/_bmad/bmb/skills/bmad-agent-builder/assets/save-memory.md +0 -29
  283. package/_bmad/bmb/skills/bmad-agent-builder/bmad-manifest.json +0 -24
  284. package/_bmad/bmb/skills/bmad-agent-builder/bmad-skill-manifest.yaml +0 -1
  285. package/_bmad/bmb/skills/bmad-agent-builder/build-process.md +0 -199
  286. package/_bmad/bmb/skills/bmad-agent-builder/quality-optimizer.md +0 -208
  287. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-agent-cohesion.md +0 -272
  288. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-enhancement-opportunities.md +0 -277
  289. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-execution-efficiency.md +0 -181
  290. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-prompt-craft.md +0 -245
  291. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-script-opportunities.md +0 -262
  292. package/_bmad/bmb/skills/bmad-agent-builder/quality-scan-structure.md +0 -183
  293. package/_bmad/bmb/skills/bmad-agent-builder/references/metadata-reference.md +0 -126
  294. package/_bmad/bmb/skills/bmad-agent-builder/references/quality-dimensions.md +0 -46
  295. package/_bmad/bmb/skills/bmad-agent-builder/references/script-opportunities-reference.md +0 -385
  296. package/_bmad/bmb/skills/bmad-agent-builder/references/skill-best-practices.md +0 -218
  297. package/_bmad/bmb/skills/bmad-agent-builder/references/standard-fields.md +0 -103
  298. package/_bmad/bmb/skills/bmad-agent-builder/references/template-substitution-rules.md +0 -72
  299. package/_bmad/bmb/skills/bmad-agent-builder/references/universal-scan-schema.md +0 -267
  300. package/_bmad/bmb/skills/bmad-agent-builder/report-quality-scan-creator.md +0 -138
  301. package/_bmad/bmb/skills/bmad-agent-builder/scripts/bmad-manifest-schema.json +0 -103
  302. package/_bmad/bmb/skills/bmad-agent-builder/scripts/generate-html-report.py +0 -1002
  303. package/_bmad/bmb/skills/bmad-agent-builder/scripts/manifest.py +0 -420
  304. package/_bmad/bmb/skills/bmad-agent-builder/scripts/prepass-execution-deps.py +0 -368
  305. package/_bmad/bmb/skills/bmad-agent-builder/scripts/prepass-prompt-metrics.py +0 -476
  306. package/_bmad/bmb/skills/bmad-agent-builder/scripts/prepass-structure-capabilities.py +0 -636
  307. package/_bmad/bmb/skills/bmad-agent-builder/scripts/scan-path-standards.py +0 -253
  308. package/_bmad/bmb/skills/bmad-agent-builder/scripts/scan-scripts.py +0 -745
  309. package/_bmad/bmb/skills/bmad-workflow-builder/SKILL.md +0 -65
  310. package/_bmad/bmb/skills/bmad-workflow-builder/assets/SKILL-template.md +0 -117
  311. package/_bmad/bmb/skills/bmad-workflow-builder/assets/quality-report-template.md +0 -260
  312. package/_bmad/bmb/skills/bmad-workflow-builder/bmad-manifest.json +0 -23
  313. package/_bmad/bmb/skills/bmad-workflow-builder/bmad-skill-manifest.yaml +0 -1
  314. package/_bmad/bmb/skills/bmad-workflow-builder/build-process.md +0 -208
  315. package/_bmad/bmb/skills/bmad-workflow-builder/quality-optimizer.md +0 -209
  316. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-enhancement-opportunities.md +0 -273
  317. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-execution-efficiency.md +0 -322
  318. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-prompt-craft.md +0 -328
  319. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-script-opportunities.md +0 -261
  320. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-skill-cohesion.md +0 -340
  321. package/_bmad/bmb/skills/bmad-workflow-builder/quality-scan-workflow-integrity.md +0 -280
  322. package/_bmad/bmb/skills/bmad-workflow-builder/references/classification-reference.md +0 -61
  323. package/_bmad/bmb/skills/bmad-workflow-builder/references/complex-workflow-patterns.md +0 -523
  324. package/_bmad/bmb/skills/bmad-workflow-builder/references/metadata-reference.md +0 -126
  325. package/_bmad/bmb/skills/bmad-workflow-builder/references/quality-dimensions.md +0 -45
  326. package/_bmad/bmb/skills/bmad-workflow-builder/references/script-opportunities-reference.md +0 -354
  327. package/_bmad/bmb/skills/bmad-workflow-builder/references/skill-best-practices.md +0 -218
  328. package/_bmad/bmb/skills/bmad-workflow-builder/references/standard-fields.md +0 -121
  329. package/_bmad/bmb/skills/bmad-workflow-builder/references/template-substitution-rules.md +0 -85
  330. package/_bmad/bmb/skills/bmad-workflow-builder/references/universal-scan-schema.md +0 -267
  331. package/_bmad/bmb/skills/bmad-workflow-builder/report-quality-scan-creator.md +0 -134
  332. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/bmad-manifest-schema.json +0 -103
  333. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/generate-html-report.py +0 -1002
  334. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/manifest.py +0 -420
  335. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/prepass-execution-deps.py +0 -313
  336. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/prepass-prompt-metrics.py +0 -285
  337. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/prepass-workflow-integrity.py +0 -485
  338. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/scan-path-standards.py +0 -213
  339. package/_bmad/bmb/skills/bmad-workflow-builder/scripts/scan-scripts.py +0 -745
  340. package/_bmad/bmm/agents/analyst.md +0 -69
  341. package/_bmad/bmm/agents/architect.md +0 -59
  342. package/_bmad/bmm/agents/bmad-skill-manifest.yaml +0 -39
  343. package/_bmad/bmm/agents/dev.md +0 -66
  344. package/_bmad/bmm/agents/pm.md +0 -63
  345. package/_bmad/bmm/agents/qa.md +0 -89
  346. package/_bmad/bmm/agents/quick-flow-solo-dev.md +0 -61
  347. package/_bmad/bmm/agents/sm.md +0 -67
  348. package/_bmad/bmm/agents/tech-writer/bmad-skill-manifest.yaml +0 -3
  349. package/_bmad/bmm/agents/tech-writer/tech-writer.md +0 -67
  350. package/_bmad/bmm/agents/ux-designer.md +0 -58
  351. package/_bmad/bmm/config.yaml +0 -16
  352. package/_bmad/bmm/data/project-context-template.md +0 -26
  353. package/_bmad/bmm/module-help.csv +0 -32
  354. package/_bmad/bmm/teams/default-party.csv +0 -20
  355. package/_bmad/bmm/teams/team-fullstack.yaml +0 -12
  356. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/SKILL.md +0 -6
  357. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/bmad-skill-manifest.yaml +0 -1
  358. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/product-brief.template.md +0 -10
  359. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-01-init.md +0 -170
  360. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-01b-continue.md +0 -158
  361. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-02-vision.md +0 -193
  362. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-03-users.md +0 -196
  363. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-04-metrics.md +0 -199
  364. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-05-scope.md +0 -213
  365. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/steps/step-06-complete.md +0 -159
  366. package/_bmad/bmm/workflows/1-analysis/bmad-create-product-brief/workflow.md +0 -55
  367. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/SKILL.md +0 -88
  368. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/artifact-analyzer.md +0 -60
  369. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/opportunity-reviewer.md +0 -44
  370. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/skeptic-reviewer.md +0 -44
  371. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/agents/web-researcher.md +0 -49
  372. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/bmad-manifest.json +0 -17
  373. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/bmad-skill-manifest.yaml +0 -1
  374. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/contextual-discovery.md +0 -57
  375. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/draft-and-review.md +0 -86
  376. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/finalize.md +0 -75
  377. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/prompts/guided-elicitation.md +0 -70
  378. package/_bmad/bmm/workflows/1-analysis/bmad-product-brief-preview/resources/brief-template.md +0 -60
  379. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/SKILL.md +0 -6
  380. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/bmad-skill-manifest.yaml +0 -1
  381. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-01-init.md +0 -137
  382. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-02-domain-analysis.md +0 -229
  383. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-03-competitive-landscape.md +0 -238
  384. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-04-regulatory-focus.md +0 -206
  385. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-05-technical-trends.md +0 -234
  386. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/domain-steps/step-06-research-synthesis.md +0 -444
  387. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/research.template.md +0 -29
  388. package/_bmad/bmm/workflows/1-analysis/research/bmad-domain-research/workflow.md +0 -49
  389. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/SKILL.md +0 -6
  390. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/bmad-skill-manifest.yaml +0 -1
  391. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/research.template.md +0 -29
  392. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-01-init.md +0 -184
  393. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-02-customer-behavior.md +0 -239
  394. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-03-customer-pain-points.md +0 -251
  395. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-04-customer-decisions.md +0 -261
  396. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-05-competitive-analysis.md +0 -173
  397. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/steps/step-06-research-completion.md +0 -478
  398. package/_bmad/bmm/workflows/1-analysis/research/bmad-market-research/workflow.md +0 -49
  399. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/SKILL.md +0 -6
  400. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/bmad-skill-manifest.yaml +0 -1
  401. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/research.template.md +0 -29
  402. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-01-init.md +0 -137
  403. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-02-technical-overview.md +0 -239
  404. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-03-integration-patterns.md +0 -248
  405. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-04-architectural-patterns.md +0 -202
  406. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-05-implementation-research.md +0 -233
  407. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/technical-steps/step-06-research-synthesis.md +0 -487
  408. package/_bmad/bmm/workflows/1-analysis/research/bmad-technical-research/workflow.md +0 -50
  409. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +0 -182
  410. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +0 -237
  411. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +0 -249
  412. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +0 -259
  413. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +0 -177
  414. package/_bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +0 -476
  415. package/_bmad/bmm/workflows/1-analysis/research/research.template.md +0 -29
  416. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/SKILL.md +0 -6
  417. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/bmad-skill-manifest.yaml +0 -1
  418. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-01-init.md +0 -135
  419. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-01b-continue.md +0 -127
  420. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-02-discovery.md +0 -190
  421. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-03-core-experience.md +0 -217
  422. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-04-emotional-response.md +0 -220
  423. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-05-inspiration.md +0 -235
  424. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-06-design-system.md +0 -253
  425. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-07-defining-experience.md +0 -255
  426. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-08-visual-foundation.md +0 -225
  427. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-09-design-directions.md +0 -225
  428. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-10-user-journeys.md +0 -242
  429. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-11-component-strategy.md +0 -249
  430. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-12-ux-patterns.md +0 -238
  431. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-13-responsive-accessibility.md +0 -265
  432. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/steps/step-14-complete.md +0 -171
  433. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/ux-design-template.md +0 -13
  434. package/_bmad/bmm/workflows/2-plan-workflows/bmad-create-ux-design/workflow.md +0 -36
  435. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/SKILL.md +0 -6
  436. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/bmad-skill-manifest.yaml +0 -1
  437. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01-discovery.md +0 -242
  438. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md +0 -204
  439. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-02-review.md +0 -245
  440. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-03-edit.md +0 -250
  441. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md +0 -165
  442. package/_bmad/bmm/workflows/2-plan-workflows/bmad-edit-prd/workflow.md +0 -63
  443. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/SKILL.md +0 -6
  444. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml +0 -1
  445. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/data/domain-complexity.csv +0 -15
  446. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/data/prd-purpose.md +0 -197
  447. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/data/project-types.csv +0 -11
  448. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-01-discovery.md +0 -221
  449. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-02-format-detection.md +0 -188
  450. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-02b-parity-check.md +0 -206
  451. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-03-density-validation.md +0 -171
  452. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -211
  453. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-05-measurability-validation.md +0 -225
  454. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-06-traceability-validation.md +0 -214
  455. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -202
  456. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -240
  457. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-09-project-type-validation.md +0 -260
  458. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-10-smart-validation.md +0 -206
  459. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +0 -261
  460. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-12-completeness-validation.md +0 -239
  461. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/steps-v/step-v-13-report-complete.md +0 -229
  462. package/_bmad/bmm/workflows/2-plan-workflows/bmad-validate-prd/workflow.md +0 -62
  463. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/domain-complexity.csv +0 -15
  464. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/prd-purpose.md +0 -197
  465. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/project-types.csv +0 -11
  466. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +0 -224
  467. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-02-format-detection.md +0 -191
  468. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-02b-parity-check.md +0 -209
  469. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-03-density-validation.md +0 -174
  470. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -214
  471. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-05-measurability-validation.md +0 -228
  472. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-06-traceability-validation.md +0 -217
  473. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -205
  474. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -243
  475. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-09-project-type-validation.md +0 -263
  476. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +0 -209
  477. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +0 -264
  478. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-12-completeness-validation.md +0 -242
  479. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +0 -232
  480. package/_bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +0 -65
  481. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/SKILL.md +0 -6
  482. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/bmad-skill-manifest.yaml +0 -1
  483. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-01-document-discovery.md +0 -179
  484. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-02-prd-analysis.md +0 -168
  485. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +0 -169
  486. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-04-ux-alignment.md +0 -129
  487. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-05-epic-quality-review.md +0 -241
  488. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/steps/step-06-final-assessment.md +0 -126
  489. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/templates/readiness-report-template.md +0 -4
  490. package/_bmad/bmm/workflows/3-solutioning/bmad-check-implementation-readiness/workflow.md +0 -49
  491. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/SKILL.md +0 -6
  492. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/architecture-decision-template.md +0 -12
  493. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/bmad-skill-manifest.yaml +0 -1
  494. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/data/domain-complexity.csv +0 -13
  495. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/data/project-types.csv +0 -7
  496. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-01-init.md +0 -153
  497. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-01b-continue.md +0 -173
  498. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-02-context.md +0 -224
  499. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-03-starter.md +0 -329
  500. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-04-decisions.md +0 -318
  501. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-05-patterns.md +0 -359
  502. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-06-structure.md +0 -379
  503. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-07-validation.md +0 -359
  504. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/steps/step-08-complete.md +0 -76
  505. package/_bmad/bmm/workflows/3-solutioning/bmad-create-architecture/workflow.md +0 -38
  506. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/SKILL.md +0 -6
  507. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/bmad-skill-manifest.yaml +0 -1
  508. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -255
  509. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-02-design-epics.md +0 -212
  510. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-03-create-stories.md +0 -255
  511. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/steps/step-04-final-validation.md +0 -131
  512. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/templates/epics-template.md +0 -61
  513. package/_bmad/bmm/workflows/3-solutioning/bmad-create-epics-and-stories/workflow.md +0 -53
  514. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/SKILL.md +0 -6
  515. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/bmad-skill-manifest.yaml +0 -1
  516. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-01-gather-context.md +0 -61
  517. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-02-review.md +0 -41
  518. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-03-triage.md +0 -50
  519. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-04-present.md +0 -38
  520. package/_bmad/bmm/workflows/4-implementation/bmad-code-review/workflow.md +0 -54
  521. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/SKILL.md +0 -6
  522. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/bmad-skill-manifest.yaml +0 -1
  523. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/checklist.md +0 -288
  524. package/_bmad/bmm/workflows/4-implementation/bmad-correct-course/workflow.md +0 -267
  525. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/SKILL.md +0 -6
  526. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/bmad-skill-manifest.yaml +0 -1
  527. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/checklist.md +0 -357
  528. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/discover-inputs.md +0 -88
  529. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/template.md +0 -49
  530. package/_bmad/bmm/workflows/4-implementation/bmad-create-story/workflow.md +0 -380
  531. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/SKILL.md +0 -6
  532. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/bmad-skill-manifest.yaml +0 -1
  533. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/checklist.md +0 -80
  534. package/_bmad/bmm/workflows/4-implementation/bmad-dev-story/workflow.md +0 -450
  535. package/_bmad/bmm/workflows/4-implementation/bmad-retrospective/SKILL.md +0 -6
  536. package/_bmad/bmm/workflows/4-implementation/bmad-retrospective/bmad-skill-manifest.yaml +0 -1
  537. package/_bmad/bmm/workflows/4-implementation/bmad-retrospective/workflow.md +0 -1479
  538. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/SKILL.md +0 -6
  539. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/bmad-skill-manifest.yaml +0 -1
  540. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/checklist.md +0 -33
  541. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/sprint-status-template.yaml +0 -56
  542. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-planning/workflow.md +0 -263
  543. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-status/SKILL.md +0 -6
  544. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-status/bmad-skill-manifest.yaml +0 -1
  545. package/_bmad/bmm/workflows/4-implementation/bmad-sprint-status/workflow.md +0 -261
  546. package/_bmad/bmm/workflows/bmad-document-project/SKILL.md +0 -6
  547. package/_bmad/bmm/workflows/bmad-document-project/bmad-skill-manifest.yaml +0 -1
  548. package/_bmad/bmm/workflows/bmad-document-project/checklist.md +0 -245
  549. package/_bmad/bmm/workflows/bmad-document-project/documentation-requirements.csv +0 -12
  550. package/_bmad/bmm/workflows/bmad-document-project/instructions.md +0 -128
  551. package/_bmad/bmm/workflows/bmad-document-project/templates/deep-dive-template.md +0 -345
  552. package/_bmad/bmm/workflows/bmad-document-project/templates/index-template.md +0 -169
  553. package/_bmad/bmm/workflows/bmad-document-project/templates/project-overview-template.md +0 -103
  554. package/_bmad/bmm/workflows/bmad-document-project/templates/project-scan-report-schema.json +0 -160
  555. package/_bmad/bmm/workflows/bmad-document-project/templates/source-tree-template.md +0 -135
  556. package/_bmad/bmm/workflows/bmad-document-project/workflow.md +0 -27
  557. package/_bmad/bmm/workflows/bmad-document-project/workflows/deep-dive-instructions.md +0 -299
  558. package/_bmad/bmm/workflows/bmad-document-project/workflows/deep-dive-workflow.md +0 -34
  559. package/_bmad/bmm/workflows/bmad-document-project/workflows/full-scan-instructions.md +0 -1107
  560. package/_bmad/bmm/workflows/bmad-document-project/workflows/full-scan-workflow.md +0 -34
  561. package/_bmad/bmm/workflows/bmad-generate-project-context/SKILL.md +0 -6
  562. package/_bmad/bmm/workflows/bmad-generate-project-context/bmad-skill-manifest.yaml +0 -1
  563. package/_bmad/bmm/workflows/bmad-generate-project-context/project-context-template.md +0 -21
  564. package/_bmad/bmm/workflows/bmad-generate-project-context/steps/step-01-discover.md +0 -186
  565. package/_bmad/bmm/workflows/bmad-generate-project-context/steps/step-02-generate.md +0 -321
  566. package/_bmad/bmm/workflows/bmad-generate-project-context/steps/step-03-complete.md +0 -278
  567. package/_bmad/bmm/workflows/bmad-generate-project-context/workflow.md +0 -43
  568. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/SKILL.md +0 -6
  569. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/bmad-skill-manifest.yaml +0 -1
  570. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/checklist.md +0 -33
  571. package/_bmad/bmm/workflows/bmad-qa-generate-e2e-tests/workflow.md +0 -136
  572. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/SKILL.md +0 -6
  573. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/bmad-skill-manifest.yaml +0 -1
  574. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-01-mode-detection.md +0 -169
  575. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-02-context-gathering.md +0 -114
  576. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-03-execute.md +0 -107
  577. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-04-self-check.md +0 -107
  578. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-05-adversarial-review.md +0 -94
  579. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/steps/step-06-resolve-findings.md +0 -144
  580. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev/workflow.md +0 -38
  581. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/SKILL.md +0 -6
  582. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml +0 -1
  583. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-01-clarify-and-route.md +0 -51
  584. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-02-plan.md +0 -35
  585. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-03-implement.md +0 -33
  586. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md +0 -50
  587. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-05-present.md +0 -17
  588. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/tech-spec-template.md +0 -90
  589. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md +0 -79
  590. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/SKILL.md +0 -6
  591. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/bmad-skill-manifest.yaml +0 -1
  592. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-01-understand.md +0 -185
  593. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-02-investigate.md +0 -140
  594. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-03-generate.md +0 -123
  595. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/steps/step-04-review.md +0 -195
  596. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/tech-spec-template.md +0 -74
  597. package/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-spec/workflow.md +0 -73
  598. package/_bmad/core/config.yaml +0 -9
  599. package/_bmad/core/module-help.csv +0 -11
  600. package/_bmad/core/skills/bmad-advanced-elicitation/SKILL.md +0 -6
  601. package/_bmad/core/skills/bmad-advanced-elicitation/bmad-skill-manifest.yaml +0 -1
  602. package/_bmad/core/skills/bmad-advanced-elicitation/methods.csv +0 -51
  603. package/_bmad/core/skills/bmad-advanced-elicitation/workflow.md +0 -135
  604. package/_bmad/core/skills/bmad-brainstorming/SKILL.md +0 -6
  605. package/_bmad/core/skills/bmad-brainstorming/bmad-skill-manifest.yaml +0 -1
  606. package/_bmad/core/skills/bmad-brainstorming/brain-methods.csv +0 -62
  607. package/_bmad/core/skills/bmad-brainstorming/steps/step-01-session-setup.md +0 -214
  608. package/_bmad/core/skills/bmad-brainstorming/steps/step-01b-continue.md +0 -124
  609. package/_bmad/core/skills/bmad-brainstorming/steps/step-02a-user-selected.md +0 -229
  610. package/_bmad/core/skills/bmad-brainstorming/steps/step-02b-ai-recommended.md +0 -239
  611. package/_bmad/core/skills/bmad-brainstorming/steps/step-02c-random-selection.md +0 -211
  612. package/_bmad/core/skills/bmad-brainstorming/steps/step-02d-progressive-flow.md +0 -266
  613. package/_bmad/core/skills/bmad-brainstorming/steps/step-03-technique-execution.md +0 -401
  614. package/_bmad/core/skills/bmad-brainstorming/steps/step-04-idea-organization.md +0 -305
  615. package/_bmad/core/skills/bmad-brainstorming/template.md +0 -15
  616. package/_bmad/core/skills/bmad-brainstorming/workflow.md +0 -53
  617. package/_bmad/core/skills/bmad-distillator/SKILL.md +0 -178
  618. package/_bmad/core/skills/bmad-distillator/agents/distillate-compressor.md +0 -116
  619. package/_bmad/core/skills/bmad-distillator/agents/round-trip-reconstructor.md +0 -68
  620. package/_bmad/core/skills/bmad-distillator/bmad-skill-manifest.yaml +0 -15
  621. package/_bmad/core/skills/bmad-distillator/resources/compression-rules.md +0 -51
  622. package/_bmad/core/skills/bmad-distillator/resources/distillate-format-reference.md +0 -227
  623. package/_bmad/core/skills/bmad-distillator/resources/splitting-strategy.md +0 -78
  624. package/_bmad/core/skills/bmad-distillator/scripts/analyze_sources.py +0 -300
  625. package/_bmad/core/skills/bmad-distillator/scripts/tests/test_analyze_sources.py +0 -204
  626. package/_bmad/core/skills/bmad-editorial-review-prose/SKILL.md +0 -6
  627. package/_bmad/core/skills/bmad-editorial-review-prose/bmad-skill-manifest.yaml +0 -1
  628. package/_bmad/core/skills/bmad-editorial-review-prose/workflow.md +0 -81
  629. package/_bmad/core/skills/bmad-editorial-review-structure/SKILL.md +0 -6
  630. package/_bmad/core/skills/bmad-editorial-review-structure/bmad-skill-manifest.yaml +0 -1
  631. package/_bmad/core/skills/bmad-editorial-review-structure/workflow.md +0 -174
  632. package/_bmad/core/skills/bmad-help/SKILL.md +0 -6
  633. package/_bmad/core/skills/bmad-help/bmad-skill-manifest.yaml +0 -1
  634. package/_bmad/core/skills/bmad-help/workflow.md +0 -88
  635. package/_bmad/core/skills/bmad-index-docs/SKILL.md +0 -6
  636. package/_bmad/core/skills/bmad-index-docs/bmad-skill-manifest.yaml +0 -1
  637. package/_bmad/core/skills/bmad-index-docs/workflow.md +0 -61
  638. package/_bmad/core/skills/bmad-party-mode/SKILL.md +0 -6
  639. package/_bmad/core/skills/bmad-party-mode/bmad-skill-manifest.yaml +0 -1
  640. package/_bmad/core/skills/bmad-party-mode/steps/step-01-agent-loading.md +0 -138
  641. package/_bmad/core/skills/bmad-party-mode/steps/step-02-discussion-orchestration.md +0 -187
  642. package/_bmad/core/skills/bmad-party-mode/steps/step-03-graceful-exit.md +0 -167
  643. package/_bmad/core/skills/bmad-party-mode/workflow.md +0 -190
  644. package/_bmad/core/skills/bmad-review-adversarial-general/SKILL.md +0 -6
  645. package/_bmad/core/skills/bmad-review-adversarial-general/bmad-skill-manifest.yaml +0 -1
  646. package/_bmad/core/skills/bmad-review-adversarial-general/workflow.md +0 -32
  647. package/_bmad/core/skills/bmad-review-edge-case-hunter/SKILL.md +0 -6
  648. package/_bmad/core/skills/bmad-review-edge-case-hunter/bmad-skill-manifest.yaml +0 -1
  649. package/_bmad/core/skills/bmad-review-edge-case-hunter/workflow.md +0 -62
  650. package/_bmad/core/skills/bmad-shard-doc/SKILL.md +0 -6
  651. package/_bmad/core/skills/bmad-shard-doc/bmad-skill-manifest.yaml +0 -1
  652. package/_bmad/core/skills/bmad-shard-doc/workflow.md +0 -100
  653. package/_bmad/core/tasks/bmad-create-prd/SKILL.md +0 -6
  654. package/_bmad/core/tasks/bmad-create-prd/bmad-skill-manifest.yaml +0 -1
  655. package/_bmad/core/tasks/bmad-create-prd/data/domain-complexity.csv +0 -15
  656. package/_bmad/core/tasks/bmad-create-prd/data/prd-purpose.md +0 -197
  657. package/_bmad/core/tasks/bmad-create-prd/data/project-types.csv +0 -11
  658. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-01-init.md +0 -178
  659. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-01b-continue.md +0 -161
  660. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-02-discovery.md +0 -208
  661. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-02b-vision.md +0 -142
  662. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-02c-executive-summary.md +0 -158
  663. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-03-success.md +0 -214
  664. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-04-journeys.md +0 -201
  665. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-05-domain.md +0 -194
  666. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-06-innovation.md +0 -211
  667. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-07-project-type.md +0 -222
  668. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-08-scoping.md +0 -216
  669. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-09-functional.md +0 -219
  670. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-10-nonfunctional.md +0 -230
  671. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-11-polish.md +0 -221
  672. package/_bmad/core/tasks/bmad-create-prd/steps-c/step-12-complete.md +0 -115
  673. package/_bmad/core/tasks/bmad-create-prd/templates/prd-template.md +0 -10
  674. package/_bmad/core/tasks/bmad-create-prd/workflow.md +0 -62
  675. package/_bmad/tea/agents/tea.md +0 -63
  676. package/_bmad/tea/config.yaml +0 -25
  677. package/_bmad/tea/module-help.csv +0 -10
  678. package/_bmad/tea/teams/default-party.csv +0 -2
  679. package/_bmad/tea/testarch/knowledge/adr-quality-readiness-checklist.md +0 -377
  680. package/_bmad/tea/testarch/knowledge/api-request.md +0 -563
  681. package/_bmad/tea/testarch/knowledge/api-testing-patterns.md +0 -915
  682. package/_bmad/tea/testarch/knowledge/auth-session.md +0 -548
  683. package/_bmad/tea/testarch/knowledge/burn-in.md +0 -273
  684. package/_bmad/tea/testarch/knowledge/ci-burn-in.md +0 -717
  685. package/_bmad/tea/testarch/knowledge/component-tdd.md +0 -486
  686. package/_bmad/tea/testarch/knowledge/contract-testing.md +0 -1050
  687. package/_bmad/tea/testarch/knowledge/data-factories.md +0 -500
  688. package/_bmad/tea/testarch/knowledge/email-auth.md +0 -721
  689. package/_bmad/tea/testarch/knowledge/error-handling.md +0 -725
  690. package/_bmad/tea/testarch/knowledge/feature-flags.md +0 -750
  691. package/_bmad/tea/testarch/knowledge/file-utils.md +0 -456
  692. package/_bmad/tea/testarch/knowledge/fixture-architecture.md +0 -401
  693. package/_bmad/tea/testarch/knowledge/fixtures-composition.md +0 -382
  694. package/_bmad/tea/testarch/knowledge/intercept-network-call.md +0 -426
  695. package/_bmad/tea/testarch/knowledge/log.md +0 -426
  696. package/_bmad/tea/testarch/knowledge/network-error-monitor.md +0 -401
  697. package/_bmad/tea/testarch/knowledge/network-first.md +0 -486
  698. package/_bmad/tea/testarch/knowledge/network-recorder.md +0 -527
  699. package/_bmad/tea/testarch/knowledge/nfr-criteria.md +0 -670
  700. package/_bmad/tea/testarch/knowledge/overview.md +0 -286
  701. package/_bmad/tea/testarch/knowledge/pact-consumer-di.md +0 -310
  702. package/_bmad/tea/testarch/knowledge/pact-consumer-framework-setup.md +0 -635
  703. package/_bmad/tea/testarch/knowledge/pact-mcp.md +0 -204
  704. package/_bmad/tea/testarch/knowledge/pactjs-utils-consumer-helpers.md +0 -270
  705. package/_bmad/tea/testarch/knowledge/pactjs-utils-overview.md +0 -216
  706. package/_bmad/tea/testarch/knowledge/pactjs-utils-provider-verifier.md +0 -315
  707. package/_bmad/tea/testarch/knowledge/pactjs-utils-request-filter.md +0 -224
  708. package/_bmad/tea/testarch/knowledge/playwright-cli.md +0 -165
  709. package/_bmad/tea/testarch/knowledge/playwright-config.md +0 -730
  710. package/_bmad/tea/testarch/knowledge/probability-impact.md +0 -601
  711. package/_bmad/tea/testarch/knowledge/recurse.md +0 -421
  712. package/_bmad/tea/testarch/knowledge/risk-governance.md +0 -615
  713. package/_bmad/tea/testarch/knowledge/selective-testing.md +0 -732
  714. package/_bmad/tea/testarch/knowledge/selector-resilience.md +0 -527
  715. package/_bmad/tea/testarch/knowledge/test-healing-patterns.md +0 -644
  716. package/_bmad/tea/testarch/knowledge/test-levels-framework.md +0 -473
  717. package/_bmad/tea/testarch/knowledge/test-priorities-matrix.md +0 -373
  718. package/_bmad/tea/testarch/knowledge/test-quality.md +0 -664
  719. package/_bmad/tea/testarch/knowledge/timing-debugging.md +0 -372
  720. package/_bmad/tea/testarch/knowledge/visual-debugging.md +0 -524
  721. package/_bmad/tea/testarch/tea-index.csv +0 -43
  722. package/_bmad/tea/workflows/testarch/README.md +0 -74
  723. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/SKILL.md +0 -6
  724. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/bmad-skill-manifest.yaml +0 -1
  725. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/checklist.md +0 -197
  726. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/curriculum.yaml +0 -129
  727. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/quiz-questions.yaml +0 -206
  728. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/role-paths.yaml +0 -136
  729. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/session-content-map.yaml +0 -207
  730. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/data/tea-resources-index.yaml +0 -359
  731. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/instructions.md +0 -130
  732. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-01-init.md +0 -235
  733. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-01b-continue.md +0 -147
  734. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-02-assess.md +0 -258
  735. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-03-session-menu.md +0 -219
  736. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-01.md +0 -460
  737. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-02.md +0 -465
  738. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-03.md +0 -301
  739. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-04.md +0 -234
  740. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-05.md +0 -234
  741. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-06.md +0 -209
  742. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-07.md +0 -212
  743. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md +0 -339
  744. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-01-assess-workflow.md +0 -141
  745. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md +0 -122
  746. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md +0 -263
  747. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/templates/certificate-template.md +0 -86
  748. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/templates/progress-template.yaml +0 -95
  749. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/templates/session-notes-template.md +0 -83
  750. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/workflow-plan-teach-me-testing.md +0 -950
  751. package/_bmad/tea/workflows/testarch/bmad-teach-me-testing/workflow.md +0 -90
  752. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/SKILL.md +0 -6
  753. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/atdd-checklist-template.md +0 -371
  754. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/bmad-skill-manifest.yaml +0 -1
  755. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/checklist.md +0 -374
  756. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/instructions.md +0 -45
  757. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-01-preflight-and-context.md +0 -226
  758. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-01b-resume.md +0 -96
  759. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-02-generation-mode.md +0 -125
  760. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-03-test-strategy.md +0 -110
  761. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04-generate-tests.md +0 -334
  762. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04a-subagent-api-failing.md +0 -286
  763. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04b-subagent-e2e-failing.md +0 -244
  764. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-04c-aggregate.md +0 -370
  765. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md +0 -106
  766. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-e/step-01-assess.md +0 -65
  767. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md +0 -60
  768. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md +0 -67
  769. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/validation-report-20260127-095021.md +0 -73
  770. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/validation-report-20260127-102401.md +0 -116
  771. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/workflow-plan.md +0 -21
  772. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/workflow.md +0 -41
  773. package/_bmad/tea/workflows/testarch/bmad-testarch-atdd/workflow.yaml +0 -46
  774. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/SKILL.md +0 -6
  775. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/bmad-skill-manifest.yaml +0 -1
  776. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/checklist.md +0 -611
  777. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/instructions.md +0 -50
  778. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-01-preflight-and-context.md +0 -237
  779. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-01b-resume.md +0 -94
  780. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-02-identify-targets.md +0 -169
  781. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03-generate-tests.md +0 -394
  782. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03a-subagent-api.md +0 -263
  783. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03b-subagent-backend.md +0 -246
  784. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03b-subagent-e2e.md +0 -213
  785. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-03c-aggregate.md +0 -393
  786. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md +0 -106
  787. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-e/step-01-assess.md +0 -65
  788. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md +0 -60
  789. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md +0 -67
  790. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/validation-report-20260127-095021.md +0 -72
  791. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/validation-report-20260127-102401.md +0 -114
  792. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/workflow-plan.md +0 -20
  793. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/workflow.md +0 -41
  794. package/_bmad/tea/workflows/testarch/bmad-testarch-automate/workflow.yaml +0 -53
  795. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/SKILL.md +0 -6
  796. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/azure-pipelines-template.yaml +0 -155
  797. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/bmad-skill-manifest.yaml +0 -1
  798. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/checklist.md +0 -289
  799. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/github-actions-template.yaml +0 -328
  800. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/gitlab-ci-template.yaml +0 -158
  801. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/harness-pipeline-template.yaml +0 -159
  802. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/instructions.md +0 -45
  803. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/jenkins-pipeline-template.groovy +0 -129
  804. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-01-preflight.md +0 -158
  805. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-01b-resume.md +0 -110
  806. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-02-generate-pipeline.md +0 -279
  807. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-03-configure-quality-gates.md +0 -135
  808. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md +0 -92
  809. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-e/step-01-assess.md +0 -65
  810. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md +0 -60
  811. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md +0 -81
  812. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/validation-report-20260127-095021.md +0 -72
  813. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/validation-report-20260127-102401.md +0 -114
  814. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/workflow-plan.md +0 -20
  815. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/workflow.md +0 -41
  816. package/_bmad/tea/workflows/testarch/bmad-testarch-ci/workflow.yaml +0 -48
  817. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/SKILL.md +0 -6
  818. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/bmad-skill-manifest.yaml +0 -1
  819. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/checklist.md +0 -345
  820. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/instructions.md +0 -45
  821. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-01-preflight.md +0 -132
  822. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-01b-resume.md +0 -116
  823. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-02-select-framework.md +0 -117
  824. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-03-scaffold-framework.md +0 -323
  825. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-04-docs-and-scripts.md +0 -105
  826. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md +0 -93
  827. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-e/step-01-assess.md +0 -65
  828. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md +0 -60
  829. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md +0 -67
  830. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/validation-report-20260127-095021.md +0 -73
  831. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/validation-report-20260127-102401.md +0 -116
  832. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/workflow-plan.md +0 -22
  833. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/workflow.md +0 -41
  834. package/_bmad/tea/workflows/testarch/bmad-testarch-framework/workflow.yaml +0 -48
  835. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/SKILL.md +0 -6
  836. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/bmad-skill-manifest.yaml +0 -1
  837. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/checklist.md +0 -407
  838. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/instructions.md +0 -43
  839. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/nfr-report-template.md +0 -470
  840. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-01-load-context.md +0 -138
  841. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-01b-resume.md +0 -106
  842. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-02-define-thresholds.md +0 -107
  843. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-03-gather-evidence.md +0 -108
  844. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04-evaluate-and-score.md +0 -254
  845. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04a-subagent-security.md +0 -138
  846. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04b-subagent-performance.md +0 -84
  847. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04c-subagent-reliability.md +0 -85
  848. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04d-subagent-scalability.md +0 -88
  849. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-04e-aggregate-nfr.md +0 -264
  850. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md +0 -108
  851. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-e/step-01-assess.md +0 -65
  852. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md +0 -60
  853. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md +0 -67
  854. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/validation-report-20260127-095021.md +0 -73
  855. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/validation-report-20260127-102401.md +0 -116
  856. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/workflow-plan.md +0 -19
  857. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/workflow.md +0 -41
  858. package/_bmad/tea/workflows/testarch/bmad-testarch-nfr/workflow.yaml +0 -48
  859. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/SKILL.md +0 -6
  860. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/bmad-skill-manifest.yaml +0 -1
  861. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/checklist.md +0 -464
  862. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/instructions.md +0 -105
  863. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-01-detect-mode.md +0 -134
  864. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-01b-resume.md +0 -102
  865. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-02-load-context.md +0 -242
  866. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-03-risk-and-testability.md +0 -110
  867. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-04-coverage-plan.md +0 -123
  868. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md +0 -222
  869. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-e/step-01-assess.md +0 -65
  870. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md +0 -60
  871. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md +0 -67
  872. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-architecture-template.md +0 -230
  873. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-handoff-template.md +0 -70
  874. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-qa-template.md +0 -396
  875. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/test-design-template.md +0 -344
  876. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/validation-report-20260127-095021.md +0 -73
  877. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/validation-report-20260127-102401.md +0 -116
  878. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/workflow-plan.md +0 -22
  879. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/workflow.md +0 -41
  880. package/_bmad/tea/workflows/testarch/bmad-testarch-test-design/workflow.yaml +0 -77
  881. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/SKILL.md +0 -6
  882. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/bmad-skill-manifest.yaml +0 -1
  883. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/checklist.md +0 -475
  884. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/instructions.md +0 -45
  885. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-01-load-context.md +0 -197
  886. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-01b-resume.md +0 -104
  887. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-02-discover-tests.md +0 -113
  888. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03-quality-evaluation.md +0 -274
  889. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03a-subagent-determinism.md +0 -214
  890. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03b-subagent-isolation.md +0 -125
  891. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03c-subagent-maintainability.md +0 -102
  892. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03e-subagent-performance.md +0 -117
  893. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-03f-aggregate-scores.md +0 -277
  894. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md +0 -111
  895. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-e/step-01-assess.md +0 -65
  896. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md +0 -60
  897. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md +0 -67
  898. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/test-review-template.md +0 -387
  899. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/validation-report-20260127-095021.md +0 -72
  900. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/validation-report-20260127-102401.md +0 -114
  901. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/workflow-plan.md +0 -18
  902. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/workflow.md +0 -41
  903. package/_bmad/tea/workflows/testarch/bmad-testarch-test-review/workflow.yaml +0 -48
  904. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/SKILL.md +0 -6
  905. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/bmad-skill-manifest.yaml +0 -1
  906. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/checklist.md +0 -647
  907. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/instructions.md +0 -43
  908. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-01-load-context.md +0 -105
  909. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-01b-resume.md +0 -102
  910. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-02-discover-tests.md +0 -112
  911. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-03-map-criteria.md +0 -97
  912. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-04-analyze-gaps.md +0 -421
  913. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md +0 -266
  914. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-e/step-01-assess.md +0 -65
  915. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md +0 -60
  916. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md +0 -67
  917. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/trace-template.md +0 -708
  918. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/validation-report-20260127-095021.md +0 -73
  919. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/validation-report-20260127-102401.md +0 -116
  920. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/workflow-plan.md +0 -21
  921. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/workflow.md +0 -41
  922. package/_bmad/tea/workflows/testarch/bmad-testarch-trace/workflow.yaml +0 -56
  923. package/eslint.config.js +0 -38
  924. package/packages/client/index.html +0 -12
  925. package/packages/client/package.json +0 -46
  926. package/packages/client/src/app.tsx +0 -57
  927. package/packages/client/src/features/about/AboutPage.tsx +0 -144
  928. package/packages/client/src/features/agents/AgentCard.tsx +0 -52
  929. package/packages/client/src/features/agents/AgentDetail.tsx +0 -338
  930. package/packages/client/src/features/agents/AgentOverrideEditor.tsx +0 -127
  931. package/packages/client/src/features/agents/AgentsPage.tsx +0 -114
  932. package/packages/client/src/features/agents/EditAgentDialog.tsx +0 -260
  933. package/packages/client/src/features/agents/SkillAssignment.tsx +0 -153
  934. package/packages/client/src/features/agents/use-agent-detail.ts +0 -17
  935. package/packages/client/src/features/agents/use-agent-mutations.ts +0 -47
  936. package/packages/client/src/features/agents/use-agents.ts +0 -17
  937. package/packages/client/src/features/connections/ConnectionsPage.tsx +0 -165
  938. package/packages/client/src/features/files/FilesPage.tsx +0 -177
  939. package/packages/client/src/features/outputs/OutputsPage.tsx +0 -190
  940. package/packages/client/src/features/overview/OverviewPage.tsx +0 -282
  941. package/packages/client/src/features/packages/EditModuleDialog.tsx +0 -118
  942. package/packages/client/src/features/packages/PackagesPage.tsx +0 -982
  943. package/packages/client/src/features/settings/SettingsPage.tsx +0 -141
  944. package/packages/client/src/features/settings/use-settings.ts +0 -34
  945. package/packages/client/src/features/skills/CreateSkillDialog.tsx +0 -328
  946. package/packages/client/src/features/skills/SkillDetailSlideOver.tsx +0 -179
  947. package/packages/client/src/features/skills/SkillsPage.tsx +0 -142
  948. package/packages/client/src/features/skills/use-skills.ts +0 -27
  949. package/packages/client/src/features/teams/CreateTeamDialog.tsx +0 -239
  950. package/packages/client/src/features/teams/TeamDetailPanel.tsx +0 -549
  951. package/packages/client/src/features/teams/TeamsPage.tsx +0 -196
  952. package/packages/client/src/features/teams/use-teams.ts +0 -39
  953. package/packages/client/src/features/workflows/CreateWorkflowDialog.tsx +0 -395
  954. package/packages/client/src/features/workflows/EditWorkflowDialog.tsx +0 -131
  955. package/packages/client/src/features/workflows/WorkflowDetailPanel.tsx +0 -503
  956. package/packages/client/src/features/workflows/WorkflowGraph.tsx +0 -108
  957. package/packages/client/src/features/workflows/WorkflowsPage.tsx +0 -277
  958. package/packages/client/src/features/workflows/use-workflows.ts +0 -27
  959. package/packages/client/src/features/workspace/WorkspacePage.tsx +0 -304
  960. package/packages/client/src/globals.css +0 -184
  961. package/packages/client/src/hooks/use-detail-param.ts +0 -31
  962. package/packages/client/src/hooks/use-file-save.ts +0 -22
  963. package/packages/client/src/hooks/use-websocket.ts +0 -38
  964. package/packages/client/src/layout/AppShell.tsx +0 -20
  965. package/packages/client/src/layout/Breadcrumbs.tsx +0 -52
  966. package/packages/client/src/layout/NotificationProvider.tsx +0 -95
  967. package/packages/client/src/layout/Sidebar.tsx +0 -176
  968. package/packages/client/src/lib/theme.ts +0 -30
  969. package/packages/client/src/lib/websocket-client.ts +0 -97
  970. package/packages/client/src/main.tsx +0 -14
  971. package/packages/client/src/shared/CommandPalette.tsx +0 -151
  972. package/packages/client/src/shared/CsvViewer.tsx +0 -120
  973. package/packages/client/src/shared/EmptyState.tsx +0 -20
  974. package/packages/client/src/shared/EntityPageHeader.tsx +0 -95
  975. package/packages/client/src/shared/FilepathLink.tsx +0 -22
  976. package/packages/client/src/shared/Skeleton.tsx +0 -31
  977. package/packages/client/src/shared/SlideOver.tsx +0 -63
  978. package/packages/client/src/shared/VocabularyHelper.tsx +0 -48
  979. package/packages/client/src/shared/diff-viewer/DiffViewer.tsx +0 -93
  980. package/packages/client/src/shared/markdown-editor/CodeMirrorEditor.tsx +0 -199
  981. package/packages/client/src/shared/markdown-editor/MarkdownEditor.tsx +0 -95
  982. package/packages/client/src/stores/ui-store.ts +0 -13
  983. package/packages/client/tsconfig.json +0 -13
  984. package/packages/client/vite.config.ts +0 -20
  985. package/packages/server/package.json +0 -30
  986. package/packages/server/src/app.test.ts +0 -89
  987. package/packages/server/src/app.ts +0 -101
  988. package/packages/server/src/core/errors.test.ts +0 -49
  989. package/packages/server/src/core/errors.ts +0 -62
  990. package/packages/server/src/core/file-store.test.ts +0 -104
  991. package/packages/server/src/core/file-store.ts +0 -209
  992. package/packages/server/src/core/project-detector.test.ts +0 -94
  993. package/packages/server/src/core/project-detector.ts +0 -97
  994. package/packages/server/src/core/websocket.test.ts +0 -80
  995. package/packages/server/src/core/websocket.ts +0 -47
  996. package/packages/server/src/core/write-service.test.ts +0 -87
  997. package/packages/server/src/core/write-service.ts +0 -75
  998. package/packages/server/src/index.ts +0 -97
  999. package/packages/server/src/parsers/agent-parser.test.ts +0 -71
  1000. package/packages/server/src/parsers/agent-parser.ts +0 -83
  1001. package/packages/server/src/parsers/config-parser.test.ts +0 -65
  1002. package/packages/server/src/parsers/config-parser.ts +0 -51
  1003. package/packages/server/src/parsers/csv-parser.test.ts +0 -53
  1004. package/packages/server/src/parsers/csv-parser.ts +0 -55
  1005. package/packages/server/src/parsers/ide-config-parser.test.ts +0 -35
  1006. package/packages/server/src/parsers/ide-config-parser.ts +0 -37
  1007. package/packages/server/src/parsers/index-builder.test.ts +0 -78
  1008. package/packages/server/src/parsers/index-builder.ts +0 -195
  1009. package/packages/server/src/parsers/package-parser.test.ts +0 -36
  1010. package/packages/server/src/parsers/package-parser.ts +0 -34
  1011. package/packages/server/src/parsers/skill-parser.test.ts +0 -51
  1012. package/packages/server/src/parsers/skill-parser.ts +0 -26
  1013. package/packages/server/src/parsers/team-parser.test.ts +0 -186
  1014. package/packages/server/src/parsers/team-parser.ts +0 -128
  1015. package/packages/server/src/parsers/workflow-parser.test.ts +0 -415
  1016. package/packages/server/src/parsers/workflow-parser.ts +0 -311
  1017. package/packages/server/src/plugins/agents-plugin.test.ts +0 -111
  1018. package/packages/server/src/plugins/agents-plugin.ts +0 -164
  1019. package/packages/server/src/plugins/files-plugin.test.ts +0 -121
  1020. package/packages/server/src/plugins/files-plugin.ts +0 -93
  1021. package/packages/server/src/plugins/modules-plugin.test.ts +0 -264
  1022. package/packages/server/src/plugins/modules-plugin.ts +0 -386
  1023. package/packages/server/src/plugins/outputs-plugin.test.ts +0 -89
  1024. package/packages/server/src/plugins/outputs-plugin.ts +0 -93
  1025. package/packages/server/src/plugins/overview-plugin.ts +0 -73
  1026. package/packages/server/src/plugins/search-plugin.ts +0 -63
  1027. package/packages/server/src/plugins/settings-plugin.test.ts +0 -82
  1028. package/packages/server/src/plugins/settings-plugin.ts +0 -46
  1029. package/packages/server/src/plugins/skills-plugin.ts +0 -87
  1030. package/packages/server/src/plugins/teams-plugin.test.ts +0 -157
  1031. package/packages/server/src/plugins/teams-plugin.ts +0 -198
  1032. package/packages/server/src/plugins/validation-plugin.test.ts +0 -229
  1033. package/packages/server/src/plugins/validation-plugin.ts +0 -116
  1034. package/packages/server/src/plugins/workflows-plugin.test.ts +0 -145
  1035. package/packages/server/src/plugins/workflows-plugin.ts +0 -270
  1036. package/packages/server/src/static.ts +0 -29
  1037. package/packages/server/tsconfig.json +0 -8
  1038. package/packages/shared/package.json +0 -20
  1039. package/packages/shared/tsconfig.json +0 -8
  1040. package/tsconfig.base.json +0 -19
  1041. package/vitest.config.ts +0 -7
@@ -0,0 +1,521 @@
1
+ var HT=t=>{throw TypeError(t)};var Nb=(t,e,n)=>e.has(t)||HT("Cannot "+n);var J=(t,e,n)=>(Nb(t,e,"read from private field"),n?n.call(t):e.get(t)),Me=(t,e,n)=>e.has(t)?HT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ve=(t,e,n,r)=>(Nb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),tt=(t,e,n)=>(Nb(t,e,"access private method"),n);var dg=(t,e,n,r)=>({set _(i){ve(t,e,i,n)},get _(){return J(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Px(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pb={exports:{}},fd={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var GT;function w6(){if(GT)return fd;GT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var o in i)o!=="key"&&(s[o]=i[o])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return fd.Fragment=e,fd.jsx=n,fd.jsxs=n,fd}var FT;function k6(){return FT||(FT=1,Pb.exports=w6()),Pb.exports}var p=k6(),Eb={exports:{}},Ze={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var KT;function Q6(){if(KT)return Ze;KT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),O=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=O&&D[O]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function w(D,Y,P){this.props=D,this.context=Y,this.refs=k,this.updater=P||v}w.prototype.isReactComponent={},w.prototype.setState=function(D,Y){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,Y,"setState")},w.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function j(){}j.prototype=w.prototype;function Q(D,Y,P){this.props=D,this.context=Y,this.refs=k,this.updater=P||v}var T=Q.prototype=new j;T.constructor=Q,S(T,w.prototype),T.isPureReactComponent=!0;var N=Array.isArray;function _(){}var M={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function U(D,Y,P){var ee=P.ref;return{$$typeof:t,type:D,key:Y,ref:ee!==void 0?ee:null,props:P}}function F(D,Y){return U(D.type,Y,D.props)}function Z(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function X(D){var Y={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(P){return Y[P]})}var H=/\/+/g;function E(D,Y){return typeof D=="object"&&D!==null&&D.key!=null?X(""+D.key):Y.toString(36)}function q(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(_,_):(D.status="pending",D.then(function(Y){D.status==="pending"&&(D.status="fulfilled",D.value=Y)},function(Y){D.status==="pending"&&(D.status="rejected",D.reason=Y)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function R(D,Y,P,ee,ae){var ne=typeof D;(ne==="undefined"||ne==="boolean")&&(D=null);var fe=!1;if(D===null)fe=!0;else switch(ne){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(D.$$typeof){case t:case e:fe=!0;break;case h:return fe=D._init,R(fe(D._payload),Y,P,ee,ae)}}if(fe)return ae=ae(D),fe=ee===""?"."+E(D,0):ee,N(ae)?(P="",fe!=null&&(P=fe.replace(H,"$&/")+"/"),R(ae,Y,P,"",function(je){return je})):ae!=null&&(Z(ae)&&(ae=F(ae,P+(ae.key==null||D&&D.key===ae.key?"":(""+ae.key).replace(H,"$&/")+"/")+fe)),Y.push(ae)),1;fe=0;var oe=ee===""?".":ee+":";if(N(D))for(var me=0;me<D.length;me++)ee=D[me],ne=oe+E(ee,me),fe+=R(ee,Y,P,ne,ae);else if(me=x(D),typeof me=="function")for(D=me.call(D),me=0;!(ee=D.next()).done;)ee=ee.value,ne=oe+E(ee,me++),fe+=R(ee,Y,P,ne,ae);else if(ne==="object"){if(typeof D.then=="function")return R(q(D),Y,P,ee,ae);throw Y=String(D),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return fe}function z(D,Y,P){if(D==null)return D;var ee=[],ae=0;return R(D,ee,"","",function(ne){return Y.call(P,ne,ae++)}),ee}function B(D){if(D._status===-1){var Y=D._result;Y=Y(),Y.then(function(P){(D._status===0||D._status===-1)&&(D._status=1,D._result=P)},function(P){(D._status===0||D._status===-1)&&(D._status=2,D._result=P)}),D._status===-1&&(D._status=0,D._result=Y)}if(D._status===1)return D._result.default;throw D._result}var W=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},A={map:z,forEach:function(D,Y,P){z(D,function(){Y.apply(this,arguments)},P)},count:function(D){var Y=0;return z(D,function(){Y++}),Y},toArray:function(D){return z(D,function(Y){return Y})||[]},only:function(D){if(!Z(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ze.Activity=m,Ze.Children=A,Ze.Component=w,Ze.Fragment=n,Ze.Profiler=i,Ze.PureComponent=Q,Ze.StrictMode=r,Ze.Suspense=u,Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ze.__COMPILER_RUNTIME={__proto__:null,c:function(D){return M.H.useMemoCache(D)}},Ze.cache=function(D){return function(){return D.apply(null,arguments)}},Ze.cacheSignal=function(){return null},Ze.cloneElement=function(D,Y,P){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ee=S({},D.props),ae=D.key;if(Y!=null)for(ne in Y.key!==void 0&&(ae=""+Y.key),Y)!I.call(Y,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&Y.ref===void 0||(ee[ne]=Y[ne]);var ne=arguments.length-2;if(ne===1)ee.children=P;else if(1<ne){for(var fe=Array(ne),oe=0;oe<ne;oe++)fe[oe]=arguments[oe+2];ee.children=fe}return U(D.type,ae,ee)},Ze.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:s,_context:D},D},Ze.createElement=function(D,Y,P){var ee,ae={},ne=null;if(Y!=null)for(ee in Y.key!==void 0&&(ne=""+Y.key),Y)I.call(Y,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ae[ee]=Y[ee]);var fe=arguments.length-2;if(fe===1)ae.children=P;else if(1<fe){for(var oe=Array(fe),me=0;me<fe;me++)oe[me]=arguments[me+2];ae.children=oe}if(D&&D.defaultProps)for(ee in fe=D.defaultProps,fe)ae[ee]===void 0&&(ae[ee]=fe[ee]);return U(D,ne,ae)},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(D){return{$$typeof:o,render:D}},Ze.isValidElement=Z,Ze.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:B}},Ze.memo=function(D,Y){return{$$typeof:f,type:D,compare:Y===void 0?null:Y}},Ze.startTransition=function(D){var Y=M.T,P={};M.T=P;try{var ee=D(),ae=M.S;ae!==null&&ae(P,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(_,W)}catch(ne){W(ne)}finally{Y!==null&&P.types!==null&&(Y.types=P.types),M.T=Y}},Ze.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ze.use=function(D){return M.H.use(D)},Ze.useActionState=function(D,Y,P){return M.H.useActionState(D,Y,P)},Ze.useCallback=function(D,Y){return M.H.useCallback(D,Y)},Ze.useContext=function(D){return M.H.useContext(D)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(D,Y){return M.H.useDeferredValue(D,Y)},Ze.useEffect=function(D,Y){return M.H.useEffect(D,Y)},Ze.useEffectEvent=function(D){return M.H.useEffectEvent(D)},Ze.useId=function(){return M.H.useId()},Ze.useImperativeHandle=function(D,Y,P){return M.H.useImperativeHandle(D,Y,P)},Ze.useInsertionEffect=function(D,Y){return M.H.useInsertionEffect(D,Y)},Ze.useLayoutEffect=function(D,Y){return M.H.useLayoutEffect(D,Y)},Ze.useMemo=function(D,Y){return M.H.useMemo(D,Y)},Ze.useOptimistic=function(D,Y){return M.H.useOptimistic(D,Y)},Ze.useReducer=function(D,Y,P){return M.H.useReducer(D,Y,P)},Ze.useRef=function(D){return M.H.useRef(D)},Ze.useState=function(D){return M.H.useState(D)},Ze.useSyncExternalStore=function(D,Y,P){return M.H.useSyncExternalStore(D,Y,P)},Ze.useTransition=function(){return M.H.useTransition()},Ze.version="19.2.4",Ze}var JT;function op(){return JT||(JT=1,Eb.exports=Q6()),Eb.exports}var C=op();const $d=Px(C);var Ab={exports:{}},dd={},Mb={exports:{}},Rb={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var e$;function C6(){return e$||(e$=1,(function(t){function e(R,z){var B=R.length;R.push(z);e:for(;0<B;){var W=B-1>>>1,A=R[W];if(0<i(A,z))R[W]=z,R[B]=A,B=W;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],B=R.pop();if(B!==z){R[0]=B;e:for(var W=0,A=R.length,D=A>>>1;W<D;){var Y=2*(W+1)-1,P=R[Y],ee=Y+1,ae=R[ee];if(0>i(P,B))ee<A&&0>i(ae,P)?(R[W]=ae,R[ee]=B,W=ee):(R[W]=P,R[Y]=B,W=Y);else if(ee<A&&0>i(ae,B))R[W]=ae,R[ee]=B,W=ee;else break e}}return z}function i(R,z){var B=R.sortIndex-z.sortIndex;return B!==0?B:R.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var u=[],f=[],h=1,m=null,O=3,x=!1,v=!1,S=!1,k=!1,w=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function T(R){for(var z=n(f);z!==null;){if(z.callback===null)r(f);else if(z.startTime<=R)r(f),z.sortIndex=z.expirationTime,e(u,z);else break;z=n(f)}}function N(R){if(S=!1,T(R),!v)if(n(u)!==null)v=!0,_||(_=!0,X());else{var z=n(f);z!==null&&q(N,z.startTime-R)}}var _=!1,M=-1,I=5,U=-1;function F(){return k?!0:!(t.unstable_now()-U<I)}function Z(){if(k=!1,_){var R=t.unstable_now();U=R;var z=!0;try{e:{v=!1,S&&(S=!1,j(M),M=-1),x=!0;var B=O;try{t:{for(T(R),m=n(u);m!==null&&!(m.expirationTime>R&&F());){var W=m.callback;if(typeof W=="function"){m.callback=null,O=m.priorityLevel;var A=W(m.expirationTime<=R);if(R=t.unstable_now(),typeof A=="function"){m.callback=A,T(R),z=!0;break t}m===n(u)&&r(u),T(R)}else r(u);m=n(u)}if(m!==null)z=!0;else{var D=n(f);D!==null&&q(N,D.startTime-R),z=!1}}break e}finally{m=null,O=B,x=!1}z=void 0}}finally{z?X():_=!1}}}var X;if(typeof Q=="function")X=function(){Q(Z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,E=H.port2;H.port1.onmessage=Z,X=function(){E.postMessage(null)}}else X=function(){w(Z,0)};function q(R,z){M=w(function(){R(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_next=function(R){switch(O){case 1:case 2:case 3:var z=3;break;default:z=O}var B=O;O=z;try{return R()}finally{O=B}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var B=O;O=R;try{return z()}finally{O=B}},t.unstable_scheduleCallback=function(R,z,B){var W=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?W+B:W):B=W,R){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=B+A,R={id:h++,callback:z,priorityLevel:R,startTime:B,expirationTime:A,sortIndex:-1},B>W?(R.sortIndex=B,e(f,R),n(u)===null&&R===n(f)&&(S?(j(M),M=-1):S=!0,q(N,B-W))):(R.sortIndex=A,e(u,R),v||x||(v=!0,_||(_=!0,X()))),R},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(R){var z=O;return function(){var B=O;O=z;try{return R.apply(this,arguments)}finally{O=B}}}})(Rb)),Rb}var t$;function j6(){return t$||(t$=1,Mb.exports=C6()),Mb.exports}var zb={exports:{}},Ln={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var n$;function T6(){if(n$)return Ln;n$=1;var t=op();function e(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(u,f,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:u,containerInfo:f,implementation:h}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ln.createPortal=function(u,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return s(u,f,null,h)},Ln.flushSync=function(u){var f=a.T,h=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=f,r.p=h,r.d.f()}},Ln.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(u,f))},Ln.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Ln.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var h=f.as,m=o(h,f.crossOrigin),O=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:O,fetchPriority:x}):h==="script"&&r.d.X(u,{crossOrigin:m,integrity:O,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Ln.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=o(f.as,f.crossOrigin);r.d.M(u,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(u)},Ln.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,m=o(h,f.crossOrigin);r.d.L(u,h,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Ln.preloadModule=function(u,f){if(typeof u=="string")if(f){var h=o(f.as,f.crossOrigin);r.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(u)},Ln.requestFormReset=function(u){r.d.r(u)},Ln.unstable_batchedUpdates=function(u,f){return u(f)},Ln.useFormState=function(u,f,h){return a.H.useFormState(u,f,h)},Ln.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ln.version="19.2.4",Ln}var r$;function pA(){if(r$)return zb.exports;r$=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),zb.exports=T6(),zb.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var i$;function $6(){if(i$)return dd;i$=1;var t=j6(),e=op(),n=pA();function r(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function s(l){var c=l,d=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(d=c.return),l=c.return;while(l)}return c.tag===3?d:null}function a(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function o(l){if(l.tag===31){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function u(l){if(s(l)!==l)throw Error(r(188))}function f(l){var c=l.alternate;if(!c){if(c=s(l),c===null)throw Error(r(188));return c!==l?null:l}for(var d=l,g=c;;){var y=d.return;if(y===null)break;var b=y.alternate;if(b===null){if(g=y.return,g!==null){d=g;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===d)return u(y),l;if(b===g)return u(y),c;b=b.sibling}throw Error(r(188))}if(d.return!==g.return)d=y,g=b;else{for(var $=!1,L=y.child;L;){if(L===d){$=!0,d=y,g=b;break}if(L===g){$=!0,g=y,d=b;break}L=L.sibling}if(!$){for(L=b.child;L;){if(L===d){$=!0,d=b,g=y;break}if(L===g){$=!0,g=b,d=y;break}L=L.sibling}if(!$)throw Error(r(189))}}if(d.alternate!==g)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?l:c}function h(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=h(l),c!==null)return c;l=l.sibling}return null}var m=Object.assign,O=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function X(l){return l===null||typeof l!="object"?null:(l=Z&&l[Z]||l["@@iterator"],typeof l=="function"?l:null)}var H=Symbol.for("react.client.reference");function E(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===H?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case S:return"Fragment";case w:return"Profiler";case k:return"StrictMode";case N:return"Suspense";case _:return"SuspenseList";case U:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case v:return"Portal";case Q:return l.displayName||"Context";case j:return(l._context.displayName||"Context")+".Consumer";case T:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case M:return c=l.displayName||null,c!==null?c:E(l.type)||"Memo";case I:c=l._payload,l=l._init;try{return E(l(c))}catch{}}return null}var q=Array.isArray,R=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},W=[],A=-1;function D(l){return{current:l}}function Y(l){0>A||(l.current=W[A],W[A]=null,A--)}function P(l,c){A++,W[A]=l.current,l.current=c}var ee=D(null),ae=D(null),ne=D(null),fe=D(null);function oe(l,c){switch(P(ne,c),P(ae,l),P(ee,null),c.nodeType){case 9:case 11:l=(l=c.documentElement)&&(l=l.namespaceURI)?xT(l):0;break;default:if(l=c.tagName,c=c.namespaceURI)c=xT(c),l=yT(c,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}Y(ee),P(ee,l)}function me(){Y(ee),Y(ae),Y(ne)}function je(l){l.memoizedState!==null&&P(fe,l);var c=ee.current,d=yT(c,l.type);c!==d&&(P(ae,l),P(ee,d))}function ke(l){ae.current===l&&(Y(ee),Y(ae)),fe.current===l&&(Y(fe),ld._currentValue=B)}var we,Qe;function Le(l){if(we===void 0)try{throw Error()}catch(d){var c=d.stack.trim().match(/\n( *(at )?)/);we=c&&c[1]||"",Qe=-1<d.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+we+l+Qe}var He=!1;function ze(l,c){if(!l||He)return"";He=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(le){var se=le}Reflect.construct(l,[],he)}else{try{he.call()}catch(le){se=le}l.call(he.prototype)}}else{try{throw Error()}catch(le){se=le}(he=l())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=g.DetermineComponentFrameRoot(),$=b[0],L=b[1];if($&&L){var G=$.split(`
44
+ `),ie=L.split(`
45
+ `);for(y=g=0;g<G.length&&!G[g].includes("DetermineComponentFrameRoot");)g++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(g===G.length||y===ie.length)for(g=G.length-1,y=ie.length-1;1<=g&&0<=y&&G[g]!==ie[y];)y--;for(;1<=g&&0<=y;g--,y--)if(G[g]!==ie[y]){if(g!==1||y!==1)do if(g--,y--,0>y||G[g]!==ie[y]){var ue=`
46
+ `+G[g].replace(" at new "," at ");return l.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",l.displayName)),ue}while(1<=g&&0<=y);break}}}finally{He=!1,Error.prepareStackTrace=d}return(d=l?l.displayName||l.name:"")?Le(d):""}function vt(l,c){switch(l.tag){case 26:case 27:case 5:return Le(l.type);case 16:return Le("Lazy");case 13:return l.child!==c&&c!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return ze(l.type,!1);case 11:return ze(l.type.render,!1);case 1:return ze(l.type,!0);case 31:return Le("Activity");default:return""}}function Qn(l){try{var c="",d=null;do c+=vt(l,d),d=l,l=l.return;while(l);return c}catch(g){return`
47
+ Error generating stack: `+g.message+`
48
+ `+g.stack}}var Jt=Object.prototype.hasOwnProperty,Cn=t.unstable_scheduleCallback,sr=t.unstable_cancelCallback,jr=t.unstable_shouldYield,Yr=t.unstable_requestPaint,en=t.unstable_now,Si=t.unstable_getCurrentPriorityLevel,ce=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,Ne=t.unstable_NormalPriority,Be=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,Ie=t.log,ht=t.unstable_setDisableYieldValue,kt=null,Qt=null;function Vt(l){if(typeof Ie=="function"&&ht(l),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(kt,l)}catch{}}var ot=Math.clz32?Math.clz32:Of,Ur=Math.log,jn=Math.LN2;function Of(l){return l>>>=0,l===0?32:31-(Ur(l)/jn|0)|0}var Wr=256,Jo=262144,ec=4194304;function ks(l){var c=l&42;if(c!==0)return c;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function tc(l,c,d){var g=l.pendingLanes;if(g===0)return 0;var y=0,b=l.suspendedLanes,$=l.pingedLanes;l=l.warmLanes;var L=g&134217727;return L!==0?(g=L&~b,g!==0?y=ks(g):($&=L,$!==0?y=ks($):d||(d=L&~l,d!==0&&(y=ks(d))))):(L=g&~b,L!==0?y=ks(L):$!==0?y=ks($):d||(d=g&~l,d!==0&&(y=ks(d)))),y===0?0:c!==0&&c!==y&&(c&b)===0&&(b=y&-y,d=c&-c,b>=d||b===32&&(d&4194048)!==0)?c:y}function _l(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function vy(l,c){switch(l){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 qp(){var l=ec;return ec<<=1,(ec&62914560)===0&&(ec=4194304),l}function xf(l){for(var c=[],d=0;31>d;d++)c.push(l);return c}function Nl(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function by(l,c,d,g,y,b){var $=l.pendingLanes;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=d,l.entangledLanes&=d,l.errorRecoveryDisabledLanes&=d,l.shellSuspendCounter=0;var L=l.entanglements,G=l.expirationTimes,ie=l.hiddenUpdates;for(d=$&~d;0<d;){var ue=31-ot(d),he=1<<ue;L[ue]=0,G[ue]=-1;var se=ie[ue];if(se!==null)for(ie[ue]=null,ue=0;ue<se.length;ue++){var le=se[ue];le!==null&&(le.lane&=-536870913)}d&=~he}g!==0&&Vp(l,g,0),b!==0&&y===0&&l.tag!==0&&(l.suspendedLanes|=b&~($&~c))}function Vp(l,c,d){l.pendingLanes|=c,l.suspendedLanes&=~c;var g=31-ot(c);l.entangledLanes|=c,l.entanglements[g]=l.entanglements[g]|1073741824|d&261930}function Ip(l,c){var d=l.entangledLanes|=c;for(l=l.entanglements;d;){var g=31-ot(d),y=1<<g;y&c|l[g]&c&&(l[g]|=c),d&=~y}}function Yp(l,c){var d=c&-c;return d=(d&42)!==0?1:yf(d),(d&(l.suspendedLanes|c))!==0?0:d}function yf(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function vf(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function Up(){var l=z.p;return l!==0?l:(l=window.event,l===void 0?32:BT(l.type))}function Wp(l,c){var d=z.p;try{return z.p=l,c()}finally{z.p=d}}var Vi=Math.random().toString(36).slice(2),On="__reactFiber$"+Vi,Dn="__reactProps$"+Vi,Qs="__reactContainer$"+Vi,nc="__reactEvents$"+Vi,Hp="__reactListeners$"+Vi,Sy="__reactHandles$"+Vi,Gp="__reactResources$"+Vi,Pl="__reactMarker$"+Vi;function bf(l){delete l[On],delete l[Dn],delete l[nc],delete l[Hp],delete l[Sy]}function ba(l){var c=l[On];if(c)return c;for(var d=l.parentNode;d;){if(c=d[Qs]||d[On]){if(d=c.alternate,c.child!==null||d!==null&&d.child!==null)for(l=CT(l);l!==null;){if(d=l[On])return d;l=CT(l)}return c}l=d,d=l.parentNode}return null}function Sa(l){if(l=l[On]||l[Qs]){var c=l.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return l}return null}function wa(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l.stateNode;throw Error(r(33))}function ka(l){var c=l[Gp];return c||(c=l[Gp]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function ln(l){l[Pl]=!0}var Fp=new Set,Kp={};function Cs(l,c){Qa(l,c),Qa(l+"Capture",c)}function Qa(l,c){for(Kp[l]=c,l=0;l<c.length;l++)Fp.add(c[l])}var wy=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]*$"),Sf={},Jp={};function ky(l){return Jt.call(Jp,l)?!0:Jt.call(Sf,l)?!1:wy.test(l)?Jp[l]=!0:(Sf[l]=!0,!1)}function rc(l,c,d){if(ky(c))if(d===null)l.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":l.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){l.removeAttribute(c);return}}l.setAttribute(c,""+d)}}function ic(l,c,d){if(d===null)l.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(c);return}l.setAttribute(c,""+d)}}function wi(l,c,d,g){if(g===null)l.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(d);return}l.setAttributeNS(c,d,""+g)}}function ar(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function em(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Qy(l,c,d){var g=Object.getOwnPropertyDescriptor(l.constructor.prototype,c);if(!l.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var y=g.get,b=g.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return y.call(this)},set:function($){d=""+$,b.call(this,$)}}),Object.defineProperty(l,c,{enumerable:g.enumerable}),{getValue:function(){return d},setValue:function($){d=""+$},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function Ca(l){if(!l._valueTracker){var c=em(l)?"checked":"value";l._valueTracker=Qy(l,c,""+l[c])}}function tm(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var d=c.getValue(),g="";return l&&(g=em(l)?l.checked?"true":"false":l.value),l=g,l!==d?(c.setValue(l),!0):!1}function El(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Cy=/[\n"\\]/g;function lr(l){return l.replace(Cy,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Al(l,c,d,g,y,b,$,L){l.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?l.type=$:l.removeAttribute("type"),c!=null?$==="number"?(c===0&&l.value===""||l.value!=c)&&(l.value=""+ar(c)):l.value!==""+ar(c)&&(l.value=""+ar(c)):$!=="submit"&&$!=="reset"||l.removeAttribute("value"),c!=null?wf(l,$,ar(c)):d!=null?wf(l,$,ar(d)):g!=null&&l.removeAttribute("value"),y==null&&b!=null&&(l.defaultChecked=!!b),y!=null&&(l.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?l.name=""+ar(L):l.removeAttribute("name")}function nm(l,c,d,g,y,b,$,L){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(l.type=b),c!=null||d!=null){if(!(b!=="submit"&&b!=="reset"||c!=null)){Ca(l);return}d=d!=null?""+ar(d):"",c=c!=null?""+ar(c):d,L||c===l.value||(l.value=c),l.defaultValue=c}g=g??y,g=typeof g!="function"&&typeof g!="symbol"&&!!g,l.checked=L?l.checked:!!g,l.defaultChecked=!!g,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(l.name=$),Ca(l)}function wf(l,c,d){c==="number"&&El(l.ownerDocument)===l||l.defaultValue===""+d||(l.defaultValue=""+d)}function js(l,c,d,g){if(l=l.options,c){c={};for(var y=0;y<d.length;y++)c["$"+d[y]]=!0;for(d=0;d<l.length;d++)y=c.hasOwnProperty("$"+l[d].value),l[d].selected!==y&&(l[d].selected=y),y&&g&&(l[d].defaultSelected=!0)}else{for(d=""+ar(d),c=null,y=0;y<l.length;y++){if(l[y].value===d){l[y].selected=!0,g&&(l[y].defaultSelected=!0);return}c!==null||l[y].disabled||(c=l[y])}c!==null&&(c.selected=!0)}}function hQ(l,c,d){if(c!=null&&(c=""+ar(c),c!==l.value&&(l.value=c),d==null)){l.defaultValue!==c&&(l.defaultValue=c);return}l.defaultValue=d!=null?""+ar(d):""}function pQ(l,c,d,g){if(c==null){if(g!=null){if(d!=null)throw Error(r(92));if(q(g)){if(1<g.length)throw Error(r(93));g=g[0]}d=g}d==null&&(d=""),c=d}d=ar(c),l.defaultValue=d,g=l.textContent,g===d&&g!==""&&g!==null&&(l.value=g),Ca(l)}function sc(l,c){if(c){var d=l.firstChild;if(d&&d===l.lastChild&&d.nodeType===3){d.nodeValue=c;return}}l.textContent=c}var xX=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 mQ(l,c,d){var g=c.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?g?l.setProperty(c,""):c==="float"?l.cssFloat="":l[c]="":g?l.setProperty(c,d):typeof d!="number"||d===0||xX.has(c)?c==="float"?l.cssFloat=d:l[c]=(""+d).trim():l[c]=d+"px"}function gQ(l,c,d){if(c!=null&&typeof c!="object")throw Error(r(62));if(l=l.style,d!=null){for(var g in d)!d.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?l.setProperty(g,""):g==="float"?l.cssFloat="":l[g]="");for(var y in c)g=c[y],c.hasOwnProperty(y)&&d[y]!==g&&mQ(l,y,g)}else for(var b in c)c.hasOwnProperty(b)&&mQ(l,b,c[b])}function jy(l){if(l.indexOf("-")===-1)return!1;switch(l){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 yX=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"]]),vX=/^[\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 rm(l){return vX.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function Ts(){}var Ty=null;function $y(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ac=null,lc=null;function OQ(l){var c=Sa(l);if(c&&(l=c.stateNode)){var d=l[Dn]||null;e:switch(l=c.stateNode,c.type){case"input":if(Al(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),c=d.name,d.type==="radio"&&c!=null){for(d=l;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+lr(""+c)+'"][type="radio"]'),c=0;c<d.length;c++){var g=d[c];if(g!==l&&g.form===l.form){var y=g[Dn]||null;if(!y)throw Error(r(90));Al(g,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(c=0;c<d.length;c++)g=d[c],g.form===l.form&&tm(g)}break e;case"textarea":hQ(l,d.value,d.defaultValue);break e;case"select":c=d.value,c!=null&&js(l,!!d.multiple,c,!1)}}}var _y=!1;function xQ(l,c,d){if(_y)return l(c,d);_y=!0;try{var g=l(c);return g}finally{if(_y=!1,(ac!==null||lc!==null)&&(Vm(),ac&&(c=ac,l=lc,lc=ac=null,OQ(c),l)))for(c=0;c<l.length;c++)OQ(l[c])}}function kf(l,c){var d=l.stateNode;if(d===null)return null;var g=d[Dn]||null;if(g===null)return null;d=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(l=l.type,g=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!g;break e;default:l=!1}if(l)return null;if(d&&typeof d!="function")throw Error(r(231,c,typeof d));return d}var $s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ny=!1;if($s)try{var Qf={};Object.defineProperty(Qf,"passive",{get:function(){Ny=!0}}),window.addEventListener("test",Qf,Qf),window.removeEventListener("test",Qf,Qf)}catch{Ny=!1}var ja=null,Py=null,im=null;function yQ(){if(im)return im;var l,c=Py,d=c.length,g,y="value"in ja?ja.value:ja.textContent,b=y.length;for(l=0;l<d&&c[l]===y[l];l++);var $=d-l;for(g=1;g<=$&&c[d-g]===y[b-g];g++);return im=y.slice(l,1<g?1-g:void 0)}function sm(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function am(){return!0}function vQ(){return!1}function or(l){function c(d,g,y,b,$){this._reactName=d,this._targetInst=y,this.type=g,this.nativeEvent=b,this.target=$,this.currentTarget=null;for(var L in l)l.hasOwnProperty(L)&&(d=l[L],this[L]=d?d(b):b[L]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?am:vQ,this.isPropagationStopped=vQ,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=am)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=am)},persist:function(){},isPersistent:am}),c}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lm=or(Ml),Cf=m({},Ml,{view:0,detail:0}),bX=or(Cf),Ey,Ay,jf,om=m({},Cf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ry,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==jf&&(jf&&l.type==="mousemove"?(Ey=l.screenX-jf.screenX,Ay=l.screenY-jf.screenY):Ay=Ey=0,jf=l),Ey)},movementY:function(l){return"movementY"in l?l.movementY:Ay}}),bQ=or(om),SX=m({},om,{dataTransfer:0}),wX=or(SX),kX=m({},Cf,{relatedTarget:0}),My=or(kX),QX=m({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),CX=or(QX),jX=m({},Ml,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),TX=or(jX),$X=m({},Ml,{data:0}),SQ=or($X),_X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NX={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"},PX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function EX(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=PX[l])?!!c[l]:!1}function Ry(){return EX}var AX=m({},Cf,{key:function(l){if(l.key){var c=_X[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=sm(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?NX[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ry,charCode:function(l){return l.type==="keypress"?sm(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?sm(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),MX=or(AX),RX=m({},om,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wQ=or(RX),zX=m({},Cf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ry}),DX=or(zX),LX=m({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),XX=or(LX),ZX=m({},om,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),BX=or(ZX),qX=m({},Ml,{newState:0,oldState:0}),VX=or(qX),IX=[9,13,27,32],zy=$s&&"CompositionEvent"in window,Tf=null;$s&&"documentMode"in document&&(Tf=document.documentMode);var YX=$s&&"TextEvent"in window&&!Tf,kQ=$s&&(!zy||Tf&&8<Tf&&11>=Tf),QQ=" ",CQ=!1;function jQ(l,c){switch(l){case"keyup":return IX.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TQ(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var oc=!1;function UX(l,c){switch(l){case"compositionend":return TQ(c);case"keypress":return c.which!==32?null:(CQ=!0,QQ);case"textInput":return l=c.data,l===QQ&&CQ?null:l;default:return null}}function WX(l,c){if(oc)return l==="compositionend"||!zy&&jQ(l,c)?(l=yQ(),im=Py=ja=null,oc=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return kQ&&c.locale!=="ko"?null:c.data;default:return null}}var HX={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 $Q(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!HX[l.type]:c==="textarea"}function _Q(l,c,d,g){ac?lc?lc.push(g):lc=[g]:ac=g,c=Fm(c,"onChange"),0<c.length&&(d=new lm("onChange","change",null,d,g),l.push({event:d,listeners:c}))}var $f=null,_f=null;function GX(l){dT(l,0)}function cm(l){var c=wa(l);if(tm(c))return l}function NQ(l,c){if(l==="change")return c}var PQ=!1;if($s){var Dy;if($s){var Ly="oninput"in document;if(!Ly){var EQ=document.createElement("div");EQ.setAttribute("oninput","return;"),Ly=typeof EQ.oninput=="function"}Dy=Ly}else Dy=!1;PQ=Dy&&(!document.documentMode||9<document.documentMode)}function AQ(){$f&&($f.detachEvent("onpropertychange",MQ),_f=$f=null)}function MQ(l){if(l.propertyName==="value"&&cm(_f)){var c=[];_Q(c,_f,l,$y(l)),xQ(GX,c)}}function FX(l,c,d){l==="focusin"?(AQ(),$f=c,_f=d,$f.attachEvent("onpropertychange",MQ)):l==="focusout"&&AQ()}function KX(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return cm(_f)}function JX(l,c){if(l==="click")return cm(c)}function eZ(l,c){if(l==="input"||l==="change")return cm(c)}function tZ(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Tr=typeof Object.is=="function"?Object.is:tZ;function Nf(l,c){if(Tr(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var d=Object.keys(l),g=Object.keys(c);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var y=d[g];if(!Jt.call(c,y)||!Tr(l[y],c[y]))return!1}return!0}function RQ(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function zQ(l,c){var d=RQ(l);l=0;for(var g;d;){if(d.nodeType===3){if(g=l+d.textContent.length,l<=c&&g>=c)return{node:d,offset:c-l};l=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=RQ(d)}}function DQ(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?DQ(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function LQ(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var c=El(l.document);c instanceof l.HTMLIFrameElement;){try{var d=typeof c.contentWindow.location.href=="string"}catch{d=!1}if(d)l=c.contentWindow;else break;c=El(l.document)}return c}function Xy(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}var nZ=$s&&"documentMode"in document&&11>=document.documentMode,cc=null,Zy=null,Pf=null,By=!1;function XQ(l,c,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;By||cc==null||cc!==El(g)||(g=cc,"selectionStart"in g&&Xy(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Pf&&Nf(Pf,g)||(Pf=g,g=Fm(Zy,"onSelect"),0<g.length&&(c=new lm("onSelect","select",null,c,d),l.push({event:c,listeners:g}),c.target=cc)))}function Rl(l,c){var d={};return d[l.toLowerCase()]=c.toLowerCase(),d["Webkit"+l]="webkit"+c,d["Moz"+l]="moz"+c,d}var uc={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionrun:Rl("Transition","TransitionRun"),transitionstart:Rl("Transition","TransitionStart"),transitioncancel:Rl("Transition","TransitionCancel"),transitionend:Rl("Transition","TransitionEnd")},qy={},ZQ={};$s&&(ZQ=document.createElement("div").style,"AnimationEvent"in window||(delete uc.animationend.animation,delete uc.animationiteration.animation,delete uc.animationstart.animation),"TransitionEvent"in window||delete uc.transitionend.transition);function zl(l){if(qy[l])return qy[l];if(!uc[l])return l;var c=uc[l],d;for(d in c)if(c.hasOwnProperty(d)&&d in ZQ)return qy[l]=c[d];return l}var BQ=zl("animationend"),qQ=zl("animationiteration"),VQ=zl("animationstart"),rZ=zl("transitionrun"),iZ=zl("transitionstart"),sZ=zl("transitioncancel"),IQ=zl("transitionend"),YQ=new Map,Vy="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(" ");Vy.push("scrollEnd");function ki(l,c){YQ.set(l,c),Cs(c,[l])}var um=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Hr=[],fc=0,Iy=0;function fm(){for(var l=fc,c=Iy=fc=0;c<l;){var d=Hr[c];Hr[c++]=null;var g=Hr[c];Hr[c++]=null;var y=Hr[c];Hr[c++]=null;var b=Hr[c];if(Hr[c++]=null,g!==null&&y!==null){var $=g.pending;$===null?y.next=y:(y.next=$.next,$.next=y),g.pending=y}b!==0&&UQ(d,y,b)}}function dm(l,c,d,g){Hr[fc++]=l,Hr[fc++]=c,Hr[fc++]=d,Hr[fc++]=g,Iy|=g,l.lanes|=g,l=l.alternate,l!==null&&(l.lanes|=g)}function Yy(l,c,d,g){return dm(l,c,d,g),hm(l)}function Dl(l,c){return dm(l,null,null,c),hm(l)}function UQ(l,c,d){l.lanes|=d;var g=l.alternate;g!==null&&(g.lanes|=d);for(var y=!1,b=l.return;b!==null;)b.childLanes|=d,g=b.alternate,g!==null&&(g.childLanes|=d),b.tag===22&&(l=b.stateNode,l===null||l._visibility&1||(y=!0)),l=b,b=b.return;return l.tag===3?(b=l.stateNode,y&&c!==null&&(y=31-ot(d),l=b.hiddenUpdates,g=l[y],g===null?l[y]=[c]:g.push(c),c.lane=d|536870912),b):null}function hm(l){if(50<ed)throw ed=0,tb=null,Error(r(185));for(var c=l.return;c!==null;)l=c,c=l.return;return l.tag===3?l.stateNode:null}var dc={};function aZ(l,c,d,g){this.tag=l,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(l,c,d,g){return new aZ(l,c,d,g)}function Uy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function _s(l,c){var d=l.alternate;return d===null?(d=$r(l.tag,c,l.key,l.mode),d.elementType=l.elementType,d.type=l.type,d.stateNode=l.stateNode,d.alternate=l,l.alternate=d):(d.pendingProps=c,d.type=l.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=l.flags&65011712,d.childLanes=l.childLanes,d.lanes=l.lanes,d.child=l.child,d.memoizedProps=l.memoizedProps,d.memoizedState=l.memoizedState,d.updateQueue=l.updateQueue,c=l.dependencies,d.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},d.sibling=l.sibling,d.index=l.index,d.ref=l.ref,d.refCleanup=l.refCleanup,d}function WQ(l,c){l.flags&=65011714;var d=l.alternate;return d===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=d.childLanes,l.lanes=d.lanes,l.child=d.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=d.memoizedProps,l.memoizedState=d.memoizedState,l.updateQueue=d.updateQueue,l.type=d.type,c=d.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function pm(l,c,d,g,y,b){var $=0;if(g=l,typeof l=="function")Uy(l)&&($=1);else if(typeof l=="string")$=f6(l,d,ee.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case U:return l=$r(31,d,c,y),l.elementType=U,l.lanes=b,l;case S:return Ll(d.children,y,b,c);case k:$=8,y|=24;break;case w:return l=$r(12,d,c,y|2),l.elementType=w,l.lanes=b,l;case N:return l=$r(13,d,c,y),l.elementType=N,l.lanes=b,l;case _:return l=$r(19,d,c,y),l.elementType=_,l.lanes=b,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Q:$=10;break e;case j:$=9;break e;case T:$=11;break e;case M:$=14;break e;case I:$=16,g=null;break e}$=29,d=Error(r(130,l===null?"null":typeof l,"")),g=null}return c=$r($,d,c,y),c.elementType=l,c.type=g,c.lanes=b,c}function Ll(l,c,d,g){return l=$r(7,l,g,c),l.lanes=d,l}function Wy(l,c,d){return l=$r(6,l,null,c),l.lanes=d,l}function HQ(l){var c=$r(18,null,null,0);return c.stateNode=l,c}function Hy(l,c,d){return c=$r(4,l.children!==null?l.children:[],l.key,c),c.lanes=d,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}var GQ=new WeakMap;function Gr(l,c){if(typeof l=="object"&&l!==null){var d=GQ.get(l);return d!==void 0?d:(c={value:l,source:c,stack:Qn(c)},GQ.set(l,c),c)}return{value:l,source:c,stack:Qn(c)}}var hc=[],pc=0,mm=null,Ef=0,Fr=[],Kr=0,Ta=null,Ii=1,Yi="";function Ns(l,c){hc[pc++]=Ef,hc[pc++]=mm,mm=l,Ef=c}function FQ(l,c,d){Fr[Kr++]=Ii,Fr[Kr++]=Yi,Fr[Kr++]=Ta,Ta=l;var g=Ii;l=Yi;var y=32-ot(g)-1;g&=~(1<<y),d+=1;var b=32-ot(c)+y;if(30<b){var $=y-y%5;b=(g&(1<<$)-1).toString(32),g>>=$,y-=$,Ii=1<<32-ot(c)+y|d<<y|g,Yi=b+l}else Ii=1<<b|d<<y|g,Yi=l}function Gy(l){l.return!==null&&(Ns(l,1),FQ(l,1,0))}function Fy(l){for(;l===mm;)mm=hc[--pc],hc[pc]=null,Ef=hc[--pc],hc[pc]=null;for(;l===Ta;)Ta=Fr[--Kr],Fr[Kr]=null,Yi=Fr[--Kr],Fr[Kr]=null,Ii=Fr[--Kr],Fr[Kr]=null}function KQ(l,c){Fr[Kr++]=Ii,Fr[Kr++]=Yi,Fr[Kr++]=Ta,Ii=c.id,Yi=c.overflow,Ta=l}var Tn=null,Dt=null,nt=!1,$a=null,Jr=!1,Ky=Error(r(519));function _a(l){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Af(Gr(c,l)),Ky}function JQ(l){var c=l.stateNode,d=l.type,g=l.memoizedProps;switch(c[On]=l,c[Dn]=g,d){case"dialog":Fe("cancel",c),Fe("close",c);break;case"iframe":case"object":case"embed":Fe("load",c);break;case"video":case"audio":for(d=0;d<nd.length;d++)Fe(nd[d],c);break;case"source":Fe("error",c);break;case"img":case"image":case"link":Fe("error",c),Fe("load",c);break;case"details":Fe("toggle",c);break;case"input":Fe("invalid",c),nm(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Fe("invalid",c);break;case"textarea":Fe("invalid",c),pQ(c,g.value,g.defaultValue,g.children)}d=g.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||c.textContent===""+d||g.suppressHydrationWarning===!0||gT(c.textContent,d)?(g.popover!=null&&(Fe("beforetoggle",c),Fe("toggle",c)),g.onScroll!=null&&Fe("scroll",c),g.onScrollEnd!=null&&Fe("scrollend",c),g.onClick!=null&&(c.onclick=Ts),c=!0):c=!1,c||_a(l,!0)}function eC(l){for(Tn=l.return;Tn;)switch(Tn.tag){case 5:case 31:case 13:Jr=!1;return;case 27:case 3:Jr=!0;return;default:Tn=Tn.return}}function mc(l){if(l!==Tn)return!1;if(!nt)return eC(l),nt=!0,!1;var c=l.tag,d;if((d=c!==3&&c!==27)&&((d=c===5)&&(d=l.type,d=!(d!=="form"&&d!=="button")||gb(l.type,l.memoizedProps)),d=!d),d&&Dt&&_a(l),eC(l),c===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Dt=QT(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Dt=QT(l)}else c===27?(c=Dt,Va(l.type)?(l=bb,bb=null,Dt=l):Dt=c):Dt=Tn?ti(l.stateNode.nextSibling):null;return!0}function Xl(){Dt=Tn=null,nt=!1}function Jy(){var l=$a;return l!==null&&(dr===null?dr=l:dr.push.apply(dr,l),$a=null),l}function Af(l){$a===null?$a=[l]:$a.push(l)}var ev=D(null),Zl=null,Ps=null;function Na(l,c,d){P(ev,c._currentValue),c._currentValue=d}function Es(l){l._currentValue=ev.current,Y(ev)}function tv(l,c,d){for(;l!==null;){var g=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),l===d)break;l=l.return}}function nv(l,c,d,g){var y=l.child;for(y!==null&&(y.return=l);y!==null;){var b=y.dependencies;if(b!==null){var $=y.child;b=b.firstContext;e:for(;b!==null;){var L=b;b=y;for(var G=0;G<c.length;G++)if(L.context===c[G]){b.lanes|=d,L=b.alternate,L!==null&&(L.lanes|=d),tv(b.return,d,l),g||($=null);break e}b=L.next}}else if(y.tag===18){if($=y.return,$===null)throw Error(r(341));$.lanes|=d,b=$.alternate,b!==null&&(b.lanes|=d),tv($,d,l),$=null}else $=y.child;if($!==null)$.return=y;else for($=y;$!==null;){if($===l){$=null;break}if(y=$.sibling,y!==null){y.return=$.return,$=y;break}$=$.return}y=$}}function gc(l,c,d,g){l=null;for(var y=c,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var $=y.alternate;if($===null)throw Error(r(387));if($=$.memoizedProps,$!==null){var L=y.type;Tr(y.pendingProps.value,$.value)||(l!==null?l.push(L):l=[L])}}else if(y===fe.current){if($=y.alternate,$===null)throw Error(r(387));$.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(l!==null?l.push(ld):l=[ld])}y=y.return}l!==null&&nv(c,l,d,g),c.flags|=262144}function gm(l){for(l=l.firstContext;l!==null;){if(!Tr(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function Bl(l){Zl=l,Ps=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function $n(l){return tC(Zl,l)}function Om(l,c){return Zl===null&&Bl(l),tC(l,c)}function tC(l,c){var d=c._currentValue;if(c={context:c,memoizedValue:d,next:null},Ps===null){if(l===null)throw Error(r(308));Ps=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else Ps=Ps.next=c;return d}var lZ=typeof AbortController<"u"?AbortController:function(){var l=[],c=this.signal={aborted:!1,addEventListener:function(d,g){l.push(g)}};this.abort=function(){c.aborted=!0,l.forEach(function(d){return d()})}},oZ=t.unstable_scheduleCallback,cZ=t.unstable_NormalPriority,on={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rv(){return{controller:new lZ,data:new Map,refCount:0}}function Mf(l){l.refCount--,l.refCount===0&&oZ(cZ,function(){l.controller.abort()})}var Rf=null,iv=0,Oc=0,xc=null;function uZ(l,c){if(Rf===null){var d=Rf=[];iv=0,Oc=lb(),xc={status:"pending",value:void 0,then:function(g){d.push(g)}}}return iv++,c.then(nC,nC),c}function nC(){if(--iv===0&&Rf!==null){xc!==null&&(xc.status="fulfilled");var l=Rf;Rf=null,Oc=0,xc=null;for(var c=0;c<l.length;c++)(0,l[c])()}}function fZ(l,c){var d=[],g={status:"pending",value:null,reason:null,then:function(y){d.push(y)}};return l.then(function(){g.status="fulfilled",g.value=c;for(var y=0;y<d.length;y++)(0,d[y])(c)},function(y){for(g.status="rejected",g.reason=y,y=0;y<d.length;y++)(0,d[y])(void 0)}),g}var rC=R.S;R.S=function(l,c){Xj=en(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&uZ(l,c),rC!==null&&rC(l,c)};var ql=D(null);function sv(){var l=ql.current;return l!==null?l:Nt.pooledCache}function xm(l,c){c===null?P(ql,ql.current):P(ql,c.pool)}function iC(){var l=sv();return l===null?null:{parent:on._currentValue,pool:l}}var yc=Error(r(460)),av=Error(r(474)),ym=Error(r(542)),vm={then:function(){}};function sC(l){return l=l.status,l==="fulfilled"||l==="rejected"}function aC(l,c,d){switch(d=l[d],d===void 0?l.push(c):d!==c&&(c.then(Ts,Ts),c=d),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,oC(l),l;default:if(typeof c.status=="string")c.then(Ts,Ts);else{if(l=Nt,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=c,l.status="pending",l.then(function(g){if(c.status==="pending"){var y=c;y.status="fulfilled",y.value=g}},function(g){if(c.status==="pending"){var y=c;y.status="rejected",y.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,oC(l),l}throw Il=c,yc}}function Vl(l){try{var c=l._init;return c(l._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Il=d,yc):d}}var Il=null;function lC(){if(Il===null)throw Error(r(459));var l=Il;return Il=null,l}function oC(l){if(l===yc||l===ym)throw Error(r(483))}var vc=null,zf=0;function bm(l){var c=zf;return zf+=1,vc===null&&(vc=[]),aC(vc,l,c)}function Df(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function Sm(l,c){throw c.$$typeof===O?Error(r(525)):(l=Object.prototype.toString.call(c),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l)))}function cC(l){function c(te,K){if(l){var re=te.deletions;re===null?(te.deletions=[K],te.flags|=16):re.push(K)}}function d(te,K){if(!l)return null;for(;K!==null;)c(te,K),K=K.sibling;return null}function g(te){for(var K=new Map;te!==null;)te.key!==null?K.set(te.key,te):K.set(te.index,te),te=te.sibling;return K}function y(te,K){return te=_s(te,K),te.index=0,te.sibling=null,te}function b(te,K,re){return te.index=re,l?(re=te.alternate,re!==null?(re=re.index,re<K?(te.flags|=67108866,K):re):(te.flags|=67108866,K)):(te.flags|=1048576,K)}function $(te){return l&&te.alternate===null&&(te.flags|=67108866),te}function L(te,K,re,de){return K===null||K.tag!==6?(K=Wy(re,te.mode,de),K.return=te,K):(K=y(K,re),K.return=te,K)}function G(te,K,re,de){var _e=re.type;return _e===S?ue(te,K,re.props.children,de,re.key):K!==null&&(K.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===I&&Vl(_e)===K.type)?(K=y(K,re.props),Df(K,re),K.return=te,K):(K=pm(re.type,re.key,re.props,null,te.mode,de),Df(K,re),K.return=te,K)}function ie(te,K,re,de){return K===null||K.tag!==4||K.stateNode.containerInfo!==re.containerInfo||K.stateNode.implementation!==re.implementation?(K=Hy(re,te.mode,de),K.return=te,K):(K=y(K,re.children||[]),K.return=te,K)}function ue(te,K,re,de,_e){return K===null||K.tag!==7?(K=Ll(re,te.mode,de,_e),K.return=te,K):(K=y(K,re),K.return=te,K)}function he(te,K,re){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Wy(""+K,te.mode,re),K.return=te,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return re=pm(K.type,K.key,K.props,null,te.mode,re),Df(re,K),re.return=te,re;case v:return K=Hy(K,te.mode,re),K.return=te,K;case I:return K=Vl(K),he(te,K,re)}if(q(K)||X(K))return K=Ll(K,te.mode,re,null),K.return=te,K;if(typeof K.then=="function")return he(te,bm(K),re);if(K.$$typeof===Q)return he(te,Om(te,K),re);Sm(te,K)}return null}function se(te,K,re,de){var _e=K!==null?K.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return _e!==null?null:L(te,K,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case x:return re.key===_e?G(te,K,re,de):null;case v:return re.key===_e?ie(te,K,re,de):null;case I:return re=Vl(re),se(te,K,re,de)}if(q(re)||X(re))return _e!==null?null:ue(te,K,re,de,null);if(typeof re.then=="function")return se(te,K,bm(re),de);if(re.$$typeof===Q)return se(te,K,Om(te,re),de);Sm(te,re)}return null}function le(te,K,re,de,_e){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return te=te.get(re)||null,L(K,te,""+de,_e);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case x:return te=te.get(de.key===null?re:de.key)||null,G(K,te,de,_e);case v:return te=te.get(de.key===null?re:de.key)||null,ie(K,te,de,_e);case I:return de=Vl(de),le(te,K,re,de,_e)}if(q(de)||X(de))return te=te.get(re)||null,ue(K,te,de,_e,null);if(typeof de.then=="function")return le(te,K,re,bm(de),_e);if(de.$$typeof===Q)return le(te,K,re,Om(K,de),_e);Sm(K,de)}return null}function Se(te,K,re,de){for(var _e=null,ct=null,Ce=K,Ye=K=0,et=null;Ce!==null&&Ye<re.length;Ye++){Ce.index>Ye?(et=Ce,Ce=null):et=Ce.sibling;var ut=se(te,Ce,re[Ye],de);if(ut===null){Ce===null&&(Ce=et);break}l&&Ce&&ut.alternate===null&&c(te,Ce),K=b(ut,K,Ye),ct===null?_e=ut:ct.sibling=ut,ct=ut,Ce=et}if(Ye===re.length)return d(te,Ce),nt&&Ns(te,Ye),_e;if(Ce===null){for(;Ye<re.length;Ye++)Ce=he(te,re[Ye],de),Ce!==null&&(K=b(Ce,K,Ye),ct===null?_e=Ce:ct.sibling=Ce,ct=Ce);return nt&&Ns(te,Ye),_e}for(Ce=g(Ce);Ye<re.length;Ye++)et=le(Ce,te,Ye,re[Ye],de),et!==null&&(l&&et.alternate!==null&&Ce.delete(et.key===null?Ye:et.key),K=b(et,K,Ye),ct===null?_e=et:ct.sibling=et,ct=et);return l&&Ce.forEach(function(Ha){return c(te,Ha)}),nt&&Ns(te,Ye),_e}function Ae(te,K,re,de){if(re==null)throw Error(r(151));for(var _e=null,ct=null,Ce=K,Ye=K=0,et=null,ut=re.next();Ce!==null&&!ut.done;Ye++,ut=re.next()){Ce.index>Ye?(et=Ce,Ce=null):et=Ce.sibling;var Ha=se(te,Ce,ut.value,de);if(Ha===null){Ce===null&&(Ce=et);break}l&&Ce&&Ha.alternate===null&&c(te,Ce),K=b(Ha,K,Ye),ct===null?_e=Ha:ct.sibling=Ha,ct=Ha,Ce=et}if(ut.done)return d(te,Ce),nt&&Ns(te,Ye),_e;if(Ce===null){for(;!ut.done;Ye++,ut=re.next())ut=he(te,ut.value,de),ut!==null&&(K=b(ut,K,Ye),ct===null?_e=ut:ct.sibling=ut,ct=ut);return nt&&Ns(te,Ye),_e}for(Ce=g(Ce);!ut.done;Ye++,ut=re.next())ut=le(Ce,te,Ye,ut.value,de),ut!==null&&(l&&ut.alternate!==null&&Ce.delete(ut.key===null?Ye:ut.key),K=b(ut,K,Ye),ct===null?_e=ut:ct.sibling=ut,ct=ut);return l&&Ce.forEach(function(S6){return c(te,S6)}),nt&&Ns(te,Ye),_e}function Tt(te,K,re,de){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case x:e:{for(var _e=re.key;K!==null;){if(K.key===_e){if(_e=re.type,_e===S){if(K.tag===7){d(te,K.sibling),de=y(K,re.props.children),de.return=te,te=de;break e}}else if(K.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===I&&Vl(_e)===K.type){d(te,K.sibling),de=y(K,re.props),Df(de,re),de.return=te,te=de;break e}d(te,K);break}else c(te,K);K=K.sibling}re.type===S?(de=Ll(re.props.children,te.mode,de,re.key),de.return=te,te=de):(de=pm(re.type,re.key,re.props,null,te.mode,de),Df(de,re),de.return=te,te=de)}return $(te);case v:e:{for(_e=re.key;K!==null;){if(K.key===_e)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){d(te,K.sibling),de=y(K,re.children||[]),de.return=te,te=de;break e}else{d(te,K);break}else c(te,K);K=K.sibling}de=Hy(re,te.mode,de),de.return=te,te=de}return $(te);case I:return re=Vl(re),Tt(te,K,re,de)}if(q(re))return Se(te,K,re,de);if(X(re)){if(_e=X(re),typeof _e!="function")throw Error(r(150));return re=_e.call(re),Ae(te,K,re,de)}if(typeof re.then=="function")return Tt(te,K,bm(re),de);if(re.$$typeof===Q)return Tt(te,K,Om(te,re),de);Sm(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,K!==null&&K.tag===6?(d(te,K.sibling),de=y(K,re),de.return=te,te=de):(d(te,K),de=Wy(re,te.mode,de),de.return=te,te=de),$(te)):d(te,K)}return function(te,K,re,de){try{zf=0;var _e=Tt(te,K,re,de);return vc=null,_e}catch(Ce){if(Ce===yc||Ce===ym)throw Ce;var ct=$r(29,Ce,null,te.mode);return ct.lanes=de,ct.return=te,ct}finally{}}}var Yl=cC(!0),uC=cC(!1),Pa=!1;function lv(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ov(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Ea(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Aa(l,c,d){var g=l.updateQueue;if(g===null)return null;if(g=g.shared,(pt&2)!==0){var y=g.pending;return y===null?c.next=c:(c.next=y.next,y.next=c),g.pending=c,c=hm(l),UQ(l,null,d),c}return dm(l,g,c,d),hm(l)}function Lf(l,c,d){if(c=c.updateQueue,c!==null&&(c=c.shared,(d&4194048)!==0)){var g=c.lanes;g&=l.pendingLanes,d|=g,c.lanes=d,Ip(l,d)}}function cv(l,c){var d=l.updateQueue,g=l.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var y=null,b=null;if(d=d.firstBaseUpdate,d!==null){do{var $={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};b===null?y=b=$:b=b.next=$,d=d.next}while(d!==null);b===null?y=b=c:b=b.next=c}else y=b=c;d={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:g.shared,callbacks:g.callbacks},l.updateQueue=d;return}l=d.lastBaseUpdate,l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=c}var uv=!1;function Xf(){if(uv){var l=xc;if(l!==null)throw l}}function Zf(l,c,d,g){uv=!1;var y=l.updateQueue;Pa=!1;var b=y.firstBaseUpdate,$=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var G=L,ie=G.next;G.next=null,$===null?b=ie:$.next=ie,$=G;var ue=l.alternate;ue!==null&&(ue=ue.updateQueue,L=ue.lastBaseUpdate,L!==$&&(L===null?ue.firstBaseUpdate=ie:L.next=ie,ue.lastBaseUpdate=G))}if(b!==null){var he=y.baseState;$=0,ue=ie=G=null,L=b;do{var se=L.lane&-536870913,le=se!==L.lane;if(le?(Je&se)===se:(g&se)===se){se!==0&&se===Oc&&(uv=!0),ue!==null&&(ue=ue.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Se=l,Ae=L;se=c;var Tt=d;switch(Ae.tag){case 1:if(Se=Ae.payload,typeof Se=="function"){he=Se.call(Tt,he,se);break e}he=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ae.payload,se=typeof Se=="function"?Se.call(Tt,he,se):Se,se==null)break e;he=m({},he,se);break e;case 2:Pa=!0}}se=L.callback,se!==null&&(l.flags|=64,le&&(l.flags|=8192),le=y.callbacks,le===null?y.callbacks=[se]:le.push(se))}else le={lane:se,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ue===null?(ie=ue=le,G=he):ue=ue.next=le,$|=se;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;le=L,L=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);ue===null&&(G=he),y.baseState=G,y.firstBaseUpdate=ie,y.lastBaseUpdate=ue,b===null&&(y.shared.lanes=0),La|=$,l.lanes=$,l.memoizedState=he}}function fC(l,c){if(typeof l!="function")throw Error(r(191,l));l.call(c)}function dC(l,c){var d=l.callbacks;if(d!==null)for(l.callbacks=null,l=0;l<d.length;l++)fC(d[l],c)}var bc=D(null),wm=D(0);function hC(l,c){l=Bs,P(wm,l),P(bc,c),Bs=l|c.baseLanes}function fv(){P(wm,Bs),P(bc,bc.current)}function dv(){Bs=wm.current,Y(bc),Y(wm)}var _r=D(null),ei=null;function Ma(l){var c=l.alternate;P(tn,tn.current&1),P(_r,l),ei===null&&(c===null||bc.current!==null||c.memoizedState!==null)&&(ei=l)}function hv(l){P(tn,tn.current),P(_r,l),ei===null&&(ei=l)}function pC(l){l.tag===22?(P(tn,tn.current),P(_r,l),ei===null&&(ei=l)):Ra()}function Ra(){P(tn,tn.current),P(_r,_r.current)}function Nr(l){Y(_r),ei===l&&(ei=null),Y(tn)}var tn=D(0);function km(l){for(var c=l;c!==null;){if(c.tag===13){var d=c.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||yb(d)||vb(d)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var As=0,qe=null,Ct=null,cn=null,Qm=!1,Sc=!1,Ul=!1,Cm=0,Bf=0,wc=null,dZ=0;function Yt(){throw Error(r(321))}function pv(l,c){if(c===null)return!1;for(var d=0;d<c.length&&d<l.length;d++)if(!Tr(l[d],c[d]))return!1;return!0}function mv(l,c,d,g,y,b){return As=b,qe=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,R.H=l===null||l.memoizedState===null?FC:_v,Ul=!1,b=d(g,y),Ul=!1,Sc&&(b=gC(c,d,g,y)),mC(l),b}function mC(l){R.H=If;var c=Ct!==null&&Ct.next!==null;if(As=0,cn=Ct=qe=null,Qm=!1,Bf=0,wc=null,c)throw Error(r(300));l===null||un||(l=l.dependencies,l!==null&&gm(l)&&(un=!0))}function gC(l,c,d,g){qe=l;var y=0;do{if(Sc&&(wc=null),Bf=0,Sc=!1,25<=y)throw Error(r(301));if(y+=1,cn=Ct=null,l.updateQueue!=null){var b=l.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}R.H=KC,b=c(d,g)}while(Sc);return b}function hZ(){var l=R.H,c=l.useState()[0];return c=typeof c.then=="function"?qf(c):c,l=l.useState()[0],(Ct!==null?Ct.memoizedState:null)!==l&&(qe.flags|=1024),c}function gv(){var l=Cm!==0;return Cm=0,l}function Ov(l,c,d){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~d}function xv(l){if(Qm){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}Qm=!1}As=0,cn=Ct=qe=null,Sc=!1,Bf=Cm=0,wc=null}function Hn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return cn===null?qe.memoizedState=cn=l:cn=cn.next=l,cn}function nn(){if(Ct===null){var l=qe.alternate;l=l!==null?l.memoizedState:null}else l=Ct.next;var c=cn===null?qe.memoizedState:cn.next;if(c!==null)cn=c,Ct=l;else{if(l===null)throw qe.alternate===null?Error(r(467)):Error(r(310));Ct=l,l={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},cn===null?qe.memoizedState=cn=l:cn=cn.next=l}return cn}function jm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qf(l){var c=Bf;return Bf+=1,wc===null&&(wc=[]),l=aC(wc,l,c),c=qe,(cn===null?c.memoizedState:cn.next)===null&&(c=c.alternate,R.H=c===null||c.memoizedState===null?FC:_v),l}function Tm(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return qf(l);if(l.$$typeof===Q)return $n(l)}throw Error(r(438,String(l)))}function yv(l){var c=null,d=qe.updateQueue;if(d!==null&&(c=d.memoCache),c==null){var g=qe.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(y){return y.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),d===null&&(d=jm(),qe.updateQueue=d),d.memoCache=c,d=c.data[c.index],d===void 0)for(d=c.data[c.index]=Array(l),g=0;g<l;g++)d[g]=F;return c.index++,d}function Ms(l,c){return typeof c=="function"?c(l):c}function $m(l){var c=nn();return vv(c,Ct,l)}function vv(l,c,d){var g=l.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=d;var y=l.baseQueue,b=g.pending;if(b!==null){if(y!==null){var $=y.next;y.next=b.next,b.next=$}c.baseQueue=y=b,g.pending=null}if(b=l.baseState,y===null)l.memoizedState=b;else{c=y.next;var L=$=null,G=null,ie=c,ue=!1;do{var he=ie.lane&-536870913;if(he!==ie.lane?(Je&he)===he:(As&he)===he){var se=ie.revertLane;if(se===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),he===Oc&&(ue=!0);else if((As&se)===se){ie=ie.next,se===Oc&&(ue=!0);continue}else he={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(L=G=he,$=b):G=G.next=he,qe.lanes|=se,La|=se;he=ie.action,Ul&&d(b,he),b=ie.hasEagerState?ie.eagerState:d(b,he)}else se={lane:he,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(L=G=se,$=b):G=G.next=se,qe.lanes|=he,La|=he;ie=ie.next}while(ie!==null&&ie!==c);if(G===null?$=b:G.next=L,!Tr(b,l.memoizedState)&&(un=!0,ue&&(d=xc,d!==null)))throw d;l.memoizedState=b,l.baseState=$,l.baseQueue=G,g.lastRenderedState=b}return y===null&&(g.lanes=0),[l.memoizedState,g.dispatch]}function bv(l){var c=nn(),d=c.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var g=d.dispatch,y=d.pending,b=c.memoizedState;if(y!==null){d.pending=null;var $=y=y.next;do b=l(b,$.action),$=$.next;while($!==y);Tr(b,c.memoizedState)||(un=!0),c.memoizedState=b,c.baseQueue===null&&(c.baseState=b),d.lastRenderedState=b}return[b,g]}function OC(l,c,d){var g=qe,y=nn(),b=nt;if(b){if(d===void 0)throw Error(r(407));d=d()}else d=c();var $=!Tr((Ct||y).memoizedState,d);if($&&(y.memoizedState=d,un=!0),y=y.queue,kv(vC.bind(null,g,y,l),[l]),y.getSnapshot!==c||$||cn!==null&&cn.memoizedState.tag&1){if(g.flags|=2048,kc(9,{destroy:void 0},yC.bind(null,g,y,d,c),null),Nt===null)throw Error(r(349));b||(As&127)!==0||xC(g,c,d)}return d}function xC(l,c,d){l.flags|=16384,l={getSnapshot:c,value:d},c=qe.updateQueue,c===null?(c=jm(),qe.updateQueue=c,c.stores=[l]):(d=c.stores,d===null?c.stores=[l]:d.push(l))}function yC(l,c,d,g){c.value=d,c.getSnapshot=g,bC(c)&&SC(l)}function vC(l,c,d){return d(function(){bC(c)&&SC(l)})}function bC(l){var c=l.getSnapshot;l=l.value;try{var d=c();return!Tr(l,d)}catch{return!0}}function SC(l){var c=Dl(l,2);c!==null&&hr(c,l,2)}function Sv(l){var c=Hn();if(typeof l=="function"){var d=l;if(l=d(),Ul){Vt(!0);try{d()}finally{Vt(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:l},c}function wC(l,c,d,g){return l.baseState=d,vv(l,Ct,typeof g=="function"?g:Ms)}function pZ(l,c,d,g,y){if(Pm(l))throw Error(r(485));if(l=c.action,l!==null){var b={payload:y,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){b.listeners.push($)}};R.T!==null?d(!0):b.isTransition=!1,g(b),d=c.pending,d===null?(b.next=c.pending=b,kC(c,b)):(b.next=d.next,c.pending=d.next=b)}}function kC(l,c){var d=c.action,g=c.payload,y=l.state;if(c.isTransition){var b=R.T,$={};R.T=$;try{var L=d(y,g),G=R.S;G!==null&&G($,L),QC(l,c,L)}catch(ie){wv(l,c,ie)}finally{b!==null&&$.types!==null&&(b.types=$.types),R.T=b}}else try{b=d(y,g),QC(l,c,b)}catch(ie){wv(l,c,ie)}}function QC(l,c,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(g){CC(l,c,g)},function(g){return wv(l,c,g)}):CC(l,c,d)}function CC(l,c,d){c.status="fulfilled",c.value=d,jC(c),l.state=d,c=l.pending,c!==null&&(d=c.next,d===c?l.pending=null:(d=d.next,c.next=d,kC(l,d)))}function wv(l,c,d){var g=l.pending;if(l.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=d,jC(c),c=c.next;while(c!==g)}l.action=null}function jC(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function TC(l,c){return c}function $C(l,c){if(nt){var d=Nt.formState;if(d!==null){e:{var g=qe;if(nt){if(Dt){t:{for(var y=Dt,b=Jr;y.nodeType!==8;){if(!b){y=null;break t}if(y=ti(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){Dt=ti(y.nextSibling),g=y.data==="F!";break e}}_a(g)}g=!1}g&&(c=d[0])}}return d=Hn(),d.memoizedState=d.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:TC,lastRenderedState:c},d.queue=g,d=WC.bind(null,qe,g),g.dispatch=d,g=Sv(!1),b=$v.bind(null,qe,!1,g.queue),g=Hn(),y={state:c,dispatch:null,action:l,pending:null},g.queue=y,d=pZ.bind(null,qe,y,b,d),y.dispatch=d,g.memoizedState=l,[c,d,!1]}function _C(l){var c=nn();return NC(c,Ct,l)}function NC(l,c,d){if(c=vv(l,c,TC)[0],l=$m(Ms)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=qf(c)}catch($){throw $===yc?ym:$}else g=c;c=nn();var y=c.queue,b=y.dispatch;return d!==c.memoizedState&&(qe.flags|=2048,kc(9,{destroy:void 0},mZ.bind(null,y,d),null)),[g,b,l]}function mZ(l,c){l.action=c}function PC(l){var c=nn(),d=Ct;if(d!==null)return NC(c,d,l);nn(),c=c.memoizedState,d=nn();var g=d.queue.dispatch;return d.memoizedState=l,[c,g,!1]}function kc(l,c,d,g){return l={tag:l,create:d,deps:g,inst:c,next:null},c=qe.updateQueue,c===null&&(c=jm(),qe.updateQueue=c),d=c.lastEffect,d===null?c.lastEffect=l.next=l:(g=d.next,d.next=l,l.next=g,c.lastEffect=l),l}function EC(){return nn().memoizedState}function _m(l,c,d,g){var y=Hn();qe.flags|=l,y.memoizedState=kc(1|c,{destroy:void 0},d,g===void 0?null:g)}function Nm(l,c,d,g){var y=nn();g=g===void 0?null:g;var b=y.memoizedState.inst;Ct!==null&&g!==null&&pv(g,Ct.memoizedState.deps)?y.memoizedState=kc(c,b,d,g):(qe.flags|=l,y.memoizedState=kc(1|c,b,d,g))}function AC(l,c){_m(8390656,8,l,c)}function kv(l,c){Nm(2048,8,l,c)}function gZ(l){qe.flags|=4;var c=qe.updateQueue;if(c===null)c=jm(),qe.updateQueue=c,c.events=[l];else{var d=c.events;d===null?c.events=[l]:d.push(l)}}function MC(l){var c=nn().memoizedState;return gZ({ref:c,nextImpl:l}),function(){if((pt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function RC(l,c){return Nm(4,2,l,c)}function zC(l,c){return Nm(4,4,l,c)}function DC(l,c){if(typeof c=="function"){l=l();var d=c(l);return function(){typeof d=="function"?d():c(null)}}if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function LC(l,c,d){d=d!=null?d.concat([l]):null,Nm(4,4,DC.bind(null,c,l),d)}function Qv(){}function XC(l,c){var d=nn();c=c===void 0?null:c;var g=d.memoizedState;return c!==null&&pv(c,g[1])?g[0]:(d.memoizedState=[l,c],l)}function ZC(l,c){var d=nn();c=c===void 0?null:c;var g=d.memoizedState;if(c!==null&&pv(c,g[1]))return g[0];if(g=l(),Ul){Vt(!0);try{l()}finally{Vt(!1)}}return d.memoizedState=[g,c],g}function Cv(l,c,d){return d===void 0||(As&1073741824)!==0&&(Je&261930)===0?l.memoizedState=c:(l.memoizedState=d,l=Bj(),qe.lanes|=l,La|=l,d)}function BC(l,c,d,g){return Tr(d,c)?d:bc.current!==null?(l=Cv(l,d,g),Tr(l,c)||(un=!0),l):(As&42)===0||(As&1073741824)!==0&&(Je&261930)===0?(un=!0,l.memoizedState=d):(l=Bj(),qe.lanes|=l,La|=l,c)}function qC(l,c,d,g,y){var b=z.p;z.p=b!==0&&8>b?b:8;var $=R.T,L={};R.T=L,$v(l,!1,c,d);try{var G=y(),ie=R.S;if(ie!==null&&ie(L,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ue=fZ(G,g);Vf(l,c,ue,Ar(l))}else Vf(l,c,g,Ar(l))}catch(he){Vf(l,c,{then:function(){},status:"rejected",reason:he},Ar())}finally{z.p=b,$!==null&&L.types!==null&&($.types=L.types),R.T=$}}function OZ(){}function jv(l,c,d,g){if(l.tag!==5)throw Error(r(476));var y=VC(l).queue;qC(l,y,c,B,d===null?OZ:function(){return IC(l),d(g)})}function VC(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:B},next:null};var d={};return c.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:d},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function IC(l){var c=VC(l);c.next===null&&(c=l.alternate.memoizedState),Vf(l,c.next.queue,{},Ar())}function Tv(){return $n(ld)}function YC(){return nn().memoizedState}function UC(){return nn().memoizedState}function xZ(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var d=Ar();l=Ea(d);var g=Aa(c,l,d);g!==null&&(hr(g,c,d),Lf(g,c,d)),c={cache:rv()},l.payload=c;return}c=c.return}}function yZ(l,c,d){var g=Ar();d={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Pm(l)?HC(c,d):(d=Yy(l,c,d,g),d!==null&&(hr(d,l,g),GC(d,c,g)))}function WC(l,c,d){var g=Ar();Vf(l,c,d,g)}function Vf(l,c,d,g){var y={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Pm(l))HC(c,y);else{var b=l.alternate;if(l.lanes===0&&(b===null||b.lanes===0)&&(b=c.lastRenderedReducer,b!==null))try{var $=c.lastRenderedState,L=b($,d);if(y.hasEagerState=!0,y.eagerState=L,Tr(L,$))return dm(l,c,y,0),Nt===null&&fm(),!1}catch{}finally{}if(d=Yy(l,c,y,g),d!==null)return hr(d,l,g),GC(d,c,g),!0}return!1}function $v(l,c,d,g){if(g={lane:2,revertLane:lb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Pm(l)){if(c)throw Error(r(479))}else c=Yy(l,d,g,2),c!==null&&hr(c,l,2)}function Pm(l){var c=l.alternate;return l===qe||c!==null&&c===qe}function HC(l,c){Sc=Qm=!0;var d=l.pending;d===null?c.next=c:(c.next=d.next,d.next=c),l.pending=c}function GC(l,c,d){if((d&4194048)!==0){var g=c.lanes;g&=l.pendingLanes,d|=g,c.lanes=d,Ip(l,d)}}var If={readContext:$n,use:Tm,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};If.useEffectEvent=Yt;var FC={readContext:$n,use:Tm,useCallback:function(l,c){return Hn().memoizedState=[l,c===void 0?null:c],l},useContext:$n,useEffect:AC,useImperativeHandle:function(l,c,d){d=d!=null?d.concat([l]):null,_m(4194308,4,DC.bind(null,c,l),d)},useLayoutEffect:function(l,c){return _m(4194308,4,l,c)},useInsertionEffect:function(l,c){_m(4,2,l,c)},useMemo:function(l,c){var d=Hn();c=c===void 0?null:c;var g=l();if(Ul){Vt(!0);try{l()}finally{Vt(!1)}}return d.memoizedState=[g,c],g},useReducer:function(l,c,d){var g=Hn();if(d!==void 0){var y=d(c);if(Ul){Vt(!0);try{d(c)}finally{Vt(!1)}}}else y=c;return g.memoizedState=g.baseState=y,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:y},g.queue=l,l=l.dispatch=yZ.bind(null,qe,l),[g.memoizedState,l]},useRef:function(l){var c=Hn();return l={current:l},c.memoizedState=l},useState:function(l){l=Sv(l);var c=l.queue,d=WC.bind(null,qe,c);return c.dispatch=d,[l.memoizedState,d]},useDebugValue:Qv,useDeferredValue:function(l,c){var d=Hn();return Cv(d,l,c)},useTransition:function(){var l=Sv(!1);return l=qC.bind(null,qe,l.queue,!0,!1),Hn().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,d){var g=qe,y=Hn();if(nt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=c(),Nt===null)throw Error(r(349));(Je&127)!==0||xC(g,c,d)}y.memoizedState=d;var b={value:d,getSnapshot:c};return y.queue=b,AC(vC.bind(null,g,b,l),[l]),g.flags|=2048,kc(9,{destroy:void 0},yC.bind(null,g,b,d,c),null),d},useId:function(){var l=Hn(),c=Nt.identifierPrefix;if(nt){var d=Yi,g=Ii;d=(g&~(1<<32-ot(g)-1)).toString(32)+d,c="_"+c+"R_"+d,d=Cm++,0<d&&(c+="H"+d.toString(32)),c+="_"}else d=dZ++,c="_"+c+"r_"+d.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:Tv,useFormState:$C,useActionState:$C,useOptimistic:function(l){var c=Hn();c.memoizedState=c.baseState=l;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=d,c=$v.bind(null,qe,!0,d),d.dispatch=c,[l,c]},useMemoCache:yv,useCacheRefresh:function(){return Hn().memoizedState=xZ.bind(null,qe)},useEffectEvent:function(l){var c=Hn(),d={impl:l};return c.memoizedState=d,function(){if((pt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},_v={readContext:$n,use:Tm,useCallback:XC,useContext:$n,useEffect:kv,useImperativeHandle:LC,useInsertionEffect:RC,useLayoutEffect:zC,useMemo:ZC,useReducer:$m,useRef:EC,useState:function(){return $m(Ms)},useDebugValue:Qv,useDeferredValue:function(l,c){var d=nn();return BC(d,Ct.memoizedState,l,c)},useTransition:function(){var l=$m(Ms)[0],c=nn().memoizedState;return[typeof l=="boolean"?l:qf(l),c]},useSyncExternalStore:OC,useId:YC,useHostTransitionStatus:Tv,useFormState:_C,useActionState:_C,useOptimistic:function(l,c){var d=nn();return wC(d,Ct,l,c)},useMemoCache:yv,useCacheRefresh:UC};_v.useEffectEvent=MC;var KC={readContext:$n,use:Tm,useCallback:XC,useContext:$n,useEffect:kv,useImperativeHandle:LC,useInsertionEffect:RC,useLayoutEffect:zC,useMemo:ZC,useReducer:bv,useRef:EC,useState:function(){return bv(Ms)},useDebugValue:Qv,useDeferredValue:function(l,c){var d=nn();return Ct===null?Cv(d,l,c):BC(d,Ct.memoizedState,l,c)},useTransition:function(){var l=bv(Ms)[0],c=nn().memoizedState;return[typeof l=="boolean"?l:qf(l),c]},useSyncExternalStore:OC,useId:YC,useHostTransitionStatus:Tv,useFormState:PC,useActionState:PC,useOptimistic:function(l,c){var d=nn();return Ct!==null?wC(d,Ct,l,c):(d.baseState=l,[l,d.queue.dispatch])},useMemoCache:yv,useCacheRefresh:UC};KC.useEffectEvent=MC;function Nv(l,c,d,g){c=l.memoizedState,d=d(g,c),d=d==null?c:m({},c,d),l.memoizedState=d,l.lanes===0&&(l.updateQueue.baseState=d)}var Pv={enqueueSetState:function(l,c,d){l=l._reactInternals;var g=Ar(),y=Ea(g);y.payload=c,d!=null&&(y.callback=d),c=Aa(l,y,g),c!==null&&(hr(c,l,g),Lf(c,l,g))},enqueueReplaceState:function(l,c,d){l=l._reactInternals;var g=Ar(),y=Ea(g);y.tag=1,y.payload=c,d!=null&&(y.callback=d),c=Aa(l,y,g),c!==null&&(hr(c,l,g),Lf(c,l,g))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var d=Ar(),g=Ea(d);g.tag=2,c!=null&&(g.callback=c),c=Aa(l,g,d),c!==null&&(hr(c,l,d),Lf(c,l,d))}};function JC(l,c,d,g,y,b,$){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(g,b,$):c.prototype&&c.prototype.isPureReactComponent?!Nf(d,g)||!Nf(y,b):!0}function ej(l,c,d,g){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(d,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(d,g),c.state!==l&&Pv.enqueueReplaceState(c,c.state,null)}function Wl(l,c){var d=c;if("ref"in c){d={};for(var g in c)g!=="ref"&&(d[g]=c[g])}if(l=l.defaultProps){d===c&&(d=m({},d));for(var y in l)d[y]===void 0&&(d[y]=l[y])}return d}function tj(l){um(l)}function nj(l){console.error(l)}function rj(l){um(l)}function Em(l,c){try{var d=l.onUncaughtError;d(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function ij(l,c,d){try{var g=l.onCaughtError;g(d.value,{componentStack:d.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Ev(l,c,d){return d=Ea(d),d.tag=3,d.payload={element:null},d.callback=function(){Em(l,c)},d}function sj(l){return l=Ea(l),l.tag=3,l}function aj(l,c,d,g){var y=d.type.getDerivedStateFromError;if(typeof y=="function"){var b=g.value;l.payload=function(){return y(b)},l.callback=function(){ij(c,d,g)}}var $=d.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(l.callback=function(){ij(c,d,g),typeof y!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function vZ(l,c,d,g,y){if(d.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=d.alternate,c!==null&&gc(c,d,y,!0),d=_r.current,d!==null){switch(d.tag){case 31:case 13:return ei===null?Im():d.alternate===null&&Ut===0&&(Ut=3),d.flags&=-257,d.flags|=65536,d.lanes=y,g===vm?d.flags|=16384:(c=d.updateQueue,c===null?d.updateQueue=new Set([g]):c.add(g),ib(l,g,y)),!1;case 22:return d.flags|=65536,g===vm?d.flags|=16384:(c=d.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},d.updateQueue=c):(d=c.retryQueue,d===null?c.retryQueue=new Set([g]):d.add(g)),ib(l,g,y)),!1}throw Error(r(435,d.tag))}return ib(l,g,y),Im(),!1}if(nt)return c=_r.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=y,g!==Ky&&(l=Error(r(422),{cause:g}),Af(Gr(l,d)))):(g!==Ky&&(c=Error(r(423),{cause:g}),Af(Gr(c,d))),l=l.current.alternate,l.flags|=65536,y&=-y,l.lanes|=y,g=Gr(g,d),y=Ev(l.stateNode,g,y),cv(l,y),Ut!==4&&(Ut=2)),!1;var b=Error(r(520),{cause:g});if(b=Gr(b,d),Jf===null?Jf=[b]:Jf.push(b),Ut!==4&&(Ut=2),c===null)return!0;g=Gr(g,d),d=c;do{switch(d.tag){case 3:return d.flags|=65536,l=y&-y,d.lanes|=l,l=Ev(d.stateNode,g,l),cv(d,l),!1;case 1:if(c=d.type,b=d.stateNode,(d.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Xa===null||!Xa.has(b))))return d.flags|=65536,y&=-y,d.lanes|=y,y=sj(y),aj(y,l,d,g),cv(d,y),!1}d=d.return}while(d!==null);return!1}var Av=Error(r(461)),un=!1;function _n(l,c,d,g){c.child=l===null?uC(c,null,d,g):Yl(c,l.child,d,g)}function lj(l,c,d,g,y){d=d.render;var b=c.ref;if("ref"in g){var $={};for(var L in g)L!=="ref"&&($[L]=g[L])}else $=g;return Bl(c),g=mv(l,c,d,$,b,y),L=gv(),l!==null&&!un?(Ov(l,c,y),Rs(l,c,y)):(nt&&L&&Gy(c),c.flags|=1,_n(l,c,g,y),c.child)}function oj(l,c,d,g,y){if(l===null){var b=d.type;return typeof b=="function"&&!Uy(b)&&b.defaultProps===void 0&&d.compare===null?(c.tag=15,c.type=b,cj(l,c,b,g,y)):(l=pm(d.type,null,g,c,c.mode,y),l.ref=c.ref,l.return=c,c.child=l)}if(b=l.child,!Bv(l,y)){var $=b.memoizedProps;if(d=d.compare,d=d!==null?d:Nf,d($,g)&&l.ref===c.ref)return Rs(l,c,y)}return c.flags|=1,l=_s(b,g),l.ref=c.ref,l.return=c,c.child=l}function cj(l,c,d,g,y){if(l!==null){var b=l.memoizedProps;if(Nf(b,g)&&l.ref===c.ref)if(un=!1,c.pendingProps=g=b,Bv(l,y))(l.flags&131072)!==0&&(un=!0);else return c.lanes=l.lanes,Rs(l,c,y)}return Mv(l,c,d,g,y)}function uj(l,c,d,g){var y=g.children,b=l!==null?l.memoizedState:null;if(l===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(b=b!==null?b.baseLanes|d:d,l!==null){for(g=c.child=l.child,y=0;g!==null;)y=y|g.lanes|g.childLanes,g=g.sibling;g=y&~b}else g=0,c.child=null;return fj(l,c,b,d,g)}if((d&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&xm(c,b!==null?b.cachePool:null),b!==null?hC(c,b):fv(),pC(c);else return g=c.lanes=536870912,fj(l,c,b!==null?b.baseLanes|d:d,d,g)}else b!==null?(xm(c,b.cachePool),hC(c,b),Ra(),c.memoizedState=null):(l!==null&&xm(c,null),fv(),Ra());return _n(l,c,y,d),c.child}function Yf(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function fj(l,c,d,g,y){var b=sv();return b=b===null?null:{parent:on._currentValue,pool:b},c.memoizedState={baseLanes:d,cachePool:b},l!==null&&xm(c,null),fv(),pC(c),l!==null&&gc(l,c,g,!0),c.childLanes=y,null}function Am(l,c){return c=Rm({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function dj(l,c,d){return Yl(c,l.child,null,d),l=Am(c,c.pendingProps),l.flags|=2,Nr(c),c.memoizedState=null,l}function bZ(l,c,d){var g=c.pendingProps,y=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(nt){if(g.mode==="hidden")return l=Am(c,g),c.lanes=536870912,Yf(null,l);if(hv(c),(l=Dt)?(l=kT(l,Jr),l=l!==null&&l.data==="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:Ta!==null?{id:Ii,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},d=HQ(l),d.return=c,c.child=d,Tn=c,Dt=null)):l=null,l===null)throw _a(c);return c.lanes=536870912,null}return Am(c,g)}var b=l.memoizedState;if(b!==null){var $=b.dehydrated;if(hv(c),y)if(c.flags&256)c.flags&=-257,c=dj(l,c,d);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(r(558));else if(un||gc(l,c,d,!1),y=(d&l.childLanes)!==0,un||y){if(g=Nt,g!==null&&($=Yp(g,d),$!==0&&$!==b.retryLane))throw b.retryLane=$,Dl(l,$),hr(g,l,$),Av;Im(),c=dj(l,c,d)}else l=b.treeContext,Dt=ti($.nextSibling),Tn=c,nt=!0,$a=null,Jr=!1,l!==null&&KQ(c,l),c=Am(c,g),c.flags|=4096;return c}return l=_s(l.child,{mode:g.mode,children:g.children}),l.ref=c.ref,c.child=l,l.return=c,l}function Mm(l,c){var d=c.ref;if(d===null)l!==null&&l.ref!==null&&(c.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(l===null||l.ref!==d)&&(c.flags|=4194816)}}function Mv(l,c,d,g,y){return Bl(c),d=mv(l,c,d,g,void 0,y),g=gv(),l!==null&&!un?(Ov(l,c,y),Rs(l,c,y)):(nt&&g&&Gy(c),c.flags|=1,_n(l,c,d,y),c.child)}function hj(l,c,d,g,y,b){return Bl(c),c.updateQueue=null,d=gC(c,g,d,y),mC(l),g=gv(),l!==null&&!un?(Ov(l,c,b),Rs(l,c,b)):(nt&&g&&Gy(c),c.flags|=1,_n(l,c,d,b),c.child)}function pj(l,c,d,g,y){if(Bl(c),c.stateNode===null){var b=dc,$=d.contextType;typeof $=="object"&&$!==null&&(b=$n($)),b=new d(g,b),c.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Pv,c.stateNode=b,b._reactInternals=c,b=c.stateNode,b.props=g,b.state=c.memoizedState,b.refs={},lv(c),$=d.contextType,b.context=typeof $=="object"&&$!==null?$n($):dc,b.state=c.memoizedState,$=d.getDerivedStateFromProps,typeof $=="function"&&(Nv(c,d,$,g),b.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||($=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),$!==b.state&&Pv.enqueueReplaceState(b,b.state,null),Zf(c,g,b,y),Xf(),b.state=c.memoizedState),typeof b.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(l===null){b=c.stateNode;var L=c.memoizedProps,G=Wl(d,L);b.props=G;var ie=b.context,ue=d.contextType;$=dc,typeof ue=="object"&&ue!==null&&($=$n(ue));var he=d.getDerivedStateFromProps;ue=typeof he=="function"||typeof b.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,ue||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(L||ie!==$)&&ej(c,b,g,$),Pa=!1;var se=c.memoizedState;b.state=se,Zf(c,g,b,y),Xf(),ie=c.memoizedState,L||se!==ie||Pa?(typeof he=="function"&&(Nv(c,d,he,g),ie=c.memoizedState),(G=Pa||JC(c,d,G,g,se,ie,$))?(ue||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(c.flags|=4194308)):(typeof b.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=ie),b.props=g,b.state=ie,b.context=$,g=G):(typeof b.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{b=c.stateNode,ov(l,c),$=c.memoizedProps,ue=Wl(d,$),b.props=ue,he=c.pendingProps,se=b.context,ie=d.contextType,G=dc,typeof ie=="object"&&ie!==null&&(G=$n(ie)),L=d.getDerivedStateFromProps,(ie=typeof L=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||($!==he||se!==G)&&ej(c,b,g,G),Pa=!1,se=c.memoizedState,b.state=se,Zf(c,g,b,y),Xf();var le=c.memoizedState;$!==he||se!==le||Pa||l!==null&&l.dependencies!==null&&gm(l.dependencies)?(typeof L=="function"&&(Nv(c,d,L,g),le=c.memoizedState),(ue=Pa||JC(c,d,ue,g,se,le,G)||l!==null&&l.dependencies!==null&&gm(l.dependencies))?(ie||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(g,le,G),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(g,le,G)),typeof b.componentDidUpdate=="function"&&(c.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof b.componentDidUpdate!="function"||$===l.memoizedProps&&se===l.memoizedState||(c.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||$===l.memoizedProps&&se===l.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=le),b.props=g,b.state=le,b.context=G,g=ue):(typeof b.componentDidUpdate!="function"||$===l.memoizedProps&&se===l.memoizedState||(c.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||$===l.memoizedProps&&se===l.memoizedState||(c.flags|=1024),g=!1)}return b=g,Mm(l,c),g=(c.flags&128)!==0,b||g?(b=c.stateNode,d=g&&typeof d.getDerivedStateFromError!="function"?null:b.render(),c.flags|=1,l!==null&&g?(c.child=Yl(c,l.child,null,y),c.child=Yl(c,null,d,y)):_n(l,c,d,y),c.memoizedState=b.state,l=c.child):l=Rs(l,c,y),l}function mj(l,c,d,g){return Xl(),c.flags|=256,_n(l,c,d,g),c.child}var Rv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zv(l){return{baseLanes:l,cachePool:iC()}}function Dv(l,c,d){return l=l!==null?l.childLanes&~d:0,c&&(l|=Er),l}function gj(l,c,d){var g=c.pendingProps,y=!1,b=(c.flags&128)!==0,$;if(($=b)||($=l!==null&&l.memoizedState===null?!1:(tn.current&2)!==0),$&&(y=!0,c.flags&=-129),$=(c.flags&32)!==0,c.flags&=-33,l===null){if(nt){if(y?Ma(c):Ra(),(l=Dt)?(l=kT(l,Jr),l=l!==null&&l.data!=="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:Ta!==null?{id:Ii,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},d=HQ(l),d.return=c,c.child=d,Tn=c,Dt=null)):l=null,l===null)throw _a(c);return vb(l)?c.lanes=32:c.lanes=536870912,null}var L=g.children;return g=g.fallback,y?(Ra(),y=c.mode,L=Rm({mode:"hidden",children:L},y),g=Ll(g,y,d,null),L.return=c,g.return=c,L.sibling=g,c.child=L,g=c.child,g.memoizedState=zv(d),g.childLanes=Dv(l,$,d),c.memoizedState=Rv,Yf(null,g)):(Ma(c),Lv(c,L))}var G=l.memoizedState;if(G!==null&&(L=G.dehydrated,L!==null)){if(b)c.flags&256?(Ma(c),c.flags&=-257,c=Xv(l,c,d)):c.memoizedState!==null?(Ra(),c.child=l.child,c.flags|=128,c=null):(Ra(),L=g.fallback,y=c.mode,g=Rm({mode:"visible",children:g.children},y),L=Ll(L,y,d,null),L.flags|=2,g.return=c,L.return=c,g.sibling=L,c.child=g,Yl(c,l.child,null,d),g=c.child,g.memoizedState=zv(d),g.childLanes=Dv(l,$,d),c.memoizedState=Rv,c=Yf(null,g));else if(Ma(c),vb(L)){if($=L.nextSibling&&L.nextSibling.dataset,$)var ie=$.dgst;$=ie,g=Error(r(419)),g.stack="",g.digest=$,Af({value:g,source:null,stack:null}),c=Xv(l,c,d)}else if(un||gc(l,c,d,!1),$=(d&l.childLanes)!==0,un||$){if($=Nt,$!==null&&(g=Yp($,d),g!==0&&g!==G.retryLane))throw G.retryLane=g,Dl(l,g),hr($,l,g),Av;yb(L)||Im(),c=Xv(l,c,d)}else yb(L)?(c.flags|=192,c.child=l.child,c=null):(l=G.treeContext,Dt=ti(L.nextSibling),Tn=c,nt=!0,$a=null,Jr=!1,l!==null&&KQ(c,l),c=Lv(c,g.children),c.flags|=4096);return c}return y?(Ra(),L=g.fallback,y=c.mode,G=l.child,ie=G.sibling,g=_s(G,{mode:"hidden",children:g.children}),g.subtreeFlags=G.subtreeFlags&65011712,ie!==null?L=_s(ie,L):(L=Ll(L,y,d,null),L.flags|=2),L.return=c,g.return=c,g.sibling=L,c.child=g,Yf(null,g),g=c.child,L=l.child.memoizedState,L===null?L=zv(d):(y=L.cachePool,y!==null?(G=on._currentValue,y=y.parent!==G?{parent:G,pool:G}:y):y=iC(),L={baseLanes:L.baseLanes|d,cachePool:y}),g.memoizedState=L,g.childLanes=Dv(l,$,d),c.memoizedState=Rv,Yf(l.child,g)):(Ma(c),d=l.child,l=d.sibling,d=_s(d,{mode:"visible",children:g.children}),d.return=c,d.sibling=null,l!==null&&($=c.deletions,$===null?(c.deletions=[l],c.flags|=16):$.push(l)),c.child=d,c.memoizedState=null,d)}function Lv(l,c){return c=Rm({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function Rm(l,c){return l=$r(22,l,null,c),l.lanes=0,l}function Xv(l,c,d){return Yl(c,l.child,null,d),l=Lv(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Oj(l,c,d){l.lanes|=c;var g=l.alternate;g!==null&&(g.lanes|=c),tv(l.return,c,d)}function Zv(l,c,d,g,y,b){var $=l.memoizedState;$===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:y,treeForkCount:b}:($.isBackwards=c,$.rendering=null,$.renderingStartTime=0,$.last=g,$.tail=d,$.tailMode=y,$.treeForkCount=b)}function xj(l,c,d){var g=c.pendingProps,y=g.revealOrder,b=g.tail;g=g.children;var $=tn.current,L=($&2)!==0;if(L?($=$&1|2,c.flags|=128):$&=1,P(tn,$),_n(l,c,g,d),g=nt?Ef:0,!L&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Oj(l,d,c);else if(l.tag===19)Oj(l,d,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(y){case"forwards":for(d=c.child,y=null;d!==null;)l=d.alternate,l!==null&&km(l)===null&&(y=d),d=d.sibling;d=y,d===null?(y=c.child,c.child=null):(y=d.sibling,d.sibling=null),Zv(c,!1,y,d,b,g);break;case"backwards":case"unstable_legacy-backwards":for(d=null,y=c.child,c.child=null;y!==null;){if(l=y.alternate,l!==null&&km(l)===null){c.child=y;break}l=y.sibling,y.sibling=d,d=y,y=l}Zv(c,!0,d,null,b,g);break;case"together":Zv(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function Rs(l,c,d){if(l!==null&&(c.dependencies=l.dependencies),La|=c.lanes,(d&c.childLanes)===0)if(l!==null){if(gc(l,c,d,!1),(d&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(r(153));if(c.child!==null){for(l=c.child,d=_s(l,l.pendingProps),c.child=d,d.return=c;l.sibling!==null;)l=l.sibling,d=d.sibling=_s(l,l.pendingProps),d.return=c;d.sibling=null}return c.child}function Bv(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&gm(l)))}function SZ(l,c,d){switch(c.tag){case 3:oe(c,c.stateNode.containerInfo),Na(c,on,l.memoizedState.cache),Xl();break;case 27:case 5:je(c);break;case 4:oe(c,c.stateNode.containerInfo);break;case 10:Na(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,hv(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Ma(c),c.flags|=128,null):(d&c.child.childLanes)!==0?gj(l,c,d):(Ma(c),l=Rs(l,c,d),l!==null?l.sibling:null);Ma(c);break;case 19:var y=(l.flags&128)!==0;if(g=(d&c.childLanes)!==0,g||(gc(l,c,d,!1),g=(d&c.childLanes)!==0),y){if(g)return xj(l,c,d);c.flags|=128}if(y=c.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(tn,tn.current),g)break;return null;case 22:return c.lanes=0,uj(l,c,d,c.pendingProps);case 24:Na(c,on,l.memoizedState.cache)}return Rs(l,c,d)}function yj(l,c,d){if(l!==null)if(l.memoizedProps!==c.pendingProps)un=!0;else{if(!Bv(l,d)&&(c.flags&128)===0)return un=!1,SZ(l,c,d);un=(l.flags&131072)!==0}else un=!1,nt&&(c.flags&1048576)!==0&&FQ(c,Ef,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(l=Vl(c.elementType),c.type=l,typeof l=="function")Uy(l)?(g=Wl(l,g),c.tag=1,c=pj(null,c,l,g,d)):(c.tag=0,c=Mv(null,c,l,g,d));else{if(l!=null){var y=l.$$typeof;if(y===T){c.tag=11,c=lj(null,c,l,g,d);break e}else if(y===M){c.tag=14,c=oj(null,c,l,g,d);break e}}throw c=E(l)||l,Error(r(306,c,""))}}return c;case 0:return Mv(l,c,c.type,c.pendingProps,d);case 1:return g=c.type,y=Wl(g,c.pendingProps),pj(l,c,g,y,d);case 3:e:{if(oe(c,c.stateNode.containerInfo),l===null)throw Error(r(387));g=c.pendingProps;var b=c.memoizedState;y=b.element,ov(l,c),Zf(c,g,null,d);var $=c.memoizedState;if(g=$.cache,Na(c,on,g),g!==b.cache&&nv(c,[on],d,!0),Xf(),g=$.element,b.isDehydrated)if(b={element:g,isDehydrated:!1,cache:$.cache},c.updateQueue.baseState=b,c.memoizedState=b,c.flags&256){c=mj(l,c,g,d);break e}else if(g!==y){y=Gr(Error(r(424)),c),Af(y),c=mj(l,c,g,d);break e}else{switch(l=c.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(Dt=ti(l.firstChild),Tn=c,nt=!0,$a=null,Jr=!0,d=uC(c,null,g,d),c.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Xl(),g===y){c=Rs(l,c,d);break e}_n(l,c,g,d)}c=c.child}return c;case 26:return Mm(l,c),l===null?(d=_T(c.type,null,c.pendingProps,null))?c.memoizedState=d:nt||(d=c.type,l=c.pendingProps,g=Km(ne.current).createElement(d),g[On]=c,g[Dn]=l,Nn(g,d,l),ln(g),c.stateNode=g):c.memoizedState=_T(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:return je(c),l===null&&nt&&(g=c.stateNode=jT(c.type,c.pendingProps,ne.current),Tn=c,Jr=!0,y=Dt,Va(c.type)?(bb=y,Dt=ti(g.firstChild)):Dt=y),_n(l,c,c.pendingProps.children,d),Mm(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&&nt&&((y=g=Dt)&&(g=KZ(g,c.type,c.pendingProps,Jr),g!==null?(c.stateNode=g,Tn=c,Dt=ti(g.firstChild),Jr=!1,y=!0):y=!1),y||_a(c)),je(c),y=c.type,b=c.pendingProps,$=l!==null?l.memoizedProps:null,g=b.children,gb(y,b)?g=null:$!==null&&gb(y,$)&&(c.flags|=32),c.memoizedState!==null&&(y=mv(l,c,hZ,null,null,d),ld._currentValue=y),Mm(l,c),_n(l,c,g,d),c.child;case 6:return l===null&&nt&&((l=d=Dt)&&(d=JZ(d,c.pendingProps,Jr),d!==null?(c.stateNode=d,Tn=c,Dt=null,l=!0):l=!1),l||_a(c)),null;case 13:return gj(l,c,d);case 4:return oe(c,c.stateNode.containerInfo),g=c.pendingProps,l===null?c.child=Yl(c,null,g,d):_n(l,c,g,d),c.child;case 11:return lj(l,c,c.type,c.pendingProps,d);case 7:return _n(l,c,c.pendingProps,d),c.child;case 8:return _n(l,c,c.pendingProps.children,d),c.child;case 12:return _n(l,c,c.pendingProps.children,d),c.child;case 10:return g=c.pendingProps,Na(c,c.type,g.value),_n(l,c,g.children,d),c.child;case 9:return y=c.type._context,g=c.pendingProps.children,Bl(c),y=$n(y),g=g(y),c.flags|=1,_n(l,c,g,d),c.child;case 14:return oj(l,c,c.type,c.pendingProps,d);case 15:return cj(l,c,c.type,c.pendingProps,d);case 19:return xj(l,c,d);case 31:return bZ(l,c,d);case 22:return uj(l,c,d,c.pendingProps);case 24:return Bl(c),g=$n(on),l===null?(y=sv(),y===null&&(y=Nt,b=rv(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=d),y=b),c.memoizedState={parent:g,cache:y},lv(c),Na(c,on,y)):((l.lanes&d)!==0&&(ov(l,c),Zf(c,null,null,d),Xf()),y=l.memoizedState,b=c.memoizedState,y.parent!==g?(y={parent:g,cache:g},c.memoizedState=y,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=y),Na(c,on,g)):(g=b.cache,Na(c,on,g),g!==y.cache&&nv(c,[on],d,!0))),_n(l,c,c.pendingProps.children,d),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function zs(l){l.flags|=4}function qv(l,c,d,g,y){if((c=(l.mode&32)!==0)&&(c=!1),c){if(l.flags|=16777216,(y&335544128)===y)if(l.stateNode.complete)l.flags|=8192;else if(Yj())l.flags|=8192;else throw Il=vm,av}else l.flags&=-16777217}function vj(l,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!MT(c))if(Yj())l.flags|=8192;else throw Il=vm,av}function zm(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?qp():536870912,l.lanes|=c,Tc|=c)}function Uf(l,c){if(!nt)switch(l.tailMode){case"hidden":c=l.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?l.tail=null:d.sibling=null;break;case"collapsed":d=l.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:g.sibling=null}}function Lt(l){var c=l.alternate!==null&&l.alternate.child===l.child,d=0,g=0;if(c)for(var y=l.child;y!==null;)d|=y.lanes|y.childLanes,g|=y.subtreeFlags&65011712,g|=y.flags&65011712,y.return=l,y=y.sibling;else for(y=l.child;y!==null;)d|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=l,y=y.sibling;return l.subtreeFlags|=g,l.childLanes=d,c}function wZ(l,c,d){var g=c.pendingProps;switch(Fy(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(c),null;case 1:return Lt(c),null;case 3:return d=c.stateNode,g=null,l!==null&&(g=l.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),Es(on),me(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(l===null||l.child===null)&&(mc(c)?zs(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Jy())),Lt(c),null;case 26:var y=c.type,b=c.memoizedState;return l===null?(zs(c),b!==null?(Lt(c),vj(c,b)):(Lt(c),qv(c,y,null,g,d))):b?b!==l.memoizedState?(zs(c),Lt(c),vj(c,b)):(Lt(c),c.flags&=-16777217):(l=l.memoizedProps,l!==g&&zs(c),Lt(c),qv(c,y,l,g,d)),null;case 27:if(ke(c),d=ne.current,y=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==g&&zs(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Lt(c),null}l=ee.current,mc(c)?JQ(c):(l=jT(y,g,d),c.stateNode=l,zs(c))}return Lt(c),null;case 5:if(ke(c),y=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==g&&zs(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Lt(c),null}if(b=ee.current,mc(c))JQ(c);else{var $=Km(ne.current);switch(b){case 1:b=$.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=$.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=$.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=$.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=$.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof g.is=="string"?$.createElement("select",{is:g.is}):$.createElement("select"),g.multiple?b.multiple=!0:g.size&&(b.size=g.size);break;default:b=typeof g.is=="string"?$.createElement(y,{is:g.is}):$.createElement(y)}}b[On]=c,b[Dn]=g;e:for($=c.child;$!==null;){if($.tag===5||$.tag===6)b.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===c)break e;for(;$.sibling===null;){if($.return===null||$.return===c)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}c.stateNode=b;e:switch(Nn(b,y,g),y){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&zs(c)}}return Lt(c),qv(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,d),null;case 6:if(l&&c.stateNode!=null)l.memoizedProps!==g&&zs(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(l=ne.current,mc(c)){if(l=c.stateNode,d=c.memoizedProps,g=null,y=Tn,y!==null)switch(y.tag){case 27:case 5:g=y.memoizedProps}l[On]=c,l=!!(l.nodeValue===d||g!==null&&g.suppressHydrationWarning===!0||gT(l.nodeValue,d)),l||_a(c,!0)}else l=Km(l).createTextNode(g),l[On]=c,c.stateNode=l}return Lt(c),null;case 31:if(d=c.memoizedState,l===null||l.memoizedState!==null){if(g=mc(c),d!==null){if(l===null){if(!g)throw Error(r(318));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[On]=c}else Xl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Lt(c),l=!1}else d=Jy(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=d),l=!0;if(!l)return c.flags&256?(Nr(c),c):(Nr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Lt(c),null;case 13:if(g=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(y=mc(c),g!==null&&g.dehydrated!==null){if(l===null){if(!y)throw Error(r(318));if(y=c.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[On]=c}else Xl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Lt(c),y=!1}else y=Jy(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=y),y=!0;if(!y)return c.flags&256?(Nr(c),c):(Nr(c),null)}return Nr(c),(c.flags&128)!==0?(c.lanes=d,c):(d=g!==null,l=l!==null&&l.memoizedState!==null,d&&(g=c.child,y=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(y=g.alternate.memoizedState.cachePool.pool),b=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(b=g.memoizedState.cachePool.pool),b!==y&&(g.flags|=2048)),d!==l&&d&&(c.child.flags|=8192),zm(c,c.updateQueue),Lt(c),null);case 4:return me(),l===null&&fb(c.stateNode.containerInfo),Lt(c),null;case 10:return Es(c.type),Lt(c),null;case 19:if(Y(tn),g=c.memoizedState,g===null)return Lt(c),null;if(y=(c.flags&128)!==0,b=g.rendering,b===null)if(y)Uf(g,!1);else{if(Ut!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(b=km(l),b!==null){for(c.flags|=128,Uf(g,!1),l=b.updateQueue,c.updateQueue=l,zm(c,l),c.subtreeFlags=0,l=d,d=c.child;d!==null;)WQ(d,l),d=d.sibling;return P(tn,tn.current&1|2),nt&&Ns(c,g.treeForkCount),c.child}l=l.sibling}g.tail!==null&&en()>Bm&&(c.flags|=128,y=!0,Uf(g,!1),c.lanes=4194304)}else{if(!y)if(l=km(b),l!==null){if(c.flags|=128,y=!0,l=l.updateQueue,c.updateQueue=l,zm(c,l),Uf(g,!0),g.tail===null&&g.tailMode==="hidden"&&!b.alternate&&!nt)return Lt(c),null}else 2*en()-g.renderingStartTime>Bm&&d!==536870912&&(c.flags|=128,y=!0,Uf(g,!1),c.lanes=4194304);g.isBackwards?(b.sibling=c.child,c.child=b):(l=g.last,l!==null?l.sibling=b:c.child=b,g.last=b)}return g.tail!==null?(l=g.tail,g.rendering=l,g.tail=l.sibling,g.renderingStartTime=en(),l.sibling=null,d=tn.current,P(tn,y?d&1|2:d&1),nt&&Ns(c,g.treeForkCount),l):(Lt(c),null);case 22:case 23:return Nr(c),dv(),g=c.memoizedState!==null,l!==null?l.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(d&536870912)!==0&&(c.flags&128)===0&&(Lt(c),c.subtreeFlags&6&&(c.flags|=8192)):Lt(c),d=c.updateQueue,d!==null&&zm(c,d.retryQueue),d=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==d&&(c.flags|=2048),l!==null&&Y(ql),null;case 24:return d=null,l!==null&&(d=l.memoizedState.cache),c.memoizedState.cache!==d&&(c.flags|=2048),Es(on),Lt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function kZ(l,c){switch(Fy(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return Es(on),me(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return ke(c),null;case 31:if(c.memoizedState!==null){if(Nr(c),c.alternate===null)throw Error(r(340));Xl()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 13:if(Nr(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Xl()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return Y(tn),null;case 4:return me(),null;case 10:return Es(c.type),null;case 22:case 23:return Nr(c),dv(),l!==null&&Y(ql),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return Es(on),null;case 25:return null;default:return null}}function bj(l,c){switch(Fy(c),c.tag){case 3:Es(on),me();break;case 26:case 27:case 5:ke(c);break;case 4:me();break;case 31:c.memoizedState!==null&&Nr(c);break;case 13:Nr(c);break;case 19:Y(tn);break;case 10:Es(c.type);break;case 22:case 23:Nr(c),dv(),l!==null&&Y(ql);break;case 24:Es(on)}}function Wf(l,c){try{var d=c.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var y=g.next;d=y;do{if((d.tag&l)===l){g=void 0;var b=d.create,$=d.inst;g=b(),$.destroy=g}d=d.next}while(d!==y)}}catch(L){St(c,c.return,L)}}function za(l,c,d){try{var g=c.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var b=y.next;g=b;do{if((g.tag&l)===l){var $=g.inst,L=$.destroy;if(L!==void 0){$.destroy=void 0,y=c;var G=d,ie=L;try{ie()}catch(ue){St(y,G,ue)}}}g=g.next}while(g!==b)}}catch(ue){St(c,c.return,ue)}}function Sj(l){var c=l.updateQueue;if(c!==null){var d=l.stateNode;try{dC(c,d)}catch(g){St(l,l.return,g)}}}function wj(l,c,d){d.props=Wl(l.type,l.memoizedProps),d.state=l.memoizedState;try{d.componentWillUnmount()}catch(g){St(l,c,g)}}function Hf(l,c){try{var d=l.ref;if(d!==null){switch(l.tag){case 26:case 27:case 5:var g=l.stateNode;break;case 30:g=l.stateNode;break;default:g=l.stateNode}typeof d=="function"?l.refCleanup=d(g):d.current=g}}catch(y){St(l,c,y)}}function Ui(l,c){var d=l.ref,g=l.refCleanup;if(d!==null)if(typeof g=="function")try{g()}catch(y){St(l,c,y)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(y){St(l,c,y)}else d.current=null}function kj(l){var c=l.type,d=l.memoizedProps,g=l.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":d.autoFocus&&g.focus();break e;case"img":d.src?g.src=d.src:d.srcSet&&(g.srcset=d.srcSet)}}catch(y){St(l,l.return,y)}}function Vv(l,c,d){try{var g=l.stateNode;YZ(g,l.type,d,c),g[Dn]=c}catch(y){St(l,l.return,y)}}function Qj(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Va(l.type)||l.tag===4}function Iv(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Qj(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Va(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Yv(l,c,d){var g=l.tag;if(g===5||g===6)l=l.stateNode,c?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(l,c):(c=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,c.appendChild(l),d=d._reactRootContainer,d!=null||c.onclick!==null||(c.onclick=Ts));else if(g!==4&&(g===27&&Va(l.type)&&(d=l.stateNode,c=null),l=l.child,l!==null))for(Yv(l,c,d),l=l.sibling;l!==null;)Yv(l,c,d),l=l.sibling}function Dm(l,c,d){var g=l.tag;if(g===5||g===6)l=l.stateNode,c?d.insertBefore(l,c):d.appendChild(l);else if(g!==4&&(g===27&&Va(l.type)&&(d=l.stateNode),l=l.child,l!==null))for(Dm(l,c,d),l=l.sibling;l!==null;)Dm(l,c,d),l=l.sibling}function Cj(l){var c=l.stateNode,d=l.memoizedProps;try{for(var g=l.type,y=c.attributes;y.length;)c.removeAttributeNode(y[0]);Nn(c,g,d),c[On]=l,c[Dn]=d}catch(b){St(l,l.return,b)}}var Ds=!1,fn=!1,Uv=!1,jj=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function QZ(l,c){if(l=l.containerInfo,pb=sg,l=LQ(l),Xy(l)){if("selectionStart"in l)var d={start:l.selectionStart,end:l.selectionEnd};else e:{d=(d=l.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var y=g.anchorOffset,b=g.focusNode;g=g.focusOffset;try{d.nodeType,b.nodeType}catch{d=null;break e}var $=0,L=-1,G=-1,ie=0,ue=0,he=l,se=null;t:for(;;){for(var le;he!==d||y!==0&&he.nodeType!==3||(L=$+y),he!==b||g!==0&&he.nodeType!==3||(G=$+g),he.nodeType===3&&($+=he.nodeValue.length),(le=he.firstChild)!==null;)se=he,he=le;for(;;){if(he===l)break t;if(se===d&&++ie===y&&(L=$),se===b&&++ue===g&&(G=$),(le=he.nextSibling)!==null)break;he=se,se=he.parentNode}he=le}d=L===-1||G===-1?null:{start:L,end:G}}else d=null}d=d||{start:0,end:0}}else d=null;for(mb={focusedElem:l,selectionRange:d},sg=!1,Sn=c;Sn!==null;)if(c=Sn,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Sn=l;else for(;Sn!==null;){switch(c=Sn,b=c.alternate,l=c.flags,c.tag){case 0:if((l&4)!==0&&(l=c.updateQueue,l=l!==null?l.events:null,l!==null))for(d=0;d<l.length;d++)y=l[d],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&b!==null){l=void 0,d=c,y=b.memoizedProps,b=b.memoizedState,g=d.stateNode;try{var Se=Wl(d.type,y);l=g.getSnapshotBeforeUpdate(Se,b),g.__reactInternalSnapshotBeforeUpdate=l}catch(Ae){St(d,d.return,Ae)}}break;case 3:if((l&1024)!==0){if(l=c.stateNode.containerInfo,d=l.nodeType,d===9)xb(l);else if(d===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":xb(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(r(163))}if(l=c.sibling,l!==null){l.return=c.return,Sn=l;break}Sn=c.return}}function Tj(l,c,d){var g=d.flags;switch(d.tag){case 0:case 11:case 15:Xs(l,d),g&4&&Wf(5,d);break;case 1:if(Xs(l,d),g&4)if(l=d.stateNode,c===null)try{l.componentDidMount()}catch($){St(d,d.return,$)}else{var y=Wl(d.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(y,c,l.__reactInternalSnapshotBeforeUpdate)}catch($){St(d,d.return,$)}}g&64&&Sj(d),g&512&&Hf(d,d.return);break;case 3:if(Xs(l,d),g&64&&(l=d.updateQueue,l!==null)){if(c=null,d.child!==null)switch(d.child.tag){case 27:case 5:c=d.child.stateNode;break;case 1:c=d.child.stateNode}try{dC(l,c)}catch($){St(d,d.return,$)}}break;case 27:c===null&&g&4&&Cj(d);case 26:case 5:Xs(l,d),c===null&&g&4&&kj(d),g&512&&Hf(d,d.return);break;case 12:Xs(l,d);break;case 31:Xs(l,d),g&4&&Nj(l,d);break;case 13:Xs(l,d),g&4&&Pj(l,d),g&64&&(l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(d=AZ.bind(null,d),e6(l,d))));break;case 22:if(g=d.memoizedState!==null||Ds,!g){c=c!==null&&c.memoizedState!==null||fn,y=Ds;var b=fn;Ds=g,(fn=c)&&!b?Zs(l,d,(d.subtreeFlags&8772)!==0):Xs(l,d),Ds=y,fn=b}break;case 30:break;default:Xs(l,d)}}function $j(l){var c=l.alternate;c!==null&&(l.alternate=null,$j(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&bf(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var Xt=null,cr=!1;function Ls(l,c,d){for(d=d.child;d!==null;)_j(l,c,d),d=d.sibling}function _j(l,c,d){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(kt,d)}catch{}switch(d.tag){case 26:fn||Ui(d,c),Ls(l,c,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:fn||Ui(d,c);var g=Xt,y=cr;Va(d.type)&&(Xt=d.stateNode,cr=!1),Ls(l,c,d),id(d.stateNode),Xt=g,cr=y;break;case 5:fn||Ui(d,c);case 6:if(g=Xt,y=cr,Xt=null,Ls(l,c,d),Xt=g,cr=y,Xt!==null)if(cr)try{(Xt.nodeType===9?Xt.body:Xt.nodeName==="HTML"?Xt.ownerDocument.body:Xt).removeChild(d.stateNode)}catch(b){St(d,c,b)}else try{Xt.removeChild(d.stateNode)}catch(b){St(d,c,b)}break;case 18:Xt!==null&&(cr?(l=Xt,ST(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,d.stateNode),Rc(l)):ST(Xt,d.stateNode));break;case 4:g=Xt,y=cr,Xt=d.stateNode.containerInfo,cr=!0,Ls(l,c,d),Xt=g,cr=y;break;case 0:case 11:case 14:case 15:za(2,d,c),fn||za(4,d,c),Ls(l,c,d);break;case 1:fn||(Ui(d,c),g=d.stateNode,typeof g.componentWillUnmount=="function"&&wj(d,c,g)),Ls(l,c,d);break;case 21:Ls(l,c,d);break;case 22:fn=(g=fn)||d.memoizedState!==null,Ls(l,c,d),fn=g;break;default:Ls(l,c,d)}}function Nj(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Rc(l)}catch(d){St(c,c.return,d)}}}function Pj(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Rc(l)}catch(d){St(c,c.return,d)}}function CZ(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new jj),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new jj),c;default:throw Error(r(435,l.tag))}}function Lm(l,c){var d=CZ(l);c.forEach(function(g){if(!d.has(g)){d.add(g);var y=MZ.bind(null,l,g);g.then(y,y)}})}function ur(l,c){var d=c.deletions;if(d!==null)for(var g=0;g<d.length;g++){var y=d[g],b=l,$=c,L=$;e:for(;L!==null;){switch(L.tag){case 27:if(Va(L.type)){Xt=L.stateNode,cr=!1;break e}break;case 5:Xt=L.stateNode,cr=!1;break e;case 3:case 4:Xt=L.stateNode.containerInfo,cr=!0;break e}L=L.return}if(Xt===null)throw Error(r(160));_j(b,$,y),Xt=null,cr=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)Ej(c,l),c=c.sibling}var Qi=null;function Ej(l,c){var d=l.alternate,g=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:ur(c,l),fr(l),g&4&&(za(3,l,l.return),Wf(3,l),za(5,l,l.return));break;case 1:ur(c,l),fr(l),g&512&&(fn||d===null||Ui(d,d.return)),g&64&&Ds&&(l=l.updateQueue,l!==null&&(g=l.callbacks,g!==null&&(d=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=d===null?g:d.concat(g))));break;case 26:var y=Qi;if(ur(c,l),fr(l),g&512&&(fn||d===null||Ui(d,d.return)),g&4){var b=d!==null?d.memoizedState:null;if(g=l.memoizedState,d===null)if(g===null)if(l.stateNode===null){e:{g=l.type,d=l.memoizedProps,y=y.ownerDocument||y;t:switch(g){case"title":b=y.getElementsByTagName("title")[0],(!b||b[Pl]||b[On]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(g),y.head.insertBefore(b,y.querySelector("head > title"))),Nn(b,g,d),b[On]=l,ln(b),g=b;break e;case"link":var $=ET("link","href",y).get(g+(d.href||""));if($){for(var L=0;L<$.length;L++)if(b=$[L],b.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&b.getAttribute("rel")===(d.rel==null?null:d.rel)&&b.getAttribute("title")===(d.title==null?null:d.title)&&b.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){$.splice(L,1);break t}}b=y.createElement(g),Nn(b,g,d),y.head.appendChild(b);break;case"meta":if($=ET("meta","content",y).get(g+(d.content||""))){for(L=0;L<$.length;L++)if(b=$[L],b.getAttribute("content")===(d.content==null?null:""+d.content)&&b.getAttribute("name")===(d.name==null?null:d.name)&&b.getAttribute("property")===(d.property==null?null:d.property)&&b.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&b.getAttribute("charset")===(d.charSet==null?null:d.charSet)){$.splice(L,1);break t}}b=y.createElement(g),Nn(b,g,d),y.head.appendChild(b);break;default:throw Error(r(468,g))}b[On]=l,ln(b),g=b}l.stateNode=g}else AT(y,l.type,l.stateNode);else l.stateNode=PT(y,g,l.memoizedProps);else b!==g?(b===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):b.count--,g===null?AT(y,l.type,l.stateNode):PT(y,g,l.memoizedProps)):g===null&&l.stateNode!==null&&Vv(l,l.memoizedProps,d.memoizedProps)}break;case 27:ur(c,l),fr(l),g&512&&(fn||d===null||Ui(d,d.return)),d!==null&&g&4&&Vv(l,l.memoizedProps,d.memoizedProps);break;case 5:if(ur(c,l),fr(l),g&512&&(fn||d===null||Ui(d,d.return)),l.flags&32){y=l.stateNode;try{sc(y,"")}catch(Se){St(l,l.return,Se)}}g&4&&l.stateNode!=null&&(y=l.memoizedProps,Vv(l,y,d!==null?d.memoizedProps:y)),g&1024&&(Uv=!0);break;case 6:if(ur(c,l),fr(l),g&4){if(l.stateNode===null)throw Error(r(162));g=l.memoizedProps,d=l.stateNode;try{d.nodeValue=g}catch(Se){St(l,l.return,Se)}}break;case 3:if(tg=null,y=Qi,Qi=Jm(c.containerInfo),ur(c,l),Qi=y,fr(l),g&4&&d!==null&&d.memoizedState.isDehydrated)try{Rc(c.containerInfo)}catch(Se){St(l,l.return,Se)}Uv&&(Uv=!1,Aj(l));break;case 4:g=Qi,Qi=Jm(l.stateNode.containerInfo),ur(c,l),fr(l),Qi=g;break;case 12:ur(c,l),fr(l);break;case 31:ur(c,l),fr(l),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Lm(l,g)));break;case 13:ur(c,l),fr(l),l.child.flags&8192&&l.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Zm=en()),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Lm(l,g)));break;case 22:y=l.memoizedState!==null;var G=d!==null&&d.memoizedState!==null,ie=Ds,ue=fn;if(Ds=ie||y,fn=ue||G,ur(c,l),fn=ue,Ds=ie,fr(l),g&8192)e:for(c=l.stateNode,c._visibility=y?c._visibility&-2:c._visibility|1,y&&(d===null||G||Ds||fn||Hl(l)),d=null,c=l;;){if(c.tag===5||c.tag===26){if(d===null){G=d=c;try{if(b=G.stateNode,y)$=b.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none";else{L=G.stateNode;var he=G.memoizedProps.style,se=he!=null&&he.hasOwnProperty("display")?he.display:null;L.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Se){St(G,G.return,Se)}}}else if(c.tag===6){if(d===null){G=c;try{G.stateNode.nodeValue=y?"":G.memoizedProps}catch(Se){St(G,G.return,Se)}}}else if(c.tag===18){if(d===null){G=c;try{var le=G.stateNode;y?wT(le,!0):wT(G.stateNode,!1)}catch(Se){St(G,G.return,Se)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=l.updateQueue,g!==null&&(d=g.retryQueue,d!==null&&(g.retryQueue=null,Lm(l,d))));break;case 19:ur(c,l),fr(l),g&4&&(g=l.updateQueue,g!==null&&(l.updateQueue=null,Lm(l,g)));break;case 30:break;case 21:break;default:ur(c,l),fr(l)}}function fr(l){var c=l.flags;if(c&2){try{for(var d,g=l.return;g!==null;){if(Qj(g)){d=g;break}g=g.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var y=d.stateNode,b=Iv(l);Dm(l,b,y);break;case 5:var $=d.stateNode;d.flags&32&&(sc($,""),d.flags&=-33);var L=Iv(l);Dm(l,L,$);break;case 3:case 4:var G=d.stateNode.containerInfo,ie=Iv(l);Yv(l,ie,G);break;default:throw Error(r(161))}}catch(ue){St(l,l.return,ue)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function Aj(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;Aj(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),l=l.sibling}}function Xs(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)Tj(l,c.alternate,c),c=c.sibling}function Hl(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:za(4,c,c.return),Hl(c);break;case 1:Ui(c,c.return);var d=c.stateNode;typeof d.componentWillUnmount=="function"&&wj(c,c.return,d),Hl(c);break;case 27:id(c.stateNode);case 26:case 5:Ui(c,c.return),Hl(c);break;case 22:c.memoizedState===null&&Hl(c);break;case 30:Hl(c);break;default:Hl(c)}l=l.sibling}}function Zs(l,c,d){for(d=d&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,y=l,b=c,$=b.flags;switch(b.tag){case 0:case 11:case 15:Zs(y,b,d),Wf(4,b);break;case 1:if(Zs(y,b,d),g=b,y=g.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){St(g,g.return,ie)}if(g=b,y=g.updateQueue,y!==null){var L=g.stateNode;try{var G=y.shared.hiddenCallbacks;if(G!==null)for(y.shared.hiddenCallbacks=null,y=0;y<G.length;y++)fC(G[y],L)}catch(ie){St(g,g.return,ie)}}d&&$&64&&Sj(b),Hf(b,b.return);break;case 27:Cj(b);case 26:case 5:Zs(y,b,d),d&&g===null&&$&4&&kj(b),Hf(b,b.return);break;case 12:Zs(y,b,d);break;case 31:Zs(y,b,d),d&&$&4&&Nj(y,b);break;case 13:Zs(y,b,d),d&&$&4&&Pj(y,b);break;case 22:b.memoizedState===null&&Zs(y,b,d),Hf(b,b.return);break;case 30:break;default:Zs(y,b,d)}c=c.sibling}}function Wv(l,c){var d=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),l=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(l=c.memoizedState.cachePool.pool),l!==d&&(l!=null&&l.refCount++,d!=null&&Mf(d))}function Hv(l,c){l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Mf(l))}function Ci(l,c,d,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)Mj(l,c,d,g),c=c.sibling}function Mj(l,c,d,g){var y=c.flags;switch(c.tag){case 0:case 11:case 15:Ci(l,c,d,g),y&2048&&Wf(9,c);break;case 1:Ci(l,c,d,g);break;case 3:Ci(l,c,d,g),y&2048&&(l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Mf(l)));break;case 12:if(y&2048){Ci(l,c,d,g),l=c.stateNode;try{var b=c.memoizedProps,$=b.id,L=b.onPostCommit;typeof L=="function"&&L($,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(G){St(c,c.return,G)}}else Ci(l,c,d,g);break;case 31:Ci(l,c,d,g);break;case 13:Ci(l,c,d,g);break;case 23:break;case 22:b=c.stateNode,$=c.alternate,c.memoizedState!==null?b._visibility&2?Ci(l,c,d,g):Gf(l,c):b._visibility&2?Ci(l,c,d,g):(b._visibility|=2,Qc(l,c,d,g,(c.subtreeFlags&10256)!==0||!1)),y&2048&&Wv($,c);break;case 24:Ci(l,c,d,g),y&2048&&Hv(c.alternate,c);break;default:Ci(l,c,d,g)}}function Qc(l,c,d,g,y){for(y=y&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var b=l,$=c,L=d,G=g,ie=$.flags;switch($.tag){case 0:case 11:case 15:Qc(b,$,L,G,y),Wf(8,$);break;case 23:break;case 22:var ue=$.stateNode;$.memoizedState!==null?ue._visibility&2?Qc(b,$,L,G,y):Gf(b,$):(ue._visibility|=2,Qc(b,$,L,G,y)),y&&ie&2048&&Wv($.alternate,$);break;case 24:Qc(b,$,L,G,y),y&&ie&2048&&Hv($.alternate,$);break;default:Qc(b,$,L,G,y)}c=c.sibling}}function Gf(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var d=l,g=c,y=g.flags;switch(g.tag){case 22:Gf(d,g),y&2048&&Wv(g.alternate,g);break;case 24:Gf(d,g),y&2048&&Hv(g.alternate,g);break;default:Gf(d,g)}c=c.sibling}}var Ff=8192;function Cc(l,c,d){if(l.subtreeFlags&Ff)for(l=l.child;l!==null;)Rj(l,c,d),l=l.sibling}function Rj(l,c,d){switch(l.tag){case 26:Cc(l,c,d),l.flags&Ff&&l.memoizedState!==null&&d6(d,Qi,l.memoizedState,l.memoizedProps);break;case 5:Cc(l,c,d);break;case 3:case 4:var g=Qi;Qi=Jm(l.stateNode.containerInfo),Cc(l,c,d),Qi=g;break;case 22:l.memoizedState===null&&(g=l.alternate,g!==null&&g.memoizedState!==null?(g=Ff,Ff=16777216,Cc(l,c,d),Ff=g):Cc(l,c,d));break;default:Cc(l,c,d)}}function zj(l){var c=l.alternate;if(c!==null&&(l=c.child,l!==null)){c.child=null;do c=l.sibling,l.sibling=null,l=c;while(l!==null)}}function Kf(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var g=c[d];Sn=g,Lj(g,l)}zj(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Dj(l),l=l.sibling}function Dj(l){switch(l.tag){case 0:case 11:case 15:Kf(l),l.flags&2048&&za(9,l,l.return);break;case 3:Kf(l);break;case 12:Kf(l);break;case 22:var c=l.stateNode;l.memoizedState!==null&&c._visibility&2&&(l.return===null||l.return.tag!==13)?(c._visibility&=-3,Xm(l)):Kf(l);break;default:Kf(l)}}function Xm(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var d=0;d<c.length;d++){var g=c[d];Sn=g,Lj(g,l)}zj(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:za(8,c,c.return),Xm(c);break;case 22:d=c.stateNode,d._visibility&2&&(d._visibility&=-3,Xm(c));break;default:Xm(c)}l=l.sibling}}function Lj(l,c){for(;Sn!==null;){var d=Sn;switch(d.tag){case 0:case 11:case 15:za(8,d,c);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var g=d.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Mf(d.memoizedState.cache)}if(g=d.child,g!==null)g.return=d,Sn=g;else e:for(d=l;Sn!==null;){g=Sn;var y=g.sibling,b=g.return;if($j(g),g===d){Sn=null;break e}if(y!==null){y.return=b,Sn=y;break e}Sn=b}}}var jZ={getCacheForType:function(l){var c=$n(on),d=c.data.get(l);return d===void 0&&(d=l(),c.data.set(l,d)),d},cacheSignal:function(){return $n(on).controller.signal}},TZ=typeof WeakMap=="function"?WeakMap:Map,pt=0,Nt=null,Ge=null,Je=0,bt=0,Pr=null,Da=!1,jc=!1,Gv=!1,Bs=0,Ut=0,La=0,Gl=0,Fv=0,Er=0,Tc=0,Jf=null,dr=null,Kv=!1,Zm=0,Xj=0,Bm=1/0,qm=null,Xa=null,xn=0,Za=null,$c=null,qs=0,Jv=0,eb=null,Zj=null,ed=0,tb=null;function Ar(){return(pt&2)!==0&&Je!==0?Je&-Je:R.T!==null?lb():Up()}function Bj(){if(Er===0)if((Je&536870912)===0||nt){var l=Jo;Jo<<=1,(Jo&3932160)===0&&(Jo=262144),Er=l}else Er=536870912;return l=_r.current,l!==null&&(l.flags|=32),Er}function hr(l,c,d){(l===Nt&&(bt===2||bt===9)||l.cancelPendingCommit!==null)&&(_c(l,0),Ba(l,Je,Er,!1)),Nl(l,d),((pt&2)===0||l!==Nt)&&(l===Nt&&((pt&2)===0&&(Gl|=d),Ut===4&&Ba(l,Je,Er,!1)),Wi(l))}function qj(l,c,d){if((pt&6)!==0)throw Error(r(327));var g=!d&&(c&127)===0&&(c&l.expiredLanes)===0||_l(l,c),y=g?NZ(l,c):rb(l,c,!0),b=g;do{if(y===0){jc&&!g&&Ba(l,c,0,!1);break}else{if(d=l.current.alternate,b&&!$Z(d)){y=rb(l,c,!1),b=!1;continue}if(y===2){if(b=c,l.errorRecoveryDisabledLanes&b)var $=0;else $=l.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){c=$;e:{var L=l;y=Jf;var G=L.current.memoizedState.isDehydrated;if(G&&(_c(L,$).flags|=256),$=rb(L,$,!1),$!==2){if(Gv&&!G){L.errorRecoveryDisabledLanes|=b,Gl|=b,y=4;break e}b=dr,dr=y,b!==null&&(dr===null?dr=b:dr.push.apply(dr,b))}y=$}if(b=!1,y!==2)continue}}if(y===1){_c(l,0),Ba(l,c,0,!0);break}e:{switch(g=l,b=y,b){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Ba(g,c,Er,!Da);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(y=Zm+300-en(),10<y)){if(Ba(g,c,Er,!Da),tc(g,0,!0)!==0)break e;qs=c,g.timeoutHandle=vT(Vj.bind(null,g,d,dr,qm,Kv,c,Er,Gl,Tc,Da,b,"Throttled",-0,0),y);break e}Vj(g,d,dr,qm,Kv,c,Er,Gl,Tc,Da,b,null,-0,0)}}break}while(!0);Wi(l)}function Vj(l,c,d,g,y,b,$,L,G,ie,ue,he,se,le){if(l.timeoutHandle=-1,he=c.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ts},Rj(c,b,he);var Se=(b&62914560)===b?Zm-en():(b&4194048)===b?Xj-en():0;if(Se=h6(he,Se),Se!==null){qs=b,l.cancelPendingCommit=Se(Kj.bind(null,l,c,b,d,g,y,$,L,G,ue,he,null,se,le)),Ba(l,b,$,!ie);return}}Kj(l,c,b,d,g,y,$,L,G)}function $Z(l){for(var c=l;;){var d=c.tag;if((d===0||d===11||d===15)&&c.flags&16384&&(d=c.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var g=0;g<d.length;g++){var y=d[g],b=y.getSnapshot;y=y.value;try{if(!Tr(b(),y))return!1}catch{return!1}}if(d=c.child,c.subtreeFlags&16384&&d!==null)d.return=c,c=d;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ba(l,c,d,g){c&=~Fv,c&=~Gl,l.suspendedLanes|=c,l.pingedLanes&=~c,g&&(l.warmLanes|=c),g=l.expirationTimes;for(var y=c;0<y;){var b=31-ot(y),$=1<<b;g[b]=-1,y&=~$}d!==0&&Vp(l,d,c)}function Vm(){return(pt&6)===0?(td(0),!1):!0}function nb(){if(Ge!==null){if(bt===0)var l=Ge.return;else l=Ge,Ps=Zl=null,xv(l),vc=null,zf=0,l=Ge;for(;l!==null;)bj(l.alternate,l),l=l.return;Ge=null}}function _c(l,c){var d=l.timeoutHandle;d!==-1&&(l.timeoutHandle=-1,HZ(d)),d=l.cancelPendingCommit,d!==null&&(l.cancelPendingCommit=null,d()),qs=0,nb(),Nt=l,Ge=d=_s(l.current,null),Je=c,bt=0,Pr=null,Da=!1,jc=_l(l,c),Gv=!1,Tc=Er=Fv=Gl=La=Ut=0,dr=Jf=null,Kv=!1,(c&8)!==0&&(c|=c&32);var g=l.entangledLanes;if(g!==0)for(l=l.entanglements,g&=c;0<g;){var y=31-ot(g),b=1<<y;c|=l[y],g&=~b}return Bs=c,fm(),d}function Ij(l,c){qe=null,R.H=If,c===yc||c===ym?(c=lC(),bt=3):c===av?(c=lC(),bt=4):bt=c===Av?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Pr=c,Ge===null&&(Ut=1,Em(l,Gr(c,l.current)))}function Yj(){var l=_r.current;return l===null?!0:(Je&4194048)===Je?ei===null:(Je&62914560)===Je||(Je&536870912)!==0?l===ei:!1}function Uj(){var l=R.H;return R.H=If,l===null?If:l}function Wj(){var l=R.A;return R.A=jZ,l}function Im(){Ut=4,Da||(Je&4194048)!==Je&&_r.current!==null||(jc=!0),(La&134217727)===0&&(Gl&134217727)===0||Nt===null||Ba(Nt,Je,Er,!1)}function rb(l,c,d){var g=pt;pt|=2;var y=Uj(),b=Wj();(Nt!==l||Je!==c)&&(qm=null,_c(l,c)),c=!1;var $=Ut;e:do try{if(bt!==0&&Ge!==null){var L=Ge,G=Pr;switch(bt){case 8:nb(),$=6;break e;case 3:case 2:case 9:case 6:_r.current===null&&(c=!0);var ie=bt;if(bt=0,Pr=null,Nc(l,L,G,ie),d&&jc){$=0;break e}break;default:ie=bt,bt=0,Pr=null,Nc(l,L,G,ie)}}_Z(),$=Ut;break}catch(ue){Ij(l,ue)}while(!0);return c&&l.shellSuspendCounter++,Ps=Zl=null,pt=g,R.H=y,R.A=b,Ge===null&&(Nt=null,Je=0,fm()),$}function _Z(){for(;Ge!==null;)Hj(Ge)}function NZ(l,c){var d=pt;pt|=2;var g=Uj(),y=Wj();Nt!==l||Je!==c?(qm=null,Bm=en()+500,_c(l,c)):jc=_l(l,c);e:do try{if(bt!==0&&Ge!==null){c=Ge;var b=Pr;t:switch(bt){case 1:bt=0,Pr=null,Nc(l,c,b,1);break;case 2:case 9:if(sC(b)){bt=0,Pr=null,Gj(c);break}c=function(){bt!==2&&bt!==9||Nt!==l||(bt=7),Wi(l)},b.then(c,c);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:sC(b)?(bt=0,Pr=null,Gj(c)):(bt=0,Pr=null,Nc(l,c,b,7));break;case 5:var $=null;switch(Ge.tag){case 26:$=Ge.memoizedState;case 5:case 27:var L=Ge;if($?MT($):L.stateNode.complete){bt=0,Pr=null;var G=L.sibling;if(G!==null)Ge=G;else{var ie=L.return;ie!==null?(Ge=ie,Ym(ie)):Ge=null}break t}}bt=0,Pr=null,Nc(l,c,b,5);break;case 6:bt=0,Pr=null,Nc(l,c,b,6);break;case 8:nb(),Ut=6;break e;default:throw Error(r(462))}}PZ();break}catch(ue){Ij(l,ue)}while(!0);return Ps=Zl=null,R.H=g,R.A=y,pt=d,Ge!==null?0:(Nt=null,Je=0,fm(),Ut)}function PZ(){for(;Ge!==null&&!jr();)Hj(Ge)}function Hj(l){var c=yj(l.alternate,l,Bs);l.memoizedProps=l.pendingProps,c===null?Ym(l):Ge=c}function Gj(l){var c=l,d=c.alternate;switch(c.tag){case 15:case 0:c=hj(d,c,c.pendingProps,c.type,void 0,Je);break;case 11:c=hj(d,c,c.pendingProps,c.type.render,c.ref,Je);break;case 5:xv(c);default:bj(d,c),c=Ge=WQ(c,Bs),c=yj(d,c,Bs)}l.memoizedProps=l.pendingProps,c===null?Ym(l):Ge=c}function Nc(l,c,d,g){Ps=Zl=null,xv(c),vc=null,zf=0;var y=c.return;try{if(vZ(l,y,c,d,Je)){Ut=1,Em(l,Gr(d,l.current)),Ge=null;return}}catch(b){if(y!==null)throw Ge=y,b;Ut=1,Em(l,Gr(d,l.current)),Ge=null;return}c.flags&32768?(nt||g===1?l=!0:jc||(Je&536870912)!==0?l=!1:(Da=l=!0,(g===2||g===9||g===3||g===6)&&(g=_r.current,g!==null&&g.tag===13&&(g.flags|=16384))),Fj(c,l)):Ym(c)}function Ym(l){var c=l;do{if((c.flags&32768)!==0){Fj(c,Da);return}l=c.return;var d=wZ(c.alternate,c,Bs);if(d!==null){Ge=d;return}if(c=c.sibling,c!==null){Ge=c;return}Ge=c=l}while(c!==null);Ut===0&&(Ut=5)}function Fj(l,c){do{var d=kZ(l.alternate,l);if(d!==null){d.flags&=32767,Ge=d;return}if(d=l.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!c&&(l=l.sibling,l!==null)){Ge=l;return}Ge=l=d}while(l!==null);Ut=6,Ge=null}function Kj(l,c,d,g,y,b,$,L,G){l.cancelPendingCommit=null;do Um();while(xn!==0);if((pt&6)!==0)throw Error(r(327));if(c!==null){if(c===l.current)throw Error(r(177));if(b=c.lanes|c.childLanes,b|=Iy,by(l,d,b,$,L,G),l===Nt&&(Ge=Nt=null,Je=0),$c=c,Za=l,qs=d,Jv=b,eb=y,Zj=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,RZ(Ne,function(){return rT(),null})):(l.callbackNode=null,l.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=R.T,R.T=null,y=z.p,z.p=2,$=pt,pt|=4;try{QZ(l,c,d)}finally{pt=$,z.p=y,R.T=g}}xn=1,Jj(),eT(),tT()}}function Jj(){if(xn===1){xn=0;var l=Za,c=$c,d=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||d){d=R.T,R.T=null;var g=z.p;z.p=2;var y=pt;pt|=4;try{Ej(c,l);var b=mb,$=LQ(l.containerInfo),L=b.focusedElem,G=b.selectionRange;if($!==L&&L&&L.ownerDocument&&DQ(L.ownerDocument.documentElement,L)){if(G!==null&&Xy(L)){var ie=G.start,ue=G.end;if(ue===void 0&&(ue=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(ue,L.value.length);else{var he=L.ownerDocument||document,se=he&&he.defaultView||window;if(se.getSelection){var le=se.getSelection(),Se=L.textContent.length,Ae=Math.min(G.start,Se),Tt=G.end===void 0?Ae:Math.min(G.end,Se);!le.extend&&Ae>Tt&&($=Tt,Tt=Ae,Ae=$);var te=zQ(L,Ae),K=zQ(L,Tt);if(te&&K&&(le.rangeCount!==1||le.anchorNode!==te.node||le.anchorOffset!==te.offset||le.focusNode!==K.node||le.focusOffset!==K.offset)){var re=he.createRange();re.setStart(te.node,te.offset),le.removeAllRanges(),Ae>Tt?(le.addRange(re),le.extend(K.node,K.offset)):(re.setEnd(K.node,K.offset),le.addRange(re))}}}}for(he=[],le=L;le=le.parentNode;)le.nodeType===1&&he.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<he.length;L++){var de=he[L];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}sg=!!pb,mb=pb=null}finally{pt=y,z.p=g,R.T=d}}l.current=c,xn=2}}function eT(){if(xn===2){xn=0;var l=Za,c=$c,d=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||d){d=R.T,R.T=null;var g=z.p;z.p=2;var y=pt;pt|=4;try{Tj(l,c.alternate,c)}finally{pt=y,z.p=g,R.T=d}}xn=3}}function tT(){if(xn===4||xn===3){xn=0,Yr();var l=Za,c=$c,d=qs,g=Zj;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?xn=5:(xn=0,$c=Za=null,nT(l,l.pendingLanes));var y=l.pendingLanes;if(y===0&&(Xa=null),vf(d),c=c.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(kt,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=R.T,y=z.p,z.p=2,R.T=null;try{for(var b=l.onRecoverableError,$=0;$<g.length;$++){var L=g[$];b(L.value,{componentStack:L.stack})}}finally{R.T=c,z.p=y}}(qs&3)!==0&&Um(),Wi(l),y=l.pendingLanes,(d&261930)!==0&&(y&42)!==0?l===tb?ed++:(ed=0,tb=l):ed=0,td(0)}}function nT(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,Mf(c)))}function Um(){return Jj(),eT(),tT(),rT()}function rT(){if(xn!==5)return!1;var l=Za,c=Jv;Jv=0;var d=vf(qs),g=R.T,y=z.p;try{z.p=32>d?32:d,R.T=null,d=eb,eb=null;var b=Za,$=qs;if(xn=0,$c=Za=null,qs=0,(pt&6)!==0)throw Error(r(331));var L=pt;if(pt|=4,Dj(b.current),Mj(b,b.current,$,d),pt=L,td(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(kt,b)}catch{}return!0}finally{z.p=y,R.T=g,nT(l,c)}}function iT(l,c,d){c=Gr(d,c),c=Ev(l.stateNode,c,2),l=Aa(l,c,2),l!==null&&(Nl(l,2),Wi(l))}function St(l,c,d){if(l.tag===3)iT(l,l,d);else for(;c!==null;){if(c.tag===3){iT(c,l,d);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Xa===null||!Xa.has(g))){l=Gr(d,l),d=sj(2),g=Aa(c,d,2),g!==null&&(aj(d,g,c,l),Nl(g,2),Wi(g));break}}c=c.return}}function ib(l,c,d){var g=l.pingCache;if(g===null){g=l.pingCache=new TZ;var y=new Set;g.set(c,y)}else y=g.get(c),y===void 0&&(y=new Set,g.set(c,y));y.has(d)||(Gv=!0,y.add(d),l=EZ.bind(null,l,c,d),c.then(l,l))}function EZ(l,c,d){var g=l.pingCache;g!==null&&g.delete(c),l.pingedLanes|=l.suspendedLanes&d,l.warmLanes&=~d,Nt===l&&(Je&d)===d&&(Ut===4||Ut===3&&(Je&62914560)===Je&&300>en()-Zm?(pt&2)===0&&_c(l,0):Fv|=d,Tc===Je&&(Tc=0)),Wi(l)}function sT(l,c){c===0&&(c=qp()),l=Dl(l,c),l!==null&&(Nl(l,c),Wi(l))}function AZ(l){var c=l.memoizedState,d=0;c!==null&&(d=c.retryLane),sT(l,d)}function MZ(l,c){var d=0;switch(l.tag){case 31:case 13:var g=l.stateNode,y=l.memoizedState;y!==null&&(d=y.retryLane);break;case 19:g=l.stateNode;break;case 22:g=l.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),sT(l,d)}function RZ(l,c){return Cn(l,c)}var Wm=null,Pc=null,sb=!1,Hm=!1,ab=!1,qa=0;function Wi(l){l!==Pc&&l.next===null&&(Pc===null?Wm=Pc=l:Pc=Pc.next=l),Hm=!0,sb||(sb=!0,DZ())}function td(l,c){if(!ab&&Hm){ab=!0;do for(var d=!1,g=Wm;g!==null;){if(l!==0){var y=g.pendingLanes;if(y===0)var b=0;else{var $=g.suspendedLanes,L=g.pingedLanes;b=(1<<31-ot(42|l)+1)-1,b&=y&~($&~L),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(d=!0,cT(g,b))}else b=Je,b=tc(g,g===Nt?b:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(b&3)===0||_l(g,b)||(d=!0,cT(g,b));g=g.next}while(d);ab=!1}}function zZ(){aT()}function aT(){Hm=sb=!1;var l=0;qa!==0&&WZ()&&(l=qa);for(var c=en(),d=null,g=Wm;g!==null;){var y=g.next,b=lT(g,c);b===0?(g.next=null,d===null?Wm=y:d.next=y,y===null&&(Pc=d)):(d=g,(l!==0||(b&3)!==0)&&(Hm=!0)),g=y}xn!==0&&xn!==5||td(l),qa!==0&&(qa=0)}function lT(l,c){for(var d=l.suspendedLanes,g=l.pingedLanes,y=l.expirationTimes,b=l.pendingLanes&-62914561;0<b;){var $=31-ot(b),L=1<<$,G=y[$];G===-1?((L&d)===0||(L&g)!==0)&&(y[$]=vy(L,c)):G<=c&&(l.expiredLanes|=L),b&=~L}if(c=Nt,d=Je,d=tc(l,l===c?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),g=l.callbackNode,d===0||l===c&&(bt===2||bt===9)||l.cancelPendingCommit!==null)return g!==null&&g!==null&&sr(g),l.callbackNode=null,l.callbackPriority=0;if((d&3)===0||_l(l,d)){if(c=d&-d,c===l.callbackPriority)return c;switch(g!==null&&sr(g),vf(d)){case 2:case 8:d=ge;break;case 32:d=Ne;break;case 268435456:d=Ke;break;default:d=Ne}return g=oT.bind(null,l),d=Cn(d,g),l.callbackPriority=c,l.callbackNode=d,c}return g!==null&&g!==null&&sr(g),l.callbackPriority=2,l.callbackNode=null,2}function oT(l,c){if(xn!==0&&xn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var d=l.callbackNode;if(Um()&&l.callbackNode!==d)return null;var g=Je;return g=tc(l,l===Nt?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),g===0?null:(qj(l,g,c),lT(l,en()),l.callbackNode!=null&&l.callbackNode===d?oT.bind(null,l):null)}function cT(l,c){if(Um())return null;qj(l,c,!0)}function DZ(){GZ(function(){(pt&6)!==0?Cn(ce,zZ):aT()})}function lb(){if(qa===0){var l=Oc;l===0&&(l=Wr,Wr<<=1,(Wr&261888)===0&&(Wr=256)),qa=l}return qa}function uT(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:rm(""+l)}function fT(l,c){var d=c.ownerDocument.createElement("input");return d.name=c.name,d.value=c.value,l.id&&d.setAttribute("form",l.id),c.parentNode.insertBefore(d,c),l=new FormData(l),d.parentNode.removeChild(d),l}function LZ(l,c,d,g,y){if(c==="submit"&&d&&d.stateNode===y){var b=uT((y[Dn]||null).action),$=g.submitter;$&&(c=(c=$[Dn]||null)?uT(c.formAction):$.getAttribute("formAction"),c!==null&&(b=c,$=null));var L=new lm("action","action",null,g,y);l.push({event:L,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(qa!==0){var G=$?fT(y,$):new FormData(y);jv(d,{pending:!0,data:G,method:y.method,action:b},null,G)}}else typeof b=="function"&&(L.preventDefault(),G=$?fT(y,$):new FormData(y),jv(d,{pending:!0,data:G,method:y.method,action:b},b,G))},currentTarget:y}]})}}for(var ob=0;ob<Vy.length;ob++){var cb=Vy[ob],XZ=cb.toLowerCase(),ZZ=cb[0].toUpperCase()+cb.slice(1);ki(XZ,"on"+ZZ)}ki(BQ,"onAnimationEnd"),ki(qQ,"onAnimationIteration"),ki(VQ,"onAnimationStart"),ki("dblclick","onDoubleClick"),ki("focusin","onFocus"),ki("focusout","onBlur"),ki(rZ,"onTransitionRun"),ki(iZ,"onTransitionStart"),ki(sZ,"onTransitionCancel"),ki(IQ,"onTransitionEnd"),Qa("onMouseEnter",["mouseout","mouseover"]),Qa("onMouseLeave",["mouseout","mouseover"]),Qa("onPointerEnter",["pointerout","pointerover"]),Qa("onPointerLeave",["pointerout","pointerover"]),Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nd="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(" "),BZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nd));function dT(l,c){c=(c&4)!==0;for(var d=0;d<l.length;d++){var g=l[d],y=g.event;g=g.listeners;e:{var b=void 0;if(c)for(var $=g.length-1;0<=$;$--){var L=g[$],G=L.instance,ie=L.currentTarget;if(L=L.listener,G!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=ie;try{b(y)}catch(ue){um(ue)}y.currentTarget=null,b=G}else for($=0;$<g.length;$++){if(L=g[$],G=L.instance,ie=L.currentTarget,L=L.listener,G!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=ie;try{b(y)}catch(ue){um(ue)}y.currentTarget=null,b=G}}}}function Fe(l,c){var d=c[nc];d===void 0&&(d=c[nc]=new Set);var g=l+"__bubble";d.has(g)||(hT(c,l,2,!1),d.add(g))}function ub(l,c,d){var g=0;c&&(g|=4),hT(d,l,g,c)}var Gm="_reactListening"+Math.random().toString(36).slice(2);function fb(l){if(!l[Gm]){l[Gm]=!0,Fp.forEach(function(d){d!=="selectionchange"&&(BZ.has(d)||ub(d,!1,l),ub(d,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[Gm]||(c[Gm]=!0,ub("selectionchange",!1,c))}}function hT(l,c,d,g){switch(BT(c)){case 2:var y=g6;break;case 8:y=O6;break;default:y=Cb}d=y.bind(null,c,d,l),y=void 0,!Ny||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(y=!0),g?y!==void 0?l.addEventListener(c,d,{capture:!0,passive:y}):l.addEventListener(c,d,!0):y!==void 0?l.addEventListener(c,d,{passive:y}):l.addEventListener(c,d,!1)}function db(l,c,d,g,y){var b=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var $=g.tag;if($===3||$===4){var L=g.stateNode.containerInfo;if(L===y)break;if($===4)for($=g.return;$!==null;){var G=$.tag;if((G===3||G===4)&&$.stateNode.containerInfo===y)return;$=$.return}for(;L!==null;){if($=ba(L),$===null)return;if(G=$.tag,G===5||G===6||G===26||G===27){g=b=$;continue e}L=L.parentNode}}g=g.return}xQ(function(){var ie=b,ue=$y(d),he=[];e:{var se=YQ.get(l);if(se!==void 0){var le=lm,Se=l;switch(l){case"keypress":if(sm(d)===0)break e;case"keydown":case"keyup":le=MX;break;case"focusin":Se="focus",le=My;break;case"focusout":Se="blur",le=My;break;case"beforeblur":case"afterblur":le=My;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=bQ;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=wX;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=DX;break;case BQ:case qQ:case VQ:le=CX;break;case IQ:le=XX;break;case"scroll":case"scrollend":le=bX;break;case"wheel":le=BX;break;case"copy":case"cut":case"paste":le=TX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=wQ;break;case"toggle":case"beforetoggle":le=VX}var Ae=(c&4)!==0,Tt=!Ae&&(l==="scroll"||l==="scrollend"),te=Ae?se!==null?se+"Capture":null:se;Ae=[];for(var K=ie,re;K!==null;){var de=K;if(re=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||re===null||te===null||(de=kf(K,te),de!=null&&Ae.push(rd(K,de,re))),Tt)break;K=K.return}0<Ae.length&&(se=new le(se,Se,null,d,ue),he.push({event:se,listeners:Ae}))}}if((c&7)===0){e:{if(se=l==="mouseover"||l==="pointerover",le=l==="mouseout"||l==="pointerout",se&&d!==Ty&&(Se=d.relatedTarget||d.fromElement)&&(ba(Se)||Se[Qs]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Se=d.relatedTarget||d.toElement,le=ie,Se=Se?ba(Se):null,Se!==null&&(Tt=s(Se),Ae=Se.tag,Se!==Tt||Ae!==5&&Ae!==27&&Ae!==6)&&(Se=null)):(le=null,Se=ie),le!==Se)){if(Ae=bQ,de="onMouseLeave",te="onMouseEnter",K="mouse",(l==="pointerout"||l==="pointerover")&&(Ae=wQ,de="onPointerLeave",te="onPointerEnter",K="pointer"),Tt=le==null?se:wa(le),re=Se==null?se:wa(Se),se=new Ae(de,K+"leave",le,d,ue),se.target=Tt,se.relatedTarget=re,de=null,ba(ue)===ie&&(Ae=new Ae(te,K+"enter",Se,d,ue),Ae.target=re,Ae.relatedTarget=Tt,de=Ae),Tt=de,le&&Se)t:{for(Ae=qZ,te=le,K=Se,re=0,de=te;de;de=Ae(de))re++;de=0;for(var _e=K;_e;_e=Ae(_e))de++;for(;0<re-de;)te=Ae(te),re--;for(;0<de-re;)K=Ae(K),de--;for(;re--;){if(te===K||K!==null&&te===K.alternate){Ae=te;break t}te=Ae(te),K=Ae(K)}Ae=null}else Ae=null;le!==null&&pT(he,se,le,Ae,!1),Se!==null&&Tt!==null&&pT(he,Tt,Se,Ae,!0)}}e:{if(se=ie?wa(ie):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var ct=NQ;else if($Q(se))if(PQ)ct=eZ;else{ct=KX;var Ce=FX}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&jy(ie.elementType)&&(ct=NQ):ct=JX;if(ct&&(ct=ct(l,ie))){_Q(he,ct,d,ue);break e}Ce&&Ce(l,se,ie),l==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&wf(se,"number",se.value)}switch(Ce=ie?wa(ie):window,l){case"focusin":($Q(Ce)||Ce.contentEditable==="true")&&(cc=Ce,Zy=ie,Pf=null);break;case"focusout":Pf=Zy=cc=null;break;case"mousedown":By=!0;break;case"contextmenu":case"mouseup":case"dragend":By=!1,XQ(he,d,ue);break;case"selectionchange":if(nZ)break;case"keydown":case"keyup":XQ(he,d,ue)}var Ye;if(zy)e:{switch(l){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else oc?jQ(l,d)&&(et="onCompositionEnd"):l==="keydown"&&d.keyCode===229&&(et="onCompositionStart");et&&(kQ&&d.locale!=="ko"&&(oc||et!=="onCompositionStart"?et==="onCompositionEnd"&&oc&&(Ye=yQ()):(ja=ue,Py="value"in ja?ja.value:ja.textContent,oc=!0)),Ce=Fm(ie,et),0<Ce.length&&(et=new SQ(et,l,null,d,ue),he.push({event:et,listeners:Ce}),Ye?et.data=Ye:(Ye=TQ(d),Ye!==null&&(et.data=Ye)))),(Ye=YX?UX(l,d):WX(l,d))&&(et=Fm(ie,"onBeforeInput"),0<et.length&&(Ce=new SQ("onBeforeInput","beforeinput",null,d,ue),he.push({event:Ce,listeners:et}),Ce.data=Ye)),LZ(he,l,ie,d,ue)}dT(he,c)})}function rd(l,c,d){return{instance:l,listener:c,currentTarget:d}}function Fm(l,c){for(var d=c+"Capture",g=[];l!==null;){var y=l,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=kf(l,d),y!=null&&g.unshift(rd(l,y,b)),y=kf(l,c),y!=null&&g.push(rd(l,y,b))),l.tag===3)return g;l=l.return}return[]}function qZ(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function pT(l,c,d,g,y){for(var b=c._reactName,$=[];d!==null&&d!==g;){var L=d,G=L.alternate,ie=L.stateNode;if(L=L.tag,G!==null&&G===g)break;L!==5&&L!==26&&L!==27||ie===null||(G=ie,y?(ie=kf(d,b),ie!=null&&$.unshift(rd(d,ie,G))):y||(ie=kf(d,b),ie!=null&&$.push(rd(d,ie,G)))),d=d.return}$.length!==0&&l.push({event:c,listeners:$})}var VZ=/\r\n?/g,IZ=/\u0000|\uFFFD/g;function mT(l){return(typeof l=="string"?l:""+l).replace(VZ,`
49
+ `).replace(IZ,"")}function gT(l,c){return c=mT(c),mT(l)===c}function jt(l,c,d,g,y,b){switch(d){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||sc(l,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&sc(l,""+g);break;case"className":ic(l,"class",g);break;case"tabIndex":ic(l,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":ic(l,d,g);break;case"style":gQ(l,g,b);break;case"data":if(c!=="object"){ic(l,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||d!=="href")){l.removeAttribute(d);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){l.removeAttribute(d);break}g=rm(""+g),l.setAttribute(d,g);break;case"action":case"formAction":if(typeof g=="function"){l.setAttribute(d,"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 b=="function"&&(d==="formAction"?(c!=="input"&&jt(l,c,"name",y.name,y,null),jt(l,c,"formEncType",y.formEncType,y,null),jt(l,c,"formMethod",y.formMethod,y,null),jt(l,c,"formTarget",y.formTarget,y,null)):(jt(l,c,"encType",y.encType,y,null),jt(l,c,"method",y.method,y,null),jt(l,c,"target",y.target,y,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){l.removeAttribute(d);break}g=rm(""+g),l.setAttribute(d,g);break;case"onClick":g!=null&&(l.onclick=Ts);break;case"onScroll":g!=null&&Fe("scroll",l);break;case"onScrollEnd":g!=null&&Fe("scrollend",l);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(y.children!=null)throw Error(r(60));l.innerHTML=d}}break;case"multiple":l.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":l.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){l.removeAttribute("xlink:href");break}d=rm(""+g),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?l.setAttribute(d,""+g):l.removeAttribute(d);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":g&&typeof g!="function"&&typeof g!="symbol"?l.setAttribute(d,""):l.removeAttribute(d);break;case"capture":case"download":g===!0?l.setAttribute(d,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?l.setAttribute(d,g):l.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?l.setAttribute(d,g):l.removeAttribute(d);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?l.removeAttribute(d):l.setAttribute(d,g);break;case"popover":Fe("beforetoggle",l),Fe("toggle",l),rc(l,"popover",g);break;case"xlinkActuate":wi(l,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":wi(l,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":wi(l,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":wi(l,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":wi(l,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":wi(l,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":wi(l,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":wi(l,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":wi(l,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":rc(l,"is",g);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=yX.get(d)||d,rc(l,d,g))}}function hb(l,c,d,g,y,b){switch(d){case"style":gQ(l,g,b);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(y.children!=null)throw Error(r(60));l.innerHTML=d}}break;case"children":typeof g=="string"?sc(l,g):(typeof g=="number"||typeof g=="bigint")&&sc(l,""+g);break;case"onScroll":g!=null&&Fe("scroll",l);break;case"onScrollEnd":g!=null&&Fe("scrollend",l);break;case"onClick":g!=null&&(l.onclick=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kp.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(y=d.endsWith("Capture"),c=d.slice(2,y?d.length-7:void 0),b=l[Dn]||null,b=b!=null?b[d]:null,typeof b=="function"&&l.removeEventListener(c,b,y),typeof g=="function")){typeof b!="function"&&b!==null&&(d in l?l[d]=null:l.hasAttribute(d)&&l.removeAttribute(d)),l.addEventListener(c,g,y);break e}d in l?l[d]=g:g===!0?l.setAttribute(d,""):rc(l,d,g)}}}function Nn(l,c,d){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",l),Fe("load",l);var g=!1,y=!1,b;for(b in d)if(d.hasOwnProperty(b)){var $=d[b];if($!=null)switch(b){case"src":g=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:jt(l,c,b,$,d,null)}}y&&jt(l,c,"srcSet",d.srcSet,d,null),g&&jt(l,c,"src",d.src,d,null);return;case"input":Fe("invalid",l);var L=b=$=y=null,G=null,ie=null;for(g in d)if(d.hasOwnProperty(g)){var ue=d[g];if(ue!=null)switch(g){case"name":y=ue;break;case"type":$=ue;break;case"checked":G=ue;break;case"defaultChecked":ie=ue;break;case"value":b=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,c));break;default:jt(l,c,g,ue,d,null)}}nm(l,b,L,G,ie,$,y,!1);return;case"select":Fe("invalid",l),g=$=b=null;for(y in d)if(d.hasOwnProperty(y)&&(L=d[y],L!=null))switch(y){case"value":b=L;break;case"defaultValue":$=L;break;case"multiple":g=L;default:jt(l,c,y,L,d,null)}c=b,d=$,l.multiple=!!g,c!=null?js(l,!!g,c,!1):d!=null&&js(l,!!g,d,!0);return;case"textarea":Fe("invalid",l),b=y=g=null;for($ in d)if(d.hasOwnProperty($)&&(L=d[$],L!=null))switch($){case"value":g=L;break;case"defaultValue":y=L;break;case"children":b=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:jt(l,c,$,L,d,null)}pQ(l,g,y,b);return;case"option":for(G in d)if(d.hasOwnProperty(G)&&(g=d[G],g!=null))switch(G){case"selected":l.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:jt(l,c,G,g,d,null)}return;case"dialog":Fe("beforetoggle",l),Fe("toggle",l),Fe("cancel",l),Fe("close",l);break;case"iframe":case"object":Fe("load",l);break;case"video":case"audio":for(g=0;g<nd.length;g++)Fe(nd[g],l);break;case"image":Fe("error",l),Fe("load",l);break;case"details":Fe("toggle",l);break;case"embed":case"source":case"link":Fe("error",l),Fe("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in d)if(d.hasOwnProperty(ie)&&(g=d[ie],g!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:jt(l,c,ie,g,d,null)}return;default:if(jy(c)){for(ue in d)d.hasOwnProperty(ue)&&(g=d[ue],g!==void 0&&hb(l,c,ue,g,d,void 0));return}}for(L in d)d.hasOwnProperty(L)&&(g=d[L],g!=null&&jt(l,c,L,g,d,null))}function YZ(l,c,d,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,$=null,L=null,G=null,ie=null,ue=null;for(le in d){var he=d[le];if(d.hasOwnProperty(le)&&he!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":G=he;default:g.hasOwnProperty(le)||jt(l,c,le,null,g,he)}}for(var se in g){var le=g[se];if(he=d[se],g.hasOwnProperty(se)&&(le!=null||he!=null))switch(se){case"type":b=le;break;case"name":y=le;break;case"checked":ie=le;break;case"defaultChecked":ue=le;break;case"value":$=le;break;case"defaultValue":L=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:le!==he&&jt(l,c,se,le,g,he)}}Al(l,$,L,G,ie,ue,b,y);return;case"select":le=$=L=se=null;for(b in d)if(G=d[b],d.hasOwnProperty(b)&&G!=null)switch(b){case"value":break;case"multiple":le=G;default:g.hasOwnProperty(b)||jt(l,c,b,null,g,G)}for(y in g)if(b=g[y],G=d[y],g.hasOwnProperty(y)&&(b!=null||G!=null))switch(y){case"value":se=b;break;case"defaultValue":L=b;break;case"multiple":$=b;default:b!==G&&jt(l,c,y,b,g,G)}c=L,d=$,g=le,se!=null?js(l,!!d,se,!1):!!g!=!!d&&(c!=null?js(l,!!d,c,!0):js(l,!!d,d?[]:"",!1));return;case"textarea":le=se=null;for(L in d)if(y=d[L],d.hasOwnProperty(L)&&y!=null&&!g.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:jt(l,c,L,null,g,y)}for($ in g)if(y=g[$],b=d[$],g.hasOwnProperty($)&&(y!=null||b!=null))switch($){case"value":se=y;break;case"defaultValue":le=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==b&&jt(l,c,$,y,g,b)}hQ(l,se,le);return;case"option":for(var Se in d)if(se=d[Se],d.hasOwnProperty(Se)&&se!=null&&!g.hasOwnProperty(Se))switch(Se){case"selected":l.selected=!1;break;default:jt(l,c,Se,null,g,se)}for(G in g)if(se=g[G],le=d[G],g.hasOwnProperty(G)&&se!==le&&(se!=null||le!=null))switch(G){case"selected":l.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:jt(l,c,G,se,g,le)}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 Ae in d)se=d[Ae],d.hasOwnProperty(Ae)&&se!=null&&!g.hasOwnProperty(Ae)&&jt(l,c,Ae,null,g,se);for(ie in g)if(se=g[ie],le=d[ie],g.hasOwnProperty(ie)&&se!==le&&(se!=null||le!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,c));break;default:jt(l,c,ie,se,g,le)}return;default:if(jy(c)){for(var Tt in d)se=d[Tt],d.hasOwnProperty(Tt)&&se!==void 0&&!g.hasOwnProperty(Tt)&&hb(l,c,Tt,void 0,g,se);for(ue in g)se=g[ue],le=d[ue],!g.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||hb(l,c,ue,se,g,le);return}}for(var te in d)se=d[te],d.hasOwnProperty(te)&&se!=null&&!g.hasOwnProperty(te)&&jt(l,c,te,null,g,se);for(he in g)se=g[he],le=d[he],!g.hasOwnProperty(he)||se===le||se==null&&le==null||jt(l,c,he,se,g,le)}function OT(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UZ(){if(typeof performance.getEntriesByType=="function"){for(var l=0,c=0,d=performance.getEntriesByType("resource"),g=0;g<d.length;g++){var y=d[g],b=y.transferSize,$=y.initiatorType,L=y.duration;if(b&&L&&OT($)){for($=0,L=y.responseEnd,g+=1;g<d.length;g++){var G=d[g],ie=G.startTime;if(ie>L)break;var ue=G.transferSize,he=G.initiatorType;ue&&OT(he)&&(G=G.responseEnd,$+=ue*(G<L?1:(L-ie)/(G-ie)))}if(--g,c+=8*(b+$)/(y.duration/1e3),l++,10<l)break}}if(0<l)return c/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var pb=null,mb=null;function Km(l){return l.nodeType===9?l:l.ownerDocument}function xT(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yT(l,c){if(l===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&c==="foreignObject"?0:l}function gb(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Ob=null;function WZ(){var l=window.event;return l&&l.type==="popstate"?l===Ob?!1:(Ob=l,!0):(Ob=null,!1)}var vT=typeof setTimeout=="function"?setTimeout:void 0,HZ=typeof clearTimeout=="function"?clearTimeout:void 0,bT=typeof Promise=="function"?Promise:void 0,GZ=typeof queueMicrotask=="function"?queueMicrotask:typeof bT<"u"?function(l){return bT.resolve(null).then(l).catch(FZ)}:vT;function FZ(l){setTimeout(function(){throw l})}function Va(l){return l==="head"}function ST(l,c){var d=c,g=0;do{var y=d.nextSibling;if(l.removeChild(d),y&&y.nodeType===8)if(d=y.data,d==="/$"||d==="/&"){if(g===0){l.removeChild(y),Rc(c);return}g--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")g++;else if(d==="html")id(l.ownerDocument.documentElement);else if(d==="head"){d=l.ownerDocument.head,id(d);for(var b=d.firstChild;b;){var $=b.nextSibling,L=b.nodeName;b[Pl]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&b.rel.toLowerCase()==="stylesheet"||d.removeChild(b),b=$}}else d==="body"&&id(l.ownerDocument.body);d=y}while(d);Rc(c)}function wT(l,c){var d=l;l=0;do{var g=d.nextSibling;if(d.nodeType===1?c?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(c?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(l===0)break;l--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||l++;d=g}while(d)}function xb(l){var c=l.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var d=c;switch(c=c.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":xb(d),bf(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}l.removeChild(d)}}function KZ(l,c,d,g){for(;l.nodeType===1;){var y=d;if(l.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(g){if(!l[Pl])switch(c){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(b=l.getAttribute("rel"),b==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(b!==y.rel||l.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||l.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||l.getAttribute("title")!==(y.title==null?null:y.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(b=l.getAttribute("src"),(b!==(y.src==null?null:y.src)||l.getAttribute("type")!==(y.type==null?null:y.type)||l.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(c==="input"&&l.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&l.getAttribute("name")===b)return l}else return l;if(l=ti(l.nextSibling),l===null)break}return null}function JZ(l,c,d){if(c==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!d||(l=ti(l.nextSibling),l===null))return null;return l}function kT(l,c){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!c||(l=ti(l.nextSibling),l===null))return null;return l}function yb(l){return l.data==="$?"||l.data==="$~"}function vb(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function e6(l,c){var d=l.ownerDocument;if(l.data==="$~")l._reactRetry=c;else if(l.data!=="$?"||d.readyState!=="loading")c();else{var g=function(){c(),d.removeEventListener("DOMContentLoaded",g)};d.addEventListener("DOMContentLoaded",g),l._reactRetry=g}}function ti(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return l}var bb=null;function QT(l){l=l.nextSibling;for(var c=0;l;){if(l.nodeType===8){var d=l.data;if(d==="/$"||d==="/&"){if(c===0)return ti(l.nextSibling);c--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||c++}l=l.nextSibling}return null}function CT(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var d=l.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(c===0)return l;c--}else d!=="/$"&&d!=="/&"||c++}l=l.previousSibling}return null}function jT(l,c,d){switch(c=Km(d),l){case"html":if(l=c.documentElement,!l)throw Error(r(452));return l;case"head":if(l=c.head,!l)throw Error(r(453));return l;case"body":if(l=c.body,!l)throw Error(r(454));return l;default:throw Error(r(451))}}function id(l){for(var c=l.attributes;c.length;)l.removeAttributeNode(c[0]);bf(l)}var ni=new Map,TT=new Set;function Jm(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var Vs=z.d;z.d={f:t6,r:n6,D:r6,C:i6,L:s6,m:a6,X:o6,S:l6,M:c6};function t6(){var l=Vs.f(),c=Vm();return l||c}function n6(l){var c=Sa(l);c!==null&&c.tag===5&&c.type==="form"?IC(c):Vs.r(l)}var Ec=typeof document>"u"?null:document;function $T(l,c,d){var g=Ec;if(g&&typeof c=="string"&&c){var y=lr(c);y='link[rel="'+l+'"][href="'+y+'"]',typeof d=="string"&&(y+='[crossorigin="'+d+'"]'),TT.has(y)||(TT.add(y),l={rel:l,crossOrigin:d,href:c},g.querySelector(y)===null&&(c=g.createElement("link"),Nn(c,"link",l),ln(c),g.head.appendChild(c)))}}function r6(l){Vs.D(l),$T("dns-prefetch",l,null)}function i6(l,c){Vs.C(l,c),$T("preconnect",l,c)}function s6(l,c,d){Vs.L(l,c,d);var g=Ec;if(g&&l&&c){var y='link[rel="preload"][as="'+lr(c)+'"]';c==="image"&&d&&d.imageSrcSet?(y+='[imagesrcset="'+lr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(y+='[imagesizes="'+lr(d.imageSizes)+'"]')):y+='[href="'+lr(l)+'"]';var b=y;switch(c){case"style":b=Ac(l);break;case"script":b=Mc(l)}ni.has(b)||(l=m({rel:"preload",href:c==="image"&&d&&d.imageSrcSet?void 0:l,as:c},d),ni.set(b,l),g.querySelector(y)!==null||c==="style"&&g.querySelector(sd(b))||c==="script"&&g.querySelector(ad(b))||(c=g.createElement("link"),Nn(c,"link",l),ln(c),g.head.appendChild(c)))}}function a6(l,c){Vs.m(l,c);var d=Ec;if(d&&l){var g=c&&typeof c.as=="string"?c.as:"script",y='link[rel="modulepreload"][as="'+lr(g)+'"][href="'+lr(l)+'"]',b=y;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Mc(l)}if(!ni.has(b)&&(l=m({rel:"modulepreload",href:l},c),ni.set(b,l),d.querySelector(y)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(ad(b)))return}g=d.createElement("link"),Nn(g,"link",l),ln(g),d.head.appendChild(g)}}}function l6(l,c,d){Vs.S(l,c,d);var g=Ec;if(g&&l){var y=ka(g).hoistableStyles,b=Ac(l);c=c||"default";var $=y.get(b);if(!$){var L={loading:0,preload:null};if($=g.querySelector(sd(b)))L.loading=5;else{l=m({rel:"stylesheet",href:l,"data-precedence":c},d),(d=ni.get(b))&&Sb(l,d);var G=$=g.createElement("link");ln(G),Nn(G,"link",l),G._p=new Promise(function(ie,ue){G.onload=ie,G.onerror=ue}),G.addEventListener("load",function(){L.loading|=1}),G.addEventListener("error",function(){L.loading|=2}),L.loading|=4,eg($,c,g)}$={type:"stylesheet",instance:$,count:1,state:L},y.set(b,$)}}}function o6(l,c){Vs.X(l,c);var d=Ec;if(d&&l){var g=ka(d).hoistableScripts,y=Mc(l),b=g.get(y);b||(b=d.querySelector(ad(y)),b||(l=m({src:l,async:!0},c),(c=ni.get(y))&&wb(l,c),b=d.createElement("script"),ln(b),Nn(b,"link",l),d.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},g.set(y,b))}}function c6(l,c){Vs.M(l,c);var d=Ec;if(d&&l){var g=ka(d).hoistableScripts,y=Mc(l),b=g.get(y);b||(b=d.querySelector(ad(y)),b||(l=m({src:l,async:!0,type:"module"},c),(c=ni.get(y))&&wb(l,c),b=d.createElement("script"),ln(b),Nn(b,"link",l),d.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},g.set(y,b))}}function _T(l,c,d,g){var y=(y=ne.current)?Jm(y):null;if(!y)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(c=Ac(d.href),d=ka(y).hoistableStyles,g=d.get(c),g||(g={type:"style",instance:null,count:0,state:null},d.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){l=Ac(d.href);var b=ka(y).hoistableStyles,$=b.get(l);if($||(y=y.ownerDocument||y,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(l,$),(b=y.querySelector(sd(l)))&&!b._p&&($.instance=b,$.state.loading=5),ni.has(l)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},ni.set(l,d),b||u6(y,l,d,$.state))),c&&g===null)throw Error(r(528,""));return $}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=d.async,d=d.src,typeof d=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Mc(d),d=ka(y).hoistableScripts,g=d.get(c),g||(g={type:"script",instance:null,count:0,state:null},d.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function Ac(l){return'href="'+lr(l)+'"'}function sd(l){return'link[rel="stylesheet"]['+l+"]"}function NT(l){return m({},l,{"data-precedence":l.precedence,precedence:null})}function u6(l,c,d,g){l.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=l.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),Nn(c,"link",d),ln(c),l.head.appendChild(c))}function Mc(l){return'[src="'+lr(l)+'"]'}function ad(l){return"script[async]"+l}function PT(l,c,d){if(c.count++,c.instance===null)switch(c.type){case"style":var g=l.querySelector('style[data-href~="'+lr(d.href)+'"]');if(g)return c.instance=g,ln(g),g;var y=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return g=(l.ownerDocument||l).createElement("style"),ln(g),Nn(g,"style",y),eg(g,d.precedence,l),c.instance=g;case"stylesheet":y=Ac(d.href);var b=l.querySelector(sd(y));if(b)return c.state.loading|=4,c.instance=b,ln(b),b;g=NT(d),(y=ni.get(y))&&Sb(g,y),b=(l.ownerDocument||l).createElement("link"),ln(b);var $=b;return $._p=new Promise(function(L,G){$.onload=L,$.onerror=G}),Nn(b,"link",g),c.state.loading|=4,eg(b,d.precedence,l),c.instance=b;case"script":return b=Mc(d.src),(y=l.querySelector(ad(b)))?(c.instance=y,ln(y),y):(g=d,(y=ni.get(b))&&(g=m({},d),wb(g,y)),l=l.ownerDocument||l,y=l.createElement("script"),ln(y),Nn(y,"link",g),l.head.appendChild(y),c.instance=y);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,eg(g,d.precedence,l));return c.instance}function eg(l,c,d){for(var g=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=g.length?g[g.length-1]:null,b=y,$=0;$<g.length;$++){var L=g[$];if(L.dataset.precedence===c)b=L;else if(b!==y)break}b?b.parentNode.insertBefore(l,b.nextSibling):(c=d.nodeType===9?d.head:d,c.insertBefore(l,c.firstChild))}function Sb(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.title==null&&(l.title=c.title)}function wb(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.integrity==null&&(l.integrity=c.integrity)}var tg=null;function ET(l,c,d){if(tg===null){var g=new Map,y=tg=new Map;y.set(d,g)}else y=tg,g=y.get(d),g||(g=new Map,y.set(d,g));if(g.has(l))return g;for(g.set(l,null),d=d.getElementsByTagName(l),y=0;y<d.length;y++){var b=d[y];if(!(b[Pl]||b[On]||l==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var $=b.getAttribute(c)||"";$=l+$;var L=g.get($);L?L.push(b):g.set($,[b])}}return g}function AT(l,c,d){l=l.ownerDocument||l,l.head.insertBefore(d,c==="title"?l.querySelector("head > title"):null)}function f6(l,c,d){if(d===1||c.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return l=c.disabled,typeof c.precedence=="string"&&l==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function MT(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function d6(l,c,d,g){if(d.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var y=Ac(g.href),b=c.querySelector(sd(y));if(b){c=b._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(l.count++,l=ng.bind(l),c.then(l,l)),d.state.loading|=4,d.instance=b,ln(b);return}b=c.ownerDocument||c,g=NT(g),(y=ni.get(y))&&Sb(g,y),b=b.createElement("link"),ln(b);var $=b;$._p=new Promise(function(L,G){$.onload=L,$.onerror=G}),Nn(b,"link",g),d.instance=b}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(d,c),(c=d.state.preload)&&(d.state.loading&3)===0&&(l.count++,d=ng.bind(l),c.addEventListener("load",d),c.addEventListener("error",d))}}var kb=0;function h6(l,c){return l.stylesheets&&l.count===0&&ig(l,l.stylesheets),0<l.count||0<l.imgCount?function(d){var g=setTimeout(function(){if(l.stylesheets&&ig(l,l.stylesheets),l.unsuspend){var b=l.unsuspend;l.unsuspend=null,b()}},6e4+c);0<l.imgBytes&&kb===0&&(kb=62500*UZ());var y=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&ig(l,l.stylesheets),l.unsuspend)){var b=l.unsuspend;l.unsuspend=null,b()}},(l.imgBytes>kb?50:800)+c);return l.unsuspend=d,function(){l.unsuspend=null,clearTimeout(g),clearTimeout(y)}}:null}function ng(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ig(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var rg=null;function ig(l,c){l.stylesheets=null,l.unsuspend!==null&&(l.count++,rg=new Map,c.forEach(p6,l),rg=null,ng.call(l))}function p6(l,c){if(!(c.state.loading&4)){var d=rg.get(l);if(d)var g=d.get(null);else{d=new Map,rg.set(l,d);for(var y=l.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var $=y[b];($.nodeName==="LINK"||$.getAttribute("media")!=="not all")&&(d.set($.dataset.precedence,$),g=$)}g&&d.set(null,g)}y=c.instance,$=y.getAttribute("data-precedence"),b=d.get($)||g,b===g&&d.set(null,y),d.set($,y),this.count++,g=ng.bind(this),y.addEventListener("load",g),y.addEventListener("error",g),b?b.parentNode.insertBefore(y,b.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(y,l.firstChild)),c.state.loading|=4}}var ld={$$typeof:Q,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function m6(l,c,d,g,y,b,$,L,G){this.tag=1,this.containerInfo=l,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=xf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xf(0),this.hiddenUpdates=xf(null),this.identifierPrefix=g,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function RT(l,c,d,g,y,b,$,L,G,ie,ue,he){return l=new m6(l,c,d,$,G,ie,ue,he,L),c=1,b===!0&&(c|=24),b=$r(3,null,null,c),l.current=b,b.stateNode=l,c=rv(),c.refCount++,l.pooledCache=c,c.refCount++,b.memoizedState={element:g,isDehydrated:d,cache:c},lv(b),l}function zT(l){return l?(l=dc,l):dc}function DT(l,c,d,g,y,b){y=zT(y),g.context===null?g.context=y:g.pendingContext=y,g=Ea(c),g.payload={element:d},b=b===void 0?null:b,b!==null&&(g.callback=b),d=Aa(l,g,c),d!==null&&(hr(d,l,c),Lf(d,l,c))}function LT(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var d=l.retryLane;l.retryLane=d!==0&&d<c?d:c}}function Qb(l,c){LT(l,c),(l=l.alternate)&&LT(l,c)}function XT(l){if(l.tag===13||l.tag===31){var c=Dl(l,67108864);c!==null&&hr(c,l,67108864),Qb(l,67108864)}}function ZT(l){if(l.tag===13||l.tag===31){var c=Ar();c=yf(c);var d=Dl(l,c);d!==null&&hr(d,l,c),Qb(l,c)}}var sg=!0;function g6(l,c,d,g){var y=R.T;R.T=null;var b=z.p;try{z.p=2,Cb(l,c,d,g)}finally{z.p=b,R.T=y}}function O6(l,c,d,g){var y=R.T;R.T=null;var b=z.p;try{z.p=8,Cb(l,c,d,g)}finally{z.p=b,R.T=y}}function Cb(l,c,d,g){if(sg){var y=jb(g);if(y===null)db(l,c,g,ag,d),qT(l,g);else if(y6(y,l,c,d,g))g.stopPropagation();else if(qT(l,g),c&4&&-1<x6.indexOf(l)){for(;y!==null;){var b=Sa(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var $=ks(b.pendingLanes);if($!==0){var L=b;for(L.pendingLanes|=2,L.entangledLanes|=2;$;){var G=1<<31-ot($);L.entanglements[1]|=G,$&=~G}Wi(b),(pt&6)===0&&(Bm=en()+500,td(0))}}break;case 31:case 13:L=Dl(b,2),L!==null&&hr(L,b,2),Vm(),Qb(b,2)}if(b=jb(g),b===null&&db(l,c,g,ag,d),b===y)break;y=b}y!==null&&g.stopPropagation()}else db(l,c,g,null,d)}}function jb(l){return l=$y(l),Tb(l)}var ag=null;function Tb(l){if(ag=null,l=ba(l),l!==null){var c=s(l);if(c===null)l=null;else{var d=c.tag;if(d===13){if(l=a(c),l!==null)return l;l=null}else if(d===31){if(l=o(c),l!==null)return l;l=null}else if(d===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null)}}return ag=l,null}function BT(l){switch(l){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(Si()){case ce:return 2;case ge:return 8;case Ne:case Be:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var $b=!1,Ia=null,Ya=null,Ua=null,od=new Map,cd=new Map,Wa=[],x6="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 qT(l,c){switch(l){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":Ya=null;break;case"mouseover":case"mouseout":Ua=null;break;case"pointerover":case"pointerout":od.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":cd.delete(c.pointerId)}}function ud(l,c,d,g,y,b){return l===null||l.nativeEvent!==b?(l={blockedOn:c,domEventName:d,eventSystemFlags:g,nativeEvent:b,targetContainers:[y]},c!==null&&(c=Sa(c),c!==null&&XT(c)),l):(l.eventSystemFlags|=g,c=l.targetContainers,y!==null&&c.indexOf(y)===-1&&c.push(y),l)}function y6(l,c,d,g,y){switch(c){case"focusin":return Ia=ud(Ia,l,c,d,g,y),!0;case"dragenter":return Ya=ud(Ya,l,c,d,g,y),!0;case"mouseover":return Ua=ud(Ua,l,c,d,g,y),!0;case"pointerover":var b=y.pointerId;return od.set(b,ud(od.get(b)||null,l,c,d,g,y)),!0;case"gotpointercapture":return b=y.pointerId,cd.set(b,ud(cd.get(b)||null,l,c,d,g,y)),!0}return!1}function VT(l){var c=ba(l.target);if(c!==null){var d=s(c);if(d!==null){if(c=d.tag,c===13){if(c=a(d),c!==null){l.blockedOn=c,Wp(l.priority,function(){ZT(d)});return}}else if(c===31){if(c=o(d),c!==null){l.blockedOn=c,Wp(l.priority,function(){ZT(d)});return}}else if(c===3&&d.stateNode.current.memoizedState.isDehydrated){l.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}l.blockedOn=null}function lg(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var d=jb(l.nativeEvent);if(d===null){d=l.nativeEvent;var g=new d.constructor(d.type,d);Ty=g,d.target.dispatchEvent(g),Ty=null}else return c=Sa(d),c!==null&&XT(c),l.blockedOn=d,!1;c.shift()}return!0}function IT(l,c,d){lg(l)&&d.delete(c)}function v6(){$b=!1,Ia!==null&&lg(Ia)&&(Ia=null),Ya!==null&&lg(Ya)&&(Ya=null),Ua!==null&&lg(Ua)&&(Ua=null),od.forEach(IT),cd.forEach(IT)}function og(l,c){l.blockedOn===c&&(l.blockedOn=null,$b||($b=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,v6)))}var cg=null;function YT(l){cg!==l&&(cg=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){cg===l&&(cg=null);for(var c=0;c<l.length;c+=3){var d=l[c],g=l[c+1],y=l[c+2];if(typeof g!="function"){if(Tb(g||d)===null)continue;break}var b=Sa(d);b!==null&&(l.splice(c,3),c-=3,jv(b,{pending:!0,data:y,method:d.method,action:g},g,y))}}))}function Rc(l){function c(G){return og(G,l)}Ia!==null&&og(Ia,l),Ya!==null&&og(Ya,l),Ua!==null&&og(Ua,l),od.forEach(c),cd.forEach(c);for(var d=0;d<Wa.length;d++){var g=Wa[d];g.blockedOn===l&&(g.blockedOn=null)}for(;0<Wa.length&&(d=Wa[0],d.blockedOn===null);)VT(d),d.blockedOn===null&&Wa.shift();if(d=(l.ownerDocument||l).$$reactFormReplay,d!=null)for(g=0;g<d.length;g+=3){var y=d[g],b=d[g+1],$=y[Dn]||null;if(typeof b=="function")$||YT(d);else if($){var L=null;if(b&&b.hasAttribute("formAction")){if(y=b,$=b[Dn]||null)L=$.formAction;else if(Tb(y)!==null)continue}else L=$.action;typeof L=="function"?d[g+1]=L:(d.splice(g,3),g-=3),YT(d)}}}function UT(){function l(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function($){return y=$})},focusReset:"manual",scroll:"manual"})}function c(){y!==null&&(y(),y=null),g||setTimeout(d,20)}function d(){if(!g&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,y=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(d,100),function(){g=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),y!==null&&(y(),y=null)}}}function _b(l){this._internalRoot=l}ug.prototype.render=_b.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(r(409));var d=c.current,g=Ar();DT(d,g,l,c,null,null)},ug.prototype.unmount=_b.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;DT(l.current,2,null,l,null,null),Vm(),c[Qs]=null}};function ug(l){this._internalRoot=l}ug.prototype.unstable_scheduleHydration=function(l){if(l){var c=Up();l={blockedOn:null,target:l,priority:c};for(var d=0;d<Wa.length&&c!==0&&c<Wa[d].priority;d++);Wa.splice(d,0,l),d===0&&VT(l)}};var WT=e.version;if(WT!=="19.2.4")throw Error(r(527,WT,"19.2.4"));z.findDOMNode=function(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=f(c),l=l!==null?h(l):null,l=l===null?null:l.stateNode,l};var b6={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fg.isDisabled&&fg.supportsFiber)try{kt=fg.inject(b6),Qt=fg}catch{}}return dd.createRoot=function(l,c){if(!i(l))throw Error(r(299));var d=!1,g="",y=tj,b=nj,$=rj;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(b=c.onCaughtError),c.onRecoverableError!==void 0&&($=c.onRecoverableError)),c=RT(l,1,!1,null,null,d,g,null,y,b,$,UT),l[Qs]=c.current,fb(l),new _b(c)},dd.hydrateRoot=function(l,c,d){if(!i(l))throw Error(r(299));var g=!1,y="",b=tj,$=nj,L=rj,G=null;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(y=d.identifierPrefix),d.onUncaughtError!==void 0&&(b=d.onUncaughtError),d.onCaughtError!==void 0&&($=d.onCaughtError),d.onRecoverableError!==void 0&&(L=d.onRecoverableError),d.formState!==void 0&&(G=d.formState)),c=RT(l,1,!0,c,d??null,g,y,G,b,$,L,UT),c.context=zT(null),d=c.current,g=Ar(),g=yf(g),y=Ea(g),y.callback=null,Aa(d,y,g),d=g,c.current.lanes=d,Nl(c,d),Wi(c),l[Qs]=c.current,fb(l),new ug(c)},dd.version="19.2.4",dd}var s$;function _6(){if(s$)return Ab.exports;s$=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ab.exports=$6(),Ab.exports}var N6=_6();/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var a$="popstate";function l$(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function P6(t={}){function e(r,i){var f;let s=(f=i.state)==null?void 0:f.masked,{pathname:a,search:o,hash:u}=s||r.location;return o1("",{pathname:a,search:o,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:ph(i)}return A6(e,n,null,t)}function It(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ri(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function E6(){return Math.random().toString(36).substring(2,10)}function o$(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function o1(t,e,n=null,r,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Ku(e):e,state:n,key:e&&e.key||r||E6(),unstable_mask:i}}function ph({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ku(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function A6(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o="POP",u=null,f=h();f==null&&(f=0,a.replaceState({...a.state,idx:f},""));function h(){return(a.state||{idx:null}).idx}function m(){o="POP";let k=h(),w=k==null?null:k-f;f=k,u&&u({action:o,location:S.location,delta:w})}function O(k,w){o="PUSH";let j=l$(k)?k:o1(S.location,k,w);f=h()+1;let Q=o$(j,f),T=S.createHref(j.unstable_mask||j);try{a.pushState(Q,"",T)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(T)}s&&u&&u({action:o,location:S.location,delta:1})}function x(k,w){o="REPLACE";let j=l$(k)?k:o1(S.location,k,w);f=h();let Q=o$(j,f),T=S.createHref(j.unstable_mask||j);a.replaceState(Q,"",T),s&&u&&u({action:o,location:S.location,delta:0})}function v(k){return M6(k)}let S={get action(){return o},get location(){return t(i,a)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(a$,m),u=k,()=>{i.removeEventListener(a$,m),u=null}},createHref(k){return e(i,k)},createURL:v,encodeLocation(k){let w=v(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:O,replace:x,go(k){return a.go(k)}};return S}function M6(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),It(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:ph(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function mA(t,e,n="/"){return R6(t,e,n,!1)}function R6(t,e,n,r){let i=typeof e=="string"?Ku(e):e,s=ca(i.pathname||"/",n);if(s==null)return null;let a=gA(t);z6(a);let o=null;for(let u=0;o==null&&u<a.length;++u){let f=W6(s);o=Y6(a[u],f,r)}return o}function gA(t,e=[],n=[],r="",i=!1){let s=(a,o,u=i,f)=>{let h={relativePath:f===void 0?a.path||"":f,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&u)return;It(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let m=ps([r,h.relativePath]),O=n.concat(h);a.children&&a.children.length>0&&(It(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),gA(a.children,e,O,m,u)),!(a.path==null&&!a.index)&&e.push({path:m,score:V6(m,a.index),routesMeta:O})};return t.forEach((a,o)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))s(a,o);else for(let f of OA(a.path))s(a,o,!0,f)}),e}function OA(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=OA(r.join("/")),o=[];return o.push(...a.map(u=>u===""?s:[s,u].join("/"))),i&&o.push(...a),o.map(u=>t.startsWith("/")&&u===""?"/":u)}function z6(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:I6(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var D6=/^:[\w-]+$/,L6=3,X6=2,Z6=1,B6=10,q6=-2,c$=t=>t==="*";function V6(t,e){let n=t.split("/"),r=n.length;return n.some(c$)&&(r+=q6),e&&(r+=X6),n.filter(i=>!c$(i)).reduce((i,s)=>i+(D6.test(s)?L6:s===""?Z6:B6),r)}function I6(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function Y6(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],f=o===r.length-1,h=s==="/"?e:e.slice(s.length)||"/",m=CO({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},h),O=u.route;if(!m&&f&&n&&!r[r.length-1].route.index&&(m=CO({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!m)return null;Object.assign(i,m.params),a.push({params:i,pathname:ps([s,m.pathname]),pathnameBase:K6(ps([s,m.pathnameBase])),route:O}),m.pathnameBase!=="/"&&(s=ps([s,m.pathnameBase]))}return a}function CO(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=U6(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((f,{paramName:h,isOptional:m},O)=>{if(h==="*"){let v=o[O]||"";a=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const x=o[O];return m&&!x?f[h]=void 0:f[h]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:a,pattern:t}}function U6(t,e=!1,n=!0){Ri(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u,f,h)=>{if(r.push({paramName:o,isOptional:u!=null}),u){let m=h.charAt(f+a.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function W6(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ri(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ca(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var H6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function G6(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ku(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=u$(n.substring(1),"/"):s=u$(n,e)):s=e,{pathname:s,search:J6(r),hash:e8(i)}}function u$(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Db(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function F6(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function xA(t){let e=F6(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function _w(t,e,n,r=!1){let i;typeof t=="string"?i=Ku(t):(i={...t},It(!i.pathname||!i.pathname.includes("?"),Db("?","pathname","search",i)),It(!i.pathname||!i.pathname.includes("#"),Db("#","pathname","hash",i)),It(!i.search||!i.search.includes("#"),Db("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let m=e.length-1;if(!r&&a.startsWith("..")){let O=a.split("/");for(;O[0]==="..";)O.shift(),m-=1;i.pathname=O.join("/")}o=m>=0?e[m]:"/"}let u=G6(i,o),f=a&&a!=="/"&&a.endsWith("/"),h=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||h)&&(u.pathname+="/"),u}var ps=t=>t.join("/").replace(/\/\/+/g,"/"),K6=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),J6=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,e8=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,t8=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function n8(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function r8(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var yA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vA(t,e){let n=t;if(typeof n!="string"||!H6.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(yA)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),o=ca(a.pathname,e);a.origin===s.origin&&o!=null?n=o+a.search+a.hash:i=!0}catch{Ri(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var bA=["POST","PUT","PATCH","DELETE"];new Set(bA);var i8=["GET",...bA];new Set(i8);var Ju=C.createContext(null);Ju.displayName="DataRouter";var Ex=C.createContext(null);Ex.displayName="DataRouterState";var s8=C.createContext(!1),SA=C.createContext({isTransitioning:!1});SA.displayName="ViewTransition";var a8=C.createContext(new Map);a8.displayName="Fetchers";var l8=C.createContext(null);l8.displayName="Await";var Oi=C.createContext(null);Oi.displayName="Navigation";var cp=C.createContext(null);cp.displayName="Location";var Di=C.createContext({outlet:null,matches:[],isDataRoute:!1});Di.displayName="Route";var Nw=C.createContext(null);Nw.displayName="RouteError";var wA="REACT_ROUTER_ERROR",o8="REDIRECT",c8="ROUTE_ERROR_RESPONSE";function u8(t){if(t.startsWith(`${wA}:${o8}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function f8(t){if(t.startsWith(`${wA}:${c8}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new t8(e.status,e.statusText,e.data)}catch{}}function d8(t,{relative:e}={}){It(up(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=C.useContext(Oi),{hash:i,pathname:s,search:a}=fp(t,{relative:e}),o=s;return n!=="/"&&(o=s==="/"?n:ps([n,s])),r.createHref({pathname:o,search:a,hash:i})}function up(){return C.useContext(cp)!=null}function Ss(){return It(up(),"useLocation() may be used only in the context of a <Router> component."),C.useContext(cp).location}var kA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function QA(t){C.useContext(Oi).static||C.useLayoutEffect(t)}function pa(){let{isDataRoute:t}=C.useContext(Di);return t?j8():h8()}function h8(){It(up(),"useNavigate() may be used only in the context of a <Router> component.");let t=C.useContext(Ju),{basename:e,navigator:n}=C.useContext(Oi),{matches:r}=C.useContext(Di),{pathname:i}=Ss(),s=JSON.stringify(xA(r)),a=C.useRef(!1);return QA(()=>{a.current=!0}),C.useCallback((u,f={})=>{if(Ri(a.current,kA),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=_w(u,JSON.parse(s),i,f.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:ps([e,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[e,n,s,i,t])}var p8=C.createContext(null);function m8(t){let e=C.useContext(Di).outlet;return C.useMemo(()=>e&&C.createElement(p8.Provider,{value:t},e),[e,t])}function CA(){let{matches:t}=C.useContext(Di),e=t[t.length-1];return e?e.params:{}}function fp(t,{relative:e}={}){let{matches:n}=C.useContext(Di),{pathname:r}=Ss(),i=JSON.stringify(xA(n));return C.useMemo(()=>_w(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function g8(t,e){return jA(t,e)}function jA(t,e,n){var k;It(up(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=C.useContext(Oi),{matches:i}=C.useContext(Di),s=i[i.length-1],a=s?s.params:{},o=s?s.pathname:"/",u=s?s.pathnameBase:"/",f=s&&s.route;{let w=f&&f.path||"";$A(o,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let h=Ss(),m;if(e){let w=typeof e=="string"?Ku(e):e;It(u==="/"||((k=w.pathname)==null?void 0:k.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${w.pathname}" was given in the \`location\` prop.`),m=w}else m=h;let O=m.pathname||"/",x=O;if(u!=="/"){let w=u.replace(/^\//,"").split("/");x="/"+O.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=mA(t,{pathname:x});Ri(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Ri(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=b8(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:ps([u,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:ps([u,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return e&&S?C.createElement(cp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},S):S}function O8(){let t=C8(),e=n8(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=C.createElement(C.Fragment,null,C.createElement("p",null,"💿 Hey developer 👋"),C.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",C.createElement("code",{style:s},"ErrorBoundary")," or"," ",C.createElement("code",{style:s},"errorElement")," prop on your route.")),C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},e),n?C.createElement("pre",{style:i},n):null,a)}var x8=C.createElement(O8,null),TA=class extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=f8(t.digest);n&&(t=n)}let e=t!==void 0?C.createElement(Di.Provider,{value:this.props.routeContext},C.createElement(Nw.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?C.createElement(y8,{error:t},e):e}};TA.contextType=s8;var Lb=new WeakMap;function y8({children:t,error:e}){let{basename:n}=C.useContext(Oi);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=u8(e.digest);if(r){let i=Lb.get(e);if(i)throw i;let s=vA(r.location,n);if(yA&&!Lb.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Lb.set(e,a),a}return C.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function v8({routeContext:t,match:e,children:n}){let r=C.useContext(Ju);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),C.createElement(Di.Provider,{value:t},n)}function b8(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=r==null?void 0:r.errors;if(s!=null){let h=i.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);It(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let a=!1,o=-1;if(n&&r){a=r.renderFallback;for(let h=0;h<i.length;h++){let m=i[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(o=h),m.route.id){let{loaderData:O,errors:x}=r,v=m.route.loader&&!O.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||v){n.isStatic&&(a=!0),o>=0?i=i.slice(0,o+1):i=[i[0]];break}}}}let u=n==null?void 0:n.onError,f=r&&u?(h,m)=>{var O,x;u(h,{location:r.location,params:((x=(O=r.matches)==null?void 0:O[0])==null?void 0:x.params)??{},unstable_pattern:r8(r.matches),errorInfo:m})}:void 0;return i.reduceRight((h,m,O)=>{let x,v=!1,S=null,k=null;r&&(x=s&&m.route.id?s[m.route.id]:void 0,S=m.route.errorElement||x8,a&&(o<0&&O===0?($A("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,k=null):o===O&&(v=!0,k=m.route.hydrateFallbackElement||null)));let w=e.concat(i.slice(0,O+1)),j=()=>{let Q;return x?Q=S:v?Q=k:m.route.Component?Q=C.createElement(m.route.Component,null):m.route.element?Q=m.route.element:Q=h,C.createElement(v8,{match:m,routeContext:{outlet:h,matches:w,isDataRoute:r!=null},children:Q})};return r&&(m.route.ErrorBoundary||m.route.errorElement||O===0)?C.createElement(TA,{location:r.location,revalidation:r.revalidation,component:S,error:x,children:j(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:f}):j()},null)}function Pw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function S8(t){let e=C.useContext(Ju);return It(e,Pw(t)),e}function w8(t){let e=C.useContext(Ex);return It(e,Pw(t)),e}function k8(t){let e=C.useContext(Di);return It(e,Pw(t)),e}function Ew(t){let e=k8(t),n=e.matches[e.matches.length-1];return It(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Q8(){return Ew("useRouteId")}function C8(){var r;let t=C.useContext(Nw),e=w8("useRouteError"),n=Ew("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function j8(){let{router:t}=S8("useNavigate"),e=Ew("useNavigate"),n=C.useRef(!1);return QA(()=>{n.current=!0}),C.useCallback(async(i,s={})=>{Ri(n.current,kA),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var f$={};function $A(t,e,n){!e&&!f$[t]&&(f$[t]=!0,Ri(!1,n))}C.memo(T8);function T8({routes:t,future:e,state:n,isStatic:r,onError:i}){return jA(t,void 0,{state:n,isStatic:r,onError:i})}function $8(t){return m8(t.context)}function Pn(t){It(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function _8({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){It(!up(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=t.replace(/^\/*/,"/"),u=C.useMemo(()=>({basename:o,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[o,i,s,a]);typeof n=="string"&&(n=Ku(n));let{pathname:f="/",search:h="",hash:m="",state:O=null,key:x="default",unstable_mask:v}=n,S=C.useMemo(()=>{let k=ca(f,o);return k==null?null:{location:{pathname:k,search:h,hash:m,state:O,key:x,unstable_mask:v},navigationType:r}},[o,f,h,m,O,x,r,v]);return Ri(S!=null,`<Router basename="${o}"> is not able to match the URL "${f}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:C.createElement(Oi.Provider,{value:u},C.createElement(cp.Provider,{children:e,value:S}))}function N8({children:t,location:e}){return g8(c1(t),e)}function c1(t,e=[]){let n=[];return C.Children.forEach(t,(r,i)=>{if(!C.isValidElement(r))return;let s=[...e,i];if(r.type===C.Fragment){n.push.apply(n,c1(r.props.children,s));return}It(r.type===Pn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),It(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=c1(r.props.children,s)),n.push(a)}),n}var Fg="get",Kg="application/x-www-form-urlencoded";function Ax(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function P8(t){return Ax(t)&&t.tagName.toLowerCase()==="button"}function E8(t){return Ax(t)&&t.tagName.toLowerCase()==="form"}function A8(t){return Ax(t)&&t.tagName.toLowerCase()==="input"}function M8(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function R8(t,e){return t.button===0&&(!e||e==="_self")&&!M8(t)}function u1(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function z8(t,e){let n=u1(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}var hg=null;function D8(){if(hg===null)try{new FormData(document.createElement("form"),0),hg=!1}catch{hg=!0}return hg}var L8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xb(t){return t!=null&&!L8.has(t)?(Ri(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kg}"`),null):t}function X8(t,e){let n,r,i,s,a;if(E8(t)){let o=t.getAttribute("action");r=o?ca(o,e):null,n=t.getAttribute("method")||Fg,i=Xb(t.getAttribute("enctype"))||Kg,s=new FormData(t)}else if(P8(t)||A8(t)&&(t.type==="submit"||t.type==="image")){let o=t.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||o.getAttribute("action");if(r=u?ca(u,e):null,n=t.getAttribute("formmethod")||o.getAttribute("method")||Fg,i=Xb(t.getAttribute("formenctype"))||Xb(o.getAttribute("enctype"))||Kg,s=new FormData(o,t),!D8()){let{name:f,type:h,value:m}=t;if(h==="image"){let O=f?`${f}.`:"";s.append(`${O}x`,"0"),s.append(`${O}y`,"0")}else f&&s.append(f,m)}}else{if(Ax(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Fg,r=null,i=Kg,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Aw(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Z8(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&ca(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function B8(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function q8(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function V8(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let a=await B8(s,n);return a.links?a.links():[]}return[]}));return W8(r.flat(1).filter(q8).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function d$(t,e,n,r,i,s){let a=(u,f)=>n[f]?u.route.id!==n[f].route.id:!0,o=(u,f)=>{var h;return n[f].pathname!==u.pathname||((h=n[f].route.path)==null?void 0:h.endsWith("*"))&&n[f].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,f)=>a(u,f)||o(u,f)):s==="data"?e.filter((u,f)=>{var m;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(a(u,f)||o(u,f))return!0;if(u.route.shouldRevalidate){let O=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof O=="boolean")return O}return!0}):[]}function I8(t,e,{includeHydrateFallback:n}={}){return Y8(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function Y8(t){return[...new Set(t)]}function U8(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function W8(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(U8(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function _A(){let t=C.useContext(Ju);return Aw(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function H8(){let t=C.useContext(Ex);return Aw(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Mw=C.createContext(void 0);Mw.displayName="FrameworkContext";function NA(){let t=C.useContext(Mw);return Aw(t,"You must render this element inside a <HydratedRouter> element"),t}function G8(t,e){let n=C.useContext(Mw),[r,i]=C.useState(!1),[s,a]=C.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:f,onMouseLeave:h,onTouchStart:m}=e,O=C.useRef(null);C.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let S=w=>{w.forEach(j=>{a(j.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return O.current&&k.observe(O.current),()=>{k.disconnect()}}},[t]),C.useEffect(()=>{if(r){let S=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(S)}}},[r]);let x=()=>{i(!0)},v=()=>{i(!1),a(!1)};return n?t!=="intent"?[s,O,{}]:[s,O,{onFocus:hd(o,x),onBlur:hd(u,v),onMouseEnter:hd(f,x),onMouseLeave:hd(h,v),onTouchStart:hd(m,x)}]:[!1,O,{}]}function hd(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function F8({page:t,...e}){let{router:n}=_A(),r=C.useMemo(()=>mA(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?C.createElement(J8,{page:t,matches:r,...e}):null}function K8(t){let{manifest:e,routeModules:n}=NA(),[r,i]=C.useState([]);return C.useEffect(()=>{let s=!1;return V8(t,e,n).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,n]),r}function J8({page:t,matches:e,...n}){let r=Ss(),{future:i,manifest:s,routeModules:a}=NA(),{basename:o}=_A(),{loaderData:u,matches:f}=H8(),h=C.useMemo(()=>d$(t,e,f,s,r,"data"),[t,e,f,s,r]),m=C.useMemo(()=>d$(t,e,f,s,r,"assets"),[t,e,f,s,r]),O=C.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let S=new Set,k=!1;if(e.forEach(j=>{var T;let Q=s.routes[j.route.id];!Q||!Q.hasLoader||(!h.some(N=>N.route.id===j.route.id)&&j.route.id in u&&((T=a[j.route.id])!=null&&T.shouldRevalidate)||Q.hasClientLoader?k=!0:S.add(j.route.id))}),S.size===0)return[];let w=Z8(t,o,i.unstable_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&w.searchParams.set("_routes",e.filter(j=>S.has(j.route.id)).map(j=>j.route.id).join(",")),[w.pathname+w.search]},[o,i.unstable_trailingSlashAwareDataRequests,u,r,s,h,e,t,a]),x=C.useMemo(()=>I8(m,s),[m,s]),v=K8(m);return C.createElement(C.Fragment,null,O.map(S=>C.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>C.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),v.map(({key:S,link:k})=>C.createElement("link",{key:S,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function eB(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var tB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tB&&(window.__reactRouterVersion="7.13.1")}catch{}function nB({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=C.useRef();i.current==null&&(i.current=P6({window:r,v5Compat:!0}));let s=i.current,[a,o]=C.useState({action:s.action,location:s.location}),u=C.useCallback(f=>{n===!1?o(f):C.startTransition(()=>o(f))},[n]);return C.useLayoutEffect(()=>s.listen(u),[s,u]),C.createElement(_8,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:s,unstable_useTransitions:n})}var PA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nr=C.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,unstable_mask:o,state:u,target:f,to:h,preventScrollReset:m,viewTransition:O,unstable_defaultShouldRevalidate:x,...v},S){let{basename:k,navigator:w,unstable_useTransitions:j}=C.useContext(Oi),Q=typeof h=="string"&&PA.test(h),T=vA(h,k);h=T.to;let N=d8(h,{relative:i}),_=Ss(),M=null;if(o){let q=_w(o,[],_.unstable_mask?_.unstable_mask.pathname:"/",!0);k!=="/"&&(q.pathname=q.pathname==="/"?k:ps([k,q.pathname])),M=w.createHref(q)}let[I,U,F]=G8(r,v),Z=sB(h,{replace:a,unstable_mask:o,state:u,target:f,preventScrollReset:m,relative:i,viewTransition:O,unstable_defaultShouldRevalidate:x,unstable_useTransitions:j});function X(q){e&&e(q),q.defaultPrevented||Z(q)}let H=!(T.isExternal||s),E=C.createElement("a",{...v,...F,href:(H?M:void 0)||T.absoluteURL||N,onClick:H?X:e,ref:eB(S,U),target:f,"data-discover":!Q&&n==="render"?"true":void 0});return I&&!Q?C.createElement(C.Fragment,null,E,C.createElement(F8,{page:N})):E});nr.displayName="Link";var Rw=C.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:o,children:u,...f},h){let m=fp(a,{relative:f.relative}),O=Ss(),x=C.useContext(Ex),{navigator:v,basename:S}=C.useContext(Oi),k=x!=null&&fB(m)&&o===!0,w=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,j=O.pathname,Q=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(j=j.toLowerCase(),Q=Q?Q.toLowerCase():null,w=w.toLowerCase()),Q&&S&&(Q=ca(Q,S)||Q);const T=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let N=j===w||!i&&j.startsWith(w)&&j.charAt(T)==="/",_=Q!=null&&(Q===w||!i&&Q.startsWith(w)&&Q.charAt(w.length)==="/"),M={isActive:N,isPending:_,isTransitioning:k},I=N?e:void 0,U;typeof r=="function"?U=r(M):U=[r,N?"active":null,_?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let F=typeof s=="function"?s(M):s;return C.createElement(nr,{...f,"aria-current":I,className:U,ref:h,style:F,to:a,viewTransition:o},typeof u=="function"?u(M):u)});Rw.displayName="NavLink";var rB=C.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:a=Fg,action:o,onSubmit:u,relative:f,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:O,...x},v)=>{let{unstable_useTransitions:S}=C.useContext(Oi),k=cB(),w=uB(o,{relative:f}),j=a.toLowerCase()==="get"?"get":"post",Q=typeof o=="string"&&PA.test(o),T=N=>{if(u&&u(N),N.defaultPrevented)return;N.preventDefault();let _=N.nativeEvent.submitter,M=(_==null?void 0:_.getAttribute("formmethod"))||a,I=()=>k(_||N.currentTarget,{fetcherKey:e,method:M,navigate:n,replace:i,state:s,relative:f,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:O});S&&n!==!1?C.startTransition(()=>I()):I()};return C.createElement("form",{ref:v,method:j,action:w,onSubmit:r?u:T,...x,"data-discover":!Q&&t==="render"?"true":void 0})});rB.displayName="Form";function iB(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EA(t){let e=C.useContext(Ju);return It(e,iB(t)),e}function sB(t,{target:e,replace:n,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:u,unstable_useTransitions:f}={}){let h=pa(),m=Ss(),O=fp(t,{relative:a});return C.useCallback(x=>{if(R8(x,e)){x.preventDefault();let v=n!==void 0?n:ph(m)===ph(O),S=()=>h(t,{replace:v,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:u});f?C.startTransition(()=>S()):S()}},[m,h,O,n,r,i,e,t,s,a,o,u,f])}function aB(t){Ri(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=C.useRef(u1(t)),n=C.useRef(!1),r=Ss(),i=C.useMemo(()=>z8(r.search,n.current?null:e.current),[r.search]),s=pa(),a=C.useCallback((o,u)=>{const f=u1(typeof o=="function"?o(new URLSearchParams(i)):o);n.current=!0,s("?"+f,u)},[s,i]);return[i,a]}var lB=0,oB=()=>`__${String(++lB)}__`;function cB(){let{router:t}=EA("useSubmit"),{basename:e}=C.useContext(Oi),n=Q8(),r=t.fetch,i=t.navigate;return C.useCallback(async(s,a={})=>{let{action:o,method:u,encType:f,formData:h,body:m}=X8(s,e);if(a.navigate===!1){let O=a.fetcherKey||oB();await r(O,n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:h,body:m,formMethod:a.method||u,formEncType:a.encType||f,flushSync:a.flushSync})}else await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:h,body:m,formMethod:a.method||u,formEncType:a.encType||f,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,e,n])}function uB(t,{relative:e}={}){let{basename:n}=C.useContext(Oi),r=C.useContext(Di);It(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...fp(t||".",{relative:e})},a=Ss();if(t==null){s.search=a.search;let o=new URLSearchParams(s.search),u=o.getAll("index");if(u.some(h=>h==="")){o.delete("index"),u.filter(m=>m).forEach(m=>o.append("index",m));let h=o.toString();s.search=h?`?${h}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ps([n,s.pathname])),ph(s)}function fB(t,{relative:e}={}){let n=C.useContext(SA);It(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=EA("useViewTransitionState"),i=fp(t,{relative:e});if(!n.isTransitioning)return!1;let s=ca(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=ca(n.nextLocation.pathname,r)||n.nextLocation.pathname;return CO(i.pathname,a)!=null||CO(i.pathname,s)!=null}var dB=pA(),dp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xo,ol,hu,iA,hB=(iA=class extends dp{constructor(){super();Me(this,xo);Me(this,ol);Me(this,hu);ve(this,hu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,ol)||this.setEventListener(J(this,hu))}onUnsubscribe(){var e;this.hasListeners()||((e=J(this,ol))==null||e.call(this),ve(this,ol,void 0))}setEventListener(e){var n;ve(this,hu,e),(n=J(this,ol))==null||n.call(this),ve(this,ol,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){J(this,xo)!==e&&(ve(this,xo,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof J(this,xo)=="boolean"?J(this,xo):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},xo=new WeakMap,ol=new WeakMap,hu=new WeakMap,iA),zw=new hB,pB={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},cl,$w,sA,mB=(sA=class{constructor(){Me(this,cl,pB);Me(this,$w,!1)}setTimeoutProvider(t){ve(this,cl,t)}setTimeout(t,e){return J(this,cl).setTimeout(t,e)}clearTimeout(t){J(this,cl).clearTimeout(t)}setInterval(t,e){return J(this,cl).setInterval(t,e)}clearInterval(t){J(this,cl).clearInterval(t)}},cl=new WeakMap,$w=new WeakMap,sA),fo=new mB;function gB(t){setTimeout(t,0)}var OB=typeof window>"u"||"Deno"in globalThis;function xr(){}function xB(t,e){return typeof t=="function"?t(e):t}function f1(t){return typeof t=="number"&&t>=0&&t!==1/0}function AA(t,e){return Math.max(t+(e||0)-Date.now(),0)}function yl(t,e){return typeof t=="function"?t(e):t}function ii(t,e){return typeof t=="function"?t(e):t}function h$(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==Dw(a,e.options))return!1}else if(!gh(e.queryKey,a))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function p$(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(mh(e.options.mutationKey)!==mh(s))return!1}else if(!gh(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Dw(t,e){return((e==null?void 0:e.queryKeyHashFn)||mh)(t)}function mh(t){return JSON.stringify(t,(e,n)=>h1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function gh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>gh(t[n],e[n])):!1}var yB=Object.prototype.hasOwnProperty;function MA(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=m$(t)&&m$(e);if(!r&&!(h1(t)&&h1(e)))return e;const s=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),o=a.length,u=r?new Array(o):{};let f=0;for(let h=0;h<o;h++){const m=r?h:a[h],O=t[m],x=e[m];if(O===x){u[m]=O,(r?h<s:yB.call(t,m))&&f++;continue}if(O===null||x===null||typeof O!="object"||typeof x!="object"){u[m]=x;continue}const v=MA(O,x,n+1);u[m]=v,v===O&&f++}return s===o&&f===s?t:u}function d1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function m$(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function h1(t){if(!g$(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!g$(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function g$(t){return Object.prototype.toString.call(t)==="[object Object]"}function vB(t){return new Promise(e=>{fo.setTimeout(e,t)})}function p1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?MA(t,e):e}function bB(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function SB(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Lw=Symbol();function RA(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Lw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function zA(t,e){return typeof t=="function"?t(...e):!!t}function wB(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Oh=(()=>{let t=()=>OB;return{isServer(){return t()},setIsServer(e){t=e}}})();function m1(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var kB=gB;function QB(){let t=[],e=0,n=o=>{o()},r=o=>{o()},i=kB;const s=o=>{e?t.push(o):i(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{r(()=>{o.forEach(u=>{n(u)})})})};return{batch:o=>{let u;e++;try{u=o()}finally{e--,e||a()}return u},batchCalls:o=>(...u)=>{s(()=>{o(...u)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Mn=QB(),pu,ul,mu,aA,CB=(aA=class extends dp{constructor(){super();Me(this,pu,!0);Me(this,ul);Me(this,mu);ve(this,mu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){J(this,ul)||this.setEventListener(J(this,mu))}onUnsubscribe(){var e;this.hasListeners()||((e=J(this,ul))==null||e.call(this),ve(this,ul,void 0))}setEventListener(e){var n;ve(this,mu,e),(n=J(this,ul))==null||n.call(this),ve(this,ul,e(this.setOnline.bind(this)))}setOnline(e){J(this,pu)!==e&&(ve(this,pu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return J(this,pu)}},pu=new WeakMap,ul=new WeakMap,mu=new WeakMap,aA),jO=new CB;function jB(t){return Math.min(1e3*2**t,3e4)}function DA(t){return(t??"online")==="online"?jO.isOnline():!0}var g1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function LA(t){let e=!1,n=0,r;const i=m1(),s=()=>i.status!=="pending",a=S=>{var k;if(!s()){const w=new g1(S);O(w),(k=t.onCancel)==null||k.call(t,w)}},o=()=>{e=!0},u=()=>{e=!1},f=()=>zw.isFocused()&&(t.networkMode==="always"||jO.isOnline())&&t.canRun(),h=()=>DA(t.networkMode)&&t.canRun(),m=S=>{s()||(r==null||r(),i.resolve(S))},O=S=>{s()||(r==null||r(),i.reject(S))},x=()=>new Promise(S=>{var k;r=w=>{(s()||f())&&S(w)},(k=t.onPause)==null||k.call(t)}).then(()=>{var S;r=void 0,s()||(S=t.onContinue)==null||S.call(t)}),v=()=>{if(s())return;let S;const k=n===0?t.initialPromise:void 0;try{S=k??t.fn()}catch(w){S=Promise.reject(w)}Promise.resolve(S).then(m).catch(w=>{var _;if(s())return;const j=t.retry??(Oh.isServer()?0:3),Q=t.retryDelay??jB,T=typeof Q=="function"?Q(n,w):Q,N=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,w);if(e||!N){O(w);return}n++,(_=t.onFail)==null||_.call(t,n,w),vB(T).then(()=>f()?void 0:x()).then(()=>{e?O(w):v()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:o,continueRetry:u,canStart:h,start:()=>(h()?v():x().then(v),i)}}var yo,lA,XA=(lA=class{constructor(){Me(this,yo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),f1(this.gcTime)&&ve(this,yo,fo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Oh.isServer()?1/0:300*1e3))}clearGcTimeout(){J(this,yo)&&(fo.clearTimeout(J(this,yo)),ve(this,yo,void 0))}},yo=new WeakMap,lA),vo,gu,ri,bo,wn,rp,So,Zr,ZA,Us,oA,TB=(oA=class extends XA{constructor(e){super();Me(this,Zr);Me(this,vo);Me(this,gu);Me(this,ri);Me(this,bo);Me(this,wn);Me(this,rp);Me(this,So);ve(this,So,!1),ve(this,rp,e.defaultOptions),this.setOptions(e.options),this.observers=[],ve(this,bo,e.client),ve(this,ri,J(this,bo).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ve(this,vo,x$(this.options)),this.state=e.state??J(this,vo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=J(this,wn))==null?void 0:e.promise}setOptions(e){if(this.options={...J(this,rp),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=x$(this.options);n.data!==void 0&&(this.setState(O$(n.data,n.dataUpdatedAt)),ve(this,vo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&J(this,ri).remove(this)}setData(e,n){const r=p1(this.state.data,e,this.options);return tt(this,Zr,Us).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){tt(this,Zr,Us).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=J(this,wn))==null?void 0:r.promise;return(i=J(this,wn))==null||i.cancel(e),n?n.then(xr).catch(xr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return J(this,vo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ii(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>yl(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!AA(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=J(this,wn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=J(this,wn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),J(this,ri).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(J(this,wn)&&(J(this,So)||tt(this,Zr,ZA).call(this)?J(this,wn).cancel({revert:!0}):J(this,wn).cancelRetry()),this.scheduleGc()),J(this,ri).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||tt(this,Zr,Us).call(this,{type:"invalidate"})}async fetch(e,n){var u,f,h,m,O,x,v,S,k,w,j,Q;if(this.state.fetchStatus!=="idle"&&((u=J(this,wn))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,wn))return J(this,wn).continueRetry(),J(this,wn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(N=>N.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,i=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ve(this,So,!0),r.signal)})},s=()=>{const T=RA(this.options,n),_=(()=>{const M={client:J(this,bo),queryKey:this.queryKey,meta:this.meta};return i(M),M})();return ve(this,So,!1),this.options.persister?this.options.persister(T,_,this):T(_)},o=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:J(this,bo),state:this.state,fetchFn:s};return i(T),T})();(f=this.options.behavior)==null||f.onFetch(o,this),ve(this,gu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=o.fetchOptions)==null?void 0:h.meta))&&tt(this,Zr,Us).call(this,{type:"fetch",meta:(m=o.fetchOptions)==null?void 0:m.meta}),ve(this,wn,LA({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:T=>{T instanceof g1&&T.revert&&this.setState({...J(this,gu),fetchStatus:"idle"}),r.abort()},onFail:(T,N)=>{tt(this,Zr,Us).call(this,{type:"failed",failureCount:T,error:N})},onPause:()=>{tt(this,Zr,Us).call(this,{type:"pause"})},onContinue:()=>{tt(this,Zr,Us).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const T=await J(this,wn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(x=(O=J(this,ri).config).onSuccess)==null||x.call(O,T,this),(S=(v=J(this,ri).config).onSettled)==null||S.call(v,T,this.state.error,this),T}catch(T){if(T instanceof g1){if(T.silent)return J(this,wn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw tt(this,Zr,Us).call(this,{type:"error",error:T}),(w=(k=J(this,ri).config).onError)==null||w.call(k,T,this),(Q=(j=J(this,ri).config).onSettled)==null||Q.call(j,this.state.data,T,this),T}finally{this.scheduleGc()}}},vo=new WeakMap,gu=new WeakMap,ri=new WeakMap,bo=new WeakMap,wn=new WeakMap,rp=new WeakMap,So=new WeakMap,Zr=new WeakSet,ZA=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Us=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...BA(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...O$(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ve(this,gu,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Mn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),J(this,ri).notify({query:this,type:"updated",action:e})})},oA);function BA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:DA(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function O$(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function x$(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var gr,rt,ip,Gn,wo,Ou,Hs,fl,sp,xu,yu,ko,Qo,dl,vu,yt,_d,O1,x1,y1,v1,b1,S1,w1,qA,cA,$B=(cA=class extends dp{constructor(e,n){super();Me(this,yt);Me(this,gr);Me(this,rt);Me(this,ip);Me(this,Gn);Me(this,wo);Me(this,Ou);Me(this,Hs);Me(this,fl);Me(this,sp);Me(this,xu);Me(this,yu);Me(this,ko);Me(this,Qo);Me(this,dl);Me(this,vu,new Set);this.options=n,ve(this,gr,e),ve(this,fl,null),ve(this,Hs,m1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,rt).addObserver(this),y$(J(this,rt),this.options)?tt(this,yt,_d).call(this):this.updateResult(),tt(this,yt,v1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return k1(J(this,rt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return k1(J(this,rt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,tt(this,yt,b1).call(this),tt(this,yt,S1).call(this),J(this,rt).removeObserver(this)}setOptions(e){const n=this.options,r=J(this,rt);if(this.options=J(this,gr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ii(this.options.enabled,J(this,rt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");tt(this,yt,w1).call(this),J(this,rt).setOptions(this.options),n._defaulted&&!d1(this.options,n)&&J(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,rt),observer:this});const i=this.hasListeners();i&&v$(J(this,rt),r,this.options,n)&&tt(this,yt,_d).call(this),this.updateResult(),i&&(J(this,rt)!==r||ii(this.options.enabled,J(this,rt))!==ii(n.enabled,J(this,rt))||yl(this.options.staleTime,J(this,rt))!==yl(n.staleTime,J(this,rt)))&&tt(this,yt,O1).call(this);const s=tt(this,yt,x1).call(this);i&&(J(this,rt)!==r||ii(this.options.enabled,J(this,rt))!==ii(n.enabled,J(this,rt))||s!==J(this,dl))&&tt(this,yt,y1).call(this,s)}getOptimisticResult(e){const n=J(this,gr).getQueryCache().build(J(this,gr),e),r=this.createResult(n,e);return NB(this,r)&&(ve(this,Gn,r),ve(this,Ou,this.options),ve(this,wo,J(this,rt).state)),r}getCurrentResult(){return J(this,Gn)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&J(this,Hs).status==="pending"&&J(this,Hs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){J(this,vu).add(e)}getCurrentQuery(){return J(this,rt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=J(this,gr).defaultQueryOptions(e),r=J(this,gr).getQueryCache().build(J(this,gr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return tt(this,yt,_d).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,Gn)))}createResult(e,n){var U;const r=J(this,rt),i=this.options,s=J(this,Gn),a=J(this,wo),o=J(this,Ou),f=e!==r?e.state:J(this,ip),{state:h}=e;let m={...h},O=!1,x;if(n._optimisticResults){const F=this.hasListeners(),Z=!F&&y$(e,n),X=F&&v$(e,r,n,i);(Z||X)&&(m={...m,...BA(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:k}=m;x=m.data;let w=!1;if(n.placeholderData!==void 0&&x===void 0&&k==="pending"){let F;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(F=s.data,w=!0):F=typeof n.placeholderData=="function"?n.placeholderData((U=J(this,yu))==null?void 0:U.state.data,J(this,yu)):n.placeholderData,F!==void 0&&(k="success",x=p1(s==null?void 0:s.data,F,n),O=!0)}if(n.select&&x!==void 0&&!w)if(s&&x===(a==null?void 0:a.data)&&n.select===J(this,sp))x=J(this,xu);else try{ve(this,sp,n.select),x=n.select(x),x=p1(s==null?void 0:s.data,x,n),ve(this,xu,x),ve(this,fl,null)}catch(F){ve(this,fl,F)}J(this,fl)&&(v=J(this,fl),x=J(this,xu),S=Date.now(),k="error");const j=m.fetchStatus==="fetching",Q=k==="pending",T=k==="error",N=Q&&j,_=x!==void 0,I={status:k,fetchStatus:m.fetchStatus,isPending:Q,isSuccess:k==="success",isError:T,isInitialLoading:N,isLoading:N,data:x,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!Q,isLoadingError:T&&!_,isPaused:m.fetchStatus==="paused",isPlaceholderData:O,isRefetchError:T&&_,isStale:Xw(e,n),refetch:this.refetch,promise:J(this,Hs),isEnabled:ii(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=I.data!==void 0,Z=I.status==="error"&&!F,X=q=>{Z?q.reject(I.error):F&&q.resolve(I.data)},H=()=>{const q=ve(this,Hs,I.promise=m1());X(q)},E=J(this,Hs);switch(E.status){case"pending":e.queryHash===r.queryHash&&X(E);break;case"fulfilled":(Z||I.data!==E.value)&&H();break;case"rejected":(!Z||I.error!==E.reason)&&H();break}}return I}updateResult(){const e=J(this,Gn),n=this.createResult(J(this,rt),this.options);if(ve(this,wo,J(this,rt).state),ve(this,Ou,this.options),J(this,wo).data!==void 0&&ve(this,yu,J(this,rt)),d1(n,e))return;ve(this,Gn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!J(this,vu).size)return!0;const a=new Set(s??J(this,vu));return this.options.throwOnError&&a.add("error"),Object.keys(J(this,Gn)).some(o=>{const u=o;return J(this,Gn)[u]!==e[u]&&a.has(u)})};tt(this,yt,qA).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&tt(this,yt,v1).call(this)}},gr=new WeakMap,rt=new WeakMap,ip=new WeakMap,Gn=new WeakMap,wo=new WeakMap,Ou=new WeakMap,Hs=new WeakMap,fl=new WeakMap,sp=new WeakMap,xu=new WeakMap,yu=new WeakMap,ko=new WeakMap,Qo=new WeakMap,dl=new WeakMap,vu=new WeakMap,yt=new WeakSet,_d=function(e){tt(this,yt,w1).call(this);let n=J(this,rt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(xr)),n},O1=function(){tt(this,yt,b1).call(this);const e=yl(this.options.staleTime,J(this,rt));if(Oh.isServer()||J(this,Gn).isStale||!f1(e))return;const r=AA(J(this,Gn).dataUpdatedAt,e)+1;ve(this,ko,fo.setTimeout(()=>{J(this,Gn).isStale||this.updateResult()},r))},x1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,rt)):this.options.refetchInterval)??!1},y1=function(e){tt(this,yt,S1).call(this),ve(this,dl,e),!(Oh.isServer()||ii(this.options.enabled,J(this,rt))===!1||!f1(J(this,dl))||J(this,dl)===0)&&ve(this,Qo,fo.setInterval(()=>{(this.options.refetchIntervalInBackground||zw.isFocused())&&tt(this,yt,_d).call(this)},J(this,dl)))},v1=function(){tt(this,yt,O1).call(this),tt(this,yt,y1).call(this,tt(this,yt,x1).call(this))},b1=function(){J(this,ko)&&(fo.clearTimeout(J(this,ko)),ve(this,ko,void 0))},S1=function(){J(this,Qo)&&(fo.clearInterval(J(this,Qo)),ve(this,Qo,void 0))},w1=function(){const e=J(this,gr).getQueryCache().build(J(this,gr),this.options);if(e===J(this,rt))return;const n=J(this,rt);ve(this,rt,e),ve(this,ip,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},qA=function(e){Mn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(J(this,Gn))}),J(this,gr).getQueryCache().notify({query:J(this,rt),type:"observerResultsUpdated"})})},cA);function _B(t,e){return ii(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function y$(t,e){return _B(t,e)||t.state.data!==void 0&&k1(t,e,e.refetchOnMount)}function k1(t,e,n){if(ii(e.enabled,t)!==!1&&yl(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Xw(t,e)}return!1}function v$(t,e,n,r){return(t!==e||ii(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Xw(t,n)}function Xw(t,e){return ii(e.enabled,t)!==!1&&t.isStaleByTime(yl(e.staleTime,t))}function NB(t,e){return!d1(t.getCurrentResult(),e)}function b$(t){return{onFetch:(e,n)=>{var h,m,O,x,v;const r=e.options,i=(O=(m=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:O.direction,s=((x=e.state.data)==null?void 0:x.pages)||[],a=((v=e.state.data)==null?void 0:v.pageParams)||[];let o={pages:[],pageParams:[]},u=0;const f=async()=>{let S=!1;const k=Q=>{wB(Q,()=>e.signal,()=>S=!0)},w=RA(e.options,e.fetchOptions),j=async(Q,T,N)=>{if(S)return Promise.reject();if(T==null&&Q.pages.length)return Promise.resolve(Q);const M=(()=>{const Z={client:e.client,queryKey:e.queryKey,pageParam:T,direction:N?"backward":"forward",meta:e.options.meta};return k(Z),Z})(),I=await w(M),{maxPages:U}=e.options,F=N?SB:bB;return{pages:F(Q.pages,I,U),pageParams:F(Q.pageParams,T,U)}};if(i&&s.length){const Q=i==="backward",T=Q?PB:S$,N={pages:s,pageParams:a},_=T(r,N);o=await j(N,_,Q)}else{const Q=t??s.length;do{const T=u===0?a[0]??r.initialPageParam:S$(r,o);if(u>0&&T==null)break;o=await j(o,T),u++}while(u<Q)}return o};e.options.persister?e.fetchFn=()=>{var S,k;return(k=(S=e.options).persister)==null?void 0:k.call(S,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function S$(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function PB(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var ap,ts,Xn,Co,ns,el,uA,EB=(uA=class extends XA{constructor(e){super();Me(this,ns);Me(this,ap);Me(this,ts);Me(this,Xn);Me(this,Co);ve(this,ap,e.client),this.mutationId=e.mutationId,ve(this,Xn,e.mutationCache),ve(this,ts,[]),this.state=e.state||AB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){J(this,ts).includes(e)||(J(this,ts).push(e),this.clearGcTimeout(),J(this,Xn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ve(this,ts,J(this,ts).filter(n=>n!==e)),this.scheduleGc(),J(this,Xn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){J(this,ts).length||(this.state.status==="pending"?this.scheduleGc():J(this,Xn).remove(this))}continue(){var e;return((e=J(this,Co))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,o,u,f,h,m,O,x,v,S,k,w,j,Q,T,N,_,M;const n=()=>{tt(this,ns,el).call(this,{type:"continue"})},r={client:J(this,ap),meta:this.options.meta,mutationKey:this.options.mutationKey};ve(this,Co,LA({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,U)=>{tt(this,ns,el).call(this,{type:"failed",failureCount:I,error:U})},onPause:()=>{tt(this,ns,el).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>J(this,Xn).canRun(this)}));const i=this.state.status==="pending",s=!J(this,Co).canStart();try{if(i)n();else{tt(this,ns,el).call(this,{type:"pending",variables:e,isPaused:s}),J(this,Xn).config.onMutate&&await J(this,Xn).config.onMutate(e,this,r);const U=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e,r));U!==this.state.context&&tt(this,ns,el).call(this,{type:"pending",context:U,variables:e,isPaused:s})}const I=await J(this,Co).start();return await((f=(u=J(this,Xn).config).onSuccess)==null?void 0:f.call(u,I,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,I,e,this.state.context,r)),await((x=(O=J(this,Xn).config).onSettled)==null?void 0:x.call(O,I,null,this.state.variables,this.state.context,this,r)),await((S=(v=this.options).onSettled)==null?void 0:S.call(v,I,null,e,this.state.context,r)),tt(this,ns,el).call(this,{type:"success",data:I}),I}catch(I){try{await((w=(k=J(this,Xn).config).onError)==null?void 0:w.call(k,I,e,this.state.context,this,r))}catch(U){Promise.reject(U)}try{await((Q=(j=this.options).onError)==null?void 0:Q.call(j,I,e,this.state.context,r))}catch(U){Promise.reject(U)}try{await((N=(T=J(this,Xn).config).onSettled)==null?void 0:N.call(T,void 0,I,this.state.variables,this.state.context,this,r))}catch(U){Promise.reject(U)}try{await((M=(_=this.options).onSettled)==null?void 0:M.call(_,void 0,I,e,this.state.context,r))}catch(U){Promise.reject(U)}throw tt(this,ns,el).call(this,{type:"error",error:I}),I}finally{J(this,Xn).runNext(this)}}},ap=new WeakMap,ts=new WeakMap,Xn=new WeakMap,Co=new WeakMap,ns=new WeakSet,el=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Mn.batch(()=>{J(this,ts).forEach(r=>{r.onMutationUpdate(e)}),J(this,Xn).notify({mutation:this,type:"updated",action:e})})},uA);function AB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gs,ji,lp,fA,MB=(fA=class extends dp{constructor(e={}){super();Me(this,Gs);Me(this,ji);Me(this,lp);this.config=e,ve(this,Gs,new Set),ve(this,ji,new Map),ve(this,lp,0)}build(e,n,r){const i=new EB({client:e,mutationCache:this,mutationId:++dg(this,lp)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){J(this,Gs).add(e);const n=pg(e);if(typeof n=="string"){const r=J(this,ji).get(n);r?r.push(e):J(this,ji).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(J(this,Gs).delete(e)){const n=pg(e);if(typeof n=="string"){const r=J(this,ji).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&J(this,ji).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=pg(e);if(typeof n=="string"){const r=J(this,ji).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=pg(e);if(typeof n=="string"){const i=(r=J(this,ji).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Mn.batch(()=>{J(this,Gs).forEach(e=>{this.notify({type:"removed",mutation:e})}),J(this,Gs).clear(),J(this,ji).clear()})}getAll(){return Array.from(J(this,Gs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>p$(n,r))}findAll(e={}){return this.getAll().filter(n=>p$(e,n))}notify(e){Mn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Mn.batch(()=>Promise.all(e.map(n=>n.continue().catch(xr))))}},Gs=new WeakMap,ji=new WeakMap,lp=new WeakMap,fA);function pg(t){var e;return(e=t.options.scope)==null?void 0:e.id}var rs,dA,RB=(dA=class extends dp{constructor(e={}){super();Me(this,rs);this.config=e,ve(this,rs,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??Dw(i,n);let a=this.get(s);return a||(a=new TB({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){J(this,rs).has(e.queryHash)||(J(this,rs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=J(this,rs).get(e.queryHash);n&&(e.destroy(),n===e&&J(this,rs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Mn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return J(this,rs).get(e)}getAll(){return[...J(this,rs).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>h$(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>h$(e,r)):n}notify(e){Mn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Mn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Mn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rs=new WeakMap,dA),Wt,hl,pl,bu,Su,ml,wu,ku,hA,zB=(hA=class{constructor(t={}){Me(this,Wt);Me(this,hl);Me(this,pl);Me(this,bu);Me(this,Su);Me(this,ml);Me(this,wu);Me(this,ku);ve(this,Wt,t.queryCache||new RB),ve(this,hl,t.mutationCache||new MB),ve(this,pl,t.defaultOptions||{}),ve(this,bu,new Map),ve(this,Su,new Map),ve(this,ml,0)}mount(){dg(this,ml)._++,J(this,ml)===1&&(ve(this,wu,zw.subscribe(async t=>{t&&(await this.resumePausedMutations(),J(this,Wt).onFocus())})),ve(this,ku,jO.subscribe(async t=>{t&&(await this.resumePausedMutations(),J(this,Wt).onOnline())})))}unmount(){var t,e;dg(this,ml)._--,J(this,ml)===0&&((t=J(this,wu))==null||t.call(this),ve(this,wu,void 0),(e=J(this,ku))==null||e.call(this),ve(this,ku,void 0))}isFetching(t){return J(this,Wt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return J(this,hl).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=J(this,Wt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=J(this,Wt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(yl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return J(this,Wt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=J(this,Wt).get(r.queryHash),s=i==null?void 0:i.state.data,a=xB(e,s);if(a!==void 0)return J(this,Wt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Mn.batch(()=>J(this,Wt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=J(this,Wt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=J(this,Wt);Mn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=J(this,Wt);return Mn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Mn.batch(()=>J(this,Wt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xr).catch(xr)}invalidateQueries(t,e={}){return Mn.batch(()=>(J(this,Wt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Mn.batch(()=>J(this,Wt).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(xr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(xr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=J(this,Wt).build(this,e);return n.isStaleByTime(yl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xr).catch(xr)}fetchInfiniteQuery(t){return t.behavior=b$(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xr).catch(xr)}ensureInfiniteQueryData(t){return t.behavior=b$(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return jO.isOnline()?J(this,hl).resumePausedMutations():Promise.resolve()}getQueryCache(){return J(this,Wt)}getMutationCache(){return J(this,hl)}getDefaultOptions(){return J(this,pl)}setDefaultOptions(t){ve(this,pl,t)}setQueryDefaults(t,e){J(this,bu).set(mh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...J(this,bu).values()],n={};return e.forEach(r=>{gh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){J(this,Su).set(mh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...J(this,Su).values()],n={};return e.forEach(r=>{gh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...J(this,pl).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Dw(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Lw&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...J(this,pl).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){J(this,Wt).clear(),J(this,hl).clear()}},Wt=new WeakMap,hl=new WeakMap,pl=new WeakMap,bu=new WeakMap,Su=new WeakMap,ml=new WeakMap,wu=new WeakMap,ku=new WeakMap,hA),VA=C.createContext(void 0),qo=t=>{const e=C.useContext(VA);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},DB=({client:t,children:e})=>(C.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),p.jsx(VA.Provider,{value:t,children:e})),IA=C.createContext(!1),LB=()=>C.useContext(IA);IA.Provider;function XB(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ZB=C.createContext(XB()),BB=()=>C.useContext(ZB),qB=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?zA(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},VB=t=>{C.useEffect(()=>{t.clearReset()},[t])},IB=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||zA(n,[t.error,r])),YB=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},UB=(t,e)=>t.isLoading&&t.isFetching&&!e,WB=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,w$=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function HB(t,e,n){var O,x,v,S;const r=LB(),i=BB(),s=qo(),a=s.defaultQueryOptions(t);(x=(O=s.getDefaultOptions().queries)==null?void 0:O._experimental_beforeQuery)==null||x.call(O,a);const o=s.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",YB(a),qB(a,i,o),VB(i);const u=!s.getQueryCache().get(a.queryHash),[f]=C.useState(()=>new e(s,a)),h=f.getOptimisticResult(a),m=!r&&t.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(k=>{const w=m?f.subscribe(Mn.batchCalls(k)):xr;return f.updateResult(),w},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),C.useEffect(()=>{f.setOptions(a)},[a,f]),WB(a,h))throw w$(a,f,i);if(IB({result:h,errorResetBoundary:i,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw h.error;if((S=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||S.call(v,a,h),a.experimental_prefetchInRender&&!Oh.isServer()&&UB(h,r)){const k=u?w$(a,f,i):o==null?void 0:o.promise;k==null||k.catch(xr).finally(()=>{f.updateResult()})}return a.notifyOnChangeProps?h:f.trackResult(h)}function ma(t,e){return HB(t,$B)}const YA=C.createContext({notifications:[],notify:()=>{},dismiss:()=>{}});function hp(){return C.useContext(YA)}let GB=0;function FB({children:t}){const[e,n]=C.useState([]),r=C.useCallback(s=>{n(a=>a.filter(o=>o.id!==s))},[]),i=C.useCallback((s,a,o)=>{const u=String(++GB),f=s==="error"||s==="warning";n(h=>[...h.slice(-2),{id:u,type:s,message:a,details:o,persistent:f}]),f||setTimeout(()=>r(u),s==="success"?3e3:5e3)},[r]);return p.jsxs(YA.Provider,{value:{notifications:e,notify:i,dismiss:r},children:[t,p.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>p.jsxs("div",{role:"alert","aria-live":"polite",className:`px-4 py-3 rounded-md shadow-lg border text-sm ${s.type==="success"?"bg-[var(--color-surface-raised)] border-[var(--color-success)] text-[var(--color-success)]":s.type==="warning"?"bg-[var(--color-surface-raised)] border-[var(--color-warning)] text-[var(--color-warning)]":s.type==="error"?"bg-[var(--color-surface-raised)] border-[var(--color-error)] text-[var(--color-error)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] text-[var(--color-text)]"}`,children:[p.jsxs("div",{className:"flex items-start justify-between gap-2",children:[p.jsx("p",{children:s.message}),s.persistent&&p.jsx("button",{onClick:()=>r(s.id),className:"text-[var(--color-muted)] hover:text-[var(--color-text)] shrink-0","aria-label":"Dismiss notification",children:"x"})]}),s.details&&p.jsxs("details",{className:"mt-2 text-xs text-[var(--color-muted)]",children:[p.jsx("summary",{className:"cursor-pointer",children:"Details"}),p.jsx("pre",{className:"mt-1 whitespace-pre-wrap font-[var(--font-mono)]",children:s.details})]})]},s.id))})]})}/**
61
+ * @license lucide-react v0.577.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const UA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
66
+ * @license lucide-react v0.577.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const KB=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
+ * @license lucide-react v0.577.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const JB=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
76
+ * @license lucide-react v0.577.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const k$=t=>{const e=JB(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
81
+ * @license lucide-react v0.577.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */var e9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
86
+ * @license lucide-react v0.577.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const t9=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
91
+ * @license lucide-react v0.577.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const n9=C.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},u)=>C.createElement("svg",{ref:u,...e9,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:UA("lucide",i),...!s&&!t9(o)&&{"aria-hidden":"true"},...o},[...a.map(([f,h])=>C.createElement(f,h)),...Array.isArray(s)?s:[s]]));/**
96
+ * @license lucide-react v0.577.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Ee=(t,e)=>{const n=C.forwardRef(({className:r,...i},s)=>C.createElement(n9,{ref:s,iconNode:e,className:UA(`lucide-${KB(k$(t))}`,`lucide-${t}`,r),...i}));return n.displayName=k$(t),n};/**
101
+ * @license lucide-react v0.577.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const r9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],TO=Ee("arrow-left",r9);/**
106
+ * @license lucide-react v0.577.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const i9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],s9=Ee("arrow-right",i9);/**
111
+ * @license lucide-react v0.577.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const a9=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Zw=Ee("book-open",a9);/**
116
+ * @license lucide-react v0.577.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const l9=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],WA=Ee("briefcase",l9);/**
121
+ * @license lucide-react v0.577.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const o9=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],c9=Ee("check",o9);/**
126
+ * @license lucide-react v0.577.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const u9=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ea=Ee("chevron-down",u9);/**
131
+ * @license lucide-react v0.577.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const f9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ta=Ee("chevron-right",f9);/**
136
+ * @license lucide-react v0.577.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const d9=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Bw=Ee("circle-check-big",d9);/**
141
+ * @license lucide-react v0.577.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const h9=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],p9=Ee("copy",h9);/**
146
+ * @license lucide-react v0.577.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const m9=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],HA=Ee("database",m9);/**
151
+ * @license lucide-react v0.577.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const g9=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],$O=Ee("download",g9);/**
156
+ * @license lucide-react v0.577.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const O9=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],qw=Ee("external-link",O9);/**
161
+ * @license lucide-react v0.577.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const x9=[["path",{d:"M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z",key:"1340ok"}],["path",{d:"M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z",key:"1hz3m3"}],["path",{d:"M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z",key:"1oz8n2"}],["path",{d:"M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z",key:"1ff65i"}],["path",{d:"M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z",key:"pdip6e"}]],y9=Ee("figma",x9);/**
166
+ * @license lucide-react v0.577.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const v9=[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1",key:"1q9hii"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],b9=Ee("file-input",v9);/**
171
+ * @license lucide-react v0.577.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const S9=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Mx=Ee("file-output",S9);/**
176
+ * @license lucide-react v0.577.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const w9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],jo=Ee("file-text",w9);/**
181
+ * @license lucide-react v0.577.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const k9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Q9=Ee("file",k9);/**
186
+ * @license lucide-react v0.577.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const C9=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Q$=Ee("folder-open",C9);/**
191
+ * @license lucide-react v0.577.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const j9=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],GA=Ee("folder-tree",j9);/**
196
+ * @license lucide-react v0.577.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const T9=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],FA=Ee("folder",T9);/**
201
+ * @license lucide-react v0.577.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const $9=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Mi=Ee("git-branch",$9);/**
206
+ * @license lucide-react v0.577.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const _9=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],KA=Ee("github",_9);/**
211
+ * @license lucide-react v0.577.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const N9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],P9=Ee("globe",N9);/**
216
+ * @license lucide-react v0.577.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const E9=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],A9=Ee("grip-vertical",E9);/**
221
+ * @license lucide-react v0.577.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const M9=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],R9=Ee("heart",M9);/**
226
+ * @license lucide-react v0.577.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const z9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],D9=Ee("info",z9);/**
231
+ * @license lucide-react v0.577.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const L9=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],X9=Ee("layers",L9);/**
236
+ * @license lucide-react v0.577.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const Z9=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],B9=Ee("layout-grid",Z9);/**
241
+ * @license lucide-react v0.577.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const q9=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],V9=Ee("layout-dashboard",q9);/**
246
+ * @license lucide-react v0.577.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const I9=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Y9=Ee("list",I9);/**
251
+ * @license lucide-react v0.577.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const U9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],_O=Ee("loader-circle",U9);/**
256
+ * @license lucide-react v0.577.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const W9=[["path",{d:"M5 12h14",key:"1ays0h"}]],H9=Ee("minus",W9);/**
261
+ * @license lucide-react v0.577.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const G9=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],F9=Ee("monitor",G9);/**
266
+ * @license lucide-react v0.577.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const K9=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],J9=Ee("moon",K9);/**
271
+ * @license lucide-react v0.577.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const eq=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],xh=Ee("package",eq);/**
276
+ * @license lucide-react v0.577.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const tq=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qu=Ee("pencil",tq);/**
281
+ * @license lucide-react v0.577.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const nq=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],rq=Ee("play",nq);/**
286
+ * @license lucide-react v0.577.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const iq=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Vw=Ee("plug",iq);/**
291
+ * @license lucide-react v0.577.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const sq=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],hn=Ee("plus",sq);/**
296
+ * @license lucide-react v0.577.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const aq=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],lq=Ee("rocket",aq);/**
301
+ * @license lucide-react v0.577.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const oq=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],yh=Ee("save",oq);/**
306
+ * @license lucide-react v0.577.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const cq=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],uq=Ee("scale",cq);/**
311
+ * @license lucide-react v0.577.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const fq=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Vo=Ee("search",fq);/**
316
+ * @license lucide-react v0.577.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const dq=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ud=Ee("settings",dq);/**
321
+ * @license lucide-react v0.577.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const hq=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],pq=Ee("sun",hq);/**
326
+ * @license lucide-react v0.577.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const mq=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ef=Ee("trash-2",mq);/**
331
+ * @license lucide-react v0.577.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const gq=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vh=Ee("triangle-alert",gq);/**
336
+ * @license lucide-react v0.577.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const Oq=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],NO=Ee("upload",Oq);/**
341
+ * @license lucide-react v0.577.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const xq=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],JA=Ee("users-round",xq);/**
346
+ * @license lucide-react v0.577.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const yq=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],di=Ee("users",yq);/**
351
+ * @license lucide-react v0.577.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const vq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yn=Ee("x",vq);/**
356
+ * @license lucide-react v0.577.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const bq=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],na=Ee("zap",bq),e5="bmad-studio-theme";function Sq(){const t=localStorage.getItem(e5);return t==="dark"||t==="light"?t:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function t5(t){t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem(e5,t)}function n5(){const e=(document.documentElement.classList.contains("dark")?"dark":"light")==="dark"?"light":"dark";return t5(e),e}const C$=t=>{let e;const n=new Set,r=(f,h)=>{const m=typeof f=="function"?f(e):f;if(!Object.is(m,e)){const O=e;e=h??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(x=>x(e,O))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=e=t(r,i,o);return o},wq=(t=>t?C$(t):C$),kq=t=>t;function Qq(t,e=kq){const n=$d.useSyncExternalStore(t.subscribe,$d.useCallback(()=>e(t.getState()),[t,e]),$d.useCallback(()=>e(t.getInitialState()),[t,e]));return $d.useDebugValue(n),n}const j$=t=>{const e=wq(t),n=r=>Qq(e,r);return Object.assign(n,e),n},Cq=(t=>t?j$(t):j$),bh=Cq(t=>({theme:document.documentElement.classList.contains("dark")?"dark":"light",setTheme:e=>t({theme:e})})),T$=1e3,jq=3e4;class Tq{constructor(e){this.ws=null,this.retryMs=T$,this.retryTimer=null,this.handlers=[],this.statusHandlers=[],this.closed=!1,this.url=e}connect(){if(!this.closed)try{this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.retryMs=T$,this.notifyStatus(!0)},this.ws.onmessage=e=>{try{const n=JSON.parse(e.data);for(const r of this.handlers)r(n)}catch{}},this.ws.onclose=()=>{this.notifyStatus(!1),this.scheduleReconnect()},this.ws.onerror=()=>{}}catch{this.scheduleReconnect()}}scheduleReconnect(){this.closed||(this.retryTimer=setTimeout(()=>{this.retryMs=Math.min(this.retryMs*2,jq),this.connect()},this.retryMs))}notifyStatus(e){for(const n of this.statusHandlers)n(e)}onMessage(e){return this.handlers.push(e),()=>{this.handlers=this.handlers.filter(n=>n!==e)}}onStatusChange(e){return this.statusHandlers.push(e),()=>{this.statusHandlers=this.statusHandlers.filter(n=>n!==e)}}close(){this.closed=!0,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.ws&&(this.ws.close(),this.ws=null)}}function $q(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function _q(t){const e=C.useRef(null),[n,r]=C.useState(!1),i=C.useCallback(s=>{t==null||t(s)},[t]);return C.useEffect(()=>{const s=new Tq($q());e.current=s,s.onStatusChange(r);const a=s.onMessage(i);return s.connect(),()=>{a(),s.close()}},[i]),{connected:n}}const Nq=[{to:"/",label:"Overview",icon:V9},{to:"/agents",label:"Agents",icon:di,badgeKey:"agents"},{to:"/teams",label:"Teams",icon:JA,badgeKey:"teams"},{to:"/skills",label:"Skills",icon:na,badgeKey:"skills"},{to:"/workflows",label:"Workflows",icon:Mi,badgeKey:"workflows"},{to:"/connections",label:"Data Sources",icon:Vw,badgeKey:"connections"},{to:"/workspace",label:"Workspace",icon:WA},{to:"/modules",label:"Modules",icon:xh,badgeKey:"modules"}],Pq=[{to:"/outputs",label:"Outputs",icon:Mx},{to:"/commands",label:"Commands",icon:Zw},{to:"/settings",label:"Settings",icon:Ud},{to:"/files",label:"Files",icon:GA}];function $$({to:t,label:e,icon:n,badge:r}){return p.jsxs(Rw,{to:t,end:t==="/",className:({isActive:i})=>`flex items-center gap-3 px-3 py-2 min-h-[44px] rounded-md text-sm transition-colors ${i?"text-[var(--color-accent)] font-bold bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsx(n,{size:18}),p.jsx("span",{className:"flex-1",children:e}),r!==void 0&&r>0&&p.jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)]",children:r})]})}function Eq(){const t=bh(o=>o.theme),e=bh(o=>o.setTheme),[n,r]=C.useState({}),i=C.useRef(null),s=C.useCallback(()=>{Promise.all([fetch("/api/overview").then(o=>o.json()).catch(()=>null),fetch("/api/modules").then(o=>o.json()).catch(()=>null)]).then(([o,u])=>{var h,m,O,x,v;const f={};o!=null&&o.sections&&(f.agents=((h=o.sections.team)==null?void 0:h.count)??0,f.teams=((m=o.sections.teams)==null?void 0:m.count)??0,f.skills=((O=o.sections.toolkit)==null?void 0:O.count)??0,f.workflows=((x=o.sections.process)==null?void 0:x.count)??0,f.connections=((v=o.sections.ideConfigs)==null?void 0:v.count)??0),Array.isArray(u)&&(f.modules=u.length),r(f)})},[]);C.useEffect(()=>{s()},[s]),_q(C.useCallback(()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(s,200)},[s]));function a(){const o=n5();e(o)}return p.jsxs("aside",{className:"w-60 h-screen flex flex-col border-r border-[var(--color-border-subtle)] bg-[var(--color-bg)]",children:[p.jsx("div",{className:"px-4 py-5",children:p.jsx("h1",{className:"text-lg font-extrabold text-[var(--color-text)]",children:"BMAD Studio"})}),p.jsxs("nav",{className:"flex-1 px-2 space-y-1",children:[Nq.map(o=>p.jsx($$,{to:o.to,label:o.label,icon:o.icon,badge:o.badgeKey?n[o.badgeKey]:void 0},o.to)),p.jsx("div",{className:"my-3 border-t border-[var(--color-border-subtle)]"}),Pq.map(o=>p.jsx($$,{...o},o.to))]}),p.jsxs("div",{className:"px-3 py-3 border-t border-[var(--color-border-subtle)] space-y-1",children:[p.jsxs(Rw,{to:"/about",className:({isActive:o})=>`flex items-center gap-2 px-3 py-2 min-h-[44px] w-full rounded-md text-sm transition-colors ${o?"text-[var(--color-accent)] font-bold bg-[var(--color-surface-raised)]":"text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsx(D9,{size:18}),p.jsx("span",{children:"About"})]}),p.jsxs("button",{onClick:a,className:"flex items-center gap-2 px-3 py-2 min-h-[44px] w-full rounded-md text-sm text-[var(--color-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:[t==="dark"?p.jsx(pq,{size:18}):p.jsx(J9,{size:18}),p.jsx("span",{children:t==="dark"?"Light mode":"Dark mode"})]})]})]})}const Aq={agents:"Agents",teams:"Teams",skills:"Skills",workflows:"Workflows",outputs:"Outputs",connections:"Connections",workspace:"Workspace",modules:"Modules",packages:"Packages",files:"Files",settings:"Settings"};function Mq(){const e=Ss().pathname.split("/").filter(Boolean);return e.length===0?null:p.jsx("nav",{"aria-label":"Breadcrumb",className:"mb-4 text-sm text-[var(--color-muted)]",children:p.jsxs("ol",{className:"flex items-center gap-1",children:[p.jsx("li",{children:p.jsx(nr,{to:"/",className:"hover:text-[var(--color-text)] transition-colors",children:"Home"})}),e.map((n,r)=>{const i="/"+e.slice(0,r+1).join("/"),s=Aq[n]||n,a=r===e.length-1;return p.jsxs("li",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"text-[var(--color-border-subtle)]",children:"/"}),a?p.jsx("span",{className:"text-[var(--color-text)]",children:s}):p.jsx(nr,{to:i,className:"hover:text-[var(--color-text)] transition-colors",children:s})]},i)})]})})}function Rq(){const[t,e]=C.useState(!1),[n,r]=C.useState(""),[i,s]=C.useState([]),[a,o]=C.useState(0),u=C.useRef(null),f=pa(),h=C.useCallback(()=>{r(""),s([]),o(0),e(!0)},[]),m=C.useCallback(()=>{e(!1)},[]);C.useEffect(()=>{function v(S){(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),t?m():h()),S.key==="Escape"&&t&&m()}return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,h,m]),C.useEffect(()=>{var v;t&&((v=u.current)==null||v.focus())},[t]),C.useEffect(()=>{if(!n.trim())return;const v=new AbortController;return fetch(`/api/search?q=${encodeURIComponent(n)}`,{signal:v.signal}).then(S=>S.json()).then(S=>s(S)).catch(()=>{}),()=>v.abort()},[n]);function O(v){f(`${{agent:"/agents",skill:"/skills",workflow:"/workflows"}[v.type]}/${v.id}`),m()}function x(v){v.key==="ArrowDown"?(v.preventDefault(),o(S=>Math.min(S+1,i.length-1))):v.key==="ArrowUp"?(v.preventDefault(),o(S=>Math.max(S-1,0))):v.key==="Enter"&&i[a]&&O(i[a])}return t?p.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:m,children:p.jsxs("div",{className:"w-full max-w-lg bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-xl shadow-2xl overflow-hidden",onClick:v=>v.stopPropagation(),onKeyDown:x,children:[p.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[var(--color-border-subtle)]",children:[p.jsx(Vo,{size:18,className:"text-[var(--color-muted)]"}),p.jsx("input",{ref:u,type:"text",placeholder:"Search agents, skills, workflows...",value:n,onChange:v=>{r(v.target.value),v.target.value.trim()||s([])},className:"flex-1 bg-transparent text-sm text-[var(--color-text)] outline-none placeholder:text-[var(--color-muted)]"}),p.jsx("kbd",{className:"text-xs text-[var(--color-muted)] px-1.5 py-0.5 rounded border border-[var(--color-border-subtle)]",children:"esc"})]}),i.length>0&&p.jsx("div",{className:"max-h-64 overflow-y-auto py-2",children:i.map((v,S)=>p.jsxs("button",{onClick:()=>O(v),className:`w-full px-4 py-2 text-left flex items-center gap-3 text-sm ${S===a?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-muted)] hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] uppercase",children:v.type}),p.jsxs("div",{children:[p.jsx("p",{className:"font-bold",children:v.name}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:v.description})]})]},`${v.type}-${v.id}`))}),n&&i.length===0&&p.jsx("div",{className:"px-4 py-6 text-center text-sm text-[var(--color-muted)]",children:"No results found"})]})}):null}function zq(){return p.jsxs("div",{className:"flex h-screen overflow-hidden",children:[p.jsx(Eq,{}),p.jsx("main",{className:"flex-1 overflow-y-auto",children:p.jsxs("div",{className:"px-8 py-6",children:[p.jsx(Mq,{}),p.jsx($8,{})]})}),p.jsx(Rq,{})]})}function Li({icon:t,title:e,description:n,actions:r}){return p.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[p.jsx(t,{size:48,className:"text-[var(--color-muted)] mb-4",strokeWidth:1.5}),p.jsx("h2",{className:"text-lg font-bold text-[var(--color-text)] mb-2",children:e}),p.jsx("p",{className:"text-sm text-[var(--color-muted)] max-w-md mb-6",children:n}),r&&p.jsx("div",{className:"flex gap-3",children:r})]})}function r5(){return ma({queryKey:["workflows"],queryFn:async()=>{const t=await fetch("/api/workflows");if(!t.ok)throw new Error("Failed to fetch workflows");return t.json()},staleTime:3e4})}function i5(t){return ma({queryKey:["workflows",{id:t}],queryFn:async()=>{const e=await fetch(`/api/workflows/${t}`);if(!e.ok)throw new Error(`Failed to fetch workflow ${t}`);return e.json()},enabled:!!t})}function Dq({workflow:t,onClose:e,onSaved:n}){const r=qo(),[i,s]=C.useState(t.description||""),[a,o]=C.useState(null),[u,f]=C.useState(!1),h=async()=>{var m;f(!0),o(null);try{const O=await fetch(`/api/workflows/${encodeURIComponent(t.id)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:i.trim()})});if(!O.ok){const x=await O.json();throw new Error(((m=x.error)==null?void 0:m.message)??"Failed to update workflow")}await r.invalidateQueries({queryKey:["workflows"]}),await r.invalidateQueries({queryKey:["workflow",t.id]}),n()}catch(O){o(O instanceof Error?O.message:"Failed to update workflow")}finally{f(!1)}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"Edit Workflow"}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:t.name,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Type"}),p.jsx("input",{type:"text",value:t.type??"step-based",disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Type cannot be changed after creation"})]}),t.phase&&p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Phase"}),p.jsx("input",{type:"text",value:t.phase,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:i,onChange:m=>s(m.target.value),rows:3,placeholder:"What does this workflow do?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{className:"text-xs text-[var(--color-muted)] space-y-1 pt-2 border-t border-[var(--color-border-subtle)]",children:[p.jsxs("p",{children:["Module: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.module??"unknown"})]}),p.jsxs("p",{children:["Steps: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.steps.length})]}),p.jsxs("p",{children:["File: ",p.jsx("code",{className:"font-[var(--font-mono)] break-all",children:t.entryPoint})]})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:h,disabled:u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(yh,{size:14}),u?"Saving...":"Save Changes"]})]})]})]})}function Lq(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Xq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bq={};function _$(t,e){return(Bq.jsx?Zq:Xq).test(t)}const qq=/[ \t\n\f\r]/g;function Vq(t){return typeof t=="object"?t.type==="text"?N$(t.value):!1:N$(t)}function N$(t){return t.replace(qq,"")===""}let pp=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};pp.prototype.normal={};pp.prototype.property={};pp.prototype.space=void 0;function s5(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new pp(n,r,e)}function Q1(t){return t.toLowerCase()}class Cr{constructor(e,n){this.attribute=n,this.property=e}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let Iq=0;const Ue=Io(),dn=Io(),C1=Io(),Oe=Io(),Et=Io(),nu=Io(),zr=Io();function Io(){return 2**++Iq}const j1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:dn,commaOrSpaceSeparated:zr,commaSeparated:nu,number:Oe,overloadedBoolean:C1,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Zb=Object.keys(j1);class Iw extends Cr{constructor(e,n,r,i){let s=-1;if(super(e,n),P$(this,"space",i),typeof r=="number")for(;++s<Zb.length;){const a=Zb[s];P$(this,Zb[s],(r&j1[a])===j1[a])}}}Iw.prototype.defined=!0;function P$(t,e,n){n&&(t[e]=n)}function tf(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Iw(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Q1(r)]=r,n[Q1(s.attribute)]=r}return new pp(e,n,t.space)}const a5=tf({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:Et,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:Oe,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:Et,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:dn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function l5(t,e){return e in t?t[e]:e}function o5(t,e){return l5(t,e.toLowerCase())}const Yq=tf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nu,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:Et,autoFocus:Ue,autoPlay:Ue,blocking:Et,capture:null,charSet:null,checked:Ue,cite:null,className:Et,cols:Oe,colSpan:null,content:null,contentEditable:dn,controls:Ue,controlsList:Et,coords:Oe|nu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:C1,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:Et,height:Oe,hidden:C1,high:Oe,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:Et,itemRef:Et,itemScope:Ue,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:Oe,pattern:null,ping:Et,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:Et,required:Ue,reversed:Ue,rows:Oe,rowSpan:Oe,sandbox:Et,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:dn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:o5}),Uq=tf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:nu,g2:nu,glyphName:nu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zr,rev:zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zr,requiredFeatures:zr,requiredFonts:zr,requiredFormats:zr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:l5}),c5=tf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),u5=tf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:o5}),f5=tf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Wq={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Hq=/[A-Z]/g,E$=/-[a-z]/g,Gq=/^data[-\w.:]+$/i;function Fq(t,e){const n=Q1(e);let r=e,i=Cr;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Gq.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(E$,Jq);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!E$.test(s)){let a=s.replace(Hq,Kq);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Iw}return new i(r,e)}function Kq(t){return"-"+t.toLowerCase()}function Jq(t){return t.charAt(1).toUpperCase()}const eV=s5([a5,Yq,c5,u5,f5],"html"),Yw=s5([a5,Uq,c5,u5,f5],"svg");function tV(t){return t.join(" ").trim()}var zc={},Bb,A$;function nV(){if(A$)return Bb;A$=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
361
+ `,f="/",h="*",m="",O="comment",x="declaration";function v(k,w){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];w=w||{};var j=1,Q=1;function T(E){var q=E.match(e);q&&(j+=q.length);var R=E.lastIndexOf(u);Q=~R?E.length-R:Q+E.length}function N(){var E={line:j,column:Q};return function(q){return q.position=new _(E),U(),q}}function _(E){this.start=E,this.end={line:j,column:Q},this.source=w.source}_.prototype.content=k;function M(E){var q=new Error(w.source+":"+j+":"+Q+": "+E);if(q.reason=E,q.filename=w.source,q.line=j,q.column=Q,q.source=k,!w.silent)throw q}function I(E){var q=E.exec(k);if(q){var R=q[0];return T(R),k=k.slice(R.length),q}}function U(){I(n)}function F(E){var q;for(E=E||[];q=Z();)q!==!1&&E.push(q);return E}function Z(){var E=N();if(!(f!=k.charAt(0)||h!=k.charAt(1))){for(var q=2;m!=k.charAt(q)&&(h!=k.charAt(q)||f!=k.charAt(q+1));)++q;if(q+=2,m===k.charAt(q-1))return M("End of comment missing");var R=k.slice(2,q-2);return Q+=2,T(R),k=k.slice(q),Q+=2,E({type:O,comment:R})}}function X(){var E=N(),q=I(r);if(q){if(Z(),!I(i))return M("property missing ':'");var R=I(s),z=E({type:x,property:S(q[0].replace(t,m)),value:R?S(R[0].replace(t,m)):m});return I(a),z}}function H(){var E=[];F(E);for(var q;q=X();)q!==!1&&(E.push(q),F(E));return E}return U(),H()}function S(k){return k?k.replace(o,m):m}return Bb=v,Bb}var M$;function rV(){if(M$)return zc;M$=1;var t=zc&&zc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zc,"__esModule",{value:!0}),zc.default=n;const e=t(nV());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:h}=u;o?i(f,h,u):h&&(s=s||{},s[f]=h)}),s}return zc}var pd={},R$;function iV(){if(R$)return pd;R$=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(f){return!f||n.test(f)||t.test(f)},a=function(f,h){return h.toUpperCase()},o=function(f,h){return"".concat(h,"-")},u=function(f,h){return h===void 0&&(h={}),s(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(i,o):f=f.replace(r,o),f.replace(e,a))};return pd.camelCase=u,pd}var md,z$;function sV(){if(z$)return md;z$=1;var t=md&&md.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(rV()),n=iV();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(a[(0,n.camelCase)(o,s)]=u)}),a}return r.default=r,md=r,md}var aV=sV();const lV=Px(aV),d5=h5("end"),Uw=h5("start");function h5(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function oV(t){const e=Uw(t),n=d5(t);if(e&&n)return{start:e,end:n}}function Wd(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?D$(t.position):"start"in t||"end"in t?D$(t):"line"in t||"column"in t?T1(t):""}function T1(t){return L$(t&&t.line)+":"+L$(t&&t.column)}function D$(t){return T1(t&&t.start)+"-"+T1(t&&t.end)}function L$(t){return t&&typeof t=="number"?t:1}class Un extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Wd(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Un.prototype.file="";Un.prototype.name="";Un.prototype.reason="";Un.prototype.message="";Un.prototype.stack="";Un.prototype.column=void 0;Un.prototype.line=void 0;Un.prototype.ancestors=void 0;Un.prototype.cause=void 0;Un.prototype.fatal=void 0;Un.prototype.place=void 0;Un.prototype.ruleId=void 0;Un.prototype.source=void 0;const Ww={}.hasOwnProperty,cV=new Map,uV=/[A-Z]/g,fV=new Set(["table","tbody","thead","tfoot","tr"]),dV=new Set(["td","th"]),p5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hV(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=bV(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=vV(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Yw:eV,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=m5(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function m5(t,e,n){if(e.type==="element")return pV(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return mV(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return OV(t,e,n);if(e.type==="mdxjsEsm")return gV(t,e);if(e.type==="root")return xV(t,e,n);if(e.type==="text")return yV(t,e)}function pV(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yw,t.schema=i),t.ancestors.push(e);const s=O5(t,e.tagName,!1),a=SV(t,e);let o=Gw(t,e);return fV.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Vq(u):!0})),g5(t,a,s,e),Hw(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function mV(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Sh(t,e.position)}function gV(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Sh(t,e.position)}function OV(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Yw,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:O5(t,e.name,!0),a=wV(t,e),o=Gw(t,e);return g5(t,a,s,e),Hw(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function xV(t,e,n){const r={};return Hw(r,Gw(t,e)),t.create(e,t.Fragment,r,n)}function yV(t,e){return e.value}function g5(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Hw(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function vV(t,e,n){return r;function r(i,s,a,o){const f=Array.isArray(a.children)?n:e;return o?f(s,a,o):f(s,a)}}function bV(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),u=Uw(r);return e(i,s,a,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function SV(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Ww.call(e.properties,i)){const s=kV(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&dV.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function wV(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else Sh(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else Sh(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Gw(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:cV;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const f=i.get(u)||0;a=u+"-"+f,i.set(u,f+1)}}const o=m5(t,s,a);o!==void 0&&n.push(o)}return n}function kV(t,e,n){const r=Fq(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Lq(n):tV(n)),r.property==="style"){let i=typeof n=="object"?n:QV(t,String(n));return t.stylePropertyNameCase==="css"&&(i=CV(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?Wq[r.property]||r.property:r.attribute,n]}}function QV(t,e){try{return lV(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Un("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=p5+"#cannot-parse-style-attribute",i}}function O5(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=_$(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=_$(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Ww.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Sh(t)}function Sh(t,e){const n=new Un("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=p5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function CV(t){const e={};let n;for(n in t)Ww.call(t,n)&&(e[jV(n)]=t[n]);return e}function jV(t){let e=t.replace(uV,TV);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function TV(t){return"-"+t.toLowerCase()}const qb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},$V={};function _V(t,e){const n=$V,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return x5(t,r,i)}function x5(t,e,n){if(NV(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return X$(t.children,e,n)}return Array.isArray(t)?X$(t,e,n):""}function X$(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=x5(t[i],e,n);return r.join("")}function NV(t){return!!(t&&typeof t=="object")}const Z$=document.createElement("i");function Fw(t){const e="&"+t+";";Z$.innerHTML=e;const n=Z$.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function xs(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function si(t,e){return t.length>0?(xs(t,t.length,0,e),t):e}const B$={}.hasOwnProperty;function PV(t){const e={};let n=-1;for(;++n<t.length;)EV(e,t[n]);return e}function EV(t,e){let n;for(n in e){const i=(B$.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){B$.call(i,a)||(i[a]=[]);const o=s[a];AV(i[a],Array.isArray(o)?o:o?[o]:[])}}}function AV(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);xs(t,0,0,r)}function y5(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ru(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const as=jl(/[A-Za-z]/),qr=jl(/[\dA-Za-z]/),MV=jl(/[#-'*+\--9=?A-Z^-~]/);function $1(t){return t!==null&&(t<32||t===127)}const _1=jl(/\d/),RV=jl(/[\dA-Fa-f]/),zV=jl(/[!-/:-@[-`{-~]/);function De(t){return t!==null&&t<-2}function wr(t){return t!==null&&(t<0||t===32)}function mt(t){return t===-2||t===-1||t===32}const DV=jl(new RegExp("\\p{P}|\\p{S}","u")),LV=jl(/\s/);function jl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function nf(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&qr(t.charCodeAt(n+1))&&qr(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Mt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return mt(u)?(t.enter(n),o(u)):e(u)}function o(u){return mt(u)&&s++<i?(t.consume(u),o):(t.exit(n),e(u))}}const XV={tokenize:ZV};function ZV(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Mt(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return De(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const BV={tokenize:qV},q$={tokenize:VV};function qV(t){const e=this,n=[];let r=0,i,s,a;return o;function o(Q){if(r<n.length){const T=n[r];return e.containerState=T[1],t.attempt(T[0].continuation,u,f)(Q)}return f(Q)}function u(Q){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&j();const T=e.events.length;let N=T,_;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){_=e.events[N][1].end;break}w(r);let M=T;for(;M<e.events.length;)e.events[M][1].end={..._},M++;return xs(e.events,N+1,0,e.events.slice(T)),e.events.length=M,f(Q)}return o(Q)}function f(Q){if(r===n.length){if(!i)return O(Q);if(i.currentConstruct&&i.currentConstruct.concrete)return v(Q);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(q$,h,m)(Q)}function h(Q){return i&&j(),w(r),O(Q)}function m(Q){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,v(Q)}function O(Q){return e.containerState={},t.attempt(q$,x,v)(Q)}function x(Q){return r++,n.push([e.currentConstruct,e.containerState]),O(Q)}function v(Q){if(Q===null){i&&j(),w(0),t.consume(Q);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),S(Q)}function S(Q){if(Q===null){k(t.exit("chunkFlow"),!0),w(0),t.consume(Q);return}return De(Q)?(t.consume(Q),k(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(Q),S)}function k(Q,T){const N=e.sliceStream(Q);if(T&&N.push(null),Q.previous=s,s&&(s.next=Q),s=Q,i.defineSkip(Q.start),i.write(N),e.parser.lazy[Q.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<a&&(!i.events[_][1].end||i.events[_][1].end.offset>a))return;const M=e.events.length;let I=M,U,F;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){if(U){F=e.events[I][1].end;break}U=!0}for(w(r),_=M;_<e.events.length;)e.events[_][1].end={...F},_++;xs(e.events,I+1,0,e.events.slice(M)),e.events.length=_}}function w(Q){let T=n.length;for(;T-- >Q;){const N=n[T];e.containerState=N[1],N[0].exit.call(e,t)}n.length=Q}function j(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function VV(t,e,n){return Mt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function V$(t){if(t===null||wr(t)||LV(t))return 1;if(DV(t))return 2}function Kw(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const N1={name:"attention",resolveAll:IV,tokenize:YV};function IV(t,e){let n=-1,r,i,s,a,o,u,f,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},O={...t[n][1].start};I$(m,-u),I$(O,u),a={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:O},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},f=[],t[r][1].end.offset-t[r][1].start.offset&&(f=si(f,[["enter",t[r][1],e],["exit",t[r][1],e]])),f=si(f,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),f=si(f,Kw(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),f=si(f,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,f=si(f,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,xs(t,r-1,n-r+3,f),n=r+f.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function YV(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=V$(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===s)return t.consume(u),o;const f=t.exit("attentionSequence"),h=V$(u),m=!h||h===2&&i||n.includes(u),O=!i||i===2&&h||n.includes(r);return f._open=!!(s===42?m:m&&(i||!O)),f._close=!!(s===42?O:O&&(h||!m)),e(u)}}function I$(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const UV={name:"autolink",tokenize:WV};function WV(t,e,n){let r=0;return i;function i(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(x){return as(x)?(t.consume(x),a):x===64?n(x):f(x)}function a(x){return x===43||x===45||x===46||qr(x)?(r=1,o(x)):f(x)}function o(x){return x===58?(t.consume(x),r=0,u):(x===43||x===45||x===46||qr(x))&&r++<32?(t.consume(x),o):(r=0,f(x))}function u(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||$1(x)?n(x):(t.consume(x),u)}function f(x){return x===64?(t.consume(x),h):MV(x)?(t.consume(x),f):n(x)}function h(x){return qr(x)?m(x):n(x)}function m(x){return x===46?(t.consume(x),r=0,h):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):O(x)}function O(x){if((x===45||qr(x))&&r++<63){const v=x===45?O:m;return t.consume(x),v}return n(x)}}const Rx={partial:!0,tokenize:HV};function HV(t,e,n){return r;function r(s){return mt(s)?Mt(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||De(s)?e(s):n(s)}}const v5={continuation:{tokenize:FV},exit:KV,name:"blockQuote",tokenize:GV};function GV(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return mt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function FV(t,e,n){const r=this;return i;function i(a){return mt(a)?Mt(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(v5,e,n)(a)}}function KV(t){t.exit("blockQuote")}const b5={name:"characterEscape",tokenize:JV};function JV(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return zV(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const S5={name:"characterReference",tokenize:e7};function e7(t,e,n){const r=this;let i=0,s,a;return o;function o(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),u}function u(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),f):(t.enter("characterReferenceValue"),s=31,a=qr,h(m))}function f(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=RV,h):(t.enter("characterReferenceValue"),s=7,a=_1,h(m))}function h(m){if(m===59&&i){const O=t.exit("characterReferenceValue");return a===qr&&!Fw(r.sliceSerialize(O))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(m)&&i++<s?(t.consume(m),h):n(m)}}const Y$={partial:!0,tokenize:n7},U$={concrete:!0,name:"codeFenced",tokenize:t7};function t7(t,e,n){const r=this,i={partial:!0,tokenize:N};let s=0,a=0,o;return u;function u(_){return f(_)}function f(_){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=_,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(_)}function h(_){return _===o?(a++,t.consume(_),h):a<3?n(_):(t.exit("codeFencedFenceSequence"),mt(_)?Mt(t,m,"whitespace")(_):m(_))}function m(_){return _===null||De(_)?(t.exit("codeFencedFence"),r.interrupt?e(_):t.check(Y$,S,T)(_)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),O(_))}function O(_){return _===null||De(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(_)):mt(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Mt(t,x,"whitespace")(_)):_===96&&_===o?n(_):(t.consume(_),O)}function x(_){return _===null||De(_)?m(_):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||De(_)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(_)):_===96&&_===o?n(_):(t.consume(_),v)}function S(_){return t.attempt(i,T,k)(_)}function k(_){return t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),w}function w(_){return s>0&&mt(_)?Mt(t,j,"linePrefix",s+1)(_):j(_)}function j(_){return _===null||De(_)?t.check(Y$,S,T)(_):(t.enter("codeFlowValue"),Q(_))}function Q(_){return _===null||De(_)?(t.exit("codeFlowValue"),j(_)):(t.consume(_),Q)}function T(_){return t.exit("codeFenced"),e(_)}function N(_,M,I){let U=0;return F;function F(q){return _.enter("lineEnding"),_.consume(q),_.exit("lineEnding"),Z}function Z(q){return _.enter("codeFencedFence"),mt(q)?Mt(_,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):X(q)}function X(q){return q===o?(_.enter("codeFencedFenceSequence"),H(q)):I(q)}function H(q){return q===o?(U++,_.consume(q),H):U>=a?(_.exit("codeFencedFenceSequence"),mt(q)?Mt(_,E,"whitespace")(q):E(q)):I(q)}function E(q){return q===null||De(q)?(_.exit("codeFencedFence"),M(q)):I(q)}}}function n7(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const Vb={name:"codeIndented",tokenize:i7},r7={partial:!0,tokenize:s7};function i7(t,e,n){const r=this;return i;function i(f){return t.enter("codeIndented"),Mt(t,s,"linePrefix",5)(f)}function s(f){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?u(f):De(f)?t.attempt(r7,a,u)(f):(t.enter("codeFlowValue"),o(f))}function o(f){return f===null||De(f)?(t.exit("codeFlowValue"),a(f)):(t.consume(f),o)}function u(f){return t.exit("codeIndented"),e(f)}}function s7(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):De(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Mt(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):De(a)?i(a):n(a)}}const a7={name:"codeText",previous:o7,resolve:l7,tokenize:c7};function l7(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function o7(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function c7(t,e,n){let r=0,i,s;return a;function a(m){return t.enter("codeText"),t.enter("codeTextSequence"),o(m)}function o(m){return m===96?(t.consume(m),r++,o):(t.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),u):m===96?(s=t.enter("codeTextSequence"),i=0,h(m)):De(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),u):(t.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||De(m)?(t.exit("codeTextData"),u(m)):(t.consume(m),f)}function h(m){return m===96?(t.consume(m),i++,h):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(s.type="codeTextData",f(m))}}class u7{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&gd(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),gd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),gd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);gd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);gd(this.left,n.reverse())}}}function gd(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function w5(t){const e={};let n=-1,r,i,s,a,o,u,f;const h=new u7(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,f7(h,n)),n=e[n],f=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return xs(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!f}function f7(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],f={};let h,m,O=-1,x=n,v=0,S=0;const k=[S];for(;x;){for(;t.get(++i)[1]!==x;);s.push(i),x._tokenizer||(h=r.sliceStream(x),x.next||h.push(null),m&&a.defineSkip(x.start),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++O<o.length;)o[O][0]==="exit"&&o[O-1][0]==="enter"&&o[O][1].type===o[O-1][1].type&&o[O][1].start.line!==o[O][1].end.line&&(S=O+1,k.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(a.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),O=k.length;O--;){const w=o.slice(k[O],k[O+1]),j=s.pop();u.push([j,j+w.length-1]),t.splice(j,2,w)}for(u.reverse(),O=-1;++O<u.length;)f[v+u[O][0]]=v+u[O][1],v+=u[O][1]-u[O][0]-1;return f}const d7={resolve:p7,tokenize:m7},h7={partial:!0,tokenize:g7};function p7(t){return w5(t),t}function m7(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):De(o)?t.check(h7,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function g7(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Mt(t,s,"linePrefix")}function s(a){if(a===null||De(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function k5(t,e,n,r,i,s,a,o,u){const f=u||Number.POSITIVE_INFINITY;let h=0;return m;function m(w){return w===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(w),t.exit(s),O):w===null||w===32||w===41||$1(w)?n(w):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),S(w))}function O(w){return w===62?(t.enter(s),t.consume(w),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===62?(t.exit("chunkString"),t.exit(o),O(w)):w===null||w===60||De(w)?n(w):(t.consume(w),w===92?v:x)}function v(w){return w===60||w===62||w===92?(t.consume(w),x):x(w)}function S(w){return!h&&(w===null||w===41||wr(w))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(w)):h<f&&w===40?(t.consume(w),h++,S):w===41?(t.consume(w),h--,S):w===null||w===32||w===40||$1(w)?n(w):(t.consume(w),w===92?k:S)}function k(w){return w===40||w===41||w===92?(t.consume(w),S):S(w)}}function Q5(t,e,n,r,i,s){const a=this;let o=0,u;return f;function f(x){return t.enter(r),t.enter(i),t.consume(x),t.exit(i),t.enter(s),h}function h(x){return o>999||x===null||x===91||x===93&&!u||x===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(t.exit(s),t.enter(i),t.consume(x),t.exit(i),t.exit(r),e):De(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||De(x)||o++>999?(t.exit("chunkString"),h(x)):(t.consume(x),u||(u=!mt(x)),x===92?O:m)}function O(x){return x===91||x===92||x===93?(t.consume(x),o++,m):m(x)}}function C5(t,e,n,r,i,s){let a;return o;function o(O){return O===34||O===39||O===40?(t.enter(r),t.enter(i),t.consume(O),t.exit(i),a=O===40?41:O,u):n(O)}function u(O){return O===a?(t.enter(i),t.consume(O),t.exit(i),t.exit(r),e):(t.enter(s),f(O))}function f(O){return O===a?(t.exit(s),u(a)):O===null?n(O):De(O)?(t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),Mt(t,f,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(O))}function h(O){return O===a||O===null||De(O)?(t.exit("chunkString"),f(O)):(t.consume(O),O===92?m:h)}function m(O){return O===a||O===92?(t.consume(O),h):h(O)}}function Hd(t,e){let n;return r;function r(i){return De(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):mt(i)?Mt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const O7={name:"definition",tokenize:y7},x7={partial:!0,tokenize:v7};function y7(t,e,n){const r=this;let i;return s;function s(x){return t.enter("definition"),a(x)}function a(x){return Q5.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function o(x){return i=ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),u):n(x)}function u(x){return wr(x)?Hd(t,f)(x):f(x)}function f(x){return k5(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return t.attempt(x7,m,m)(x)}function m(x){return mt(x)?Mt(t,O,"whitespace")(x):O(x)}function O(x){return x===null||De(x)?(t.exit("definition"),r.parser.defined.push(i),e(x)):n(x)}}function v7(t,e,n){return r;function r(o){return wr(o)?Hd(t,i)(o):n(o)}function i(o){return C5(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return mt(o)?Mt(t,a,"whitespace")(o):a(o)}function a(o){return o===null||De(o)?e(o):n(o)}}const b7={name:"hardBreakEscape",tokenize:S7};function S7(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return De(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const w7={name:"headingAtx",resolve:k7,tokenize:Q7};function k7(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},xs(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function Q7(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),s(h)}function s(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||wr(h)?(t.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(t.enter("atxHeadingSequence"),u(h)):h===null||De(h)?(t.exit("atxHeading"),e(h)):mt(h)?Mt(t,o,"whitespace")(h):(t.enter("atxHeadingText"),f(h))}function u(h){return h===35?(t.consume(h),u):(t.exit("atxHeadingSequence"),o(h))}function f(h){return h===null||h===35||wr(h)?(t.exit("atxHeadingText"),o(h)):(t.consume(h),f)}}const C7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],W$=["pre","script","style","textarea"],j7={concrete:!0,name:"htmlFlow",resolveTo:_7,tokenize:N7},T7={partial:!0,tokenize:E7},$7={partial:!0,tokenize:P7};function _7(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function N7(t,e,n){const r=this;let i,s,a,o,u;return f;function f(P){return h(P)}function h(P){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(P),m}function m(P){return P===33?(t.consume(P),O):P===47?(t.consume(P),s=!0,S):P===63?(t.consume(P),i=3,r.interrupt?e:A):as(P)?(t.consume(P),a=String.fromCharCode(P),k):n(P)}function O(P){return P===45?(t.consume(P),i=2,x):P===91?(t.consume(P),i=5,o=0,v):as(P)?(t.consume(P),i=4,r.interrupt?e:A):n(P)}function x(P){return P===45?(t.consume(P),r.interrupt?e:A):n(P)}function v(P){const ee="CDATA[";return P===ee.charCodeAt(o++)?(t.consume(P),o===ee.length?r.interrupt?e:X:v):n(P)}function S(P){return as(P)?(t.consume(P),a=String.fromCharCode(P),k):n(P)}function k(P){if(P===null||P===47||P===62||wr(P)){const ee=P===47,ae=a.toLowerCase();return!ee&&!s&&W$.includes(ae)?(i=1,r.interrupt?e(P):X(P)):C7.includes(a.toLowerCase())?(i=6,ee?(t.consume(P),w):r.interrupt?e(P):X(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?j(P):Q(P))}return P===45||qr(P)?(t.consume(P),a+=String.fromCharCode(P),k):n(P)}function w(P){return P===62?(t.consume(P),r.interrupt?e:X):n(P)}function j(P){return mt(P)?(t.consume(P),j):F(P)}function Q(P){return P===47?(t.consume(P),F):P===58||P===95||as(P)?(t.consume(P),T):mt(P)?(t.consume(P),Q):F(P)}function T(P){return P===45||P===46||P===58||P===95||qr(P)?(t.consume(P),T):N(P)}function N(P){return P===61?(t.consume(P),_):mt(P)?(t.consume(P),N):Q(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),u=P,M):mt(P)?(t.consume(P),_):I(P)}function M(P){return P===u?(t.consume(P),u=null,U):P===null||De(P)?n(P):(t.consume(P),M)}function I(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||wr(P)?N(P):(t.consume(P),I)}function U(P){return P===47||P===62||mt(P)?Q(P):n(P)}function F(P){return P===62?(t.consume(P),Z):n(P)}function Z(P){return P===null||De(P)?X(P):mt(P)?(t.consume(P),Z):n(P)}function X(P){return P===45&&i===2?(t.consume(P),R):P===60&&i===1?(t.consume(P),z):P===62&&i===4?(t.consume(P),D):P===63&&i===3?(t.consume(P),A):P===93&&i===5?(t.consume(P),W):De(P)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(T7,Y,H)(P)):P===null||De(P)?(t.exit("htmlFlowData"),H(P)):(t.consume(P),X)}function H(P){return t.check($7,E,Y)(P)}function E(P){return t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),q}function q(P){return P===null||De(P)?H(P):(t.enter("htmlFlowData"),X(P))}function R(P){return P===45?(t.consume(P),A):X(P)}function z(P){return P===47?(t.consume(P),a="",B):X(P)}function B(P){if(P===62){const ee=a.toLowerCase();return W$.includes(ee)?(t.consume(P),D):X(P)}return as(P)&&a.length<8?(t.consume(P),a+=String.fromCharCode(P),B):X(P)}function W(P){return P===93?(t.consume(P),A):X(P)}function A(P){return P===62?(t.consume(P),D):P===45&&i===2?(t.consume(P),A):X(P)}function D(P){return P===null||De(P)?(t.exit("htmlFlowData"),Y(P)):(t.consume(P),D)}function Y(P){return t.exit("htmlFlow"),e(P)}}function P7(t,e,n){const r=this;return i;function i(a){return De(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function E7(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Rx,e,n)}}const A7={name:"htmlText",tokenize:M7};function M7(t,e,n){const r=this;let i,s,a;return o;function o(A){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(A),u}function u(A){return A===33?(t.consume(A),f):A===47?(t.consume(A),N):A===63?(t.consume(A),Q):as(A)?(t.consume(A),I):n(A)}function f(A){return A===45?(t.consume(A),h):A===91?(t.consume(A),s=0,v):as(A)?(t.consume(A),j):n(A)}function h(A){return A===45?(t.consume(A),x):n(A)}function m(A){return A===null?n(A):A===45?(t.consume(A),O):De(A)?(a=m,z(A)):(t.consume(A),m)}function O(A){return A===45?(t.consume(A),x):m(A)}function x(A){return A===62?R(A):A===45?O(A):m(A)}function v(A){const D="CDATA[";return A===D.charCodeAt(s++)?(t.consume(A),s===D.length?S:v):n(A)}function S(A){return A===null?n(A):A===93?(t.consume(A),k):De(A)?(a=S,z(A)):(t.consume(A),S)}function k(A){return A===93?(t.consume(A),w):S(A)}function w(A){return A===62?R(A):A===93?(t.consume(A),w):S(A)}function j(A){return A===null||A===62?R(A):De(A)?(a=j,z(A)):(t.consume(A),j)}function Q(A){return A===null?n(A):A===63?(t.consume(A),T):De(A)?(a=Q,z(A)):(t.consume(A),Q)}function T(A){return A===62?R(A):Q(A)}function N(A){return as(A)?(t.consume(A),_):n(A)}function _(A){return A===45||qr(A)?(t.consume(A),_):M(A)}function M(A){return De(A)?(a=M,z(A)):mt(A)?(t.consume(A),M):R(A)}function I(A){return A===45||qr(A)?(t.consume(A),I):A===47||A===62||wr(A)?U(A):n(A)}function U(A){return A===47?(t.consume(A),R):A===58||A===95||as(A)?(t.consume(A),F):De(A)?(a=U,z(A)):mt(A)?(t.consume(A),U):R(A)}function F(A){return A===45||A===46||A===58||A===95||qr(A)?(t.consume(A),F):Z(A)}function Z(A){return A===61?(t.consume(A),X):De(A)?(a=Z,z(A)):mt(A)?(t.consume(A),Z):U(A)}function X(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),i=A,H):De(A)?(a=X,z(A)):mt(A)?(t.consume(A),X):(t.consume(A),E)}function H(A){return A===i?(t.consume(A),i=void 0,q):A===null?n(A):De(A)?(a=H,z(A)):(t.consume(A),H)}function E(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||wr(A)?U(A):(t.consume(A),E)}function q(A){return A===47||A===62||wr(A)?U(A):n(A)}function R(A){return A===62?(t.consume(A),t.exit("htmlTextData"),t.exit("htmlText"),e):n(A)}function z(A){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),B}function B(A){return mt(A)?Mt(t,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):W(A)}function W(A){return t.enter("htmlTextData"),a(A)}}const Jw={name:"labelEnd",resolveAll:L7,resolveTo:X7,tokenize:Z7},R7={tokenize:B7},z7={tokenize:q7},D7={tokenize:V7};function L7(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&xs(t,0,t.length,n),t}function X7(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},f={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},h={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",u,e],["enter",f,e]],o=si(o,t.slice(s+1,s+r+3)),o=si(o,[["enter",h,e]]),o=si(o,Kw(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=si(o,[["exit",h,e],t[a-2],t[a-1],["exit",f,e]]),o=si(o,t.slice(a+1)),o=si(o,[["exit",u,e]]),xs(t,s,t.length,o),t}function Z7(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(O){return s?s._inactive?m(O):(a=r.parser.defined.includes(ru(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(O),t.exit("labelMarker"),t.exit("labelEnd"),u):n(O)}function u(O){return O===40?t.attempt(R7,h,a?h:m)(O):O===91?t.attempt(z7,h,a?f:m)(O):a?h(O):m(O)}function f(O){return t.attempt(D7,h,m)(O)}function h(O){return e(O)}function m(O){return s._balanced=!0,n(O)}}function B7(t,e,n){return r;function r(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),i}function i(m){return wr(m)?Hd(t,s)(m):s(m)}function s(m){return m===41?h(m):k5(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function a(m){return wr(m)?Hd(t,u)(m):h(m)}function o(m){return n(m)}function u(m){return m===34||m===39||m===40?C5(t,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):h(m)}function f(m){return wr(m)?Hd(t,h)(m):h(m)}function h(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function q7(t,e,n){const r=this;return i;function i(o){return Q5.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function V7(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const I7={name:"labelStartImage",resolveAll:Jw.resolveAll,tokenize:Y7};function Y7(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const U7={name:"labelStartLink",resolveAll:Jw.resolveAll,tokenize:W7};function W7(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const Ib={name:"lineEnding",tokenize:H7};function H7(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Mt(t,e,"linePrefix")}}const Jg={name:"thematicBreak",tokenize:G7};function G7(t,e,n){let r=0,i;return s;function s(f){return t.enter("thematicBreak"),a(f)}function a(f){return i=f,o(f)}function o(f){return f===i?(t.enter("thematicBreakSequence"),u(f)):r>=3&&(f===null||De(f))?(t.exit("thematicBreak"),e(f)):n(f)}function u(f){return f===i?(t.consume(f),r++,u):(t.exit("thematicBreakSequence"),mt(f)?Mt(t,o,"whitespace")(f):o(f))}}const pr={continuation:{tokenize:eI},exit:nI,name:"list",tokenize:J7},F7={partial:!0,tokenize:rI},K7={partial:!0,tokenize:tI};function J7(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:_1(x)){if(r.containerState.type||(r.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Jg,n,f)(x):f(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(x)}return n(x)}function u(x){return _1(x)&&++a<10?(t.consume(x),u):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),f(x)):n(x)}function f(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(Rx,r.interrupt?n:h,t.attempt(F7,O,m))}function h(x){return r.containerState.initialBlankLine=!0,s++,O(x)}function m(x){return mt(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),O):n(x)}function O(x){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function eI(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Rx,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!mt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(K7,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(t,t.attempt(pr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function tI(t,e,n){const r=this;return Mt(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function nI(t){t.exit(this.containerState.type)}function rI(t,e,n){const r=this;return Mt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!mt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const H$={name:"setextUnderline",resolveTo:iI,tokenize:sI};function iI(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function sI(t,e,n){const r=this;let i;return s;function s(f){let h=r.events.length,m;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){m=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return t.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===i?(t.consume(f),o):(t.exit("setextHeadingLineSequence"),mt(f)?Mt(t,u,"lineSuffix")(f):u(f))}function u(f){return f===null||De(f)?(t.exit("setextHeadingLine"),e(f)):n(f)}}const aI={tokenize:lI};function lI(t){const e=this,n=t.attempt(Rx,r,t.attempt(this.parser.constructs.flowInitial,i,Mt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(d7,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const oI={resolveAll:T5()},cI=j5("string"),uI=j5("text");function j5(t){return{resolveAll:T5(t==="text"?fI:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(h){return f(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return f(h)?(n.exit("data"),s(h)):(n.consume(h),u)}function f(h){if(h===null)return!0;const m=i[h];let O=-1;if(m)for(;++O<m.length;){const x=m[O];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function T5(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function fI(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,o=0,u;for(;s--;){const f=i[s];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(f===-2)u=!0,o++;else if(f!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const f={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(t.splice(n,0,["enter",f,e],["exit",f,e]),n+=2)}n++}return t}const dI={42:pr,43:pr,45:pr,48:pr,49:pr,50:pr,51:pr,52:pr,53:pr,54:pr,55:pr,56:pr,57:pr,62:v5},hI={91:O7},pI={[-2]:Vb,[-1]:Vb,32:Vb},mI={35:w7,42:Jg,45:[H$,Jg],60:j7,61:H$,95:Jg,96:U$,126:U$},gI={38:S5,92:b5},OI={[-5]:Ib,[-4]:Ib,[-3]:Ib,33:I7,38:S5,42:N1,60:[UV,A7],91:U7,92:[b7,b5],93:Jw,95:N1,96:a7},xI={null:[N1,oI]},yI={null:[42,95]},vI={null:[]},bI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yI,contentInitial:hI,disable:vI,document:dI,flow:mI,flowInitial:pI,insideSpan:xI,string:gI,text:OI},Symbol.toStringTag,{value:"Module"}));function SI(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const u={attempt:M(N),check:M(_),consume:j,enter:Q,exit:T,interrupt:M(_,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:v,parser:t,previous:null,sliceSerialize:O,sliceStream:x,write:m};let h=e.tokenize.call(f,u);return e.resolveAll&&s.push(e),f;function m(Z){return a=si(a,Z),k(),a[a.length-1]!==null?[]:(I(e,0),f.events=Kw(s,f.events,f),f.events)}function O(Z,X){return kI(x(Z),X)}function x(Z){return wI(a,Z)}function v(){const{_bufferIndex:Z,_index:X,line:H,column:E,offset:q}=r;return{_bufferIndex:Z,_index:X,line:H,column:E,offset:q}}function S(Z){i[Z.line]=Z.column,F()}function k(){let Z;for(;r._index<a.length;){const X=a[r._index];if(typeof X=="string")for(Z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Z&&r._bufferIndex<X.length;)w(X.charCodeAt(r._bufferIndex));else w(X)}}function w(Z){h=h(Z)}function j(Z){De(Z)?(r.line++,r.column=1,r.offset+=Z===-3?2:1,F()):Z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=Z}function Q(Z,X){const H=X||{};return H.type=Z,H.start=v(),f.events.push(["enter",H,f]),o.push(H),H}function T(Z){const X=o.pop();return X.end=v(),f.events.push(["exit",X,f]),X}function N(Z,X){I(Z,X.from)}function _(Z,X){X.restore()}function M(Z,X){return H;function H(E,q,R){let z,B,W,A;return Array.isArray(E)?Y(E):"tokenize"in E?Y([E]):D(E);function D(ne){return fe;function fe(oe){const me=oe!==null&&ne[oe],je=oe!==null&&ne.null,ke=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(je)?je:je?[je]:[]];return Y(ke)(oe)}}function Y(ne){return z=ne,B=0,ne.length===0?R:P(ne[B])}function P(ne){return fe;function fe(oe){return A=U(),W=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?ae():ne.tokenize.call(X?Object.assign(Object.create(f),X):f,u,ee,ae)(oe)}}function ee(ne){return Z(W,A),q}function ae(ne){return A.restore(),++B<z.length?P(z[B]):R}}}function I(Z,X){Z.resolveAll&&!s.includes(Z)&&s.push(Z),Z.resolve&&xs(f.events,X,f.events.length-X,Z.resolve(f.events.slice(X),f)),Z.resolveTo&&(f.events=Z.resolveTo(f.events,f))}function U(){const Z=v(),X=f.previous,H=f.currentConstruct,E=f.events.length,q=Array.from(o);return{from:E,restore:R};function R(){r=Z,f.previous=X,f.currentConstruct=H,f.events.length=E,o=q,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function wI(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function kI(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
362
+ `;break}case-3:{a=`\r
363
+ `;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function QI(t){const r={constructs:PV([bI,...(t||{}).extensions||[]]),content:i(XV),defined:[],document:i(BV),flow:i(aI),lazy:{},string:i(cI),text:i(uI)};return r;function i(s){return a;function a(o){return SI(r,s,o)}}}function CI(t){for(;!w5(t););return t}const G$=/[\0\t\n\r]/g;function jI(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const u=[];let f,h,m,O,x;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(G$.lastIndex=m,f=G$.exec(s),O=f&&f.index!==void 0?f.index:s.length,x=s.charCodeAt(O),!f){e=s.slice(m);break}if(x===10&&m===O&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<O&&(u.push(s.slice(m,O)),t+=O-m),x){case 0:{u.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,u.push(-2);t++<h;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}m=O+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const TI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $I(t){return t.replace(TI,_I)}function _I(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return y5(n.slice(s?2:1),s?16:10)}return Fw(n)||t}const $5={}.hasOwnProperty;function NI(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),PI(n)(CI(QI(n).document().write(jI()(t,e,!0))))}function PI(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Jt),autolinkProtocol:U,autolinkEmail:U,atxHeading:s(He),blockQuote:s(je),characterEscape:U,characterReference:U,codeFenced:s(ke),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(ke,a),codeText:s(we,a),codeTextData:U,data:U,codeFlowValue:U,definition:s(Qe),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Le),hardBreakEscape:s(ze),hardBreakTrailing:s(ze),htmlFlow:s(vt,a),htmlFlowData:U,htmlText:s(vt,a),htmlTextData:U,image:s(Qn),label:a,link:s(Jt),listItem:s(sr),listItemValue:O,listOrdered:s(Cn,m),listUnordered:s(Cn),paragraph:s(jr),reference:P,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(He),strong:s(Yr),thematicBreak:s(Si)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:me,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:ne,characterReference:fe,codeFenced:u(k),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:F,codeIndented:u(w),codeText:u(q),codeTextData:F,data:F,definition:u(),definitionDestinationString:T,definitionLabelString:j,definitionTitleString:Q,emphasis:u(),hardBreakEscape:u(X),hardBreakTrailing:u(X),htmlFlow:u(H),htmlFlowData:F,htmlText:u(E),htmlTextData:F,image:u(z),label:W,labelText:B,lineEnding:Z,link:u(R),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ee,resourceDestinationString:A,resourceTitleString:D,resource:Y,setextHeading:u(I),setextHeadingLineSequence:M,setextHeadingText:_,strong:u(),thematicBreak:u()}};_5(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ce){let ge={type:"root",children:[]};const Ne={stack:[ge],tokenStack:[],config:e,enter:o,exit:f,buffer:a,resume:h,data:n},Be=[];let Ke=-1;for(;++Ke<ce.length;)if(ce[Ke][1].type==="listOrdered"||ce[Ke][1].type==="listUnordered")if(ce[Ke][0]==="enter")Be.push(Ke);else{const Ie=Be.pop();Ke=i(ce,Ie,Ke)}for(Ke=-1;++Ke<ce.length;){const Ie=e[ce[Ke][0]];$5.call(Ie,ce[Ke][1].type)&&Ie[ce[Ke][1].type].call(Object.assign({sliceSerialize:ce[Ke][2].sliceSerialize},Ne),ce[Ke][1])}if(Ne.tokenStack.length>0){const Ie=Ne.tokenStack[Ne.tokenStack.length-1];(Ie[1]||F$).call(Ne,void 0,Ie[0])}for(ge.position={start:Ga(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Ga(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<e.transforms.length;)ge=e.transforms[Ke](ge)||ge;return ge}function i(ce,ge,Ne){let Be=ge-1,Ke=-1,Ie=!1,ht,kt,Qt,Vt;for(;++Be<=Ne;){const ot=ce[Be];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Ke++:Ke--,Vt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(ht&&!Vt&&!Ke&&!Qt&&(Qt=Be),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!Ke&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Ke===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(ht){let Ur=Be;for(kt=void 0;Ur--;){const jn=ce[Ur];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;kt&&(ce[kt][1].type="lineEndingBlank",Ie=!0),jn[1].type="lineEnding",kt=Ur}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Qt&&(!kt||Qt<kt)&&(ht._spread=!0),ht.end=Object.assign({},kt?ce[kt][1].start:ot[1].end),ce.splice(kt||Be,0,["exit",ht,ot[2]]),Be++,Ne++}if(ot[1].type==="listItemPrefix"){const Ur={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};ht=Ur,ce.splice(Be,0,["enter",Ur,ot[2]]),Be++,Ne++,Qt=void 0,Vt=!0}}}return ce[ge][1]._spread=Ie,Ne}function s(ce,ge){return Ne;function Ne(Be){o.call(this,ce(Be),Be),ge&&ge.call(this,Be)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(ce,ge,Ne){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([ge,Ne||void 0]),ce.position={start:Ga(ge.start),end:void 0}}function u(ce){return ge;function ge(Ne){ce&&ce.call(this,Ne),f.call(this,Ne)}}function f(ce,ge){const Ne=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==ce.type&&(ge?ge.call(this,ce,Be[0]):(Be[1]||F$).call(this,ce,Be[0]));else throw new Error("Cannot close `"+ce.type+"` ("+Wd({start:ce.start,end:ce.end})+"): it’s not open");Ne.position.end=Ga(ce.end)}function h(){return _V(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function O(ce){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ce}function v(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ce}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ce.replace(/(\r?\n|\r)$/g,"")}function j(ce){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ge,Ne.identifier=ru(this.sliceSerialize(ce)).toLowerCase()}function Q(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ce}function T(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ce}function N(ce){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Ne=this.sliceSerialize(ce).length;ge.depth=Ne}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function M(ce){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function U(ce){const Ne=this.stack[this.stack.length-1].children;let Be=Ne[Ne.length-1];(!Be||Be.type!=="text")&&(Be=en(),Be.position={start:Ga(ce.start),end:void 0},Ne.push(Be)),this.stack.push(Be)}function F(ce){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ce),ge.position.end=Ga(ce.end)}function Z(ce){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=ge.children[ge.children.length-1];Ne.position.end=Ga(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ge.type)&&(U.call(this,ce),F.call(this,ce))}function X(){this.data.atHardBreak=!0}function H(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ce}function E(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ce}function q(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ce}function R(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ge,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function z(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ge,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function B(ce){const ge=this.sliceSerialize(ce),Ne=this.stack[this.stack.length-2];Ne.label=$I(ge),Ne.identifier=ru(ge).toLowerCase()}function W(){const ce=this.stack[this.stack.length-1],ge=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Be=ce.children;Ne.children=Be}else Ne.alt=ge}function A(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ce}function D(){const ce=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ce}function Y(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function ee(ce){const ge=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ge,Ne.identifier=ru(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function ae(ce){this.data.characterReferenceType=ce.type}function ne(ce){const ge=this.sliceSerialize(ce),Ne=this.data.characterReferenceType;let Be;Ne?(Be=y5(ge,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Fw(ge);const Ke=this.stack[this.stack.length-1];Ke.value+=Be}function fe(ce){const ge=this.stack.pop();ge.position.end=Ga(ce.end)}function oe(ce){F.call(this,ce);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ce)}function me(ce){F.call(this,ce);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ce)}function je(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Qe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function vt(){return{type:"html",value:""}}function Qn(){return{type:"image",title:null,url:"",alt:null}}function Jt(){return{type:"link",title:null,url:"",children:[]}}function Cn(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function sr(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function jr(){return{type:"paragraph",children:[]}}function Yr(){return{type:"strong",children:[]}}function en(){return{type:"text",value:""}}function Si(){return{type:"thematicBreak"}}}function Ga(t){return{line:t.line,column:t.column,offset:t.offset}}function _5(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?_5(t,r):EI(t,r)}}function EI(t,e){let n;for(n in e)if($5.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function F$(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Wd({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Wd({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Wd({start:e.start,end:e.end})+") is still open")}function AI(t){const e=this;e.parser=n;function n(r){return NI(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function MI(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function RI(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
364
+ `}]}function zI(t,e){const n=e.value?e.value+`
365
+ `:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function DI(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function LI(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function XI(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=nf(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,f),t.applyData(e,f)}function ZI(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function BI(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function N5(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function qI(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return N5(t,e);const i={src:nf(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function VI(t,e){const n={src:nf(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function II(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function YI(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return N5(t,e);const i={href:nf(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function UI(t,e){const n={href:nf(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function WI(t,e,n){const r=t.all(e),i=n?HI(n):P5(e),s={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
366
+ `}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
367
+ `});const f={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,f),t.applyData(e,f)}function HI(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=P5(n[r])}return e}function P5(t){const e=t.spread;return e??t.children.length>1}function GI(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function FI(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function KI(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function JI(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function eY(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=Uw(e.children[1]),u=d5(e.children[e.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function tY(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let u=-1;const f=[];for(;++u<o;){const m=e.children[u],O={},x=a?a[u]:void 0;x&&(O.align=x);let v={type:"element",tagName:s,properties:O,children:[]};m&&(v.children=t.all(m),t.patch(m,v),v=t.applyData(m,v)),f.push(v)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(f,!0)};return t.patch(e,h),t.applyData(e,h)}function nY(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const K$=9,J$=32;function rY(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(e_(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(e_(e.slice(i),i>0,!1)),s.join("")}function e_(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===K$||s===J$;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===K$||s===J$;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function iY(t,e){const n={type:"text",value:rY(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function sY(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const aY={blockquote:MI,break:RI,code:zI,delete:DI,emphasis:LI,footnoteReference:XI,heading:ZI,html:BI,imageReference:qI,image:VI,inlineCode:II,linkReference:YI,link:UI,listItem:WI,list:GI,paragraph:FI,root:KI,strong:JI,table:eY,tableCell:nY,tableRow:tY,text:iY,thematicBreak:sY,toml:mg,yaml:mg,definition:mg,footnoteDefinition:mg};function mg(){}const E5=-1,zx=0,Gd=1,PO=2,ek=3,tk=4,nk=5,rk=6,A5=7,M5=8,t_=typeof self=="object"?self:globalThis,lY=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case zx:case E5:return n(a,i);case Gd:{const o=n([],i);for(const u of a)o.push(r(u));return o}case PO:{const o=n({},i);for(const[u,f]of a)o[r(u)]=r(f);return o}case ek:return n(new Date(a),i);case tk:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case nk:{const o=n(new Map,i);for(const[u,f]of a)o.set(r(u),r(f));return o}case rk:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case A5:{const{name:o,message:u}=a;return n(new t_[o](u),i)}case M5:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new t_[s](a),i)};return r},n_=t=>lY(new Map,t)(0),Dc="",{toString:oY}={},{keys:cY}=Object,Od=t=>{const e=typeof t;if(e!=="object"||!t)return[zx,e];const n=oY.call(t).slice(8,-1);switch(n){case"Array":return[Gd,Dc];case"Object":return[PO,Dc];case"Date":return[ek,Dc];case"RegExp":return[tk,Dc];case"Map":return[nk,Dc];case"Set":return[rk,Dc];case"DataView":return[Gd,n]}return n.includes("Array")?[Gd,n]:n.includes("Error")?[A5,n]:[PO,n]},gg=([t,e])=>t===zx&&(e==="function"||e==="symbol"),uY=(t,e,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},s=a=>{if(n.has(a))return n.get(a);let[o,u]=Od(a);switch(o){case zx:{let h=a;switch(u){case"bigint":o=M5,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([E5],a)}return i([o,h],a)}case Gd:{if(u){let O=a;return u==="DataView"?O=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(O=new Uint8Array(a)),i([u,[...O]],a)}const h=[],m=i([o,h],a);for(const O of a)h.push(s(O));return m}case PO:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const h=[],m=i([o,h],a);for(const O of cY(a))(t||!gg(Od(a[O])))&&h.push([s(O),s(a[O])]);return m}case ek:return i([o,a.toISOString()],a);case tk:{const{source:h,flags:m}=a;return i([o,{source:h,flags:m}],a)}case nk:{const h=[],m=i([o,h],a);for(const[O,x]of a)(t||!(gg(Od(O))||gg(Od(x))))&&h.push([s(O),s(x)]);return m}case rk:{const h=[],m=i([o,h],a);for(const O of a)(t||!gg(Od(O)))&&h.push(s(O));return m}}const{message:f}=a;return i([o,{name:u,message:f}],a)};return s},r_=(t,{json:e,lossy:n}={})=>{const r=[];return uY(!(e||n),!!e,new Map,r)(t),r},EO=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?n_(r_(t,e)):structuredClone(t):(t,e)=>n_(r_(t,e));function fY(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function dY(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function hY(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||fY,r=t.options.footnoteBackLabel||dY,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<t.footnoteOrder.length;){const f=t.footnoteById.get(t.footnoteOrder[u]);if(!f)continue;const h=t.all(f),m=String(f.identifier).toUpperCase(),O=nf(m.toLowerCase());let x=0;const v=[],S=t.footnoteCounts.get(m);for(;S!==void 0&&++x<=S;){v.length>0&&v.push({type:"text",value:" "});let j=typeof n=="string"?n:n(u,x);typeof j=="string"&&(j={type:"text",value:j}),v.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+O+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const k=h[h.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const j=k.children[k.children.length-1];j&&j.type==="text"?j.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else h.push(...v);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+O},children:t.wrap(h,!0)};t.patch(f,w),o.push(w)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...EO(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
368
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
369
+ `}]}}const R5=(function(t){if(t==null)return OY;if(typeof t=="function")return Dx(t);if(typeof t=="object")return Array.isArray(t)?pY(t):mY(t);if(typeof t=="string")return gY(t);throw new Error("Expected function, string, or object as test")});function pY(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=R5(t[n]);return Dx(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function mY(t){const e=t;return Dx(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function gY(t){return Dx(e);function e(n){return n&&n.type===t}}function Dx(t){return e;function e(n,r,i){return!!(xY(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function OY(){return!0}function xY(t){return t!==null&&typeof t=="object"&&"type"in t}const z5=[],yY=!0,i_=!1,vY="skip";function bY(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=R5(i),a=r?-1:1;o(t,void 0,[])();function o(u,f,h){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(O,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return O;function O(){let x=z5,v,S,k;if((!e||s(u,f,h[h.length-1]||void 0))&&(x=SY(n(u,h)),x[0]===i_))return x;if("children"in u&&u.children){const w=u;if(w.children&&x[0]!==vY)for(S=(r?w.children.length:-1)+a,k=h.concat(w);S>-1&&S<w.children.length;){const j=w.children[S];if(v=o(j,S,k)(),v[0]===i_)return v;S=typeof v[1]=="number"?v[1]:S+a}}return x}}}function SY(t){return Array.isArray(t)?t:typeof t=="number"?[yY,t]:t==null?z5:[t]}function D5(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),bY(t,s,o,i);function o(u,f){const h=f[f.length-1],m=h?h.children.indexOf(u):void 0;return a(u,m,h)}}const P1={}.hasOwnProperty,wY={};function kY(t,e){const n=e||wY,r=new Map,i=new Map,s=new Map,a={...aY,...n.handlers},o={all:f,applyData:CY,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:QY,wrap:TY};return D5(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?r:i,O=String(h.identifier).toUpperCase();m.has(O)||m.set(O,h)}}),o;function u(h,m){const O=h.type,x=o.handlers[O];if(P1.call(o.handlers,O)&&x)return x(o,h,m);if(o.options.passThrough&&o.options.passThrough.includes(O)){if("children"in h){const{children:S,...k}=h,w=EO(k);return w.children=o.all(h),w}return EO(h)}return(o.options.unknownHandler||jY)(o,h,m)}function f(h){const m=[];if("children"in h){const O=h.children;let x=-1;for(;++x<O.length;){const v=o.one(O[x],h);if(v){if(x&&O[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=s_(v.value)),!Array.isArray(v)&&v.type==="element")){const S=v.children[0];S&&S.type==="text"&&(S.value=s_(S.value))}Array.isArray(v)?m.push(...v):m.push(v)}}}return m}}function QY(t,e){t.position&&(e.position=oV(t))}function CY(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,EO(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function jY(t,e){const n=e.data||{},r="value"in e&&!(P1.call(n,"hProperties")||P1.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function TY(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
370
+ `});++r<t.length;)r&&n.push({type:"text",value:`
371
+ `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
372
+ `}),n}function s_(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function a_(t,e){const n=kY(t,e),r=n.one(t,void 0),i=hY(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
373
+ `},i),s}function $Y(t,e){return t&&"run"in t?async function(n,r){const i=a_(n,{file:r,...e});await t.run(i,r)}:function(n,r){return a_(n,{file:r,...t||e})}}function l_(t){if(t)throw t}var Yb,o_;function _Y(){if(o_)return Yb;o_=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):e.call(f)==="[object Array]"},s=function(f){if(!f||e.call(f)!=="[object Object]")return!1;var h=t.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&t.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!m)return!1;var O;for(O in f);return typeof O>"u"||t.call(f,O)},a=function(f,h){n&&h.name==="__proto__"?n(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},o=function(f,h){if(h==="__proto__")if(t.call(f,h)){if(r)return r(f,h).value}else return;return f[h]};return Yb=function u(){var f,h,m,O,x,v,S=arguments[0],k=1,w=arguments.length,j=!1;for(typeof S=="boolean"&&(j=S,S=arguments[1]||{},k=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});k<w;++k)if(f=arguments[k],f!=null)for(h in f)m=o(S,h),O=o(f,h),S!==O&&(j&&O&&(s(O)||(x=i(O)))?(x?(x=!1,v=m&&i(m)?m:[]):v=m&&s(m)?m:{},a(S,{name:h,newValue:u(j,v,O)})):typeof O<"u"&&a(S,{name:h,newValue:O}));return S},Yb}var NY=_Y();const Ub=Px(NY);function E1(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function PY(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...f){const h=t[++s];let m=-1;if(u){a(u);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,h?EY(h,o)(...f):a(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function EY(t,e){let n;return r;function r(...a){const o=t.length>a.length;let u;o&&a.push(i);try{u=t.apply(this,a)}catch(f){const h=f;if(o&&n)throw h;return i(h)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const Ji={basename:AY,dirname:MY,extname:RY,join:zY,sep:"/"};function AY(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');mp(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function MY(t){if(mp(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function RY(t){mp(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function zY(...t){let e=-1,n;for(;++e<t.length;)mp(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":DY(n)}function DY(t){mp(t);const e=t.codePointAt(0)===47;let n=LY(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function LY(t,e){let n="",r=0,i=-1,s=0,a=-1,o,u;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function mp(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const XY={cwd:ZY};function ZY(){return"/"}function A1(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function BY(t){if(typeof t=="string")t=new URL(t);else if(!A1(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return qY(t)}function qY(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Wb=["history","path","basename","stem","extname","dirname"];class L5{constructor(e){let n;e?A1(e)?n={path:e}:typeof e=="string"||VY(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":XY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Wb.length;){const s=Wb[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Wb.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ji.basename(this.path):void 0}set basename(e){Gb(e,"basename"),Hb(e,"basename"),this.path=Ji.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ji.dirname(this.path):void 0}set dirname(e){c_(this.basename,"dirname"),this.path=Ji.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ji.extname(this.path):void 0}set extname(e){if(Hb(e,"extname"),c_(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ji.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){A1(e)&&(e=BY(e)),Gb(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ji.basename(this.path,this.extname):void 0}set stem(e){Gb(e,"stem"),Hb(e,"stem"),this.path=Ji.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Un(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Hb(t,e){if(t&&t.includes(Ji.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ji.sep+"`")}function Gb(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function c_(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function VY(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const IY=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),YY={}.hasOwnProperty;class ik extends IY{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=PY()}copy(){const e=new ik;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Ub(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Jb("data",this.frozen),this.namespace[e]=n,this):YY.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Jb("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Og(e),r=this.parser||this.Parser;return Fb("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Fb("process",this.parser||this.Parser),Kb("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Og(e),u=r.parse(o);r.run(u,o,function(h,m,O){if(h||!m||!O)return f(h);const x=m,v=r.stringify(x,O);HY(v)?O.value=v:O.result=v,f(h,O)});function f(h,m){h||!m?a(h):s?s(m):n(void 0,m)}}}processSync(e){let n=!1,r;return this.freeze(),Fb("processSync",this.parser||this.Parser),Kb("processSync",this.compiler||this.Compiler),this.process(e,i),f_("processSync","process",n),r;function i(s,a){n=!0,l_(s),r=a}}run(e,n,r){u_(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const u=Og(n);i.run(e,u,f);function f(h,m,O){const x=m||e;h?o(h):a?a(x):r(void 0,x,O)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),f_("runSync","run",r),i;function s(a,o){l_(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=Og(n),i=this.compiler||this.Compiler;return Kb("stringify",i),u_(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(Jb("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[h,...m]=f;u(h,m)}else a(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function a(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(f.plugins),f.settings&&(i.settings=Ub(!0,i.settings,f.settings))}function o(f){let h=-1;if(f!=null)if(Array.isArray(f))for(;++h<f.length;){const m=f[h];s(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,h){let m=-1,O=-1;for(;++m<r.length;)if(r[m][0]===f){O=m;break}if(O===-1)r.push([f,...h]);else if(h.length>0){let[x,...v]=h;const S=r[O][1];E1(S)&&E1(x)&&(x=Ub(!0,S,x)),r[O]=[f,x,...v]}}}}const UY=new ik().freeze();function Fb(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Kb(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Jb(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function u_(t){if(!E1(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function f_(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Og(t){return WY(t)?t:new L5(t)}function WY(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function HY(t){return typeof t=="string"||GY(t)}function GY(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const FY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",d_=[],h_={allowDangerousHtml:!0},KY=/^(https?|ircs?|mailto|xmpp)$/i,JY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function X5(t){const e=eU(t),n=tU(t);return nU(e.runSync(e.parse(n),n),t)}function eU(t){const e=t.rehypePlugins||d_,n=t.remarkPlugins||d_,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...h_}:h_;return UY().use(AI).use(n).use($Y,r).use(e)}function tU(t){const e=t.children||"",n=new L5;return typeof e=="string"&&(n.value=e),n}function nU(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||rU;for(const h of JY)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+FY+h.id,void 0);return D5(t,f),hV(t,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function f(h,m,O){if(h.type==="raw"&&O&&typeof m=="number")return a?O.children.splice(m,1):O.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in qb)if(Object.hasOwn(qb,x)&&Object.hasOwn(h.properties,x)){const v=h.properties[x],S=qb[x];(S===null||S.includes(h.tagName))&&(h.properties[x]=u(String(v||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(h,m,O)),x&&O&&typeof m=="number")return o&&h.children?O.children.splice(m,1,...h.children):O.children.splice(m,1),m}}}function rU(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||KY.test(t.slice(0,e))?t:""}let M1=[],Z5=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,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(e%2?Z5:M1).push(n=n+t[e])})();function iU(t){if(t<768)return!1;for(let e=0,n=M1.length;;){let r=e+n>>1;if(t<M1[r])n=r;else if(t>=Z5[r])e=r+1;else return!0;if(e==n)return!1}}function p_(t){return t>=127462&&t<=127487}const m_=8205;function sU(t,e,n=!0,r=!0){return(n?B5:aU)(t,e,r)}function B5(t,e,n){if(e==t.length)return e;e&&q5(t.charCodeAt(e))&&V5(t.charCodeAt(e-1))&&e--;let r=e0(t,e);for(e+=g_(r);e<t.length;){let i=e0(t,e);if(r==m_||i==m_||n&&iU(i))e+=g_(i),r=i;else if(p_(i)){let s=0,a=e-2;for(;a>=0&&p_(e0(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function aU(t,e,n){for(;e>0;){let r=B5(t,e-2,n);if(r<e)return r;e--}return 0}function e0(t,e){let n=t.charCodeAt(e);if(!V5(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return q5(r)?(n-55296<<10)+(r-56320)+65536:n}function q5(t){return t>=56320&&t<57344}function V5(t){return t>=55296&&t<56320}function g_(t){return t<65536?1:2}class st{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Cu(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),ls.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Cu(this,e,n);let r=[];return this.decompose(e,n,r,0),ls.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Fd(this),s=new Fd(e);for(let a=n,o=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new Fd(this,e)}iterRange(e,n=this.length){return new I5(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Y5(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?st.empty:e.length<=32?new rn(e):ls.from(rn.split(e,[]))}}class rn extends st{constructor(e,n=lU(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.text[s],o=i+a.length;if((n?r:o)>=e)return new oU(i,o,r,a);i=o+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new rn(O_(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=eO(s.text,a.text.slice(),0,s.length);if(o.length<=32)r.push(new rn(o,a.length+s.length));else{let u=o.length>>1;r.push(new rn(o.slice(0,u)),new rn(o.slice(u)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof rn))return super.replace(e,n,r);[e,n]=Cu(this,e,n);let i=eO(this.text,eO(r.text,O_(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new rn(i,s):ls.from(rn.split(i,[]),s)}sliceString(e,n=this.length,r=`
374
+ `){[e,n]=Cu(this,e,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let o=this.text[a],u=s+o.length;s>e&&a&&(i+=r),e<u&&n>s&&(i+=o.slice(Math.max(0,e-s),n-s)),s=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new rn(r,i)),r=[],i=-1);return i>-1&&n.push(new rn(r,i)),n}}class ls extends st{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.children[s],o=i+a.length,u=r+a.lines-1;if((n?u:o)>=e)return a.lineInner(e,n,r,i);i=o+1,r=u+1}}decompose(e,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let o=this.children[s],u=a+o.length;if(e<=u&&n>=a){let f=i&((a<=e?1:0)|(u>=n?2:0));a>=e&&u<=n&&!f?r.push(o):o.decompose(e-a,n-a,r,f)}a=u+1}}replace(e,n,r){if([e,n]=Cu(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],o=s+a.length;if(e>=s&&n<=o){let u=a.replace(e-s,n-s,r),f=this.lines-a.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){let h=this.children.slice();return h[i]=u,new ls(h,this.length-(n-e)+r.length)}return super.replace(s,o,u)}s=o+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
375
+ `){[e,n]=Cu(this,e,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let o=this.children[s],u=a+o.length;a>e&&s&&(i+=r),e<u&&n>a&&(i+=o.sliceString(e-a,n-a,r)),a=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof ls))return 0;let r=0,[i,s,a,o]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==o)return r;let u=this.children[i],f=e.children[s];if(u!=f)return r+u.scanIdentical(f,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let v of e)v.flatten(x);return new rn(x,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,o=[],u=0,f=-1,h=[];function m(x){let v;if(x.lines>s&&x instanceof ls)for(let S of x.children)m(S);else x.lines>a&&(u>a||!u)?(O(),o.push(x)):x instanceof rn&&u&&(v=h[h.length-1])instanceof rn&&x.lines+v.lines<=32?(u+=x.lines,f+=x.length+1,h[h.length-1]=new rn(v.text.concat(x.text),v.length+1+x.length)):(u+x.lines>i&&O(),u+=x.lines,f+=x.length+1,h.push(x))}function O(){u!=0&&(o.push(h.length==1?h[0]:ls.from(h,f)),f=-1,u=h.length=0)}for(let x of e)m(x);return O(),o.length==1?o[0]:new ls(o,n)}}st.empty=new rn([""],0);function lU(t){let e=-1;for(let n of t)e+=n.length+1;return e}function eO(t,e,n=0,r=1e9){for(let i=0,s=0,a=!0;s<t.length&&i<=r;s++){let o=t[s],u=i+o.length;u>=n&&(u>r&&(o=o.slice(0,r-i)),i<n&&(o=o.slice(n-i)),a?(e[e.length-1]+=o,a=!1):e.push(o)),i=u+1}return e}function O_(t,e,n){return eO(t,[""],e,n)}class Fd{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof rn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,o=i instanceof rn?i.text.length:i.children.length;if(a==(n>0?o:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
376
+ `,this;e--}else if(i instanceof rn){let u=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[a+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof rn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class I5{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Fd(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Y5{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(st.prototype[Symbol.iterator]=function(){return this.iter()},Fd.prototype[Symbol.iterator]=I5.prototype[Symbol.iterator]=Y5.prototype[Symbol.iterator]=function(){return this});let oU=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function Cu(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function In(t,e,n=!0,r=!0){return sU(t,e,n,r)}function cU(t){return t>=56320&&t<57344}function uU(t){return t>=55296&&t<56320}function fU(t,e){let n=t.charCodeAt(e);if(!uU(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return cU(r)?(n-55296<<10)+(r-56320)+65536:n}function dU(t){return t<65536?1:2}const R1=/\r\n?|\n/;var er=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(er||(er={}));class ms{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(e,n=!1){z1(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new ms(e)}composeDesc(e){return this.empty?e:e.empty?this:U5(this,e)}mapDesc(e,n=!1){return e.empty?this:D1(this,e,n)}mapPos(e,n=-1,r=er.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],u=this.sections[a++],f=i+o;if(u<0){if(f>e)return s+(e-i);s+=o}else{if(r!=er.Simple&&f>=e&&(r==er.TrackDel&&i<e&&f>e||r==er.TrackBefore&&i<e||r==er.TrackAfter&&f>e))return null;if(f>e||f==e&&n<0&&!o)return e==i||n<0?s:s+u;s+=u}i=f}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],o=i+s;if(a>=0&&i<=n&&o>=e)return i<e&&o>n?"cover":!0;i=o}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ms(e)}static create(e){return new ms(e)}}class vn extends ms{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return z1(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return D1(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],o=n[i+1];if(o>=0){n[i]=o,n[i+1]=a;let u=i>>1;for(;r.length<u;)r.push(st.empty);r.push(a?e.slice(s,s+a):st.empty)}s+=a}return new vn(n,r)}compose(e){return this.empty?e:e.empty?this:U5(this,e,!0)}map(e,n=!1){return e.empty?this:D1(this,e,n,!0)}iterChanges(e,n=!1){z1(this,e,n)}get desc(){return ms.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new wh(this);e:for(let a=0,o=0;;){let u=a==e.length?1e9:e[a++];for(;o<u||o==u&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,u-o);qn(i,h,-1);let m=s.ins==-1?-1:s.off==0?s.ins:0;qn(n,h,m),m>0&&gl(r,n,s.text),s.forward(h),o+=h}let f=e[a++];for(;o<f;){if(s.done)break e;let h=Math.min(s.len,f-o);qn(n,h,-1),qn(i,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),o+=h}}return{changes:new vn(n,r),filtered:ms.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],a=0,o=null;function u(h=!1){if(!h&&!i.length)return;a<n&&qn(i,n-a,-1);let m=new vn(i,s);o=o?o.compose(m.map(o)):m,i=[],s=[],a=0}function f(h){if(Array.isArray(h))for(let m of h)f(m);else if(h instanceof vn){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);u(),o=o?o.compose(h.map(o)):h}else{let{from:m,to:O=m,insert:x}=h;if(m>O||m<0||O>n)throw new RangeError(`Invalid change range ${m} to ${O} (in doc of length ${n})`);let v=x?typeof x=="string"?st.of(x.split(r||R1)):x:st.empty,S=v.length;if(m==O&&S==0)return;m<a&&u(),m>a&&qn(i,m-a,-1),qn(i,O-m,S),gl(s,i,v),a=O}}return f(e),u(!o),o}static empty(e){return new vn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,o)=>o&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(st.empty);r[i]=st.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new vn(n,r)}static createSet(e,n){return new vn(e,n)}}function qn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function gl(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(st.empty);t.push(n)}}function z1(t,e,n){let r=t.inserted;for(let i=0,s=0,a=0;a<t.sections.length;){let o=t.sections[a++],u=t.sections[a++];if(u<0)i+=o,s+=o;else{let f=i,h=s,m=st.empty;for(;f+=o,h+=u,u&&r&&(m=m.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)o=t.sections[a++],u=t.sections[a++];e(i,f,s,h,m),i=f,s=h}}}function D1(t,e,n,r=!1){let i=[],s=r?[]:null,a=new wh(t),o=new wh(e);for(let u=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let f=Math.min(a.len,o.len);qn(i,f,-1),a.forward(f),o.forward(f)}else if(o.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(o.len<a.len||o.len==a.len&&!n))){let f=o.len;for(qn(i,o.ins,-1);f;){let h=Math.min(a.len,f);a.ins>=0&&u<a.i&&a.len<=h&&(qn(i,0,a.ins),s&&gl(s,i,a.text),u=a.i),a.forward(h),f-=h}o.next()}else if(a.ins>=0){let f=0,h=a.len;for(;h;)if(o.ins==-1){let m=Math.min(h,o.len);f+=m,h-=m,o.forward(m)}else if(o.ins==0&&o.len<h)h-=o.len,o.next();else break;qn(i,f,u<a.i?a.ins:0),s&&u<a.i&&gl(s,i,a.text),u=a.i,a.forward(a.len-h)}else{if(a.done&&o.done)return s?vn.createSet(i,s):ms.create(i);throw new Error("Mismatched change set lengths")}}}function U5(t,e,n=!1){let r=[],i=n?[]:null,s=new wh(t),a=new wh(e);for(let o=!1;;){if(s.done&&a.done)return i?vn.createSet(r,i):ms.create(r);if(s.ins==0)qn(r,s.len,0,o),s.next();else if(a.len==0&&!a.done)qn(r,0,a.ins,o),i&&gl(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,a.len),f=r.length;if(s.ins==-1){let h=a.ins==-1?-1:a.off?0:a.ins;qn(r,u,h,o),i&&h&&gl(i,r,a.text)}else a.ins==-1?(qn(r,s.off?0:s.len,u,o),i&&gl(i,r,s.textBit(u))):(qn(r,s.off?0:s.len,a.off?0:a.ins,o),i&&!a.off&&gl(i,r,a.text));o=(s.ins>u||a.ins>=0&&a.len>u)&&(o||r.length>f),s.forward2(u),a.forward(u)}}}}class wh{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?st.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?st.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ho{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new ho(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return pe.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return pe.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return pe.range(e.anchor,e.head)}static create(e,n,r){return new ho(e,n,r)}}class pe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:pe.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new pe([this.main],0)}addRange(e,n=!0){return pe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,pe.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new pe(e.ranges.map(n=>ho.fromJSON(n)),e.main)}static single(e,n=e){return new pe([pe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return pe.normalized(e.slice(),n);r=s.to}return new pe(e,n)}static cursor(e,n=0,r,i){return ho.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?ho.create(n,e,48|a):ho.create(e,n,(s?s<0?8:16:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],a=e[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let o=a.from,u=Math.max(s.to,a.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?pe.range(u,o):pe.range(o,u))}}return new pe(e,n)}}function W5(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let sk=0;class Re{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=sk++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Re(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:ak),!!e.static,e.enables)}of(e){return new tO([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new tO(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new tO(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function ak(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class tO{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=sk++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,o=this.type==2,u=!1,f=!1,h=[];for(let m of this.dependencies)m=="doc"?u=!0:m=="selection"?f=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,O){if(u&&O.docChanged||f&&(O.docChanged||O.selection)||L1(m,h)){let x=r(m);if(o?!x_(x,m.values[a],i):!i(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,O)=>{let x,v=O.config.address[s];if(v!=null){let S=MO(O,v);if(this.dependencies.every(k=>k instanceof Re?O.facet(k)===m.facet(k):k instanceof ga?O.field(k,!1)==m.field(k,!1):!0)||(o?x_(x=r(m),S,i):i(x=r(m),S)))return m.values[a]=S,0}else x=r(m);return m.values[a]=x,1}}}}function x_(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function L1(t,e){let n=!1;for(let r of e)Kd(t,r)&1&&(n=!0);return n}function hU(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),s=r.filter(u=>!(u&1)),a=t[e.id]>>1;function o(u){let f=[];for(let h=0;h<r.length;h++){let m=MO(u,r[h]);if(i[h]==2)for(let O of m)f.push(O);else f.push(m)}return e.combine(f)}return{create(u){for(let f of r)Kd(u,f);return u.values[a]=o(u),1},update(u,f){if(!L1(u,s))return 0;let h=o(u);return e.compare(h,u.values[a])?0:(u.values[a]=h,1)},reconfigure(u,f){let h=L1(u,r),m=f.config.facets[e.id],O=f.facet(e);if(m&&!h&&ak(n,m))return u.values[a]=O,0;let x=o(u);return e.compare(x,O)?(u.values[a]=O,0):(u.values[a]=x,1)}}}const xg=Re.define({static:!0});class ga{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new ga(sk++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(xg).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet(xg),a=i.facet(xg),o;return(o=s.find(u=>u.field==this))&&o!=a.find(u=>u.field==this)?(r.values[n]=o.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,xg.of({field:this,create:e})]}get extension(){return this}}const ao={lowest:4,low:3,default:2,high:1,highest:0};function xd(t){return e=>new H5(e,t)}const gp={highest:xd(ao.highest),high:xd(ao.high),default:xd(ao.default),low:xd(ao.low),lowest:xd(ao.lowest)};class H5{constructor(e,n){this.inner=e,this.prec=n}}class Lx{of(e){return new X1(this,e)}reconfigure(e){return Lx.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class X1{constructor(e,n){this.compartment=e,this.inner=n}}class AO{constructor(e,n,r,i,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),a=new Map;for(let O of pU(e,n,a))O instanceof ga?i.push(O):(s[O.facet.id]||(s[O.facet.id]=[])).push(O);let o=Object.create(null),u=[],f=[];for(let O of i)o[O.id]=f.length<<1,f.push(x=>O.slot(x));let h=r==null?void 0:r.config.facets;for(let O in s){let x=s[O],v=x[0].facet,S=h&&h[O]||[];if(x.every(k=>k.type==0))if(o[v.id]=u.length<<1|1,ak(S,x))u.push(r.facet(v));else{let k=v.combine(x.map(w=>w.value));u.push(r&&v.compare(k,r.facet(v))?r.facet(v):k)}else{for(let k of x)k.type==0?(o[k.id]=u.length<<1|1,u.push(k.value)):(o[k.id]=f.length<<1,f.push(w=>k.dynamicSlot(w)));o[v.id]=f.length<<1,f.push(k=>hU(k,v,x))}}let m=f.map(O=>O(o));return new AO(e,a,m,o,u,s)}}function pU(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(a,o){let u=i.get(a);if(u!=null){if(u<=o)return;let f=r[u].indexOf(a);f>-1&&r[u].splice(f,1),a instanceof X1&&n.delete(a.compartment)}if(i.set(a,o),Array.isArray(a))for(let f of a)s(f,o);else if(a instanceof X1){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(a.compartment)||a.inner;n.set(a.compartment,f),s(f,o)}else if(a instanceof H5)s(a.inner,a.prec);else if(a instanceof ga)r[o].push(a),a.provides&&s(a.provides,o);else if(a instanceof tO)r[o].push(a),a.facet.extensions&&s(a.facet.extensions,ao.default);else{let f=a.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(f,o)}}return s(t,ao.default),r.reduce((a,o)=>a.concat(o))}function Kd(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function MO(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const G5=Re.define(),Z1=Re.define({combine:t=>t.some(e=>e),static:!0}),F5=Re.define({combine:t=>t.length?t[0]:void 0,static:!0}),K5=Re.define(),J5=Re.define(),eM=Re.define(),tM=Re.define({combine:t=>t.length?t[0]:!1});class Oa{constructor(e,n){this.type=e,this.value=n}static define(){return new mU}}class mU{of(e){return new Oa(this,e)}}class gU{constructor(e){this.map=e}of(e){return new Zt(this,e)}}class Zt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Zt(this.type,n)}is(e){return this.type==e}static define(e={}){return new gU(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}Zt.reconfigure=Zt.define();Zt.appendConfig=Zt.define();class pn{constructor(e,n,r,i,s,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&W5(r,n.newLength),s.some(o=>o.type==pn.time)||(this.annotations=s.concat(pn.time.of(Date.now())))}static create(e,n,r,i,s,a){return new pn(e,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(pn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}pn.time=Oa.define();pn.userEvent=Oa.define();pn.addToHistory=Oa.define();pn.remote=Oa.define();function OU(t,e){let n=[];for(let r=0,i=0;;){let s,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],a=t[r++];else if(i<e.length)s=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function nM(t,e,n){var r;let i,s,a;return n?(i=e.changes,s=vn.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Zt.mapEffects(t.effects,i).concat(Zt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function B1(t,e,n){let r=e.selection,i=iu(e.annotations);return e.userEvent&&(i=i.concat(pn.userEvent.of(e.userEvent))),{changes:e.changes instanceof vn?e.changes:vn.of(e.changes||[],n,t.facet(F5)),selection:r&&(r instanceof pe?r:pe.single(r.anchor,r.head)),effects:iu(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function rM(t,e,n){let r=B1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;r=nM(r,B1(t,e[s],a?r.changes.newLength:t.doc.length),a)}let i=pn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return yU(n?xU(i):i)}function xU(t){let e=t.startState,n=!0;for(let i of e.facet(K5)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:OU(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=vn.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=pn.create(e,i,t.selection&&t.selection.map(s),Zt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(J5);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof pn?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof pn?t=s[0]:t=rM(e,iu(s),!1)}return t}function yU(t){let e=t.startState,n=e.facet(eM),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=nM(r,B1(e,s,t.changes.newLength),!0))}return r==t?t:pn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const vU=[];function iu(t){return t==null?vU:Array.isArray(t)?t:[t]}var Ks=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Ks||(Ks={}));const bU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let q1;try{q1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function SU(t){if(q1)return q1.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||bU.test(n)))return!0}return!1}function wU(t){return e=>{if(!/\S/.test(e))return Ks.Space;if(SU(e))return Ks.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Ks.Word;return Ks.Other}}class ft{constructor(e,n,r,i,s,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)Kd(this,o<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Kd(this,r),MO(this,r)}update(...e){return rM(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let o of e.effects)o.is(Lx.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,f)=>i.set(f,u)),n=null),i.set(o.value.compartment,o.value.extension)):o.is(Zt.reconfigure)?(n=null,r=o.value):o.is(Zt.appendConfig)&&(n=null,r=iu(r).concat(o.value));let s;n?s=e.startState.values.slice():(n=AO.resolve(r,i,this),s=new ft(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,f)=>f.reconfigure(u,this),null).values);let a=e.startState.facet(Z1)?e.newSelection:e.newSelection.asSingle();new ft(n,e.newDoc,a,s,(o,u)=>u.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:pe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=iu(r.effects);for(let o=1;o<n.ranges.length;o++){let u=e(n.ranges[o]),f=this.changes(u.changes),h=f.map(i);for(let O=0;O<o;O++)s[O]=s[O].map(h);let m=i.mapDesc(f,!0);s.push(u.range.map(m)),i=i.compose(h),a=Zt.mapEffects(a,h).concat(Zt.mapEffects(iu(u.effects),m))}return{changes:i,selection:pe.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof vn?e:vn.of(e,this.doc.length,this.facet(ft.lineSeparator))}toText(e){return st.of(e.split(this.facet(ft.lineSeparator)||R1))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Kd(this,n),MO(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof ga&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let a=r[s],o=e[s];i.push(a.init(u=>a.spec.fromJSON(o,u)))}}return ft.create({doc:e.doc,selection:pe.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=AO.resolve(e.extensions||[],new Map),r=e.doc instanceof st?e.doc:st.of((e.doc||"").split(n.staticFacet(ft.lineSeparator)||R1)),i=e.selection?e.selection instanceof pe?e.selection:pe.single(e.selection.anchor,e.selection.head):pe.single(0);return W5(i,r.length),n.staticFacet(Z1)||(i=i.asSingle()),new ft(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(ft.tabSize)}get lineBreak(){return this.facet(ft.lineSeparator)||`
377
+ `}get readOnly(){return this.facet(tM)}phrase(e,...n){for(let r of this.facet(ft.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(G5))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return wU(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-r,o=e-r;for(;a>0;){let u=In(n,a,!1);if(s(n.slice(u,a))!=Ks.Word)break;a=u}for(;o<i;){let u=In(n,o);if(s(n.slice(o,u))!=Ks.Word)break;o=u}return a==o?null:pe.range(a+r,o+r)}}ft.allowMultipleSelections=Z1;ft.tabSize=Re.define({combine:t=>t.length?t[0]:4});ft.lineSeparator=F5;ft.readOnly=tM;ft.phrases=Re.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});ft.languageData=G5;ft.changeFilter=K5;ft.transactionFilter=J5;ft.transactionExtender=eM;Lx.reconfigure=Zt.define();function kU(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let a=i[s],o=r[s];if(o===void 0)r[s]=a;else if(!(o===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](o,a);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class bl{eq(e){return this==e}range(e,n=e){return V1.create(e,n,this)}}bl.prototype.startSide=bl.prototype.endSide=0;bl.prototype.point=!1;bl.prototype.mapMode=er.TrackDel;function lk(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let V1=class iM{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new iM(e,n,r)}};function I1(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class ok{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let a=i,o=s.length;;){if(a==o)return a;let u=a+o>>1,f=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==a)return f>=0?a:o;f>=0?o=u:a=u+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],a=-1,o=-1;for(let u=0;u<this.value.length;u++){let f=this.value[u],h=this.from[u]+e,m=this.to[u]+e,O,x;if(h==m){let v=n.mapPos(h,f.startSide,f.mapMode);if(v==null||(O=x=v,f.startSide!=f.endSide&&(x=n.mapPos(h,f.endSide),x<O)))continue}else if(O=n.mapPos(h,f.startSide),x=n.mapPos(m,f.endSide),O>x||O==x&&f.startSide>0&&f.endSide<=0)continue;(x-O||f.endSide-f.startSide)<0||(a<0&&(a=O),f.point&&(o=Math.max(o,x-O)),r.push(f),i.push(O-a),s.push(x-a))}return{mapped:r.length?new ok(i,s,r,o):null,pos:a}}}class wt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new wt(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(I1)),this.isEmpty)return n.length?wt.of(n):this;let o=new sM(this,null,-1).goto(0),u=0,f=[],h=new kh;for(;o.value||u<n.length;)if(u<n.length&&(o.from-n[u].from||o.startSide-n[u].value.startSide)>=0){let m=n[u++];h.addInner(m.from,m.to,m.value)||f.push(m)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(o.chunkIndex)<n[u].from)&&(!a||i>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!a||i>o.to||s<o.from||a(o.from,o.to,o.value))&&(h.addInner(o.from,o.to,o.value)||f.push(V1.create(o.from,o.to,o.value))),o.next());return h.finishInner(this.nextLayer.isEmpty&&!f.length?wt.empty:this.nextLayer.update({add:f,filter:a,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let o=this.chunkPos[a],u=this.chunk[a],f=e.touchesRange(o,o+u.length);if(f===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(o));else if(f===!0){let{mapped:h,pos:m}=u.map(o,e);h&&(i=Math.max(i,h.maxPoint),n.push(h),r.push(m))}}let s=this.nextLayer.map(e);return n.length==0?s:new wt(r,n,s||wt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Qh.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Qh.from(e).goto(n)}static compare(e,n,r,i,s=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=s),o=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=s),u=y_(a,o,r),f=new yd(a,u,s),h=new yd(o,u,s);r.iterGaps((m,O,x)=>v_(f,m,h,O,x,i)),r.empty&&r.length==0&&v_(f,0,h,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let o=y_(s,a),u=new yd(s,o,0).goto(r),f=new yd(a,o,0).goto(r);for(;;){if(u.to!=f.to||!Y1(u.active,f.active)||u.point&&(!f.point||!lk(u.point,f.point)))return!1;if(u.to>i)return!0;u.next(),f.next()}}static spans(e,n,r,i,s=-1){let a=new yd(e,null,s).goto(n),o=n,u=a.openStart;for(;;){let f=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFrom<n?h.length+1:a.point.startSide<0?h.length:Math.min(h.length,u);i.point(o,f,a.point,h,m,a.pointRank),u=Math.min(a.openEnd(f),h.length)}else f>o&&(i.span(o,f,a.active,u),u=a.openEnd(f));if(a.to>r)return u+(a.point&&a.to>r?1:0);o=a.to,a.next()}}static of(e,n=!1){let r=new kh;for(let i of e instanceof V1?[e]:n?QU(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return wt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=wt.empty;i=i.nextLayer)n=new wt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}wt.empty=new wt([],[],null,-1);function QU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(I1(e,r)>0)return t.slice().sort(I1);e=r}return t}wt.empty.nextLayer=wt.empty;class kh{finishChunk(e){this.chunks.push(new ok(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new kh)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(wt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=wt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function y_(t,e,n){let r=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let o=r.get(s.chunk[a]);o!=null&&(n?n.mapPos(o):o)==s.chunkPos[a]&&!(n!=null&&n.touchesRange(o,o+s.chunk[a].length))&&i.add(s.chunk[a])}return i}class sM{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Qh{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new sM(a,n,r,s));return i.length==1?i[0]:new Qh(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)t0(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)t0(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),t0(this.heap,0)}}}function t0(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class yd{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Qh.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){yg(this.active,e),yg(this.activeTo,e),yg(this.activeRank,e),this.minActive=b_(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;vg(this.active,n,r),vg(this.activeTo,n,i),vg(this.activeRank,n,s),e&&vg(e,n,this.cursor.from),this.minActive=b_(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&yg(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function v_(t,e,n,r,i,s){t.goto(e),n.goto(r);let a=r+i,o=r,u=r-e,f=!!s.boundChange;for(let h=!1;;){let m=t.to+u-n.to,O=m||t.endSide-n.endSide,x=O<0?t.to+u:n.to,v=Math.min(x,a);if(t.point||n.point?(t.point&&n.point&&lk(t.point,n.point)&&Y1(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(o,v,t.point,n.point),h=!1):(h&&s.boundChange(o),v>o&&!Y1(t.active,n.active)&&s.compareRange(o,v,t.active,n.active),f&&v<a&&(m||t.openEnd(x)!=n.openEnd(x))&&(h=!0)),x>a)break;o=x,O<=0&&t.next(),O>=0&&n.next()}}function Y1(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!lk(t[n],e[n]))return!1;return!0}function yg(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function vg(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function b_(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function ua(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=In(t,i));return r}function CU(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=In(t,i)}return t.length}const U1="ͼ",S_=typeof Symbol>"u"?"__"+U1:Symbol.for(U1),W1=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),w_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Sl{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,o,u,f){let h=[],m=/^@(\w+)\b/.exec(a[0]),O=m&&m[1]=="keyframes";if(m&&o==null)return u.push(a[0]+";");for(let x in o){let v=o[x];if(/&/.test(x))s(x.split(/,\s*/).map(S=>a.map(k=>S.replace(/&/,k))).reduce((S,k)=>S.concat(k)),v,u);else if(v&&typeof v=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");s(i(x),v,h,O)}else v!=null&&h.push(x.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+": "+v+";")}(h.length||O)&&u.push((r&&!m&&!f?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)s(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
378
+ `)}static newName(){let e=w_[S_]||1;return w_[S_]=e+1,U1+e.toString(36)}static mount(e,n,r){let i=e[W1],s=r&&r.nonce;i?s&&i.setNonce(s):i=new jU(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let k_=new Map;class jU{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=k_.get(r);if(s)return e[W1]=s;this.sheet=new i.CSSStyleSheet,k_.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[W1]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let o=e[a],u=this.modules.indexOf(o);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,o),r)for(let f=0;f<o.rules.length;f++)r.insertRule(o.rules[f],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let u=0;u<this.modules.length;u++)a+=this.modules[u].getRules()+`
379
+ `;this.styleTag.textContent=a;let o=n.head||n;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var wl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ch={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},TU=typeof navigator<"u"&&/Mac/.test(navigator.platform),$U=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Rn=0;Rn<10;Rn++)wl[48+Rn]=wl[96+Rn]=String(Rn);for(var Rn=1;Rn<=24;Rn++)wl[Rn+111]="F"+Rn;for(var Rn=65;Rn<=90;Rn++)wl[Rn]=String.fromCharCode(Rn+32),Ch[Rn]=String.fromCharCode(Rn);for(var n0 in wl)Ch.hasOwnProperty(n0)||(Ch[n0]=wl[n0]);function _U(t){var e=TU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||$U&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ch:wl)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let Fn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},H1=typeof document<"u"?document:{documentElement:{style:{}}};const G1=/Edge\/(\d+)/.exec(Fn.userAgent),aM=/MSIE \d/.test(Fn.userAgent),F1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fn.userAgent),Xx=!!(aM||F1||G1),Q_=!Xx&&/gecko\/(\d+)/i.test(Fn.userAgent),r0=!Xx&&/Chrome\/(\d+)/.exec(Fn.userAgent),NU="webkitFontSmoothing"in H1.documentElement.style,K1=!Xx&&/Apple Computer/.test(Fn.vendor),C_=K1&&(/Mobile\/\w+/.test(Fn.userAgent)||Fn.maxTouchPoints>2);var be={mac:C_||/Mac/.test(Fn.platform),windows:/Win/.test(Fn.platform),linux:/Linux|X11/.test(Fn.platform),ie:Xx,ie_version:aM?H1.documentMode||6:F1?+F1[1]:G1?+G1[1]:0,gecko:Q_,gecko_version:Q_?+(/Firefox\/(\d+)/.exec(Fn.userAgent)||[0,0])[1]:0,chrome:!!r0,chrome_version:r0?+r0[1]:0,ios:C_,android:/Android\b/.test(Fn.userAgent),webkit_version:NU?+(/\bAppleWebKit\/(\d+)/.exec(Fn.userAgent)||[0,0])[1]:0,safari:K1,safari_version:K1?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fn.userAgent)||[0,0])[1]:0,tabSize:H1.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ck(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const RO=Object.create(null);function uk(t,e,n){if(t==e)return!0;t||(t=RO),e||(e=RO);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function PU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function j_(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function EU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class rf{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var hi=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(hi||(hi={}));class zt extends bl{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Op(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new _o(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=lM(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new _o(e,r,i,n,e.widget||null,!0)}static line(e){return new xp(e)}static set(e,n=!1){return wt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}zt.none=wt.empty;class Op extends zt{constructor(e){let{start:n,end:r}=lM(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?ck(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||RO}eq(e){return this==e||e instanceof Op&&this.tagName==e.tagName&&uk(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Op.prototype.point=!1;class xp extends zt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof xp&&this.spec.class==e.spec.class&&uk(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}xp.prototype.mapMode=er.TrackBefore;xp.prototype.point=!0;class _o extends zt{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?er.TrackBefore:er.TrackAfter:er.TrackDel}get type(){return this.startSide!=this.endSide?hi.WidgetRange:this.startSide<=0?hi.WidgetBefore:hi.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof _o&&AU(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}_o.prototype.point=!0;function lM(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function AU(t,e){return t==e||!!(t&&e&&t.compare(e))}function su(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class jh extends bl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof jh&&this.tagName==e.tagName&&uk(this.attributes,e.attributes)}static create(e){return new jh(e.tagName,e.attributes||RO)}static set(e,n=!1){return wt.of(e,n)}}jh.prototype.startSide=jh.prototype.endSide=-1;function Th(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function J1(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Jd(t,e){if(!e.anchorNode)return!1;try{return J1(t,e.anchorNode)}catch{return!1}}function eh(t){return t.nodeType==3?_h(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function th(t,e,n,r){return n?T_(t,e,n,r,-1)||T_(t,e,n,r,1):!1}function kl(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function zO(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function T_(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:fa(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=kl(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?fa(t):0}else return!1}}function fa(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $h(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function MU(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function oM(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function RU(t,e,n,r,i,s,a,o){let u=t.ownerDocument,f=u.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let O,x=h==u.body,v=1,S=1;if(x)O=MU(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let j=h.getBoundingClientRect();({scaleX:v,scaleY:S}=oM(h,j)),O={left:j.left,right:j.left+h.clientWidth*v,top:j.top,bottom:j.top+h.clientHeight*S}}let k=0,w=0;if(i=="nearest")e.top<O.top?(w=e.top-(O.top+a),n>0&&e.bottom>O.bottom+w&&(w=e.bottom-O.bottom+a)):e.bottom>O.bottom&&(w=e.bottom-O.bottom+a,n<0&&e.top-w<O.top&&(w=e.top-(O.top+a)));else{let j=e.bottom-e.top,Q=O.bottom-O.top;w=(i=="center"&&j<=Q?e.top+j/2-Q/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-Q+a)-O.top}if(r=="nearest"?e.left<O.left?(k=e.left-(O.left+s),n>0&&e.right>O.right+k&&(k=e.right-O.right+s)):e.right>O.right&&(k=e.right-O.right+s,n<0&&e.left<O.left+k&&(k=e.left-(O.left+s))):k=(r=="center"?e.left+(e.right-e.left)/2-(O.right-O.left)/2:r=="start"==o?e.left-s:e.right-(O.right-O.left)+s)-O.left,k||w)if(x)f.scrollBy(k,w);else{let j=0,Q=0;if(w){let T=h.scrollTop;h.scrollTop+=w/S,Q=(h.scrollTop-T)*S}if(k){let T=h.scrollLeft;h.scrollLeft+=k/v,j=(h.scrollLeft-T)*v}e={left:e.left-j,top:e.top-Q,right:e.right-j,bottom:e.bottom-Q},j&&Math.abs(j-k)<1&&(r="nearest"),Q&&Math.abs(Q-w)<1&&(i="nearest")}if(x)break;(e.top<O.top||e.bottom>O.bottom||e.left<O.left||e.right>O.right)&&(e={left:Math.max(e.left,O.left),right:Math.min(e.right,O.right),top:Math.max(e.top,O.top),bottom:Math.min(e.bottom,O.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function cM(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class zU{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?fa(n):0),r,Math.min(e.focusOffset,r?fa(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Jl=null;be.safari&&be.safari_version>=26&&(Jl=!1);function uM(t){if(t.setActive)return t.setActive();if(Jl)return t.focus(Jl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Jl==null?{get preventScroll(){return Jl={preventScroll:!0},!0}}:void 0),!Jl){Jl=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let $_;function _h(t,e,n=e){let r=$_||($_=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function au(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function DU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function LU(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,fa(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=fa(n))}else{if(n==t)return!0;r=kl(n),n=n.parentNode}}function fM(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function dM(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=fa(n)}else if(n.parentNode&&!zO(n))r=kl(n),n=n.parentNode;else return null}}function hM(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!zO(n))r=kl(n)+1,n=n.parentNode;else return null}}class Pi{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Pi(e.parentNode,kl(e),n)}static after(e,n){return new Pi(e.parentNode,kl(e)+1,n)}}var mn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(mn||(mn={}));const No=mn.LTR,fk=mn.RTL;function pM(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const XU=pM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ZU=pM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),eS=Object.create(null),Hi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);eS[e]=n,eS[n]=-e}function mM(t){return t<=247?XU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?ZU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const BU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class us{get dir(){return this.level%2?fk:No}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=n&&o.to>=n){if(o.level==r)return a;(s<0||(i!=0?i<0?o.from<n:o.to>n:e[s].level>o.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function gM(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!gM(r.inner,i.inner))return!1}return!0}const Pt=[];function qU(t,e,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:e,o=s<r.length?r[s].from:n,u=s?256:i;for(let f=a,h=u,m=u;f<o;f++){let O=mM(t.charCodeAt(f));O==512?O=h:O==8&&m==4&&(O=16),Pt[f]=O==4?2:O,O&7&&(m=O),h=O}for(let f=a,h=u,m=u;f<o;f++){let O=Pt[f];if(O==128)f<o-1&&h==Pt[f+1]&&h&24?O=Pt[f]=h:Pt[f]=256;else if(O==64){let x=f+1;for(;x<o&&Pt[x]==64;)x++;let v=f&&h==8||x<n&&Pt[x]==8?m==1?1:8:256;for(let S=f;S<x;S++)Pt[S]=v;f=x-1}else O==8&&m==1&&(Pt[f]=1);h=O,O&7&&(m=O)}}}function VU(t,e,n,r,i){let s=i==1?2:1;for(let a=0,o=0,u=0;a<=r.length;a++){let f=a?r[a-1].to:e,h=a<r.length?r[a].from:n;for(let m=f,O,x,v;m<h;m++)if(x=eS[O=t.charCodeAt(m)])if(x<0){for(let S=o-3;S>=0;S-=3)if(Hi[S+1]==-x){let k=Hi[S+2],w=k&2?i:k&4?k&1?s:i:0;w&&(Pt[m]=Pt[Hi[S]]=w),o=S;break}}else{if(Hi.length==189)break;Hi[o++]=m,Hi[o++]=O,Hi[o++]=u}else if((v=Pt[m])==2||v==1){let S=v==i;u=S?0:1;for(let k=o-3;k>=0;k-=3){let w=Hi[k+2];if(w&2)break;if(S)Hi[k+2]|=2;else{if(w&4)break;Hi[k+2]|=4}}}}}function IU(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:t,o=i<n.length?n[i].from:e;for(let u=a;u<o;){let f=Pt[u];if(f==256){let h=u+1;for(;;)if(h==o){if(i==n.length)break;h=n[i++].to,o=i<n.length?n[i].from:e}else if(Pt[h]==256)h++;else break;let m=s==1,O=(h<e?Pt[h]:r)==1,x=m==O?m?1:2:r;for(let v=h,S=i,k=S?n[S-1].to:t;v>u;)v==k&&(v=n[--S].from,k=S?n[S-1].to:t),Pt[--v]=x;u=h}else s=f,u++}}}function tS(t,e,n,r,i,s,a){let o=r%2?2:1;if(r%2==i%2)for(let u=e,f=0;u<n;){let h=!0,m=!1;if(f==s.length||u<s[f].from){let S=Pt[u];S!=o&&(h=!1,m=S==16)}let O=!h&&o==1?[]:null,x=h?r:r+1,v=u;e:for(;;)if(f<s.length&&v==s[f].from){if(m)break e;let S=s[f];if(!h)for(let k=S.to,w=f+1;;){if(k==n)break e;if(w<s.length&&s[w].from==k)k=s[w++].to;else{if(Pt[k]==o)break e;break}}if(f++,O)O.push(S);else{S.from>u&&a.push(new us(u,S.from,x));let k=S.direction==No!=!(x%2);nS(t,k?r+1:r,i,S.inner,S.from,S.to,a),u=S.to}v=S.to}else{if(v==n||(h?Pt[v]!=o:Pt[v]==o))break;v++}O?tS(t,u,v,r+1,i,O,a):u<v&&a.push(new us(u,v,x)),u=v}else for(let u=n,f=s.length;u>e;){let h=!0,m=!1;if(!f||u>s[f-1].to){let S=Pt[u-1];S!=o&&(h=!1,m=S==16)}let O=!h&&o==1?[]:null,x=h?r:r+1,v=u;e:for(;;)if(f&&v==s[f-1].to){if(m)break e;let S=s[--f];if(!h)for(let k=S.from,w=f;;){if(k==e)break e;if(w&&s[w-1].to==k)k=s[--w].from;else{if(Pt[k-1]==o)break e;break}}if(O)O.push(S);else{S.to<u&&a.push(new us(S.to,u,x));let k=S.direction==No!=!(x%2);nS(t,k?r+1:r,i,S.inner,S.from,S.to,a),u=S.from}v=S.from}else{if(v==e||(h?Pt[v-1]!=o:Pt[v-1]==o))break;v--}O?tS(t,v,u,r+1,i,O,a):v<u&&a.push(new us(v,u,x)),u=v}}function nS(t,e,n,r,i,s,a){let o=e%2?2:1;qU(t,i,s,r,o),VU(t,i,s,r,o),IU(i,s,r,o),tS(t,i,s,e,n,r,a)}function YU(t,e,n){if(!t)return[new us(0,0,e==fk?1:0)];if(e==No&&!n.length&&!BU.test(t))return OM(t.length);if(n.length)for(;t.length>Pt.length;)Pt[Pt.length]=256;let r=[],i=e==No?0:1;return nS(t,i,i,n,0,t.length,r),r}function OM(t){return[new us(0,t,0)]}let xM="";function UU(t,e,n,r,i){var s;let a=r.head-t.from,o=us.find(e,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[o],f=u.side(i,n);if(a==f){let O=o+=i?1:-1;if(O<0||O>=e.length)return null;u=e[o=O],a=u.side(!i,n),f=u.side(i,n)}let h=In(t.text,a,u.forward(i,n));(h<u.from||h>u.to)&&(h=f),xM=t.text.slice(Math.min(a,h),Math.max(a,h));let m=o==(i?e.length-1:0)?null:e[o+(i?1:-1)];return m&&h==f&&m.level+(i?0:1)<u.level?pe.cursor(m.side(!i,n)+t.from,m.forward(i,n)?1:-1,m.level):pe.cursor(h+t.from,u.forward(i,n)?-1:1,u.level)}function WU(t,e,n){for(let r=e;r<n;r++){let i=mM(t.charCodeAt(r));if(i==1)return No;if(i==2||i==4)return fk}return No}const yM=Re.define(),vM=Re.define(),bM=Re.define(),SM=Re.define(),rS=Re.define(),wM=Re.define(),kM=Re.define(),dk=Re.define(),hk=Re.define(),QM=Re.define({combine:t=>t.some(e=>e)}),HU=Re.define({combine:t=>t.some(e=>e)}),CM=Re.define();class lu{constructor(e,n="nearest",r="nearest",i=5,s=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new lu(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new lu(pe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const bg=Zt.define({map:(t,e)=>t.map(e)}),jM=Zt.define();function fs(t,e,n){let r=t.facet(SM);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Fs=Re.define({combine:t=>t.length?t[0]:!0});let GU=0;const Fc=Re.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Ql{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Fc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Fc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new Ql(GU++,e,r,i,o=>{let u=[];return a&&u.push(Zx.of(f=>{let h=f.plugin(o);return h?a(h):zt.none})),s&&u.push(s(o)),u})}static fromClass(e,n){return Ql.define((r,i)=>new e(r,i),n)}}class i0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(fs(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){fs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){fs(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const TM=Re.define(),pk=Re.define(),Zx=Re.define(),$M=Re.define(),mk=Re.define(),yp=Re.define(),_M=Re.define();function __(t,e){let n=t.state.facet(_M);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return wt.spans(r,e.from,e.to,{point(){},span(s,a,o,u){let f=s-e.from,h=a-e.from,m=i;for(let O=o.length-1;O>=0;O--,u--){let x=o[O].spec.bidiIsolate,v;if(x==null&&(x=WU(e.text,f,h)),u>0&&m.length&&(v=m[m.length-1]).to==f&&v.direction==x)v.to=h,m=v.inner;else{let S={from:f,to:h,direction:x,inner:[]};m.push(S),m=S.inner}}}}),i}const NM=Re.define();function PM(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(NM)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Nd=Re.define();class ai{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ai(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,a=0;;){let o=i<e.length?e[i].fromB:1e9,u=s<n.length?n[s]:1e9,f=Math.min(o,u);if(f==1e9)break;let h=f+a,m=f,O=h;for(;;)if(s<n.length&&n[s]<=m){let x=n[s+1];s+=2,m=Math.max(m,x);for(let v=i;v<e.length&&e[v].fromB<=m;v++)a=e[v].toA-e[v].toB;O=Math.max(O,x+a)}else if(i<e.length&&e[i].fromB<=m){let x=e[i++];m=Math.max(m,x.toB),O=Math.max(O,x.toA),a=x.toA-x.toB}else break;r.push(new ai(h,O,f,m))}return r}}class DO{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=vn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,o,u)=>i.push(new ai(s,a,o,u))),this.changedRanges=i}static create(e,n,r){return new DO(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const FU=[];class Gt{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return FU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&PU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=kl(this.dom),i=this.length?e>0:n>0;return new Pi(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof qx)return e;return null}static get(e){return e.cmTile}}class Bx extends Gt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=(e==null?void 0:e.node)==n?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=o.dom&&(s.written=!0),o.dom.parentNode==n)for(;i&&i!=o.dom;)i=N_(i);else n.insertBefore(o.dom,i);r=o.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=N_(i);this.length=a}}function N_(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class qx extends Bx{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Gt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof ra)n.push(i),r=a,i=0;else{let o=s+a.length,u=e(a,s);if(u!==void 0)return u;s=o+a.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,a=-1;if(this.blockTiles((o,u)=>{let f=u+o.length;if(e>=u&&e<=f){if(o.isWidget()&&n>=-1&&n<=1){if(o.flags&32)return!0;o.flags&16&&(r=void 0)}(u<e||e==f&&(n<-1?o.length:o.covers(1)))&&(!r||!o.isWidget()&&r.isWidget())&&(r=o,i=e-u),(f>e||e==u&&(n>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,a=e-u)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class ra extends Bx{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new ra(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class ju extends Bx{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new ju(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,a=null,o=-1;function u(h,m){for(let O=0,x=0;O<h.children.length&&x<=m;O++){let v=h.children[O],S=x+v.length;S>=m&&(v.isComposite()?u(v,m-x):(!a||a.isHidden&&(n>0||r&&JU(a,v)))&&(S>m||v.flags&32)?(a=v,o=m-x):(x<m||v.flags&16&&!v.isHidden)&&(i=v,s=m-x)),x=S}}u(this,e);let f=(n<0?i:a)||i||a;return f?{tile:f,offset:f==i?s:o}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):KU(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new Pi(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,o=!1;for(let u of a.children){if(o)return new Pi(u.dom,0);u==r.tile&&(o=!0)}}return new Pi(this.dom,0)}}function KU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=eh(e);return n[n.length-1]||null}function JU(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class vr extends Bx{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new vr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class po extends Gt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,a=0;e==0&&n<0||e==r&&n>=0?be.chrome||be.gecko||(e?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let o=_h(this.dom,i,s).getClientRects();if(!o.length)return null;let u=o[(a?a<0:n>=0)?0:o.length-1];return be.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(o,f=>f.width)||u),a?$h(u,a<0):u||null}static of(e,n){let r=new po(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Po extends Gt{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return $h(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=o?s.length-1:0;a=s[u],!(e>0?u==0:u==s.length-1||a.top<a.bottom);u+=o?-1:1);return $h(a,!o)}}get overrideDOMText(){if(!this.length)return st.empty;let{root:e}=this;if(!e)return st.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new Po(s,r,e,i)}}class LO extends Gt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return st.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class eW{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:a,parents:o}=this;for(;e||n>0;)if(i.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(s==i.children.length){if(!e&&!o.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=o.pop(),s++}else{let u=i.children[s],f=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!f,s++,e-=u.length):(o.push({tile:i,index:s}),i=u,s=0,r&&u.isComposite()&&r.enter(u))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=o.pop(),s++;else if(e){let u=Math.min(e,i.length-s);r&&r.skip(i,s,s+u),e-=u,s+=u}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class tW{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class nW{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),o=a.lastChild;if(o&&o.isText()&&!(o.flags&8)&&o.length+e.length<512){this.cache.reused.set(o,2);let u=a.children[a.children.length-1]=new po(o.dom,o.text+e);u.parent=a}else a.append(i||po.of(e,(s=this.cache.find(po))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?s0(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let o=n.marks.length-1;o>=0;o--){let u=n.marks[o],f=i.lastChild;if(f instanceof vr&&f.mark.eq(u.mark))f.dom!=u.dom&&f.setDOM(s0(u.dom)),i=f;else{if(this.cache.reused.get(u)){let m=Gt.get(u.dom);m&&m.setDOM(s0(u.dom))}let h=vr.of(u.mark,u.dom);i.append(h),i=h}this.cache.reused.set(u,2)}let s=Gt.get(e.text);s&&this.cache.reused.set(s,2);let a=new po(e.text,e.text.nodeValue);a.flags|=8,i.append(a)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=EM);let i=ju.start(e,n||((r=this.cache.find(ju))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],o;if(n>0&&(o=i.lastChild)&&o instanceof vr&&o.mark.eq(a))i=o,n--;else{let u=vr.of(a,(r=this.cache.find(vr,f=>f.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!P_(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(be.ios&&P_(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(a0,0,32)||new Po(a0.toDOM(),0,a0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new tW(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof ra&&i.wrapper.eq(r.wrapper))n=i;else{let s=ra.of(r.wrapper,(e=this.cache.find(ra,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(LO,void 0,1);return r&&(r.flags=n),r||new LO(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class rW{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let o=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,o)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const XO=[Po,ju,po,vr,LO,ra,qx];for(let t=0;t<XO.length;t++)XO[t].bucket=t;class iW{constructor(e){this.view=e,this.buckets=XO.map(()=>[]),this.index=XO.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],a=this.index[i];for(let o=s.length-1;o>=0;o--){let u=(o+a)%s.length,f=s[u];if((!n||n(f))&&!this.reused.has(f))return s.splice(u,1),u<a&&this.index[i]--,this.reused.set(f,r),f}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let o=i[s];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,o.widget==e&&o.length==n&&(o.flags&497)==r?(this.reused.set(o,1),o):(this.reused.set(o,2),new Po(o.dom,n,e,o.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class sW{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new iW(e),this.text=new rW(e.state.doc),this.builder=new nW(this.cache,new qx(e,e.contentDOM),wt.iter(r)),this.cache.reused.set(n,2),this.old=new eW(n),this.reuseWalker={skip:(a,o,u)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let o=a<e.length?e[a++]:null,u=o?o.fromA:this.old.root.length;if(u>i){let f=u-i;this.preserve(f,!a,!o),i=u,s+=f}if(!o)break;n&&o.fromA<=n.range.fromA&&o.toA>=n.range.toA?(this.forward(o.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,o.toA),this.emit(n.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(s,o.toB)),s=o.toB,i=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=oW(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,o,u)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(u-o);else{let f=u>0||o<a.length?Po.of(a.widget,this.view,u-o,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!o&&u==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(o,u),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof LO)this.cache.add(a);else if(a instanceof vr)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof vr&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof vr&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,a=wt.spans(this.decorations,e,n,{point:(o,u,f,h,m,O)=>{if(f instanceof _o){if(this.disallowBlockEffectsFor[O]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=h.length,m>h.length)i.continueWidget(u-o);else{let x=f.widget||(f.block?Tu.block:Tu.inline),v=aW(f),S=this.cache.findWidget(x,u-o,v)||Po.of(x,this.view,u-o,v);f.block?(f.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(S)):(i.ensureLine(r),i.addInlineWidget(S,h,m))}r=null}else r=lW(r,f);u>o&&this.text.skip(u-o)},span:(o,u,f,h)=>{for(let m=o;m<u;){let O=this.text.next(Math.min(512,u-m));O==null?(i.addLineStartIfNotCovered(r),i.addBreak(),m++):(i.ensureLine(r),i.addText(O,f,m==o?h:f.length),m+=O.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Gt.get(i);if(i==this.view.contentDOM)break;s instanceof vr?n.push(s):s!=null&&s.isLine()?r=s:s instanceof ra||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new ju(i,EM):r||n.push(vr.of(new Op({tagName:i.nodeName.toLowerCase(),attributes:EU(i)}),i)))}return{line:r,marks:n}}}function P_(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function aW(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const EM={class:"cm-line"};function lW(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&ck(n,t),r&&(t.class+=" "+r)),t}function oW(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof vr&&e.push(r.mark)}return e}function s0(t){let e=Gt.get(t);return e&&e.setDOM(t.cloneNode()),t}class Tu extends rf{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Tu.inline=new Tu("span");Tu.block=new Tu("div");const a0=new class extends rf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class E_{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=zt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new qx(e,e.contentDOM),this.updateInner([new ai(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:h,toA:m})=>m<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!OW(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?uW(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:m}=this.hasComposition;r=new ai(h,m,e.changes.mapPos(h,-1),e.changes.mapPos(m,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(be.ie||be.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,o=this.blockWrappers;this.updateDeco();let u=hW(a,this.decorations,e.changes);u.length&&(r=ai.extendWithRanges(r,u));let f=mW(o,this.blockWrappers,e.changes);return f.length&&(r=ai.extendWithRanges(r,f)),s&&!r.some(h=>h.fromA<=s.range.fromA&&h.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let a=this.tile,o=new sW(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Gt.get(n.text)&&o.cache.reused.set(Gt.get(n.text),2),this.tile=o.run(e,n),iS(a,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=be.chrome||be.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof l0&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(jM)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(Fs)||r.tabIndex>-1)&&Jd(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let o=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,f,h;if(u.empty?h=f=this.inlineDOMNearPos(u.anchor,u.assoc||1):(h=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),f=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),be.gecko&&u.empty&&!this.hasComposition&&cW(f)){let O=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(O,f.node.childNodes[f.offset]||null)),f=h=new Pi(O,0),o=!0}let m=this.view.observer.selectionRange;(o||!m.focusNode||(!th(f.node,f.offset,m.anchorNode,m.anchorOffset)||!th(h.node,h.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,u))&&(this.view.observer.ignore(()=>{be.android&&be.chrome&&r.contains(m.focusNode)&&gW(m.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let O=Th(this.view.root);if(O)if(u.empty){if(be.gecko){let x=fW(f.node,f.offset);if(x&&x!=3){let v=(x==1?dM:hM)(f.node,f.offset);v&&(f=new Pi(v.node,v.offset))}}O.collapse(f.node,f.offset),u.bidiLevel!=null&&O.caretBidiLevel!==void 0&&(O.caretBidiLevel=u.bidiLevel)}else if(O.extend){O.collapse(f.node,f.offset);try{O.extend(h.node,h.offset)}catch{}}else{let x=document.createRange();u.anchor>u.head&&([f,h]=[h,f]),x.setEnd(h.node,h.offset),x.setStart(f.node,f.offset),O.removeAllRanges(),O.addRange(x)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(f,h)),this.impreciseAnchor=f.precise?null:new Pi(m.anchorNode,m.anchorOffset),this.impreciseHead=h.precise?null:new Pi(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&th(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Th(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let o=a.posAtStart;if(n.head==o||n.head==o+a.length)return;let u=this.coordsAt(n.head,-1),f=this.coordsAt(n.head,1);if(!u||!f||u.bottom>f.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let a=fa(e)==0?0:n==0?-1:1;for(;;){let o=e.parentNode;if(o==r.dom)break;a==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?a=-1:a=1),e=o}a<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Gt.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,o=i;;a++){let u=r.children[a];if(u.dom==s)return o;o+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,a,o=-1,u=!1;return this.tile.blockTiles((f,h)=>{if(f.isWidget()){if(f.flags&32&&h>=e)return!0;f.flags&16&&(s=!0)}else{let m=h+f.length;if(h<=e&&(r=f,i=e-h,s=m<e),m>=e&&!a&&(a=f,o=e-h,u=h>e),h>e&&a)return!0}}),!r&&!a?this.domAtPos(e,n):(s&&a?r=null:u&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(o,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof l0?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let o of s.children){if(o.length>=a){let u=i(o,a);if(u)return u}if(a-=o.length,a<0)break}else if(s.isText()&&a<s.length){let o=In(s.text,a);if(o==a)return null;let u=_h(s.dom,a,o).getClientRects();for(let f=0;f<u.length;f++){let h=u[f];if(f==u.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,u=this.view.textDirection==mn.LTR,f=0,h=(m,O,x)=>{for(let v=0;v<m.children.length&&!(O>i);v++){let S=m.children[v],k=O+S.length,w=S.dom.getBoundingClientRect(),{height:j}=w;if(x&&!v&&(f+=w.top-x.top),S instanceof ra)k>r&&h(S,O,w);else if(O>=r&&(f>0&&n.push(-f),n.push(j+f),f=0,a)){let Q=S.dom.lastChild,T=Q?eh(Q):[];if(T.length){let N=T[T.length-1],_=u?N.right-w.left:w.right-N.left;_>o&&(o=_,this.minWidth=s,this.minWidthFrom=O,this.minWidthTo=k)}}x&&v==m.children.length-1&&(f+=x.bottom-w.bottom),O=k+S.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?mn.RTL:mn.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let o=0,u;for(let f of a.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let h=eh(f.dom);if(h.length!=1)return;o+=h[0].width,u=h[0].height}if(o)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:o/a.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=eh(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let o=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(zt.replace({widget:new l0(o),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return zt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Zx).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(mk).map((s,a)=>{let o=typeof s=="function";return o&&(r=!0),o?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(wt.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet($M).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(CM))try{if(h(this.view,e.range,e))return!0}catch(m){fs(this.view.state,m,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let a=PM(this.view),o={left:i.left-a.left,top:i.top-a.top,right:i.right+a.right,bottom:i.bottom+a.bottom},{offsetWidth:u,offsetHeight:f}=this.view.scrollDOM;if(RU(this.view.scrollDOM,o,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==mn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(r.head,1);h&&h.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){iS(this.tile)}}function iS(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)iS(r,e)}}function cW(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function AM(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=dM(n.focusNode,n.focusOffset),i=hM(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let o=Gt.get(i.node);if(!o||o.isText()&&o.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let u=Gt.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function uW(t,e,n){let r=AM(t,n);if(!r)return null;let{node:i,from:s,to:a}=r,o=i.nodeValue;if(/[\n\r]/.test(o)||t.state.doc.sliceString(r.from,r.to)!=o)return null;let u=e.invertedDesc;return{range:new ai(u.mapPos(s),u.mapPos(a),s,a),text:i}}function fW(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let dW=class{constructor(){this.changes=[]}compareRange(e,n){su(e,n,this.changes)}comparePoint(e,n){su(e,n,this.changes)}boundChange(e){su(e,e,this.changes)}};function hW(t,e,n){let r=new dW;return wt.compare(t,e,n,r),r.changes}class pW{constructor(){this.changes=[]}compareRange(e,n){su(e,n,this.changes)}comparePoint(){}boundChange(e){su(e,e,this.changes)}}function mW(t,e,n){let r=new pW;return wt.compare(t,e,n,r),r.changes}function gW(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function OW(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class l0 extends rf{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function xW(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return pe.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,o=s;n<0?a=In(i.text,s,!1):o=In(i.text,s);let u=r(i.text.slice(a,o));for(;a>0;){let f=In(i.text,a,!1);if(r(i.text.slice(f,a))!=u)break;a=f}for(;o<i.length;){let f=In(i.text,o);if(r(i.text.slice(o,f))!=u)break;o=f}return pe.range(a+i.from,o+i.from)}function yW(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let o=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-o)*.5)/o);s+=u*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+CU(a,s,t.state.tabSize)}function vW(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==hi.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function bW(t,e,n,r){let i=vW(t,e.head,e.assoc||-1),s=!r||i.type!=hi.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),o=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(o==mn.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(u!=null)return pe.cursor(u,n?-1:1)}return pe.cursor(n?i.to:i.from,n?-1:1)}function A_(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let o=e,u=null;;){let f=UU(i,s,a,o,n),h=xM;if(!f){if(i.number==(n?t.state.doc.lines:1))return o;h=`
380
+ `,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),f=t.visualLineSide(i,!n)}if(u){if(!u(h))return o}else{if(!r)return f;u=r(h)}o=f}}function SW(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==Ks.Space&&(i=a),i==a}}function wW(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return pe.cursor(i,e.assoc);let a=e.goalColumn,o,u=t.contentDOM.getBoundingClientRect(),f=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),h=t.documentTop;if(f)a==null&&(a=f.left-u.left),o=s<0?f.top:f.bottom;else{let v=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-v.from))),o=(s<0?v.top:v.bottom)+h}let m=u.left+a,O=t.viewState.heightOracle.textHeight>>1,x=r??O;for(let v=0;;v+=O){let S=o+(x+v)*s,k=sS(t,{x:m,y:S},!1,s);if(n?S>u.bottom:S<u.top)return pe.cursor(k.pos,k.assoc);let w=t.coordsAtPos(k.pos,k.assoc),j=w?(w.top+w.bottom)/2:0;if(!w||(n?j>o:j<o))return pe.cursor(k.pos,k.assoc,void 0,a)}}function nh(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,a,o)=>{if(e>s&&e<a){let u=r||n||(e-s<a-e?-1:1);e=u<0?s:a,r=u}});if(!r)return e}}function MM(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let a=nh(t,i.from,0);a!=i.from&&(s=pe.cursor(a,-1))}else{let a=nh(t,i.from,-1),o=nh(t,i.to,1);(a!=i.from||o!=i.to)&&(s=pe.range(i.from==i.anchor?a:o,i.from==i.head?a:o))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?pe.create(n,e.mainIndex):e}function o0(t,e,n){let r=nh(t.state.facet(yp).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:pe.cursor(r,r<n.from?1:-1)}class os{constructor(e,n){this.pos=e,this.assoc=n}}function sS(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:a,y:o}=e,u=o-s,f;for(;;){if(u<0)return new os(0,1);if(u>t.viewState.docHeight)return new os(t.state.doc.length,-1);if(f=t.elementAtHeight(u),r==null)break;if(f.type==hi.Text){if(r<0?f.to<t.viewport.from:f.from>t.viewport.to)break;let O=t.docView.coordsAt(r<0?f.from:f.to,r>0?-1:1);if(O&&(r<0?O.top<=u+s:O.bottom>=u+s))break}let m=t.viewState.heightOracle.textHeight/2;u=r>0?f.bottom+m:f.top-m}if(t.viewport.from>=f.to||t.viewport.to<=f.from){if(n)return null;if(f.type==hi.Text){let m=yW(t,i,f,a,o);return new os(m,m==f.from?1:-1)}}if(f.type!=hi.Text)return u<(f.top+f.bottom)/2?new os(f.from,1):new os(f.to,-1);let h=t.docView.lineAt(f.from,2);return(!h||h.length!=f.length)&&(h=t.docView.lineAt(f.from,-2)),new kW(t,a,o,t.textDirectionAt(f.from)).scanTile(h,f.from)}class kW{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[us.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[us.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,a=this.bidiIn(e[0],e[i]),o,u,f=-1,h=1e9,m;e:for(;r<i;){let x=i-r,v=r+i>>1;t:if(s.has(v)){let k=r+Math.floor(Math.random()*x);for(let w=0;w<x;w++){if(!s.has(k)){v=k;break t}k++,k==i&&(k=r)}break e}s.add(v);let S=n(v);if(S)for(let k=0;k<S.length;k++){let w=S[k],j=0;if(!(w.width==0&&S.length>1)){if(w.bottom<this.y)(!o||o.bottom<w.bottom)&&(o=w),j=1;else if(w.top>this.y)(!u||u.top>w.top)&&(u=w),j=-1;else{let Q=w.left>this.x?this.x-w.left:w.right<this.x?this.x-w.right:0,T=Math.abs(Q);T<h&&(f=v,h=T,m=w),Q&&(j=Q<0==(this.baseDir==mn.LTR)?-1:1)}j==-1&&(!a||this.baseDirAt(e[v],1))?i=v:j==1&&(!a||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}}if(!m){let x=o&&(!u||this.y-o.bottom<u.top-this.y)?o:u;return this.y=(x.top+x.bottom)/2,this.scan(e,n)}let O=(a?this.dirAt(e[f],1):this.baseDir)==mn.LTR;return{i:f,after:this.x>(m.left+m.right)/2==O}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=In(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let a=r[s]-n,o=r[s+1]-n;return _h(e.dom,a,o).getClientRects()});return i.after?new os(r[i.i+1],-1):new os(r[i.i],1)}scanTile(e,n){if(!e.length)return new os(n,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,n);if(o.isComposite())return this.scanTile(o,n)}let r=[n];for(let o=0,u=n;o<e.children.length;o++)r.push(u+=e.children[o].length);let i=this.scan(r,o=>{let u=e.children[o];return u.flags&48?null:(u.dom.nodeType==1?u.dom:_h(u.dom,0,u.length)).getClientRects()}),s=e.children[i.i],a=r[i.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):i.after?new os(r[i.i+1],-1):new os(a,1)}}const qc="￿";class QW{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(ft.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qc}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=Gt.get(i),o=i.nextSibling;if(o==n){a!=null&&a.breakAfter&&!o&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Gt.get(o);(a&&u?a.breakAfter:(a?a.breakAfter:zO(i))||zO(o)&&(i.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!jW(o,n)&&this.lineBreak(),i=o}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,o;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=i.exec(n))&&(s=o.index,a=o[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=a-1);r=s+a}}readNode(e){let n=Gt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(CW(e,r.node,r.offset)?n:0))}}function CW(t,e,n){for(;;){if(!e||n<fa(e))return!1;if(e==t)return!0;n=kl(e)+1,e=e.parentNode}}function jW(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Gt.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class M_{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class TW{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=RM(e.docView.tile,n,r,0))){let u=s||a?[]:_W(e),f=new QW(u,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=NW(u,this.bounds.from)}else{let u=e.observer.selectionRange,f=s&&s.node==u.focusNode&&s.offset==u.focusOffset||!J1(e.contentDOM,u.focusNode)?o.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),h=a&&a.node==u.anchorNode&&a.offset==u.anchorOffset||!J1(e.contentDOM,u.anchorNode)?o.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),m=e.viewport;if((be.ios||be.chrome)&&o.main.empty&&f!=h&&(m.from>0||m.to<e.state.doc.length)){let O=Math.min(f,h),x=Math.max(f,h),v=m.from-O,S=m.to-x;(v==0||v==1||O==0)&&(S==0||S==-1||x==e.state.doc.length)&&(f=0,h=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(pe.range(h,f));else if(e.lineWrapping&&h==f&&!(o.main.empty&&o.main.head==f)&&e.inputState.lastTouchTime>Date.now()-100){let O=e.coordsAtPos(f,-1),x=0;O&&(x=e.inputState.lastTouchY<=O.bottom?-1:1),this.newSel=pe.create([pe.cursor(f,x)])}else this.newSel=pe.single(h,f)}}}function RM(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,a=-1,o=-1;for(let u=0,f=r,h=r;u<t.children.length;u++){let m=t.children[u],O=f+m.length;if(f<e&&O>n)return RM(m,e,n,f);if(O>=e&&i==-1&&(i=u,s=f),f>n&&m.dom.parentNode==t.dom){a=u,o=h;break}h=O,f=O+m.breakAfter}return{from:s,to:o<0?r+t.length:o,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function zM(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:u}=e.bounds,f=s.from,h=null;(a===8||be.android&&e.text.length<u-o)&&(f=s.to,h="end");let m=i.doc.sliceString(o,u,qc),O,x;!s.empty&&s.from>=o&&s.to<=u&&(e.typeOver||m!=e.text)&&m.slice(0,s.from-o)==e.text.slice(0,s.from-o)&&m.slice(s.to-o)==e.text.slice(O=e.text.length-(m.length-(s.to-o)))?n={from:s.from,to:s.to,insert:st.of(e.text.slice(s.from-o,O).split(qc))}:(x=DM(m,e.text,f-o,h))&&(be.chrome&&a==13&&x.toB==x.from+2&&e.text.slice(x.from,x.toB)==qc+qc&&x.toB--,n={from:o+x.from,to:o+x.toA,insert:st.of(e.text.slice(x.from,x.toB).split(qc))})}else r&&(!t.hasFocus&&i.facet(Fs)||ZO(r,s))&&(r=null);if(!n&&!r)return!1;if((be.mac||be.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=pe.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:st.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:be.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
381
+ `&&t.lineWrapping&&(r&&(r=pe.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:st.of([" "])}),n)return gk(t,n,r,a);if(r&&!ZO(r,s)){let o=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(r=MM(i.facet(yp).map(f=>f(t)),r))),t.dispatch({selection:r,scrollIntoView:o,userEvent:u}),!0}else return!1}function gk(t,e,n,r=-1){if(be.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(be.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&au(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&au(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&au(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,o=()=>a||(a=$W(t,e,n));return t.state.facet(wM).some(u=>u(t,e.from,e.to,s,o))||t.dispatch(o()),!0}function $W(t,e,n){let r,i=t.state,s=i.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,f=u<0?s.from:s.to,h=nh(i.facet(yp).map(m=>m(t)),f,u);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:pe.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?i.sliceDoc(s.from,e.from):"",f=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+f))}else{let u=i.changes(e),f=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=t.state.sliceDoc(e.from,e.to),m,O=n&&AM(t,n.main.head);if(O){let v=e.insert.length-(e.to-e.from);m={from:O.from,to:O.to-v}}else m=t.state.doc.lineAt(s.head);let x=s.to-e.to;r=i.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:u,range:f||v.map(u)};let S=v.to-x,k=S-h.length;if(t.state.sliceDoc(k,S)!=h||S>=m.from&&k<=m.to)return{range:v};let w=i.changes({from:k,to:S,insert:e.insert}),j=v.to-s.to;return{changes:w,range:f?pe.range(Math.max(0,f.anchor+j),Math.max(0,f.head+j)):v.map(w)}})}else r={changes:u,selection:f&&i.selection.replaceRange(f)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function DM(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let a=t.length,o=e.length;for(;a>0&&o>0&&t.charCodeAt(a-1)==e.charCodeAt(o-1);)a--,o--;if(r=="end"){let u=Math.max(0,s-Math.min(a,o));n-=a+u-s}if(a<s&&t.length<e.length){let u=n<=s&&n>=a?s-n:0;s-=u,o=s+(o-a),a=s}else if(o<s){let u=n<=s&&n>=o?s-n:0;s-=u,a=s+(a-o),o=s}return{from:s,toA:a,toB:o}}function _W(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new M_(n,r)),(i!=n||s!=r)&&e.push(new M_(i,s))),e}function NW(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?pe.single(n+e,r+e):null}function ZO(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class PW{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,be.safari&&e.contentDOM.addEventListener("input",()=>null),be.gecko&&UW(e.contentDOM.ownerDocument)}handleEvent(e){!XW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=EW(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,o=r[s];o&&a!=!o.handlers.length&&(i.removeEventListener(s,this.handleEvent),o=null),o||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&XM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),be.android&&be.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return be.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=LM.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||AW.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,au(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:be.safari&&!be.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function R_(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){fs(n.state,i)}}}function EW(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let o in s){let u=s[o];u&&n(o).handlers.push(R_(r.value,u))}if(a)for(let o in a){let u=a[o];u&&n(o).observers.push(R_(r.value,u))}}for(let r in zi)n(r).handlers.push(zi[r]);for(let r in kr)n(r).observers.push(kr[r]);return e}const LM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],AW="dthko",XM=[16,17,18,20,91,92,224,225],Sg=6;function wg(t){return Math.max(0,t)*.7+8}function MW(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class RW{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=cM(e.contentDOM),this.atoms=e.state.facet(yp).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(ft.allowMultipleSelections)&&zW(e,n),this.dragging=LW(e,n)&&qM(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&MW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let u=PM(this.view);e.clientX-u.left<=i+Sg?n=-wg(i-e.clientX):e.clientX+u.right>=a-Sg&&(n=wg(e.clientX-a)),e.clientY-u.top<=s+Sg?r=-wg(s-e.clientY):e.clientY+u.bottom>=o-Sg&&(r=wg(e.clientY-o)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=MM(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function zW(t,e){let n=t.state.facet(yM);return n.length?n[0](e):be.mac?e.metaKey:e.ctrlKey}function DW(t,e){let n=t.state.facet(vM);return n.length?n[0](e):be.mac?!e.altKey:!e.ctrlKey}function LW(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Th(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function XW(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Gt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const zi=Object.create(null),kr=Object.create(null),ZM=be.ie&&be.ie_version<15||be.ios&&be.webkit_version<604;function ZW(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),BM(t,n.value)},50)}function Vx(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function BM(t,e){e=Vx(t.state,dk,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(aS!=null&&n.selection.ranges.every(u=>u.empty)&&aS==s.toString()){let u=-1;r=n.changeByRange(f=>{let h=n.doc.lineAt(f.from);if(h.from==u)return{range:f};u=h.from;let m=n.toText((a?s.line(i++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:pe.cursor(f.from+m.length)}})}else a?r=n.changeByRange(u=>{let f=s.line(i++);return{changes:{from:u.from,to:u.to,insert:f.text},range:pe.cursor(u.from+f.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}kr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};kr.wheel=kr.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};zi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);kr.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};kr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};zi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(bM))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=qW(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new RW(t,e,n,r)),r&&t.observer.ignore(()=>{uM(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function z_(t,e,n,r){if(r==1)return pe.cursor(e,n);if(r==2)return xW(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:s.from,o=i?i.posAtEnd:s.to;return o<t.state.doc.length&&o==s.to&&o++,pe.range(a,o)}}const BW=be.ie&&be.ie_version<=11;let D_=null,L_=0,X_=0;function qM(t){if(!BW)return t.detail;let e=D_,n=X_;return D_=t,X_=Date.now(),L_=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(L_+1)%3:1}function qW(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=qM(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,o){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),f,h=z_(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!a){let m=z_(t,n.pos,n.assoc,r),O=Math.min(m.from,h.from),x=Math.max(m.to,h.to);h=O<h.from?pe.range(O,x,h.assoc):pe.range(x,O,h.assoc)}return a?i.replaceRange(i.main.extend(h.from,h.to,h.assoc)):o&&r==1&&i.ranges.length>1&&(f=VW(i,u.pos))?f:o?i.addRange(h):pe.create([h])}}}function VW(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return pe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}zi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=pe.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Vx(t.state,hk,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};zi.dragend=t=>(t.inputState.draggedContent=null,!1);function Z_(t,e,n,r){if(n=Vx(t.state,dk,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&DW(t,e)?{from:s.from,to:s.to}:null,o={from:i,insert:n},u=t.state.changes(a?[a,o]:o);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}zi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&Z_(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let o=new FileReader;o.onerror=s,o.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),s()},o.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Z_(t,e,r,!0),!0}return!1};zi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=ZM?null:e.clipboardData;return n?(BM(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(ZW(t),!1)};function IW(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function YW(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:Vx(t,hk,e.join(t.lineBreak)),ranges:n,linewise:r}}let aS=null;zi.copy=zi.cut=(t,e)=>{if(!Jd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=YW(t.state);if(!n&&!i)return!1;aS=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=ZM?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(IW(t,n),!1)};const VM=Oa.define();function IM(t,e){let n=[];for(let r of t.facet(kM)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:VM.of(!0)}):null}function YM(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=IM(t.state,e);n?t.dispatch(n):t.update([])}},10)}kr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),YM(t)};kr.blur=t=>{t.observer.clearSelectionRange(),YM(t)};kr.compositionstart=kr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};kr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,be.chrome&&be.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};kr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};zi.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let o=a[0],u=t.posAtDOM(o.startContainer,o.startOffset),f=t.posAtDOM(o.endContainer,o.endOffset);return gk(t,{from:u,to:f,insert:t.state.toText(s)},null),!0}}let i;if(be.chrome&&be.android&&(i=LM.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return be.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),be.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>kr.compositionend(t,e),20),!1};const B_=new Set;function UW(t){B_.has(t)||(B_.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const q_=["pre-wrap","normal","pre-line","break-spaces"];let $u=!1;function V_(){$u=!1}class WW{constructor(e){this.lineWrapping=e,this.doc=st.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return q_.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,a){let o=q_.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let f=0;f<a.length;f++){let h=a[f];h<0?f++:this.heightSamples[Math.floor(h*10)]=!0}}return u}}class HW{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class _i{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?hi.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof _o?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new _i(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var At=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(At||(At={}));const nO=.001;class rr{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>nO&&($u=!0),this.height=e)}replace(e,n,r){return rr.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,a=r.doc;for(let o=i.length-1;o>=0;o--){let{fromA:u,toA:f,fromB:h,toB:m}=i[o],O=s.lineAt(u,At.ByPosNoHeight,r.setDoc(n),0,0),x=O.to>=f?O:s.lineAt(f,At.ByPosNoHeight,r,0,0);for(m+=x.to-f,f=x.to;o>0&&O.from<=i[o-1].toA;)u=i[o-1].fromA,h=i[o-1].fromB,o--,u<O.from&&(O=s.lineAt(u,At.ByPosNoHeight,r,0,0));h+=O.from-u,u=O.from;let v=Ok.build(r.setDoc(a),e,h,m);s=BO(s,s.replace(u,f,v))}return s.updateHeight(r,0)}static empty(){return new Dr(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let o=e[n-1];o.break?e.splice(--n,1,o.left,null,o.right):e.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else if(s>i*2){let o=e[r];o.break?e.splice(r,1,o.left,null,o.right):e.splice(r,1,o.left,o.right),r+=2+o.break,s-=o.size}else break;else if(i<s){let o=e[n++];o&&(i+=o.size)}else{let o=e[--r];o&&(s+=o.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new FW(rr.of(e.slice(0,n)),a,rr.of(e.slice(r)))}}function BO(t,e){return t==e?t:(t.constructor!=e.constructor&&($u=!0),e)}rr.prototype.size=1;const GW=zt.replace({});class UM extends rr{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new _i(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new _i(i,0,r,this.spaceAbove,GW):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(e,n,r,i,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,At.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Dr extends UM{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new _i(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Dr||i instanceof En&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof En?i=new Dr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):rr.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class En extends rr{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,a,o=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);a=u/s,this.length>s+1&&(o=(this.height-u)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:o}}blockAt(e,n,r,i){let{firstLine:s,lastLine:a,perLine:o,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let f=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),h=n.doc.lineAt(f),m=o+h.length*u,O=Math.max(r,e-m/2);return new _i(h.from,h.length,O,m,0)}else{let f=Math.max(0,Math.min(a-s,Math.floor((e-r)/o))),{from:h,length:m}=n.doc.line(s+f);return new _i(h,m,r+o*f,o,0)}}lineAt(e,n,r,i,s){if(n==At.ByHeight)return this.blockAt(e,r,i,s);if(n==At.ByPosNoHeight){let{from:x,to:v}=r.doc.lineAt(e);return new _i(x,v-x,0,0,0)}let{firstLine:a,perLine:o,perChar:u}=this.heightMetrics(r,s),f=r.doc.lineAt(e),h=o+f.length*u,m=f.number-a,O=i+o*m+u*(f.from-s-m);return new _i(f.from,f.length,Math.max(i,Math.min(O,i+this.height-h)),h,0)}forEachLine(e,n,r,i,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:o,perLine:u,perChar:f}=this.heightMetrics(r,s);for(let h=e,m=i;h<=n;){let O=r.doc.lineAt(h);if(h==e){let v=O.number-o;m+=u*v+f*(e-s-v)}let x=u+f*O.length;a(new _i(O.from,O.length,m,x,0)),m+=x,h=O.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof En?r[r.length-1]=new En(s.length+i):r.push(null,new En(i-1))}if(e>0){let s=r[0];s instanceof En?r[0]=new En(e+s.length):r.unshift(new En(e-1),null)}return rr.of(r)}decomposeLeft(e,n){n.push(new En(e-1),null)}decomposeRight(e,n){n.push(null,new En(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],o=Math.max(n,i.from),u=-1;for(i.from>n&&a.push(new En(i.from-n-1).updateHeight(e,n));o<=s&&i.more;){let h=e.doc.lineAt(o).length;a.length&&a.push(null);let m=i.heights[i.index++],O=0;m<0&&(O=-m,m=i.heights[i.index++]),u==-1?u=m:Math.abs(m-u)>=nO&&(u=-2);let x=new Dr(h,m,O);x.outdated=!1,a.push(x),o+=h+1}o<=s&&a.push(null,new En(s-o).updateHeight(e,o));let f=rr.of(a);return(u<0||Math.abs(f.height-this.height)>=nO||Math.abs(u-this.heightMetrics(e,n).perLine)>=nO)&&($u=!0),BO(this,f)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class FW extends rr{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let a=i+this.left.height,o=s+this.left.length+this.break,u=n==At.ByHeight?e<a:e<o,f=u?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,a,o);if(this.break||(u?f.to<o:f.from>o))return f;let h=n==At.ByPosNoHeight?At.ByPosNoHeight:At.ByPos;return u?f.join(this.right.lineAt(o,h,r,a,o)):this.left.lineAt(o,h,r,i,s).join(f)}forEachLine(e,n,r,i,s,a){let o=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,s,a),n>=u&&this.right.forEachLine(e,n,r,o,u,a);else{let f=this.lineAt(u,At.ByPos,r,i,s);e<f.from&&this.left.forEachLine(e,f.from-1,r,i,s,a),f.to>=e&&f.from<=n&&a(f),n>f.to&&this.right.forEachLine(f.to+1,n,r,o,u,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let o of r)s.push(o);if(e>0&&I_(s,a-1),n<this.length){let o=s.length;this.decomposeRight(n,s),I_(s,o)}return rr.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?rr.of(this.break?[e,null,n]:[e,n]):(this.left=BO(this.left,e),this.right=BO(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:a}=this,o=n+s.length+this.break,u=null;return i&&i.from<=n+s.length&&i.more?u=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=o+a.length&&i.more?u=a=a.updateHeight(e,o,r,i):a.updateHeight(e,o,r),u?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function I_(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof En&&(r=t[e+1])instanceof En&&t.splice(e-1,3,new En(n.length+1+r.length))}const KW=5;class Ok{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Dr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Dr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new UM(a,i,r)):(a||s||i>=KW)&&this.addLineDeco(i,s,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Dr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new En(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Dr)return e;let n=new Dr(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Dr)&&!this.isCovered?this.nodes.push(new Dr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Dr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new Ok(r,e);return wt.spans(n,r,i,s,0),s.finish(r)}}function JW(t,e,n){let r=new eH;return wt.compare(t,e,n,r,0),r.changes}class eH{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&su(e,n,this.changes,5)}}function tH(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),o=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let f=t.parentNode;f&&f!=r.body;)if(f.nodeType==1){let h=f,m=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let O=h.getBoundingClientRect();s=Math.max(s,O.left),a=Math.min(a,O.right),o=Math.max(o,O.top),u=Math.min(f==t.parentNode?i.innerHeight:u,O.bottom)}f=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:o-(n.top+e),bottom:Math.max(o,u)-(n.top+e)}}function nH(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function rH(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class c0{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return zt.replace({widget:new iH(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class iH extends rf{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Y_{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=U_,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(pk).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new WW(r),this.stateDeco=W_(n),this.heightMap=rr.empty().applyChanges(this.stateDeco,st.empty,this.heightOracle.setDoc(n.doc),[new ai(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=zt.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);e.push(new kg(s,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?U_:new xk(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Pd(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=W_(this.state);let i=e.changedRanges,s=ai.extendWithRanges(i,JW(r,this.stateDeco,e?e.changes:vn.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);V_(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||$u)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let f=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(f||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(HU)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?mn.RTL:mn.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",o=n.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let f=0,h=0;if(o.width&&o.height){let{scaleX:N,scaleY:_}=oM(n,o);(N>.005&&Math.abs(this.scaleX-N)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=N,this.scaleY=_,f|=16,a=u=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,O=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=O)&&(this.paddingTop=m,this.paddingBottom=O,f|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=16);let x=cM(this.view.contentDOM,!1).y;x!=this.scrollParent&&(this.scrollParent=x,this.scrollAnchorHeight=-1,this.scrollOffset=0);let v=this.getScrollOffset();this.scrollOffset!=v&&(this.scrollAnchorHeight=-1,this.scrollOffset=v),this.scrolledToBottom=fM(this.scrollParent||e.win);let S=(this.printing?rH:tH)(n,this.paddingTop),k=S.top-this.pixelViewport.top,w=S.bottom-this.pixelViewport.bottom;this.pixelViewport=S;let j=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(j!=this.inView&&(this.inView=j,j&&(u=!0)),!this.inView&&!this.scrollTarget&&!nH(e.dom))return 0;let Q=o.width;if((this.contentDOMWidth!=Q||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,f|=16),u){let N=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(N)&&(a=!0),a||i.lineWrapping&&Math.abs(Q-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:M,textHeight:I}=e.docView.measureTextSize();a=_>0&&i.refresh(s,_,M,I,Math.max(5,Q/M),N),a&&(e.docView.minWidth=0,f|=16)}k>0&&w>0?h=Math.max(k,w):k<0&&w<0&&(h=Math.min(k,w)),V_();for(let _ of this.viewports){let M=_.from==this.viewport.from?N:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?rr.empty().applyChanges(this.stateDeco,st.empty,this.heightOracle,[new ai(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new HW(_.from,M))}$u&&(f|=2)}let T=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),f|=this.updateForViewport()),(f&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,u=new kg(i.lineAt(a-r*1e3,At.ByHeight,s,0,0).from,i.lineAt(o+(1-r)*1e3,At.ByHeight,s,0,0).to);if(n){let{head:f}=n.range;if(f<u.from||f>u.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=i.lineAt(f,At.ByPos,s,0,0),O;n.y=="center"?O=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&f<u.from?O=m.top:O=m.bottom-h,u=new kg(i.lineAt(O-1e3/2,At.ByHeight,s,0,0).from,i.lineAt(O+h+1e3/2,At.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new kg(this.heightMap.lineAt(r,At.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,At.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,At.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,At.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=o+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<o+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new c0(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=mn.LTR&&!r)return[];let o=[],u=(h,m,O,x)=>{if(m-h<s)return;let v=this.state.selection.main,S=[v.from];v.empty||S.push(v.to);for(let w of S)if(w>h&&w<m){u(h,w-10,O,x),u(w+10,m,O,x);return}let k=aH(e,w=>w.from>=O.from&&w.to<=O.to&&Math.abs(w.from-h)<s&&Math.abs(w.to-m)<s&&!S.some(j=>w.from<j&&w.to>j));if(!k){if(m<O.to&&n&&r&&n.visibleRanges.some(Q=>Q.from<=m&&Q.to>=m)){let Q=n.moveToLineBoundary(pe.cursor(m),!1,!0).head;Q>h&&(m=Q)}let w=this.gapSize(O,h,m,x),j=r||w<2e6?w:2e6;k=new c0(h,m,w,j)}o.push(k)},f=h=>{if(h.length<a||h.type!=hi.Text)return;let m=sH(h.from,h.to,this.stateDeco);if(m.total<a)return;let O=this.scrollTarget?this.scrollTarget.range.head:null,x,v;if(r){let S=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,w;if(O!=null){let j=Cg(m,O),Q=((this.visibleBottom-this.visibleTop)/2+S)/h.height;k=j-Q,w=j+Q}else k=(this.visibleTop-h.top-S)/h.height,w=(this.visibleBottom-h.top+S)/h.height;x=Qg(m,k),v=Qg(m,w)}else{let S=m.total*this.heightOracle.charWidth,k=i*this.heightOracle.charWidth,w=0;if(S>2e6)for(let _ of e)_.from>=h.from&&_.from<h.to&&_.size!=_.displaySize&&_.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=_.size-_.displaySize);let j=this.pixelViewport.left+w,Q=this.pixelViewport.right+w,T,N;if(O!=null){let _=Cg(m,O),M=((Q-j)/2+k)/S;T=_-M,N=_+M}else T=(j-k)/S,N=(Q+k)/S;x=Qg(m,T),v=Qg(m,N)}x>h.from&&u(h.from,x,h,m),v<h.to&&u(v,h.to,h,m)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(f):f(h);return o}gapSize(e,n,r,i){let s=Cg(i,r)-Cg(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){c0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=zt.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];wt.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],o=r[s];(a.from!=o.from||a.to!=o.to)&&(i|=4,e&&e.mapPos(a.from,-1)==o.from&&e.mapPos(a.to,1)==o.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Pd(this.heightMap.lineAt(e,At.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Pd(this.heightMap.lineAt(this.scaler.fromDOM(e),At.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Pd(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let kg=class{constructor(e,n){this.from=e,this.to=n}};function sH(t,e,n){let r=[],i=t,s=0;return wt.spans(n,t,e,{span(){},point(a,o){a>i&&(r.push({from:i,to:a}),s+=a-i),i=o}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Qg({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:a}=e[i],o=a-s;if(r<=o)return s+r;r-=o}}function Cg(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function aH(t,e){for(let n of t)if(e(n))return n}const U_={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function W_(t){let e=t.facet(Zx).filter(r=>typeof r!="function"),n=t.facet(mk).filter(r=>typeof r!="function");return n.length&&e.push(wt.join(n)),e}class xk{constructor(e,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:o,to:u})=>{let f=n.lineAt(o,At.ByPos,e,0,0).top,h=n.lineAt(u,At.ByPos,e,0,0).bottom;return i+=h-f,{from:o,to:u,top:f,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let o of this.viewports)o.domTop=a+(o.top-s)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof xk?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Pd(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new _i(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Pd(i,e)):t._content)}const jg=Re.define({combine:t=>t.join(" ")}),lS=Re.define({combine:t=>t.indexOf(!0)>-1}),oS=Sl.newName(),WM=Sl.newName(),HM=Sl.newName(),GM={"&light":"."+WM,"&dark":"."+HM};function cS(t,e,n){return new Sl(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const lH=cS("."+oS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},GM),oH={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},u0=be.ie&&be.ie_version<=11;class cH{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new zU,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(be.ie&&be.ie_version<=11||be.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&be.android&&e.constructor.EDIT_CONTEXT!==!1&&!(be.chrome&&be.chrome_version<126)&&(this.editContext=new fH(e),e.state.facet(Fs)&&(e.contentDOM.editContext=this.editContext.editContext)),u0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Fs)?r.root.activeElement!=this.dom:!Jd(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(be.ie&&be.ie_version<=11||be.android&&be.chrome)&&!r.state.selection.main.empty&&i.focusNode&&th(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Th(e.root);if(!n)return!1;let r=be.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&uH(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Jd(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&LU(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,oH),u0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),u0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&au(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Jd(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new TW(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=zM(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!ZO(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=H_(n,e.previousSibling||e.target.previousSibling,-1),i=H_(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Fs)!=e.state.facet(Fs)&&(e.view.contentDOM.editContext=e.state.facet(Fs)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function H_(t,e,n){for(;e;){let r=Gt.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function G_(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return th(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function uH(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return G_(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?G_(t,n):null}class fH{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:a}=i,o=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let f=u-o>r.text.length;o==this.from&&s<this.from?o=s:u==this.to&&s>this.to&&(u=s);let h=DM(e.state.sliceDoc(o,u),r.text,(f?i.from:i.to)-o,f?"end":null);if(!h){let O=pe.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));ZO(O,i)||e.dispatch({selection:O,userEvent:"select"});return}let m={from:h.from+o,to:h.toA+o,insert:st.of(r.text.slice(h.from,h.toB).split(`
382
+ `))};if((be.mac||be.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:o,to:u,insert:st.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let O=this.to-this.from+(m.to-m.from+m.insert.length);gk(e,m,pe.single(this.toEditorPos(r.selectionStart,O),this.toEditorPos(r.selectionEnd,O)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),o=this.toEditorPos(r.rangeEnd);a<o;a++){let u=e.coordsForChar(a);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,o=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let u=this.toEditorPos(s.rangeStart),f=this.toEditorPos(s.rangeEnd);if(u<f){let h=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(o)?1:2}px`;i.push(zt.mark({attributes:{style:h}}).range(u,f))}}}e.dispatch({effects:jM.of(zt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Th(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,a,o,u,f)=>{if(r)return;let h=f.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(f)){i=this.pendingContextChange=null,n+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),f.toString()),this.to+=h}n+=h}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Pe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||DU(e.parent)||document,this.viewState=new Y_(this,e.state||ft.create(e)),e.scrollTo&&e.scrollTo.is(bg)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Fc).map(i=>new i0(i));for(let i of this.plugins)i.update(this);this.observer=new cH(this),this.inputState=new PW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new E_(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof pn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let O of e){if(O.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=O.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,o=0,u=null;e.some(O=>O.annotation(VM))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=IM(s,a),u||(o=1));let f=this.observer.delayedAndroidKey,h=null;if(f?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(ft.phrases)!=this.state.facet(ft.phrases))return this.setState(s);i=DO.create(this,s,e),i.flags|=o;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let O of e){if(m&&(m=m.map(O.changes)),O.scrollIntoView){let{main:x}=O.state.selection;m=new lu(x.empty?x:pe.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of O.effects)x.is(bg)&&(m=x.value.clip(this.state))}this.viewState.update(i,m),this.bidiCache=qO.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Nd)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(O=>O.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(jg)!=i.state.facet(jg)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let O of this.state.facet(rS))try{O(i)}catch(x){fs(this.state,x,"update listener")}(u||h)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),h&&!zM(this,h)&&f.force&&au(this.contentDOM,f.key,f.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Y_(this,e),this.plugins=e.facet(Fc).map(r=>new i0(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new E_(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Fc),r=e.state.facet(Fc);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new i0(s));else{let o=this.plugins[a];o.mustUpdate=e,i.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){fs(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(a<0)if(fM(r||this.win))s=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(i);s=x.from,a=x.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];u&4||([this.measureRequests,f]=[f,this.measureRequests]);let h=f.map(x=>{try{return x.read(this)}catch(v){return fs(this.state,v),F_}}),m=DO.create(this,this.state,[]),O=!1;m.flags|=u,n?n.flags|=u:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),O=this.docView.update(m),O&&this.docViewUpdate());for(let x=0;x<f.length;x++)if(h[x]!=F_)try{let v=f[x];v.write&&v.write(h[x],this)}catch(v){fs(this.state,v)}if(O&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let v=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((v>1||v<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+v,r?r.scrollTop+=v:this.win.scrollBy(0,v),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let o of this.state.facet(rS))o(n)}get themeClasses(){return oS+" "+(this.state.facet(lS)?HM:WM)+" "+this.state.facet(jg)}updateAttrs(){let e=K_(this,TM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Fs)?"true":"false",class:"cm-content",style:`${be.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),K_(this,pk,n);let r=this.observer.ignore(()=>{let i=j_(this.contentDOM,this.contentAttrs,n),s=j_(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Pe.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Nd);let e=this.state.facet(Pe.cspNonce);Sl.mount(this.root,this.styleModules.concat(lH).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return o0(this,e,A_(this,e,n,r))}moveByGroup(e,n){return o0(this,e,A_(this,e,n,r=>SW(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return pe.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return bW(this,e,n,r)}moveVertically(e,n,r){return o0(this,e,wW(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=sS(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),sS(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),a=s[us.find(s,e-i.from,-1,n)];return $h(r,a.dir==mn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(QM)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>dH)return OM(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||gM(s.isolates,r=__(this,e))))return s.order;r||(r=__(this,e));let i=YU(e.text,n,r);return this.bidiCache.push(new qO(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||be.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{uM(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return bg.of(new lu(typeof e=="number"?pe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return bg.of(new lu(pe.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ql.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ql.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Sl.newName(),i=[jg.of(r),Nd.of(cS(`.${r}`,e))];return n&&n.dark&&i.push(lS.of(!0)),i}static baseTheme(e){return gp.lowest(Nd.of(cS("."+oS,e,GM)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Gt.get(r)||Gt.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}Pe.styleModule=Nd;Pe.inputHandler=wM;Pe.clipboardInputFilter=dk;Pe.clipboardOutputFilter=hk;Pe.scrollHandler=CM;Pe.focusChangeEffect=kM;Pe.perLineTextDirection=QM;Pe.exceptionSink=SM;Pe.updateListener=rS;Pe.editable=Fs;Pe.mouseSelectionStyle=bM;Pe.dragMovesSelection=vM;Pe.clickAddsSelectionRange=yM;Pe.decorations=Zx;Pe.blockWrappers=$M;Pe.outerDecorations=mk;Pe.atomicRanges=yp;Pe.bidiIsolatedRanges=_M;Pe.scrollMargins=NM;Pe.darkTheme=lS;Pe.cspNonce=Re.define({combine:t=>t.length?t[0]:""});Pe.contentAttributes=pk;Pe.editorAttributes=TM;Pe.lineWrapping=Pe.contentAttributes.of({class:"cm-lineWrapping"});Pe.announce=Zt.define();const dH=4096,F_={};class qO{constructor(e,n,r,i,s,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:mn.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new qO(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function K_(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(t):s;a&&ck(a,n)}return n}const hH=be.mac?"mac":be.windows?"win":be.linux?"linux":"key";function pH(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,o;for(let u=0;u<n.length-1;++u){const f=n[u];if(/^(cmd|meta|m)$/i.test(f))o=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))s=!0;else if(/^s(hift)?$/i.test(f))a=!0;else if(/^mod$/i.test(f))e=="mac"?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),o&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Tg(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const mH=gp.default(Pe.domEventHandlers({keydown(t,e){return yH(gH(e.state),t,e,"editor")}})),Ix=Re.define({enables:mH}),J_=new WeakMap;function gH(t){let e=t.facet(Ix),n=J_.get(e);return n||J_.set(e,n=xH(e.reduce((r,i)=>r.concat(i),[]))),n}let al=null;const OH=4e3;function xH(t,e=hH){let n=Object.create(null),r=Object.create(null),i=(a,o)=>{let u=r[a];if(u==null)r[a]=o;else if(u!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,o,u,f,h)=>{var m,O;let x=n[a]||(n[a]=Object.create(null)),v=o.split(/ (?!$)/).map(w=>pH(w,e));for(let w=1;w<v.length;w++){let j=v.slice(0,w).join(" ");i(j,!0),x[j]||(x[j]={preventDefault:!0,stopPropagation:!1,run:[Q=>{let T=al={view:Q,prefix:j,scope:a};return setTimeout(()=>{al==T&&(al=null)},OH),!0}]})}let S=v.join(" ");i(S,!1);let k=x[S]||(x[S]={preventDefault:!1,stopPropagation:!1,run:((O=(m=x._any)===null||m===void 0?void 0:m.run)===null||O===void 0?void 0:O.slice())||[]});u&&k.run.push(u),f&&(k.preventDefault=!0),h&&(k.stopPropagation=!0)};for(let a of t){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let f of o){let h=n[f]||(n[f]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let O in h)h[O].run.push(x=>m(x,uS))}let u=a[e]||a.key;if(u)for(let f of o)s(f,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(f,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return n}let uS=null;function yH(t,e,n,r){uS=e;let i=_U(e),s=fU(i,0),a=dU(s)==i.length&&i!=" ",o="",u=!1,f=!1,h=!1;al&&al.view==n&&al.scope==r&&(o=al.prefix+" ",XM.indexOf(e.keyCode)<0&&(f=!0,al=null));let m=new Set,O=k=>{if(k){for(let w of k.run)if(!m.has(w)&&(m.add(w),w(n)))return k.stopPropagation&&(h=!0),!0;k.preventDefault&&(k.stopPropagation&&(h=!0),f=!0)}return!1},x=t[r],v,S;return x&&(O(x[o+Tg(i,e,!a)])?u=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(be.windows&&e.ctrlKey&&e.altKey)&&!(be.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=wl[e.keyCode])&&v!=i?(O(x[o+Tg(v,e,!0)])||e.shiftKey&&(S=Ch[e.keyCode])!=i&&S!=v&&O(x[o+Tg(S,e,!1)]))&&(u=!0):a&&e.shiftKey&&O(x[o+Tg(i,e,!0)])&&(u=!0),!u&&O(x._any)&&(u=!0)),f&&(u=!0),u&&h&&e.stopPropagation(),uS=null,u}class vH extends rf{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?eh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=$h(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function bH(t){let e=Ql.fromClass(class{constructor(n){this.view=n,this.placeholder=t?zt.set([zt.widget({widget:new vH(t),side:1}).range(0)]):zt.none}get decorations(){return this.view.state.doc.length?zt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Pe.contentAttributes.of({"aria-placeholder":t})]:e}class _u extends bl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}_u.prototype.elementClass="";_u.prototype.toDOM=void 0;_u.prototype.mapMode=er.TrackBefore;_u.prototype.startSide=_u.prototype.endSide=-1;_u.prototype.point=!0;const FM=1024;let SH=0;class li{constructor(e,n){this.from=e,this.to=n}}class Xe{constructor(e={}){this.id=SH++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=bn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Xe.closedBy=new Xe({deserialize:t=>t.split(" ")});Xe.openedBy=new Xe({deserialize:t=>t.split(" ")});Xe.group=new Xe({deserialize:t=>t.split(" ")});Xe.isolate=new Xe({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Xe.contextHash=new Xe({perNode:!0});Xe.lookAhead=new Xe({perNode:!0});Xe.mounted=new Xe({perNode:!0});class ou{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Xe.mounted.id]}}const wH=Object.create(null);class bn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):wH,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new bn(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Xe.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Xe.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}bn.none=new bn("",Object.create(null),0,8);class vp{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let a=s(r);if(a){i||(i=Object.assign({},r.props));let o=a[1],u=a[0];u.combine&&u.id in i&&(o=u.combine(i[u.id],o)),i[u.id]=o}}n.push(i?new bn(r.name,i,r.id,r.flags):r)}return new vp(n)}}const $g=new WeakMap,eN=new WeakMap;var xt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(xt||(xt={}));class gt{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,o]of s)this.props[typeof a=="number"?a:a.id]=o}}toString(){let e=ou.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new VO(this.topNode,e)}cursorAt(e,n=0,r=0){let i=$g.get(this)||this.topNode,s=new VO(i);return s.moveTo(e,n),$g.set(this,s._tree),s}get topNode(){return new gi(this,0,0,null)}resolve(e,n=0){let r=Nh($g.get(this)||this.topNode,e,n,!1);return $g.set(this,r),r}resolveInner(e,n=0){let r=Nh(eN.get(this)||this.topNode,e,n,!0);return eN.set(this,r),r}resolveStack(e,n=0){return CH(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,a=e.mode||0,o=(a&xt.IncludeAnonymous)>0;for(let u=this.cursor(a|xt.IncludeAnonymous);;){let f=!1;if(u.from<=s&&u.to>=i&&(!o&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;f=!0}for(;f&&r&&(o||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;f=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:bk(bn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new gt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new gt(bn.none,n,r,i)))}static build(e){return jH(e)}}gt.empty=new gt(bn.none,[],[],0);class yk{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new yk(this.buffer,this.index)}}class Cl{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return bn.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,r,i,s){let{buffer:a}=this,o=-1;for(let u=e;u!=n&&!(KM(s,i,a[u+1],a[u+2])&&(o=u,r>0));u=a[u+3]);return o}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),a=0;for(let o=e,u=0;o<n;){s[u++]=i[o++],s[u++]=i[o++]-r;let f=s[u++]=i[o++]-r;s[u++]=i[o++]-e,a=Math.max(a,f)}return new Cl(s,a,this.set)}}function KM(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Nh(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof gi&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=r?0:xt.IgnoreOverlays;if(r)for(let a=t,o=a.parent;o;a=o,o=a.parent)a instanceof gi&&a.index<0&&((i=o.enter(e,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(t=o);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class JM{cursor(e=0){return new VO(this,e)}getChild(e,n=null,r=null){let i=tN(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return tN(this,e,n,r)}resolve(e,n=0){return Nh(this,e,n,!1)}resolveInner(e,n=0){return Nh(this,e,n,!0)}matchContext(e){return fS(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}let gi=class rO extends JM{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let a=this;;){for(let{children:o,positions:u}=a._tree,f=n>0?o.length:-1;e!=f;e+=n){let h=o[e],m=u[e]+a.from,O;if(!(!(s&xt.EnterBracketed&&h instanceof gt&&(O=ou.get(h))&&!O.overlay&&O.bracketed&&r>=m&&r<=m+h.length)&&!KM(i,r,m,m+h.length))){if(h instanceof Cl){if(s&xt.ExcludeBuffers)continue;let x=h.findChild(0,h.buffer.length,n,r-m,i);if(x>-1)return new ds(new kH(a,h,e,m),null,x)}else if(s&xt.IncludeAnonymous||!h.type.isAnonymous||vk(h)){let x;if(!(s&xt.IgnoreMounts)&&(x=ou.get(h))&&!x.overlay)return new rO(x.tree,m,e,a);let v=new rO(h,m,e,a);return s&xt.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?h.children.length-1:0,n,r,i,s)}}}if(s&xt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&xt.IgnoreOverlays)&&(i=ou.get(this._tree))&&i.overlay){let s=e-this.from,a=r&xt.EnterBracketed&&i.bracketed;for(let{from:o,to:u}of i.overlay)if((n>0||a?o<=s:o<s)&&(n<0||a?u>=s:u>s))return new rO(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function tN(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function fS(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class kH{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class ds extends JM{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new ds(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&xt.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new ds(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ds(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ds(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];e.push(r.slice(i,s,a)),n.push(0)}return new gt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function e3(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let r=n instanceof gi&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new QH(i,n)}class QH{constructor(e,n){this.heads=e,this.node=n}get next(){return e3(this.heads)}}function CH(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof gi?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(e,n)),s=a}else{let a=ou.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let o=new gi(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Nh(o,e,n,!1))}}return i?e3(i):r}class VO{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~xt.EnterBracketed,e instanceof gi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof gi?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&xt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,a=e<0?-1:r._tree.children.length;s!=a;s+=e){let o=r._tree.children[s];if(this.mode&xt.IncludeAnonymous||o instanceof Cl||!o.type.isAnonymous||vk(o))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new ds(this.buffer,n,this.stack[i]);return this.bufferNode=new ds(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return fS(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return fS(this._tree,e,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function vk(t){return t.children.some(e=>e instanceof Cl||!e.type.isAnonymous||vk(e))}function jH(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=FM,reused:s=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new yk(n,n.length):n,u=r.types,f=0,h=0;function m(N,_,M,I,U,F){let{id:Z,start:X,end:H,size:E}=o,q=h,R=f;if(E<0)if(o.next(),E==-1){let D=s[Z];M.push(D),I.push(X-N);return}else if(E==-3){f=Z;return}else if(E==-4){h=Z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let z=u[Z],B,W,A=X-N;if(H-X<=i&&(W=k(o.pos-_,U))){let D=new Uint16Array(W.size-W.skip),Y=o.pos-W.size,P=D.length;for(;o.pos>Y;)P=w(W.start,D,P);B=new Cl(D,H-W.start,r),A=W.start-N}else{let D=o.pos-E;o.next();let Y=[],P=[],ee=Z>=a?Z:-1,ae=0,ne=H;for(;o.pos>D;)ee>=0&&o.id==ee&&o.size>=0?(o.end<=ne-i&&(v(Y,P,X,ae,o.end,ne,ee,q,R),ae=Y.length,ne=o.end),o.next()):F>2500?O(X,D,Y,P):m(X,D,Y,P,ee,F+1);if(ee>=0&&ae>0&&ae<Y.length&&v(Y,P,X,ae,X,ne,ee,q,R),Y.reverse(),P.reverse(),ee>-1&&ae>0){let fe=x(z,R);B=bk(z,Y,P,0,Y.length,0,H-X,fe,fe)}else B=S(z,Y,P,H-X,q-H,R)}M.push(B),I.push(A)}function O(N,_,M,I){let U=[],F=0,Z=-1;for(;o.pos>_;){let{id:X,start:H,end:E,size:q}=o;if(q>4)o.next();else{if(Z>-1&&H<Z)break;Z<0&&(Z=E-i),U.push(X,H,E),F++,o.next()}}if(F){let X=new Uint16Array(F*4),H=U[U.length-2];for(let E=U.length-3,q=0;E>=0;E-=3)X[q++]=U[E],X[q++]=U[E+1]-H,X[q++]=U[E+2]-H,X[q++]=q;M.push(new Cl(X,U[2]-H,r)),I.push(H-N)}}function x(N,_){return(M,I,U)=>{let F=0,Z=M.length-1,X,H;if(Z>=0&&(X=M[Z])instanceof gt){if(!Z&&X.type==N&&X.length==U)return X;(H=X.prop(Xe.lookAhead))&&(F=I[Z]+X.length+H)}return S(N,M,I,U,F,_)}}function v(N,_,M,I,U,F,Z,X,H){let E=[],q=[];for(;N.length>I;)E.push(N.pop()),q.push(_.pop()+M-U);N.push(S(r.types[Z],E,q,F-U,X-F,H)),_.push(U-M)}function S(N,_,M,I,U,F,Z){if(F){let X=[Xe.contextHash,F];Z=Z?[X].concat(Z):[X]}if(U>25){let X=[Xe.lookAhead,U];Z=Z?[X].concat(Z):[X]}return new gt(N,_,M,I,Z)}function k(N,_){let M=o.fork(),I=0,U=0,F=0,Z=M.end-i,X={size:0,start:0,skip:0};e:for(let H=M.pos-N;M.pos>H;){let E=M.size;if(M.id==_&&E>=0){X.size=I,X.start=U,X.skip=F,F+=4,I+=4,M.next();continue}let q=M.pos-E;if(E<0||q<H||M.start<Z)break;let R=M.id>=a?4:0,z=M.start;for(M.next();M.pos>q;){if(M.size<0)if(M.size==-3||M.size==-4)R+=4;else break e;else M.id>=a&&(R+=4);M.next()}U=z,I+=E,F+=R}return(_<0||I==N)&&(X.size=I,X.start=U,X.skip=F),X.size>4?X:void 0}function w(N,_,M){let{id:I,start:U,end:F,size:Z}=o;if(o.next(),Z>=0&&I<a){let X=M;if(Z>4){let H=o.pos-(Z-4);for(;o.pos>H;)M=w(N,_,M)}_[--M]=X,_[--M]=F-N,_[--M]=U-N,_[--M]=I}else Z==-3?f=I:Z==-4&&(h=I);return M}let j=[],Q=[];for(;o.pos>0;)m(t.start||0,t.bufferStart||0,j,Q,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:j.length?Q[0]+j[0].length:0;return new gt(u[t.topID],j.reverse(),Q.reverse(),T)}const nN=new WeakMap;function iO(t,e){if(!t.isAnonymous||e instanceof Cl||e.type!=t)return 1;let n=nN.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof gt)){n=1;break}n+=iO(t,r)}nN.set(e,n)}return n}function bk(t,e,n,r,i,s,a,o,u){let f=0;for(let v=r;v<i;v++)f+=iO(t,e[v]);let h=Math.ceil(f*1.5/8),m=[],O=[];function x(v,S,k,w,j){for(let Q=k;Q<w;){let T=Q,N=S[Q],_=iO(t,v[Q]);for(Q++;Q<w;Q++){let M=iO(t,v[Q]);if(_+M>=h)break;_+=M}if(Q==T+1){if(_>h){let M=v[T];x(M.children,M.positions,0,M.children.length,S[T]+j);continue}m.push(v[T])}else{let M=S[Q-1]+v[Q-1].length-N;m.push(bk(t,v,S,T,Q,N,M,null,u))}O.push(N+j-s)}}return x(e,n,r,i,0),(o||u)(m,O,a)}class t3{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof ds?this.setBuffer(e.context.buffer,e.index,n):e instanceof gi&&this.map.set(e.tree,n)}get(e){return e instanceof ds?this.getBuffer(e.context.buffer,e.index):e instanceof gi?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class ia{constructor(e,n,r,i,s=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new ia(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,a=e.length?e[0]:null;for(let o=0,u=0,f=0;;o++){let h=o<n.length?n[o]:null,m=h?h.fromA:1e9;if(m-u>=r)for(;a&&a.from<m;){let O=a;if(u>=O.from||m<=O.to||f){let x=Math.max(O.from,u)-f,v=Math.min(O.to,m)-f;O=x>=v?null:new ia(x,v,O.tree,O.offset+f,o>0,!!h)}if(O&&i.push(O),a.to>m)break;a=s<e.length?e[s++]:null}if(!h)break;u=h.toA,f=h.toA-h.toB}return i}}class Sk{startParse(e,n,r){return typeof e=="string"&&(e=new TH(e)),r=r?r.length?r.map(i=>new li(i.from,i.to)):[new li(0,0)]:[new li(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class TH{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function n3(t){return(e,n,r,i)=>new _H(e,t,n,r,i)}class rN{constructor(e,n,r,i,s,a){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=s,this.from=a}}function iN(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class $H{constructor(e,n,r,i,s,a,o,u){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.bracketed=a,this.target=o,this.prev=u,this.depth=0,this.ranges=[]}}const dS=new Xe({perNode:!0});class _H{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new gt(r.type,r.children,r.positions,r.length,r.propValues.concat([[dS,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Xe.mounted.id]=new ou(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new EH(this.fragments),n=null,r=null,i=new VO(new gi(this.baseTree,this.ranges[0].from,0,null),xt.IncludeAnonymous|xt.IgnoreMounts);e:for(let s,a;;){let o=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(n){let f=n.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(f)for(let h of f.mount.overlay){let m=h.from+f.pos,O=h.to+f.pos;m>=i.from&&O<=i.to&&!n.ranges.some(x=>x.from<O&&x.to>m)&&n.ranges.push({from:m,to:O})}}o=!1}else if(r&&(a=NH(r.ranges,i.from,i.to)))o=a!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(PH(i),n&&n.depth++,r&&r.depth++);let f=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")n=new $H(s.parser,s.overlay,f,this.inner.length,i.from,!!s.bracketed,i.tree,n);else{let h=lN(this.ranges,s.overlay||(i.from<i.to?[new li(i.from,i.to)]:[]));h.length&&iN(h),(h.length||!s.overlay)&&this.inner.push(new rN(s.parser,h.length?s.parser.startParse(this.input,oN(f,h),h):s.parser.startParse(""),s.overlay?s.overlay.map(m=>new li(m.from-i.from,m.to-i.from)):null,!!s.bracketed,i.tree,h.length?h[0].from:i.from)),s.overlay?h.length&&(r={ranges:h,depth:0,prev:r}):o=!1}}else if(n&&(u=n.predicate(i))&&(u===!0&&(u=new li(i.from,i.to)),u.from<u.to)){let f=n.ranges.length-1;f>=0&&n.ranges[f].to==u.from?n.ranges[f]={from:n.ranges[f].from,to:u.to}:n.ranges.push(u)}if(o&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let f=lN(this.ranges,n.ranges);f.length&&(iN(f),this.inner.splice(n.index,0,new rN(n.parser,n.parser.startParse(this.input,oN(n.mounts,f),f),n.ranges.map(h=>new li(h.from-n.start,h.to-n.start)),n.bracketed,n.target,f[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function NH(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function sN(t,e,n,r,i,s){if(e<n){let a=t.buffer[e+1];r.push(t.slice(e,n,a)),i.push(a-s)}}function PH(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(r),a=i.children[s],o=a.buffer,u=[s];function f(h,m,O,x,v,S){let k=n[S],w=[],j=[];sN(a,h,k,w,j,x);let Q=o[k+1],T=o[k+2];u.push(w.length);let N=S?f(k+4,o[k+3],a.set.types[o[k]],Q,T-Q,S-1):e.toTree();return w.push(N),j.push(Q-x),sN(a,o[k+3],m,w,j,x),new gt(O,w,j,v)}i.children[s]=f(0,o.length,bn.none,0,a.length,n.length-1);for(let h of u){let m=t.tree.children[h],O=t.tree.positions[h];t.yield(new gi(m,O+t.from,h,t._tree))}}class aN{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(xt.IncludeAnonymous|xt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,xt.IgnoreOverlays|xt.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof gt)n=n.children[0];else break}return!1}}let EH=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(dS))!==null&&n!==void 0?n:r.to,this.inner=new aN(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(dS))!==null&&e!==void 0?e:n.to,this.inner=new aN(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(r=s.tree)===null||r===void 0?void 0:r.prop(Xe.mounted);if(a&&a.parser==n)for(let o=this.fragI;o<this.fragments.length;o++){let u=this.fragments[o];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:s.from-u.offset,mount:a})}}}return i}};function lN(t,e){let n=null,r=e;for(let i=1,s=0;i<t.length;i++){let a=t[i-1].to,o=t[i].from;for(;s<r.length;s++){let u=r[s];if(u.from>=o)break;u.to<=a||(n||(r=n=e.slice()),u.from<a?(n[s]=new li(u.from,a),u.to>o&&n.splice(s+1,0,new li(o,u.to))):u.to>o?n[s--]=new li(o,u.to):n.splice(s--,1))}}return r}function AH(t,e,n,r){let i=0,s=0,a=!1,o=!1,u=-1e9,f=[];for(;;){let h=i==t.length?1e9:a?t[i].to:t[i].from,m=s==e.length?1e9:o?e[s].to:e[s].from;if(a!=o){let O=Math.max(u,n),x=Math.min(h,m,r);O<x&&f.push(new li(O,x))}if(u=Math.min(h,m),u==1e9)break;h==u&&(a?(a=!1,i++):a=!0),m==u&&(o?(o=!1,s++):o=!0)}return f}function oN(t,e){let n=[];for(let{pos:r,mount:i,frag:s}of t){let a=r+(i.overlay?i.overlay[0].from:0),o=a+i.tree.length,u=Math.max(s.from,a),f=Math.min(s.to,o);if(i.overlay){let h=i.overlay.map(O=>new li(O.from+r,O.to+r)),m=AH(e,h,u,f);for(let O=0,x=u;;O++){let v=O==m.length,S=v?f:m[O].from;if(S>x&&n.push(new ia(x,S,i.tree,-a,s.from>=x||s.openStart,s.to<=S||s.openEnd)),v)break;x=m[O].to}}else n.push(new ia(u,f,i.tree,-a,s.from>=a||s.openStart,s.to<=o||s.openEnd))}return n}let MH=0,is=class hS{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=MH++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof hS&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new hS(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new cN(e);return r=>r.modified.indexOf(n)>-1?r:cN.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}},RH=0,cN=class r3{constructor(e){this.name=e,this.instances=[],this.id=RH++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&zH(n,o.modified));if(r)return r;let i=[],s=new is(e.name,i,e,n);for(let o of n)o.instances.push(s);let a=DH(n);for(let o of e.set)if(!o.modified.length)for(let u of a)i.push(r3.get(o,u));return s}};function zH(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function DH(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Yo(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,o=i;for(let m=0;;){if(o=="..."&&m>0&&m+3==i.length){a=1;break}let O=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!O)throw new RangeError("Invalid path: "+i);if(s.push(O[0]=="*"?"":O[0][0]=='"'?JSON.parse(O[0]):O[0]),m+=O[0].length,m==i.length)break;let x=i[m++];if(m==i.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+i);o=i.slice(m)}let u=s.length-1,f=s[u];if(!f)throw new RangeError("Invalid path: "+i);let h=new Ph(r,a,u>0?s.slice(0,u):null);e[f]=h.sort(e[f])}}return i3.add(e)}const i3=new Xe({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new Ph(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class Ph{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ph.empty=new Ph([],2,null);function s3(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let a=i;for(let o of s)for(let u of o.set){let f=n[u.id];if(f){a=a?a+" "+f:f;break}}return a},scope:r}}function LH(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function XH(t,e,n,r=0,i=t.length){let s=new ZH(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class ZH{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:a,from:o,to:u}=e;if(o>=r||u<=n)return;a.isTop&&(s=this.highlighters.filter(x=>!x.scope||x.scope(a)));let f=i,h=BH(e)||Ph.empty,m=LH(s,h.tags);if(m&&(f&&(f+=" "),f+=m,h.mode==1&&(i+=(i?" ":"")+m)),this.startSpan(Math.max(n,o),f),h.opaque)return;let O=e.tree&&e.tree.prop(Xe.mounted);if(O&&O.overlay){let x=e.node.enter(O.overlay[0].from+o,1),v=this.highlighters.filter(k=>!k.scope||k.scope(O.tree.type)),S=e.firstChild();for(let k=0,w=o;;k++){let j=k<O.overlay.length?O.overlay[k]:null,Q=j?j.from+o:u,T=Math.max(n,w),N=Math.min(r,Q);if(T<N&&S)for(;e.from<N&&(this.highlightRange(e,T,N,i,s),this.startSpan(Math.min(N,e.to),f),!(e.to>=Q||!e.nextSibling())););if(!j||Q>r)break;w=j.to+o,w>n&&(this.highlightRange(x.cursor(),Math.max(n,j.from+o),Math.min(r,w),"",v),this.startSpan(Math.min(r,w),f))}S&&e.parent()}else if(e.firstChild()){O&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),f)}while(e.nextSibling());e.parent()}}}function BH(t){let e=t.type.prop(i3);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const ye=is.define,_g=ye(),rl=ye(),uN=ye(rl),fN=ye(rl),il=ye(),Ng=ye(il),f0=ye(il),Ki=ye(),Fl=ye(Ki),Gi=ye(),Fi=ye(),pS=ye(),vd=ye(pS),Pg=ye(),V={comment:_g,lineComment:ye(_g),blockComment:ye(_g),docComment:ye(_g),name:rl,variableName:ye(rl),typeName:uN,tagName:ye(uN),propertyName:fN,attributeName:ye(fN),className:ye(rl),labelName:ye(rl),namespace:ye(rl),macroName:ye(rl),literal:il,string:Ng,docString:ye(Ng),character:ye(Ng),attributeValue:ye(Ng),number:f0,integer:ye(f0),float:ye(f0),bool:ye(il),regexp:ye(il),escape:ye(il),color:ye(il),url:ye(il),keyword:Gi,self:ye(Gi),null:ye(Gi),atom:ye(Gi),unit:ye(Gi),modifier:ye(Gi),operatorKeyword:ye(Gi),controlKeyword:ye(Gi),definitionKeyword:ye(Gi),moduleKeyword:ye(Gi),operator:Fi,derefOperator:ye(Fi),arithmeticOperator:ye(Fi),logicOperator:ye(Fi),bitwiseOperator:ye(Fi),compareOperator:ye(Fi),updateOperator:ye(Fi),definitionOperator:ye(Fi),typeOperator:ye(Fi),controlOperator:ye(Fi),punctuation:pS,separator:ye(pS),bracket:vd,angleBracket:ye(vd),squareBracket:ye(vd),paren:ye(vd),brace:ye(vd),content:Ki,heading:Fl,heading1:ye(Fl),heading2:ye(Fl),heading3:ye(Fl),heading4:ye(Fl),heading5:ye(Fl),heading6:ye(Fl),contentSeparator:ye(Ki),list:ye(Ki),quote:ye(Ki),emphasis:ye(Ki),strong:ye(Ki),link:ye(Ki),monospace:ye(Ki),strikethrough:ye(Ki),inserted:ye(),deleted:ye(),changed:ye(),invalid:ye(),meta:Pg,documentMeta:ye(Pg),annotation:ye(Pg),processingInstruction:ye(Pg),definition:is.defineModifier("definition"),constant:is.defineModifier("constant"),function:is.defineModifier("function"),standard:is.defineModifier("standard"),local:is.defineModifier("local"),special:is.defineModifier("special")};for(let t in V){let e=V[t];e instanceof is&&(e.name=t)}s3([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var d0;const mo=new Xe;function wk(t){return Re.define({combine:t?e=>e.concat(t):void 0})}const kk=new Xe;class oi{constructor(e,n,r=[],i=""){this.data=e,this.name=i,ft.prototype.hasOwnProperty("tree")||Object.defineProperty(ft.prototype,"tree",{get(){return Kt(this)}}),this.parser=n,this.extension=[Pu.of(this),ft.languageData.of((s,a,o)=>{let u=dN(s,a,o),f=u.type.prop(mo);if(!f)return[];let h=s.facet(f),m=u.type.prop(kk);if(m){let O=u.resolve(a-u.from,o);for(let x of m)if(x.test(O,s)){let v=s.facet(x.facet);return x.type=="replace"?v:v.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return dN(e,n,r).type.prop(mo)==this.data}findRegions(e){let n=e.facet(Pu);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(mo)==this.data){r.push({from:a,to:a+s.length});return}let o=s.prop(Xe.mounted);if(o){if(o.tree.prop(mo)==this.data){if(o.overlay)for(let u of o.overlay)r.push({from:u.from+a,to:u.to+a});else r.push({from:a,to:a+s.length});return}else if(o.overlay){let u=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>u)return}}for(let u=0;u<s.children.length;u++){let f=s.children[u];f instanceof gt&&i(f,s.positions[u]+a)}};return i(Kt(e),0),r}get allowsNesting(){return!0}}oi.setState=Zt.define();function dN(t,e,n){let r=t.facet(Pu),i=Kt(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,xt.ExcludeBuffers|xt.EnterBracketed))s.type.isTop&&(i=s);return i}class Eo extends oi{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=wk(e.languageData);return new Eo(n,e.parser.configure({props:[mo.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new Eo(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Kt(t){let e=t.field(oi.state,!1);return e?e.tree:gt.empty}class qH{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let bd=null;class Eh{constructor(e,n,r=[],i,s,a,o,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=o,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Eh(e,n,[],gt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new qH(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=gt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(ia.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(ia.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=bd;bd=this;try{return e()}finally{bd=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=hN(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((f,h,m,O)=>u.push({fromA:f,toA:h,fromB:m,toB:O})),r=ia.applyChanges(r,u),i=gt.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let f of this.skipped){let h=e.mapPos(f.from,1),m=e.mapPos(f.to,-1);h<m&&o.push({from:h,to:m})}}}return new Eh(this.parser,n,r,i,s,a,o,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=hN(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Sk{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let u=bd;if(u){for(let f of i)u.tempSkipped.push(f);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new gt(bn.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return bd}}function hN(t,e,n){return ia.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Nu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Nu(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Eh.create(e.facet(Pu).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Nu(r)}}oi.state=ga.define({create:Nu.init,update(t,e){for(let n of e.effects)if(n.is(oi.setState))return n.value;return e.startState.facet(Pu)!=e.state.facet(Pu)?Nu.init(e.state):t.apply(e)}});let a3=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(a3=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const h0=typeof navigator<"u"&&(!((d0=navigator.scheduling)===null||d0===void 0)&&d0.isInputPending)?()=>navigator.scheduling.isInputPending():null,VH=Ql.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(oi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(oi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=a3(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(oi.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!h0?Math.max(25,e.timeRemaining()-5):1e9),o=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>h0&&h0()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:oi.setState.of(new Nu(s.context))})),this.chunkBudget>0&&!(u&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>fs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Pu=Re.define({combine(t){return t.length?t[0]:null},enables:t=>[oi.state,VH,Pe.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Eu{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class IO{constructor(e,n,r,i,s,a=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new IO(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(s=>s==n))return i;if(r)for(let i of e)for(let s of i.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return i}return null}}const IH=Re.define(),bp=Re.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function YO(t){let e=t.facet(bp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function UO(t,e){let n="",r=t.tabSize,i=t.facet(bp)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function l3(t,e){t instanceof ft&&(t=new Yx(t));for(let r of t.state.facet(IH)){let i=r(t,e);if(i!==void 0)return i}let n=Kt(t.state);return n.length>=e?YH(t,n,e):null}class Yx{constructor(e,n={}){this.state=e,this.options=n,this.unit=YO(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return ua(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const sf=new Xe;function YH(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return o3(r,t,n)}function o3(t,e,n){for(let r=t;r;r=r.next){let i=WH(r.node);if(i)return i(Qk.create(e,n,r))}return 0}function UH(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function WH(t){let e=t.type.prop(sf);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Xe.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>c3(a,!0,1,void 0,s&&!UH(a)?i.from:void 0)}return t.parent==null?HH:null}function HH(){return 0}class Qk extends Yx{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Qk(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(GH(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return o3(this.context.next,this.base,this.pos)}}function GH(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function FH(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let o=n.to;;){let u=e.childAfter(o);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=a)return null;let f=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+f}}o=u.to}}function mS({closing:t,align:e=!0,units:n=1}){return r=>c3(r,e,n,t)}function c3(t,e,n,r,i){let s=t.textAfter,a=s.match(/^\s*/)[0].length,o=r&&s.slice(a,a+r.length)==r||i==t.pos+a,u=e?FH(t):null;return u?o?t.column(u.from):t.column(u.to):t.baseIndent+(o?0:t.unit*n)}const KH=t=>t.baseIndent;function sO({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const JH=Re.define(),af=new Xe;function Ck(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}class Sp{constructor(e,n){this.specs=e;let r;function i(o){let u=Sl.newName();return(r||(r=Object.create(null)))["."+u]=o,u}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof oi?o=>o.prop(mo)==a.data:a?o=>o==a:void 0,this.style=s3(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=r?new Sl(r):null,this.themeType=n.themeType}static define(e,n){return new Sp(e,n||{})}}const gS=Re.define(),eG=Re.define({combine(t){return t.length?[t[0]]:null}});function p0(t){let e=t.facet(gS);return e.length?e:t.facet(eG)}function u3(t,e){let n=[nG],r;return t instanceof Sp&&(t.module&&n.push(Pe.styleModule.of(t.module)),r=t.themeType),r?n.push(gS.computeN([Pe.darkTheme],i=>i.facet(Pe.darkTheme)==(r=="dark")?[t]:[])):n.push(gS.of(t)),n}class tG{constructor(e){this.markCache=Object.create(null),this.tree=Kt(e.state),this.decorations=this.buildDeco(e,p0(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Kt(e.state),r=p0(e.state),i=r!=p0(e.startState),{viewport:s}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&a>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return zt.none;let r=new kh;for(let{from:i,to:s}of e.visibleRanges)XH(this.tree,n,(a,o,u)=>{r.add(a,o,this.markCache[u]||(this.markCache[u]=zt.mark({class:u})))},i,s);return r.finish()}}const nG=gp.high(Ql.fromClass(tG,{decorations:t=>t.decorations})),rG=Sp.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),iG=1e4,sG="()[]{}",f3=new Xe;function OS(t,e,n){let r=t.prop(e<0?Xe.openedBy:Xe.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function xS(t){let e=t.type.prop(f3);return e?e(t.node):t}function Kc(t,e,n,r={}){let i=r.maxScanDistance||iG,s=r.brackets||sG,a=Kt(t),o=a.resolveInner(e,n);for(let u=o;u;u=u.parent){let f=OS(u.type,n,s);if(f&&u.from<u.to){let h=xS(u);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return aG(t,e,n,u,h,f,s)}}return lG(t,e,n,a,o.type,i,s)}function aG(t,e,n,r,i,s,a){let o=r.parent,u={from:i.from,to:i.to},f=0,h=o==null?void 0:o.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(f==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let m=xS(h);return{start:u,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(OS(h.type,n,a))f++;else if(OS(h.type,-n,a)){if(f==0){let m=xS(h);return{start:u,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}f--}}while(n<0?h.prevSibling():h.nextSibling());return{start:u,matched:!1}}function lG(t,e,n,r,i,s,a){let o=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(o);if(u<0||u%2==0!=n>0)return null;let f={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let O=0;!h.next().done&&O<=s;){let x=h.value;n<0&&(O+=x.length);let v=e+O*n;for(let S=n>0?0:x.length-1,k=n>0?x.length:-1;S!=k;S+=n){let w=a.indexOf(x[S]);if(!(w<0||r.resolveInner(v+S,1).type!=i))if(w%2==0==n>0)m++;else{if(m==1)return{start:f,end:{from:v+S,to:v+S+1},matched:w>>1==u>>1};m--}}n>0&&(O+=x.length)}return h.done?{start:f,matched:!1}:null}const oG=Object.create(null),pN=[bn.none],mN=[],gN=Object.create(null),cG=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])cG[t]=uG(oG,e);function m0(t,e){mN.indexOf(t)>-1||(mN.push(t),console.warn(e))}function uG(t,e){let n=[];for(let o of e.split(" ")){let u=[];for(let f of o.split(".")){let h=t[f]||V[f];h?typeof h=="function"?u.length?u=u.map(h):m0(f,`Modifier ${f} used at start of tag`):u.length?m0(f,`Tag ${f} used as modifier`):u=Array.isArray(h)?h:[h]:m0(f,`Unknown highlighting tag ${f}`)}for(let f of u)n.push(f)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),s=gN[i];if(s)return s.id;let a=gN[i]=bn.define({id:pN.length,name:r,props:[Yo({[r]:n})]});return pN.push(a),a.id}mn.RTL,mn.LTR;class fG{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Kt(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(mG(e));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function ON(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function dG(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=ON(e)+ON(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function hG(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:dG(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function pG(t,e){return n=>{for(let r=Kt(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}function mG(t,e){var n;let{source:r}=t,i=r[r.length-1]!="$";return i?new RegExp(`(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":""):t}const gG=Oa.define(),OG=Pe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class xG{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class jk{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,er.TrackDel),r=e.mapPos(this.to,1,er.TrackDel);return n==null||r==null?null:new jk(this.field,n,r)}}class Tk{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let f=a,h=/^\t*/.exec(u)[0].length;for(let m=0;m<h;m++)f+=e.facet(bp);i.push(n+f.length-h),u=f+u.slice(h)}r.push(u),n+=u.length+1}let o=this.fieldPositions.map(u=>new jk(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],i=[],s;for(let a of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=s[1]?+s[1]:null,u=s[2]||s[3]||"",f=-1,h=u.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m<n.length;m++)(o!=null?n[m].seq==o:h&&n[m].name==h)&&(f=m);if(f<0){let m=0;for(;m<n.length&&(o==null||n[m].seq!=null&&n[m].seq<o);)m++;n.splice(m,0,{seq:o,name:h}),f=m;for(let O of i)O.field>=f&&O.field++}for(let m of i)if(m.line==r.length&&m.from>s.index){let O=s[2]?3+(s[1]||"").length:2;m.from-=O,m.to-=O}i.push(new xG(f,r.length,s.index,s.index+h.length)),a=a.slice(0,s.index)+u+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(o,u,f)=>{for(let h of i)h.line==r.length&&h.from>f&&(h.from--,h.to--);return u}),r.push(a)}return new Tk(r,i)}}let yG=zt.widget({widget:new class extends rf{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),vG=zt.mark({class:"cm-snippetField"});class lf{constructor(e,n){this.ranges=e,this.active=n,this.deco=zt.set(e.map(r=>(r.from==r.to?yG:vG).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new lf(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const wp=Zt.define({map(t,e){return t&&t.map(e)}}),bG=Zt.define(),Ah=ga.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(wp))return n.value;if(n.is(bG)&&t)return new lf(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Pe.decorations.from(t,e=>e?e.deco:zt.none)});function $k(t,e){return pe.create(t.filter(n=>n.field==e).map(n=>pe.range(n.from,n.to)))}function SG(t){let e=Tk.parse(t);return(n,r,i,s)=>{let{text:a,ranges:o}=e.instantiate(n.state,i),{main:u}=n.state.selection,f={changes:{from:i,to:s==u.from?u.to:s,insert:st.of(a)},scrollIntoView:!0,annotations:r?[gG.of(r),pn.userEvent.of("input.complete")]:void 0};if(o.length&&(f.selection=$k(o,0)),o.some(h=>h.field>0)){let h=new lf(o,0),m=f.effects=[wp.of(h)];n.state.field(Ah,!1)===void 0&&m.push(Zt.appendConfig.of([Ah,jG,TG,OG]))}n.dispatch(n.state.update(f))}}function d3(t){return({state:e,dispatch:n})=>{let r=e.field(Ah,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:$k(r.ranges,i),effects:wp.of(s?null:new lf(r.ranges,i)),scrollIntoView:!0})),!0}}const wG=({state:t,dispatch:e})=>t.field(Ah,!1)?(e(t.update({effects:wp.of(null)})),!0):!1,kG=d3(1),QG=d3(-1),CG=[{key:"Tab",run:kG,shift:QG},{key:"Escape",run:wG}],xN=Re.define({combine(t){return t.length?t[0]:CG}}),jG=gp.highest(Ix.compute([xN],t=>t.facet(xN)));function mr(t,e){return{...e,apply:SG(t)}}const TG=Pe.domEventHandlers({mousedown(t,e){let n=e.state.field(Ah,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:$k(n.ranges,i.field),effects:wp.of(n.ranges.some(s=>s.field>i.field)?new lf(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),h3=new class extends bl{};h3.startSide=1;h3.endSide=-1;class WO{static create(e,n,r,i,s){let a=i+(i<<8)+e+(n<<4)|0;return new WO(e,n,r,a,s,[],[])}constructor(e,n,r,i,s,a,o){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=s,this.children=a,this.positions=o,this.hashProp=[[Xe.contextHash,i]]}addChild(e,n){e.prop(Xe.contextHash)!=this.hash&&(e=new gt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new gt(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,s,a)=>new gt(bn.none,i,s,a,this.hashProp)})}}var xe;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(xe||(xe={}));class $G{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class _G{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return rh(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let i=n;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function yN(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==xe.OrderedList?Pk:Nk)(n,e,!1);return r>0&&(t.type!=xe.BulletList||_k(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const p3={[xe.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(it(xe.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(xi(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[xe.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[xe.OrderedList]:yN,[xe.BulletList]:yN,[xe.Document](){return!0}};function xi(t){return t==32||t==9||t==10||t==13}function rh(t,e=0){for(;e<t.length&&xi(t.charCodeAt(e));)e++;return e}function vN(t,e,n){for(;e>n&&xi(t.charCodeAt(e-1));)e--;return e}function m3(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function g3(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function _k(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let s=t.text.charCodeAt(i);if(s==t.next)r++;else if(!xi(s))return-1}return n&&t.next==45&&y3(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(w3.SetextHeading)>-1||r<3?-1:1}function O3(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function Nk(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||xi(t.text.charCodeAt(t.pos+1)))&&(!n||O3(e,xe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function Pk(t,e,n){let r=t.pos,i=t.next;for(;i>=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||r<t.text.length-1&&!xi(t.text.charCodeAt(r+1))||n&&!O3(e,xe.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function x3(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function y3(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&xi(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const yS=/^[ \t]*$/,v3=/-->/,b3=/\?>/,vS=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,v3],[/^\s*<\?/,b3],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,yS],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,yS]];function S3(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,s=vS.length-(n?1:0);i<s;i++)if(vS[i][0].test(r))return i;return-1}function bN(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function Fa(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==xe.CodeText?t[r].to=n:t.push(it(xe.CodeText,e,n))}const Eg={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,s=t.lineStart+e.text.length,a=[],o=[];for(Fa(a,i,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){Fa(o,t.lineStart-1,t.lineStart);for(let u of e.markers)o.push(u)}else{if(e.indent<n)break;{if(o.length){for(let f of o)f.type==xe.CodeText?Fa(a,f.from,f.to):a.push(f);o=[]}Fa(a,t.lineStart-1,t.lineStart);for(let f of e.markers)a.push(f);s=t.lineStart+e.text.length;let u=t.lineStart+e.findColumn(e.baseIndent+4);u<s&&Fa(a,u,s)}}return o.length&&(o=o.filter(u=>u.type!=xe.CodeText),o.length&&(e.markers=o.concat(e.markers))),t.addNode(t.buffer.writeElements(a,-i).finish(xe.CodeBlock,s-i),i),!0},FencedCode(t,e){let n=m3(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,s=n-e.pos,a=e.skipSpace(n),o=vN(e.text,e.text.length,a),u=[it(xe.CodeMark,r,r+s)];a<o&&u.push(it(xe.CodeInfo,t.lineStart+a,t.lineStart+o));for(let f=!0,h=!0,m=!1;t.nextLine()&&e.depth>=t.stack.length;f=!1){let O=e.pos;if(e.indent-e.baseIndent<4)for(;O<e.text.length&&e.text.charCodeAt(O)==i;)O++;if(O-e.pos>=s&&e.skipSpace(O)==e.text.length){for(let x of e.markers)u.push(x);h&&m&&Fa(u,t.lineStart-1,t.lineStart),u.push(it(xe.CodeMark,t.lineStart+e.pos,t.lineStart+O)),t.nextLine();break}else{m=!0,f||(Fa(u,t.lineStart-1,t.lineStart),h=!1);for(let S of e.markers)u.push(S);let x=t.lineStart+e.basePos,v=t.lineStart+e.text.length;x<v&&(Fa(u,x,v),h=!1)}}return t.addNode(t.buffer.writeElements(u,-r).finish(xe.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=g3(e);return n<0?!1:(t.startContext(xe.Blockquote,e.pos),t.addNode(xe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(_k(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(xe.HorizontalRule,n),!0},BulletList(t,e){let n=Nk(e,t,!1);if(n<0)return!1;t.block.type!=xe.BulletList&&t.startContext(xe.BulletList,e.basePos,e.next);let r=bN(e,e.pos+1);return t.startContext(xe.ListItem,e.basePos,r-e.baseIndent),t.addNode(xe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=Pk(e,t,!1);if(n<0)return!1;t.block.type!=xe.OrderedList&&t.startContext(xe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=bN(e,e.pos+n);return t.startContext(xe.ListItem,e.basePos,r-e.baseIndent),t.addNode(xe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=x3(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,s=vN(e.text,e.text.length,r),a=s;for(;a>r&&e.text.charCodeAt(a-1)==e.next;)a--;(a==s||a==r||!xi(e.text.charCodeAt(a-1)))&&(a=e.text.length);let o=t.buffer.write(xe.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,a),i+n+1),-i);a<e.text.length&&o.write(xe.HeaderMark,a-r,s-r);let u=o.finish(xe.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(u,i),!0},HTMLBlock(t,e){let n=S3(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=vS[n][1],s=[],a=i!=yS;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){a=!1;break}for(let f of e.markers)s.push(f)}a&&t.nextLine();let o=i==v3?xe.CommentBlock:i==b3?xe.ProcessingInstructionBlock:xe.HTMLBlock,u=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-r).finish(o,u-r),r),!0},SetextHeading:void 0};class NG{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
383
+ `+n.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,n){return(this.stage==2||this.stage==3)&&rh(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,it(xe.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(P3(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(it(xe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(_3(e,rh(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=rh(e,this.pos),r=0;if(n>this.pos){let i=N3(e,n,this.start);if(i){let s=g0(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=g0(e,this.pos)),r>0&&r<e.length?r:-1}else return g0(e,this.pos)}}}function g0(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!xi(n))return-1}return e}class PG{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:y3(n),s=n.next;if(i<0)return!1;let a=it(xe.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,it(s==61?xe.SetextHeading1:xe.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),a])),!0}finish(){return!1}}const w3={LinkReference(t,e){return e.content.charCodeAt(0)==91?new NG(e):null},SetextHeading(){return new PG}},EG=[(t,e)=>x3(e)>=0,(t,e)=>m3(e)>=0,(t,e)=>g3(e)>=0,(t,e)=>Nk(e,t,!0)>=0,(t,e)=>Pk(e,t,!0)>=0,(t,e)=>_k(e,t,!0)>=0,(t,e)=>S3(e,t,!0)>=0],AG={text:"",end:0};class MG{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new _G,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=WO.create(xe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new DG(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let n=new $G(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
384
+ `+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=E3(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=AG;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let s=this.ranges[i].from,a=this.lineChunkAt(s);n.end=s+a.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+a,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+xe[i.type]);let a=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>a&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
385
+ `?"":n;else{let i=n.indexOf(`
386
+ `);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=WO.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new gt(this.parser.nodeSet.types[e],Au,Au,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(SS(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?k3(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=SS(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(xe.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?it(this.parser.getNodeType(e),n,r,i):new j3(e,n)}get buffer(){return new C3(this.parser.nodeSet)}}function k3(t,e,n,r,i){let s=t[e].to,a=[],o=[],u=n.from+r;function f(h,m){for(;m?h>=s:h>s;){let O=t[e+1].from-s;r+=O,h+=O,e++,s=t[e].to}}for(let h=n.firstChild;h;h=h.nextSibling){f(h.from+r,!0);let m=h.from+r,O,x=i.get(h.tree);x?O=x:h.to+r>s?(O=k3(t,e,h,r,i),f(h.to+r,!1)):O=h.toTree(),a.push(O),o.push(m-u)}return f(n.to+r,!1),new gt(n.type,a,o,n.to+r-u,n.tree?n.tree.propValues:void 0)}class Ux extends Sk{constructor(e,n,r,i,s,a,o,u,f){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=u,this.wrappers=f,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,n,r){let i=new MG(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}configure(e){let n=bS(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),o=this.blockNames.slice(),u=this.inlineParsers.slice(),f=this.inlineNames.slice(),h=this.endLeafBlock.slice(),m=this.wrappers;if(Sd(n.defineNodes)){i=Object.assign({},i);let O=r.types.slice(),x;for(let v of n.defineNodes){let{name:S,block:k,composite:w,style:j}=typeof v=="string"?{name:v}:v;if(O.some(N=>N.name==S))continue;w&&(i[O.length]=(N,_,M)=>w(_,M,N.value));let Q=O.length,T=w?["Block","BlockContext"]:k?Q>=xe.ATXHeading1&&Q<=xe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;O.push(bn.define({id:Q,name:S,props:T&&[[Xe.group,T]]})),j&&(x||(x={}),Array.isArray(j)||j instanceof is?x[S]=j:Object.assign(x,j))}r=new vp(O),x&&(r=r.extend(Yo(x)))}if(Sd(n.props)&&(r=r.extend(...n.props)),Sd(n.remove))for(let O of n.remove){let x=this.blockNames.indexOf(O),v=this.inlineNames.indexOf(O);x>-1&&(s[x]=a[x]=void 0),v>-1&&(u[v]=void 0)}if(Sd(n.parseBlock))for(let O of n.parseBlock){let x=o.indexOf(O.name);if(x>-1)s[x]=O.parse,a[x]=O.leaf;else{let v=O.before?Ag(o,O.before):O.after?Ag(o,O.after)+1:o.length-1;s.splice(v,0,O.parse),a.splice(v,0,O.leaf),o.splice(v,0,O.name)}O.endLeaf&&h.push(O.endLeaf)}if(Sd(n.parseInline))for(let O of n.parseInline){let x=f.indexOf(O.name);if(x>-1)u[x]=O.parse;else{let v=O.before?Ag(f,O.before):O.after?Ag(f,O.after)+1:f.length-1;u.splice(v,0,O.parse),f.splice(v,0,O.name)}}return n.wrap&&(m=m.concat(n.wrap)),new Ux(r,s,a,o,h,i,u,f,m)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new Ek(this,e,n);e:for(let i=n;i<r.end;){let s=r.char(i);for(let a of this.inlineParsers)if(a){let o=a(r,s,i);if(o>=0){i=o;continue e}}i++}return r.resolveMarkers(0)}}function Sd(t){return t!=null&&t.length>0}function bS(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=bS(t[0]);if(t.length==1)return e;let n=bS(t.slice(1));if(!n||!e)return e||n;let r=(a,o)=>(a||Au).concat(o||Au),i=e.wrap,s=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?s?(a,o,u,f)=>i(s(a,o,u,f),o,u,f):i:s}}function Ag(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let Q3=[bn.none];for(let t=1,e;e=xe[t];t++)Q3[t]=bn.define({id:t,name:e,props:t>=xe.Escape?[]:[[Xe.group,t in p3?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Au=[];class C3{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return gt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let Mh=class{constructor(e,n,r,i=Au){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new C3(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class j3{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Au}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function it(t,e,n,r){return new Mh(t,e,n,r)}const T3={resolve:"Emphasis",mark:"EmphasisMark"},$3={resolve:"Emphasis",mark:"EmphasisMark"},lo={},HO={};class Lr{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const SN="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Rh=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Rh=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const O0={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<SN.length;i++)if(SN.charCodeAt(i)==r)return t.append(it(xe.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(it(xe.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,s=0;for(;r<t.end;r++)if(t.char(r)==96){if(s++,s==i&&t.char(r+1)!=96)return t.append(it(xe.InlineCode,n,r+1,[it(xe.CodeMark,n,n+i),it(xe.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return t.append(it(xe.Autolink,n,n+1+i[0].length,[it(xe.LinkMark,n,n+1),it(xe.URL,n+1,n+i[0].length),it(xe.LinkMark,n+i[0].length,n+1+i[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(s)return t.append(it(xe.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(r);if(a)return t.append(it(xe.ProcessingInstruction,n,n+1+a[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return o?t.append(it(xe.HTMLTag,n,n+1+o[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),s=t.slice(r,r+1),a=Rh.test(i),o=Rh.test(s),u=/\s|^$/.test(i),f=/\s|^$/.test(s),h=!f&&(!o||u||a),m=!u&&(!a||f||o),O=h&&(e==42||!m||a),x=m&&(e==42||!h||o);return t.append(new Lr(e==95?T3:$3,n,r,(O?1:0)|(x?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(it(xe.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(it(xe.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new Lr(lo,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new Lr(HO,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof Lr&&(i.type==lo||i.type==HO)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let s=t.takeContent(r),a=t.parts[r]=RG(t,s,i.type==lo?xe.Link:xe.Image,i.from,n+1);if(i.type==lo)for(let o=0;o<r;o++){let u=t.parts[o];u instanceof Lr&&u.type==lo&&(u.side=0)}return a.to}}return-1}};function RG(t,e,n,r,i){let{text:s}=t,a=t.char(i),o=i;if(e.unshift(it(xe.LinkMark,r,r+(n==xe.Image?2:1))),e.push(it(xe.LinkMark,i-1,i)),a==40){let u=t.skipSpace(i+1),f=_3(s,u-t.offset,t.offset),h;f&&(u=t.skipSpace(f.to),u!=f.to&&(h=N3(s,u-t.offset,t.offset),h&&(u=t.skipSpace(h.to)))),t.char(u)==41&&(e.push(it(xe.LinkMark,i,i+1)),o=u+1,f&&e.push(f),h&&e.push(h),e.push(it(xe.LinkMark,u,o)))}else if(a==91){let u=P3(s,i-t.offset,t.offset,!1);u&&(e.push(u),o=u.to)}return it(n,r,o,e)}function _3(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let s=t.charCodeAt(i);if(s==62)return it(xe.URL,e+n,i+1+n);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let a=!1;s<t.length;s++){let o=t.charCodeAt(s);if(xi(o))break;if(a)a=!1;else if(o==40)i++;else if(o==41){if(!i)break;i--}else o==92&&(a=!0)}return s>e?it(xe.URL,e+n,s+n):s==t.length?null:!1}}function N3(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,a=!1;s<t.length;s++){let o=t.charCodeAt(s);if(a)a=!1;else{if(o==i)return it(xe.LinkTitle,e+n,s+1+n);o==92&&(a=!0)}}return null}function P3(t,e,n,r){for(let i=!1,s=e+1,a=Math.min(t.length,s+999);s<a;s++){let o=t.charCodeAt(s);if(i)i=!1;else{if(o==93)return r?!1:it(xe.LinkLabel,e+n,s+1+n);if(r&&!xi(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}class Ek{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,r,i,s){return this.append(new Lr(e,n,r,(i?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let n=this.parts[e];if(n instanceof Lr&&(n.type==lo||n.type==HO))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Lr&&i.type.resolve&&i.side&2))continue;let s=i.type==T3||i.type==$3,a=i.to-i.from,o,u=r-1;for(;u>=e;u--){let S=this.parts[u];if(S instanceof Lr&&S.side&1&&S.type==i.type&&!(s&&(i.side&1||S.side&2)&&(S.to-S.from+a)%3==0&&((S.to-S.from)%3||a%3))){o=S;break}}if(!o)continue;let f=i.type.resolve,h=[],m=o.from,O=i.to;if(s){let S=Math.min(2,o.to-o.from,a);m=o.to-S,O=i.from+S,f=S==1?"Emphasis":"StrongEmphasis"}o.type.mark&&h.push(this.elt(o.type.mark,m,o.to));for(let S=u+1;S<r;S++)this.parts[S]instanceof Mh&&h.push(this.parts[S]),this.parts[S]=null;i.type.mark&&h.push(this.elt(i.type.mark,i.from,O));let x=this.elt(f,m,O,h);this.parts[u]=s&&o.from!=m?new Lr(o.type,o.from,m,o.side):null,(this.parts[r]=s&&i.to!=O?new Lr(i.type,O,i.to,i.side):null)?this.parts.splice(r,0,x):this.parts[r]=x}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof Mh&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof Lr&&r.type==e&&r.side&1)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}getDelimiterAt(e){let n=this.parts[e];return n instanceof Lr?n:null}skipSpace(e){return rh(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?it(this.parser.getNodeType(e),n,r,i):new j3(e,n)}}Ek.linkStart=lo;Ek.imageStart=HO;function SS(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let s=n[r];s instanceof Mh&&(n[r]=new Mh(s.type,s.from,s.to,SS(s.children,[i])))}else n.splice(r++,0,i)}return n}const zG=[xe.CodeBlock,xe.ListItem,xe.OrderedList,xe.BulletList];let DG=class{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
387
+ `;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(Xe.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,a=s,o=e.block.children.length,u=a,f=o;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let h=E3(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,h);else{let m=new gt(e.parser.nodeSet.types[xe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(m,n.tree),e.addNode(m,h)}if(n.type.is("Block")&&(zG.indexOf(n.type.id)<0?(a=n.to-r,o=e.block.children.length):(a=u,o=f),u=n.to-r,f=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-s}};function E3(t,e){let n=t;for(let r=1;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<t&&(n-=s-i)}return n}const LG=Yo({"Blockquote/...":V.quote,HorizontalRule:V.contentSeparator,"ATXHeading1/... SetextHeading1/...":V.heading1,"ATXHeading2/... SetextHeading2/...":V.heading2,"ATXHeading3/...":V.heading3,"ATXHeading4/...":V.heading4,"ATXHeading5/...":V.heading5,"ATXHeading6/...":V.heading6,"Comment CommentBlock":V.comment,Escape:V.escape,Entity:V.character,"Emphasis/...":V.emphasis,"StrongEmphasis/...":V.strong,"Link/... Image/...":V.link,"OrderedList/... BulletList/...":V.list,"BlockQuote/...":V.quote,"InlineCode CodeText":V.monospace,"URL Autolink":V.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":V.processingInstruction,"CodeInfo LinkLabel":V.labelName,LinkTitle:V.string,Paragraph:V.content}),XG=new Ux(new vp(Q3).extend(LG),Object.keys(Eg).map(t=>Eg[t]),Object.keys(Eg).map(t=>w3[t]),Object.keys(Eg),EG,p3,Object.keys(O0).map(t=>O0[t]),Object.keys(O0),[]);function ZG(t,e,n){let r=[];for(let i=t.firstChild,s=e;;i=i.nextSibling){let a=i?i.from:n;if(a>s&&r.push({from:s,to:a}),!i)break;s=i.to}return r}function BG(t){let{codeParser:e,htmlParser:n}=t;return{wrap:n3((i,s)=>{let a=i.type.id;if(e&&(a==xe.CodeBlock||a==xe.FencedCode)){let o="";if(a==xe.FencedCode){let f=i.node.getChild(xe.CodeInfo);f&&(o=s.read(f.from,f.to))}let u=e(o);if(u)return{parser:u,overlay:f=>f.type.id==xe.CodeText,bracketed:a==xe.FencedCode}}else if(n&&(a==xe.HTMLBlock||a==xe.HTMLTag||a==xe.CommentBlock))return{parser:n,overlay:ZG(i.node,i.from,i.to)};return null})}}const qG={resolve:"Strikethrough",mark:"StrikethroughMark"},VG={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":V.strikethrough}},{name:"StrikethroughMark",style:V.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),s=/\s|^$/.test(r),a=/\s|^$/.test(i),o=Rh.test(r),u=Rh.test(i);return t.addDelimiter(qG,n,n+2,!a&&(!u||s||o),!s&&(!o||a||u))},after:"Emphasis"}]};function ih(t,e,n=0,r,i=0){let s=0,a=!0,o=-1,u=-1,f=!1,h=()=>{r.push(t.elt("TableCell",i+o,i+u,t.parser.parseInline(e.slice(o,u),i+o)))};for(let m=n;m<e.length;m++){let O=e.charCodeAt(m);O==124&&!f?((!a||o>-1)&&s++,a=!1,r&&(o>-1&&h(),r.push(t.elt("TableDelimiter",m+i,m+i+1))),o=u=-1):(f||O!=32&&O!=9)&&(o<0&&(o=m),u=m+1),f=!f&&O==92}return o>-1&&(s++,r&&h()),s}function wN(t,e){for(let n=e;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const A3=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class kN{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&A3.test(i=n.text.slice(n.pos))){let s=[];ih(e,r.content,0,s,r.start)==ih(e,i,n.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];ih(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const IG={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":V.heading}},"TableRow",{name:"TableCell",style:V.content},{name:"TableDelimiter",style:V.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return wN(e.content,0)?new kN:null},endLeaf(t,e,n){if(n.parsers.some(i=>i instanceof kN)||!wN(e.text,e.basePos))return!1;let r=t.peekLine();return A3.test(r)&&ih(t,e.text,e.basePos)==ih(t,r,e.basePos)},before:"SetextHeading"}]};class YG{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const UG={defineNodes:[{name:"Task",block:!0,style:V.list},{name:"TaskMarker",style:V.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new YG:null},after:"SetextHeading"}]},QN=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,CN=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,WG=/[\w-]+\.[\w-]+($|\/)/,jN=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,TN=/\/[a-zA-Z\d@.]+/gy;function $N(t,e,n,r){let i=0;for(let s=e;s<n;s++)t[s]==r&&i++;return i}function HG(t,e){CN.lastIndex=e;let n=CN.exec(t);if(!n||WG.exec(n[0])[0].indexOf("_")>-1)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&$N(t,e,r,")")>$N(t,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+s.index;else break}return r}function _N(t,e){jN.lastIndex=e;let n=jN.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const GG={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;if(r&&/\w/.test(t.text[r-1]))return-1;QN.lastIndex=r;let i=QN.exec(t.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=HG(t.text,r+i[0].length),s>-1&&t.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(r,s));s=r+a[0].length}}else i[3]?s=_N(t.text,r):(s=_N(t.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(TN.lastIndex=s,i=TN.exec(t.text),i&&(s=i.index+i[0].length)));return s<0?-1:(t.addElement(t.elt("URL",n,s+t.offset)),s+t.offset)}}]},FG=[IG,UG,VG,GG];function M3(t,e,n){return(r,i,s)=>{if(i!=t||r.char(s+1)==t)return-1;let a=[r.elt(n,s,s+1)];for(let o=s+1;o<r.end;o++){let u=r.char(o);if(u==t)return r.addElement(r.elt(e,s,o+1,a.concat(r.elt(n,o,o+1))));if(u==92&&a.push(r.elt("Escape",o,o+++2)),xi(u))break}return-1}}const KG={defineNodes:[{name:"Superscript",style:V.special(V.content)},{name:"SuperscriptMark",style:V.processingInstruction}],parseInline:[{name:"Superscript",parse:M3(94,"Superscript","SuperscriptMark")}]},JG={defineNodes:[{name:"Subscript",style:V.special(V.content)},{name:"SubscriptMark",style:V.processingInstruction}],parseInline:[{name:"Subscript",parse:M3(126,"Subscript","SubscriptMark")}]},eF={defineNodes:[{name:"Emoji",style:V.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]};var NN={};class GO{constructor(e,n,r,i,s,a,o,u,f,h=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=a,this.buffer=o,this.bufferBase=u,this.curContext=f,this.lookAhead=h,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new GO(e,[],n,r,r,0,[],0,i?new PN(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),o=s.dynamicPrecedence(i);if(o&&(this.score+=o),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),f=u?this.stack[u-2]:this.p.ranges[0].from,h=this.reducePos-f;h>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=h));let m=u?this.stack[u-1]:0,O=this.bufferBase+this.buffer.length-m;if(i<s.minRepeatTerm||e&131072){let x=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,f,x,O+4,!0)}if(e&262144)this.state=this.stack[u];else{let x=this.stack[u-3];this.state=s.getGoto(x,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,f)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,o=this.buffer.length;if(o==0&&a.parent&&(o=a.bufferBase-a.parent.bufferBase,a=a.parent),o>0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let o=!1;for(let u=a;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:a}=this.p;this.pos=i;let o=a.stateFlag(s,1);!o&&(i>r||n<=a.maxNode)&&(this.reducePos=i),this.pushState(s,o?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new GO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new tF(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,a;s<n.length;s+=2)(a=n[s+1])!=this.state&&this.p.parser.hasAction(a,e)&&i.push(n[s],a);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let a=n[s+1];i.some((o,u)=>u&1&&o==a)||i.push(n[s],a)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let a=this.split();a.pushState(s,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(n[i],this.pos),a.reducePos=this.pos,a.score-=200,r.push(a)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-s;if(o>1){let u=a&65535,f=this.stack.length-o*3;if(f>=0&&e.getGoto(this.stack[f],u,!1)>=0)return o<<19|65536|u}}else{let o=r(a,s+1);if(o!=null)return o}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new PN(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class PN{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class tF{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class FO{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new FO(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new FO(this.stack,this.pos,this.index)}}function Ed(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let a=t.charCodeAt(r++),o=!1;if(a==126){s=65535;break}a>=92&&a--,a>=34&&a--;let u=a-32;if(u>=46&&(u-=46,o=!0),s+=u,o)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const EN=new aO;class nF{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=EN,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let a=this.ranges[--i];s-=r.from-a.to,r=a}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];s+=a.from-r.to,r=a}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let a=this.rangeIndex,o=this.range;for(;o.to<=r;)o=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=EN,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class cu{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;R3(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}cu.prototype.contextual=cu.prototype.fallback=cu.prototype.extend=!1;class KO{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Ed(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,a=e.resolveOffset(1,1);if(R3(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}KO.prototype.contextual=cu.prototype.fallback=cu.prototype.extend=!1;class zn{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function R3(t,e,n,r,i,s){let a=0,o=1<<r,{dialect:u}=n.p.parser;e:for(;(o&t[a])!=0;){let f=t[a+1];for(let x=a+3;x<f;x+=2)if((t[x+1]&o)>0){let v=t[x];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||rF(v,e.token.value,i,s))){e.acceptToken(v);break}}let h=e.next,m=0,O=t[a+2];if(e.next<0&&O>m&&t[f+O*3-3]==65535){a=t[f+O*3-1];continue e}for(;m<O;){let x=m+O>>1,v=f+x+(x<<1),S=t[v],k=t[v+1]||65536;if(h<S)O=x;else if(h>=k)m=x+1;else{a=t[v+2],e.advance();continue e}}break}}function AN(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function rF(t,e,n,r){let i=AN(n,r,e);return i<0||AN(n,r,t)<i}const Mr=typeof process<"u"&&NN&&/\bparse\b/.test(NN.LOG);let x0=null;function MN(t,e,n){let r=t.cursor(xt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class iF{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?MN(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?MN(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],a=this.start[n]+r.positions[i];if(a>e)return this.nextStart=a,null;if(s instanceof gt){if(a==e){if(a<this.safeFrom)return null;let o=a+s.length;if(o<=this.safeTo){let u=s.prop(Xe.lookAhead);if(!u||o+u<this.fragment.to)return s}}this.index[n]++,a+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}}class sF{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new aO)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,a=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,u=0;for(let f=0;f<s.length;f++){if((1<<f&a)==0)continue;let h=s[f],m=this.tokens[f];if(!(r&&!h.fallback)&&((h.contextual||m.start!=e.pos||m.mask!=a||m.context!=o)&&(this.updateCachedToken(m,h,e),m.mask=a,m.context=o),m.lookAhead>m.end+25&&(u=Math.max(m.lookAhead,u)),m.value!=0)){let O=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!h.extend&&(r=m,n>O))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new aO,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new aO,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let a=0;a<s.specialized.length;a++)if(s.specialized[a]==e.value){let o=s.specializers[a](this.stream.read(e.start,e.end),r);if(o>=0&&r.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:a}=e.p,{data:o}=a;for(let u=0;u<2;u++)for(let f=a.stateSlot(s,u?2:1);;f+=3){if(o[f]==65535)if(o[f+1]==1)f=Ws(o,f+2);else{i==0&&o[f+1]==2&&(i=this.putAction(Ws(o,f+2),n,r,i));break}o[f]==n&&(i=this.putAction(Ws(o,f+1),n,r,i))}return i}}class aF{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new nF(n,i),this.tokens=new sF(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[GO.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new iF(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>n)r.push(o);else{if(this.advanceStack(o,r,e))continue;{i||(i=[],s=[]),i.push(o);let u=this.tokens.getMainToken(o);s.push(u.value,u.end)}}break}}if(!r.length){let a=i&&oF(i);if(a)return Mr&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Mr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(a)return Mr&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,u)=>u.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a<r.length-1;a++){let o=r[a];for(let u=a+1;u<r.length;u++){let f=r[u];if(o.sameState(f)||o.buffer.length>500&&f.buffer.length>500)if((o.score-f.score||o.buffer.length-f.buffer.length)>0)r.splice(u--,1);else{r.splice(a--,1);continue e}}}r.length>12&&(r.sort((a,o)=>o.score-a.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let a=1;a<r.length;a++)r[a].pos<this.minStackPos&&(this.minStackPos=r[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:s}=this,a=Mr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,h=f?e.curContext.hash:0;for(let m=this.fragments.nodeAt(i);m;){let O=this.parser.nodeSet.types[m.type.id]==m.type?s.getGoto(e.state,m.type.id):-1;if(O>-1&&m.length&&(!f||(m.prop(Xe.contextHash)||0)==h))return e.useNode(m,O),Mr&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(m.type.id)})`),!0;if(!(m instanceof gt)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof gt&&m.positions[0]==0)m=x;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),Mr&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let f=0;f<u.length;){let h=u[f++],m=u[f++],O=u[f++],x=f==u.length||!r,v=x?e:e.split(),S=this.tokens.mainToken;if(v.apply(h,m,S?S.start:v.pos,O),Mr&&console.log(a+this.stackID(v)+` (via ${(h&65536)==0?"shift":`reduce of ${s.getName(h&65535)}`} for ${s.getName(m)} @ ${i}${v==e?"":", split"})`),x)return!0;v.pos>i?n.push(v):r.push(v)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return RN(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let a=0;a<e.length;a++){let o=e[a],u=n[a<<1],f=n[(a<<1)+1],h=Mr?this.stackID(o)+" -> ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),Mr&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let m=o.split(),O=h;for(let x=0;x<10&&m.forceReduce()&&(Mr&&console.log(O+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Mr&&(O=this.stackID(m)+" -> ");for(let x of o.recoverByInsert(u))Mr&&console.log(h+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>o.pos?(f==o.pos&&(f++,u=0),o.recoverByDelete(u,f),Mr&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(u)})`),RN(o,r)):(!i||i.score<m.score)&&(i=m)}return i}stackToTree(e){return e.close(),gt.build({buffer:FO.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(x0||(x0=new WeakMap)).get(e);return n||x0.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function RN(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class lF{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const y0=t=>t;class Ak{constructor(e){this.start=e.start,this.shift=e.shift||y0,this.reduce=e.reduce||y0,this.reuse=e.reuse||y0,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ao extends Sk{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let o=0;o<e.repeatNodeCount;o++)n.push("");let r=Object.keys(e.topRules).map(o=>e.topRules[o][1]),i=[];for(let o=0;o<n.length;o++)i.push([]);function s(o,u,f){i[o].push([u,u.deserialize(String(f))])}if(e.nodeProps)for(let o of e.nodeProps){let u=o[0];typeof u=="string"&&(u=Xe[u]);for(let f=1;f<o.length;){let h=o[f++];if(h>=0)s(h,u,o[f++]);else{let m=o[f+-h];for(let O=-h;O>0;O--)s(o[f++],u,m);f++}}}this.nodeSet=new vp(n.map((o,u)=>bn.define({name:u>=this.minRepeatTerm?void 0:o,id:u,props:i[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=FM;let a=Ed(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(zN),this.states=Ed(e.states,Uint32Array),this.data=Ed(e.stateData),this.goto=Ed(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new cu(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new aF(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let a=i[s++],o=a&1,u=i[s++];if(o&&r)return u;for(let f=s+(a>>1);s<f;s++)if(i[s]==e)return u;if(o)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),a;;s+=3){if((a=r[s])==65535)if(r[s+1]==1)a=r[s=Ws(r,s+2)];else{if(r[s+1]==2)return Ws(r,s+2);break}if(a==n||a==0)return Ws(r,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ws(this.data,s+2);else break;i=n(Ws(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ws(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,a)=>a&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Ao.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(o=>o.from==r.external);if(!s)return r;let a=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=zN(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let a=n.indexOf(s);a>=0&&(r[a]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let a=this.dialects[n[s]],o;(o=this.data[a++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[o]=1;return new lF(e,r,i)}static deserialize(e){return new Ao(e)}}function Ws(t,e){return t[e]|t[e+1]<<16}function oF(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function zN(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const cF=55,uF=1,fF=56,dF=2,hF=57,pF=3,DN=4,mF=5,Mk=6,z3=7,D3=8,L3=9,X3=10,gF=11,OF=12,xF=13,v0=58,yF=14,vF=15,LN=59,Z3=21,bF=23,B3=24,SF=25,wS=27,q3=28,wF=29,kF=32,QF=35,CF=37,jF=38,TF=0,$F=1,_F={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},NF={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},XN={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function PF(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let ZN=null,BN=null,qN=0;function kS(t,e){let n=t.pos+e;if(qN==n&&BN==t)return ZN;let r=t.peek(e),i="";for(;PF(r);)i+=String.fromCharCode(r),r=t.peek(++e);return BN=t,qN=n,ZN=i?i.toLowerCase():r==EF||r==AF?void 0:null}const V3=60,JO=62,Rk=47,EF=63,AF=33,MF=45;function VN(t,e){this.name=t,this.parent=e}const RF=[Mk,X3,z3,D3,L3],zF=new Ak({start:null,shift(t,e,n,r){return RF.indexOf(e)>-1?new VN(kS(r,1)||"",t):t},reduce(t,e){return e==Z3&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==Mk||i==CF?new VN(kS(r,1)||"",t):t},strict:!1}),DF=new zn((t,e)=>{if(t.next!=V3){t.next<0&&e.context&&t.acceptToken(v0);return}t.advance();let n=t.next==Rk;n&&t.advance();let r=kS(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?vF:yF);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(gF);if(i&&NF[i])return t.acceptToken(v0,-2);if(e.dialectEnabled(TF))return t.acceptToken(OF);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(xF)}else{if(r=="script")return t.acceptToken(z3);if(r=="style")return t.acceptToken(D3);if(r=="textarea")return t.acceptToken(L3);if(_F.hasOwnProperty(r))return t.acceptToken(X3);i&&XN[i]&&XN[i][r]?t.acceptToken(v0,-1):t.acceptToken(Mk)}},{contextual:!0}),LF=new zn(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(LN);break}if(t.next==MF)e++;else if(t.next==JO&&e>=2){n>=3&&t.acceptToken(LN,-2);break}else e=0;t.advance()}});function XF(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const ZF=new zn((t,e)=>{if(t.next==Rk&&t.peek(1)==JO){let n=e.dialectEnabled($F)||XF(e.context);t.acceptToken(n?mF:DN,2)}else t.next==JO&&t.acceptToken(DN,1)});function zk(t,e,n){let r=2+t.length;return new zn(i=>{for(let s=0,a=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(s==0&&i.next==V3||s==1&&i.next==Rk||s>=2&&s<r&&i.next==t.charCodeAt(s-2))s++,a++;else if(s==r&&i.next==JO){o>a?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else s=a=0;i.advance()}})}const BF=zk("script",cF,uF),qF=zk("style",fF,dF),VF=zk("textarea",hF,pF),IF=Yo({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),YF=Ao.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#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!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:zF,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity T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%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[BF,qF,VF,ZF,DF,LF,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function I3(t,e){let n=Object.create(null);for(let r of t.getChildren(B3)){let i=r.getChild(SF),s=r.getChild(wS)||r.getChild(q3);i&&(n[e.read(i.from,i.to)]=s?s.type.id==wS?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function IN(t,e){let n=t.getChild(bF);return n?e.read(n.from,n.to):" "}function b0(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=I3(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function Y3(t=[],e=[]){let n=[],r=[],i=[],s=[];for(let o of t)(o.tag=="script"?n:o.tag=="style"?r:o.tag=="textarea"?i:s).push(o);let a=e.length?Object.create(null):null;for(let o of e)(a[o.name]||(a[o.name]=[])).push(o);return n3((o,u)=>{let f=o.type.id;if(f==wF)return b0(o,u,n);if(f==kF)return b0(o,u,r);if(f==QF)return b0(o,u,i);if(f==Z3&&s.length){let h=o.node,m=h.firstChild,O=m&&IN(m,u),x;if(O){for(let v of s)if(v.tag==O&&(!v.attrs||v.attrs(x||(x=I3(m,u))))){let S=h.lastChild,k=S.type.id==jF?S.from:h.to;if(k>m.to)return{parser:v.parser,overlay:[{from:m.to,to:k}]}}}}if(a&&f==B3){let h=o.node,m;if(m=h.firstChild){let O=a[u.read(m.from,m.to)];if(O)for(let x of O){if(x.tagName&&x.tagName!=IN(h.parent,u))continue;let v=h.lastChild;if(v.type.id==wS){let S=v.from+1,k=v.lastChild,w=v.to-(k&&k.isError?0:1);if(w>S)return{parser:x.parser,overlay:[{from:S,to:w}],bracketed:!0}}else if(v.type.id==q3)return{parser:x.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const UF=122,YN=1,WF=123,HF=124,U3=2,GF=125,FF=3,KF=4,W3=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],JF=58,eK=40,H3=95,tK=91,lO=45,nK=46,rK=35,iK=37,sK=38,aK=92,lK=10,oK=42;function zh(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Dk(t){return t>=48&&t<=57}function UN(t){return Dk(t)||t>=97&&t<=102||t>=65&&t<=70}const G3=(t,e,n)=>(r,i)=>{for(let s=!1,a=0,o=0;;o++){let{next:u}=r;if(zh(u)||u==lO||u==H3||s&&Dk(u))!s&&(u!=lO||o>0)&&(s=!0),a===o&&u==lO&&a++,r.advance();else if(u==aK&&r.peek(1)!=lK){if(r.advance(),UN(r.next)){do r.advance();while(UN(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(a==2&&i.canShift(U3)?e:u==eK?n:t);break}}},cK=new zn(G3(WF,U3,HF)),uK=new zn(G3(GF,FF,KF)),fK=new zn(t=>{if(W3.includes(t.peek(-1))){let{next:e}=t;(zh(e)||e==H3||e==rK||e==nK||e==oK||e==tK||e==JF&&zh(t.peek(1))||e==lO||e==sK)&&t.acceptToken(UF)}}),dK=new zn(t=>{if(!W3.includes(t.peek(-1))){let{next:e}=t;if(e==iK&&(t.advance(),t.acceptToken(YN)),zh(e)){do t.advance();while(zh(t.next)||Dk(t.next));t.acceptToken(YN)}}}),hK=Yo({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),pK={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},mK={__proto__:null,or:98,and:98,not:106,only:106,layer:170},gK={__proto__:null,selector:112,layer:166},OK={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},xK={__proto__:null,to:207},yK=Ao.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQ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tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[hK],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q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#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[fK,dK,cK,uK,1,2,3,4,new KO("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:t=>pK[t]||-1},{term:125,get:t=>mK[t]||-1},{term:4,get:t=>gK[t]||-1},{term:25,get:t=>OK[t]||-1},{term:123,get:t=>xK[t]||-1}],tokenPrec:1963});let S0=null;function w0(){if(!S0&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));S0=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return S0||[]}const WN=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),HN=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),vK=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),bK=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Is=/^(\w[\w-]*|-\w[\w-]*|)$/,SK=/^-(-[\w-]*)?$/;function wK(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const GN=new t3,kK=["Declaration"];function QK(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function F3(t,e,n){if(e.to-e.from>4096){let r=GN.get(e);if(r)return r;let i=[],s=new Set,a=e.cursor(xt.IncludeAnonymous);if(a.firstChild())do for(let o of F3(t,a.node,n))s.has(o.label)||(s.add(o.label),i.push(o));while(a.nextSibling());return GN.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(kK)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=t.sliceString(s.from,s.to);i.has(o)||(i.add(o),r.push({label:o,type:"variable"}))}}),r}}const CK=t=>e=>{let{state:n,pos:r}=e,i=Kt(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:w0(),validFor:Is};if(i.name=="ValueName")return{from:i.from,options:HN,validFor:Is};if(i.name=="PseudoClassName")return{from:i.from,options:WN,validFor:Is};if(t(i)||(e.explicit||s)&&wK(i,n.doc))return{from:t(i)||s?i.from:r,options:F3(n.doc,QK(i),t),validFor:SK};if(i.name=="TagName"){for(let{parent:u}=i;u;u=u.parent)if(u.name=="Block")return{from:i.from,options:w0(),validFor:Is};return{from:i.from,options:vK,validFor:Is}}if(i.name=="AtKeyword")return{from:i.from,options:bK,validFor:Is};if(!e.explicit)return null;let a=i.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:WN,validFor:Is}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:HN,validFor:Is}:a.name=="Block"||a.name=="Styles"?{from:r,options:w0(),validFor:Is}:null},jK=CK(t=>t.name=="VariableName"),ex=Eo.define({name:"css",parser:yK.configure({props:[sf.add({Declaration:sO()}),af.add({"Block KeyframeList":Ck})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function TK(){return new Eu(ex,ex.data.of({autocomplete:jK}))}const $K=316,_K=317,FN=1,NK=2,PK=3,EK=4,AK=318,MK=320,RK=321,zK=5,DK=6,LK=0,QS=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],K3=125,XK=59,CS=47,ZK=42,BK=43,qK=45,VK=60,IK=44,YK=63,UK=46,WK=91,HK=new Ak({start:!1,shift(t,e){return e==zK||e==DK||e==MK?t:e==RK},strict:!1}),GK=new zn((t,e)=>{let{next:n}=t;(n==K3||n==-1||e.context)&&t.acceptToken(AK)},{contextual:!0,fallback:!0}),FK=new zn((t,e)=>{let{next:n}=t,r;QS.indexOf(n)>-1||n==CS&&((r=t.peek(1))==CS||r==ZK)||n!=K3&&n!=XK&&n!=-1&&!e.context&&t.acceptToken($K)},{contextual:!0}),KK=new zn((t,e)=>{t.next==WK&&!e.context&&t.acceptToken(_K)},{contextual:!0}),JK=new zn((t,e)=>{let{next:n}=t;if(n==BK||n==qK){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(FN);t.acceptToken(r?FN:NK)}}else n==YK&&t.peek(1)==UK&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(PK))},{contextual:!0});function k0(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const eJ=new zn((t,e)=>{if(t.next!=VK||!e.dialectEnabled(LK)||(t.advance(),t.next==CS))return;let n=0;for(;QS.indexOf(t.next)>-1;)t.advance(),n++;if(k0(t.next,!0)){for(t.advance(),n++;k0(t.next,!1);)t.advance(),n++;for(;QS.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==IK)return;for(let r=0;;r++){if(r==7){if(!k0(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(EK,-n)}),tJ=Yo({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),nJ={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},rJ={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},iJ={__proto__:null,"<":193},sJ=Ao.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ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6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:HK,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[tJ],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&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![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[FK,KK,JK,eJ,2,3,4,5,6,7,8,9,10,11,12,13,14,GK,new KO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new KO("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>nJ[t]||-1},{term:343,get:t=>rJ[t]||-1},{term:95,get:t=>iJ[t]||-1}],tokenPrec:15201}),J3=[mr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),mr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),mr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),mr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),mr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),mr(`try {
388
+ \${}
389
+ } catch (\${error}) {
390
+ \${}
391
+ }`,{label:"try",detail:"/ catch block",type:"keyword"}),mr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),mr(`if (\${}) {
392
+ \${}
393
+ } else {
394
+ \${}
395
+ }`,{label:"if",detail:"/ else block",type:"keyword"}),mr(`class \${name} {
396
+ constructor(\${params}) {
397
+ \${}
398
+ }
399
+ }`,{label:"class",detail:"definition",type:"keyword"}),mr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),mr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],aJ=J3.concat([mr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),mr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),mr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),KN=new t3,eR=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function wd(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const lJ=["FunctionDeclaration"],oJ={FunctionDeclaration:wd("function"),ClassDeclaration:wd("class"),ClassExpression:()=>!0,EnumDeclaration:wd("constant"),TypeAliasDeclaration:wd("type"),NamespaceDeclaration:wd("namespace"),VariableDefinition(t,e){t.matchContext(lJ)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function tR(t,e){let n=KN.get(e);if(n)return n;let r=[],i=!0;function s(a,o){let u=t.sliceString(a.from,a.to);r.push({label:u,type:o})}return e.cursor(xt.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let o=oJ[a.name];if(o&&o(a,s)||eR.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of tR(t,a.node))r.push(o);return!1}}),KN.set(e,r),r}const JN=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,nR=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function cJ(t){let e=Kt(t.state).resolveInner(t.pos,-1);if(nR.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&JN.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)eR.has(i.name)&&(r=r.concat(tR(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:JN}}const gs=Eo.define({name:"javascript",parser:sJ.configure({props:[sf.add({IfStatement:sO({except:/^\s*({|else\b)/}),TryStatement:sO({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:KH,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:mS({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":sO({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),af.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ck,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),rR={test:t=>/^JSX/.test(t.name),facet:wk({commentTokens:{block:{open:"{/*",close:"*/}"}}})},iR=gs.configure({dialect:"ts"},"typescript"),sR=gs.configure({dialect:"jsx",props:[kk.add(t=>t.isTop?[rR]:void 0)]}),aR=gs.configure({dialect:"jsx ts",props:[kk.add(t=>t.isTop?[rR]:void 0)]},"typescript");let lR=t=>({label:t,type:"keyword"});const oR="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(lR),uJ=oR.concat(["declare","implements","private","protected","public"].map(lR));function cR(t={}){let e=t.jsx?t.typescript?aR:sR:t.typescript?iR:gs,n=t.typescript?aJ.concat(uJ):J3.concat(oR);return new Eu(e,[gs.data.of({autocomplete:pG(nR,hG(n))}),gs.data.of({autocomplete:cJ}),t.jsx?hJ:[]])}function fJ(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function eP(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const dJ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),hJ=Pe.inputHandler.of((t,e,n,r,i)=>{if((dJ?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!gs.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:a}=s,o=a.changeByRange(u=>{var f;let{head:h}=u,m=Kt(a).resolveInner(h-1,-1),O;if(m.name=="JSXStartTag"&&(m=m.parent),!(a.doc.sliceString(h-1,h)!=r||m.name=="JSXAttributeValue"&&m.to>h)){if(r==">"&&m.name=="JSXFragmentTag")return{range:u,changes:{from:h,insert:"</>"}};if(r=="/"&&m.name=="JSXStartCloseTag"){let x=m.parent,v=x.parent;if(v&&x.from==h-2&&((O=eP(a.doc,v.firstChild,h))||((f=v.firstChild)===null||f===void 0?void 0:f.name)=="JSXFragmentTag")){let S=`${O}>`;return{range:pe.cursor(h+S.length,-1),changes:{from:h,insert:S}}}}else if(r==">"){let x=fJ(m);if(x&&x.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(h,h+2))&&(O=eP(a.doc,x,h)))return{range:u,changes:{from:h,insert:`</${O}>`}}}}return{range:u}});return o.changes.empty?!1:(t.dispatch([s,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),kd=["_blank","_self","_top","_parent"],Q0=["ascii","utf-8","utf-16","latin1","latin1"],C0=["get","post","put","delete"],j0=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Rr=["true","false"],Te={},pJ={a:{attrs:{href:null,ping:null,type:null,media:null,target:kd,hreflang:null}},abbr:Te,address:Te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Te,aside:Te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Te,base:{attrs:{href:null,target:kd}},bdi:Te,bdo:Te,blockquote:{attrs:{cite:null}},body:Te,br:Te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:j0,formmethod:C0,formnovalidate:["novalidate"],formtarget:kd,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Te,center:Te,cite:Te,code:Te,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Te,div:Te,dl:Te,dt:Te,em:Te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Te,figure:Te,footer:Te,form:{attrs:{action:null,name:null,"accept-charset":Q0,autocomplete:["on","off"],enctype:j0,method:C0,novalidate:["novalidate"],target:kd}},h1:Te,h2:Te,h3:Te,h4:Te,h5:Te,h6:Te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Te,hgroup:Te,hr:Te,html:{attrs:{manifest:null}},i:Te,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:j0,formmethod:C0,formnovalidate:["novalidate"],formtarget:kd,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Te,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Q0,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Te,noscript:Te,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Te,param:{attrs:{name:null,value:null}},pre:Te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Te,rt:Te,ruby:Te,samp:Te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Q0}},section:Te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Te,source:{attrs:{src:null,type:null,media:null}},span:Te,strong:Te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Te,summary:Te,sup:Te,table:Te,tbody:Te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Te,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Te,time:{attrs:{datetime:null}},title:Te,tr:Te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Te,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Te},uR={accesskey:null,class:null,contenteditable:Rr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Rr,autocorrect:Rr,autocapitalize:Rr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Rr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Rr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Rr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Rr,"aria-hidden":Rr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Rr,"aria-multiselectable":Rr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Rr,"aria-relevant":null,"aria-required":Rr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},fR="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of fR)uR[t]=null;class Dh{constructor(e,n){this.tags={...pJ,...e},this.globalAttrs={...uR,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Dh.default=new Dh;function Mu(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Ru(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function dR(t,e,n){let r=n.tags[Mu(t,Ru(e))];return(r==null?void 0:r.children)||n.allTags}function Lk(t,e){let n=[];for(let r=Ru(e);r&&!r.type.isTop;r=Ru(r.parent)){let i=Mu(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const hR=/^[:\-\.\w\u00b7-\uffff]*$/;function tP(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=Ru(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:dR(t.doc,a,e).map(o=>({label:o,type:"type"})).concat(Lk(t.doc,n).map((o,u)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function nP(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Lk(t.doc,e).map((s,a)=>({label:s,apply:s+i,type:"type",boost:99-a})),validFor:hR}}function mJ(t,e,n,r){let i=[],s=0;for(let a of dR(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of Lk(t.doc,n))i.push({label:"</"+a+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function gJ(t,e,n,r,i){let s=Ru(n),a=s?e.tags[Mu(t.doc,s)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],u=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:u.map(f=>({label:f,type:"property"})),validFor:hR}}function OJ(t,e,n,r,i){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],u;if(a){let f=t.sliceDoc(a.from,a.to),h=e.globalAttrs[f];if(!h){let m=Ru(n),O=m?e.tags[Mu(t.doc,m)]:null;h=(O==null?void 0:O.attrs)&&O.attrs[f]}if(h){let m=t.sliceDoc(r,i).toLowerCase(),O='"',x='"';/^['"]/.test(m)?(u=m[0]=='"'?/^[^"]*$/:/^[^']*$/,O="",x=t.sliceDoc(i,i+1)==m[0]?"":m[0],m=m.slice(1),r++):u=/^[^\s<>='"]*$/;for(let v of h)o.push({label:v,apply:O+v+x,type:"constant"})}}return{from:r,to:i,options:o,validFor:u}}function pR(t,e){let{state:n,pos:r}=e,i=Kt(n).resolveInner(r,-1),s=i.resolve(r);for(let a=r,o;s==i&&(o=i.childBefore(a));){let u=o.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=i=o,a=u.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?nP(n,i,i.from,r):tP(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?tP(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?nP(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?gJ(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?OJ(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?mJ(n,t,i,r):null}function xJ(t){return pR(Dh.default,t)}function yJ(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new Dh(e,n):Dh.default;return i=>pR(r,i)}const vJ=gs.parser.configure({top:"SingleExpression"}),mR=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:iR.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:sR.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:aR.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:vJ},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:gs.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:ex.parser}],gR=[{name:"style",parser:ex.parser.configure({top:"Styles"})}].concat(fR.map(t=>({name:t,parser:gs.parser}))),OR=Eo.define({name:"html",parser:YF.configure({props:[sf.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),af.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),f3.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),oO=OR.configure({wrap:Y3(mR,gR)});function xR(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=Y3((t.nestedLanguages||[]).concat(mR),(t.nestedAttributes||[]).concat(gR)));let r=n?OR.configure({wrap:n,dialect:e}):e?oO.configure({dialect:e}):oO;return new Eu(r,[oO.data.of({autocomplete:yJ(t)}),t.autoCloseTags!==!1?bJ:[],cR().support,TK().support])}const rP=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),bJ=Pe.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!oO.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:a}=s,o=a.changeByRange(u=>{var f,h,m;let O=a.doc.sliceString(u.from-1,u.to)==r,{head:x}=u,v=Kt(a).resolveInner(x,-1),S;if(O&&r==">"&&v.name=="EndTag"){let k=v.parent;if(((h=(f=k.parent)===null||f===void 0?void 0:f.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(S=Mu(a.doc,k.parent,x))&&!rP.has(S)){let w=x+(a.doc.sliceString(x,x+1)===">"?1:0),j=`</${S}>`;return{range:u,changes:{from:x,to:w,insert:j}}}}else if(O&&r=="/"&&v.name=="IncompleteCloseTag"){let k=v.parent;if(v.from==x-2&&((m=k.lastChild)===null||m===void 0?void 0:m.name)!="CloseTag"&&(S=Mu(a.doc,k,x))&&!rP.has(S)){let w=x+(a.doc.sliceString(x,x+1)===">"?1:0),j=`${S}>`;return{range:pe.cursor(x+j.length,-1),changes:{from:x,to:w,insert:j}}}}return{range:u}});return o.changes.empty?!1:(t.dispatch([s,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),yR=wk({commentTokens:{block:{open:"<!--",close:"-->"}}}),vR=new Xe,bR=XG.configure({props:[af.add(t=>!t.is("Block")||t.is("Document")||jS(t)!=null||SJ(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),vR.add(jS),sf.add({Document:()=>null}),mo.add({Document:yR})]});function jS(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function SJ(t){return t.name=="OrderedList"||t.name=="BulletList"}function wJ(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=jS(r.type))!=null&&i<=e)break;n=r}return n.to}const kJ=JH.of((t,e,n)=>{for(let r=Kt(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(vR);if(i==null)continue;let s=wJ(r,i);if(s>n)return{from:n,to:s}}return null});function Xk(t){return new oi(yR,t,[],"markdown")}const QJ=Xk(bR),CJ=bR.configure([FG,JG,KG,eF,{props:[af.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),tx=Xk(CJ);function jJ(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=IO.matchLanguageName(t,n,!0),r instanceof IO)return r.support?r.support.language.parser:Eh.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}let T0=class{constructor(e,n,r,i,s,a,o){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=a,this.item=o}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+wR(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function SR(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i],a,o=e.lineAt(s.from),u=s.from-o.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(o.text.slice(u))))r.push(new T0(s,u,u+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(u)))){let f=a[3],h=a[0].length;f.length>=4&&(f=f.slice(0,f.length-4),h-=4),r.push(new T0(s.parent,u,u+h,a[1],f,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(u)))){let f=a[4],h=a[0].length;f.length>4&&(f=f.slice(0,f.length-4),h-=4);let m=a[2];a[3]&&(m+=a[3].replace(/[xX]/," ")),r.push(new T0(s.parent,u,u+h,a[1],f,m,s))}}return r}function wR(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function $0(t,e,n,r=0){for(let i=-1,s=t;;){if(s.name=="ListItem"){let o=wR(s,e),u=+o[2];if(i>=0){if(u!=i+1)return;n.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(i+2+r)})}i=u}let a=s.nextSibling;if(!a)break;s=a}}function Zk(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(bp)!=" ")return t;let r=ua(t,4,n),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+t.slice(n)}const TJ=(t={})=>({state:e,dispatch:n})=>{let r=Kt(e),{doc:i}=e,s=null,a=e.changeByRange(o=>{if(!o.empty||!tx.isActiveAt(e,o.from,-1)&&!tx.isActiveAt(e,o.from,1))return s={range:o};let u=o.from,f=i.lineAt(u),h=SR(r.resolveInner(u,-1),i);for(;h.length&&h[h.length-1].from>u-f.from;)h.pop();if(!h.length)return s={range:o};let m=h[h.length-1];if(m.to-m.spaceAfter.length>u-f.from)return s={range:o};let O=u>=m.to-m.spaceAfter.length&&!/\S/.test(f.text.slice(m.to));if(m.item&&O){let w=m.node.firstChild,j=m.node.getChild("ListItem","ListItem");if(w.to>=u||j&&j.to<u||f.from>0&&!/[^\s>]/.test(i.lineAt(f.from-1).text)||t.nonTightLists===!1){let Q=h.length>1?h[h.length-2]:null,T,N="";Q&&Q.item?(T=f.from+Q.from,N=Q.marker(i,1)):T=f.from+(Q?Q.to:0);let _=[{from:T,to:u,insert:N}];return m.node.name=="OrderedList"&&$0(m.item,i,_,-2),Q&&Q.node.name=="OrderedList"&&$0(Q.item,i,_),{range:pe.cursor(T+N.length),changes:_}}else{let Q=sP(h,e,f);return{range:pe.cursor(u+Q.length+1),changes:{from:f.from,insert:Q+e.lineBreak}}}}if(m.node.name=="Blockquote"&&O&&f.from){let w=i.lineAt(f.from-1),j=/>\s*$/.exec(w.text);if(j&&j.index==m.from){let Q=e.changes([{from:w.from+j.index,to:w.to},{from:f.from+m.from,to:f.to}]);return{range:o.map(Q),changes:Q}}}let x=[];m.node.name=="OrderedList"&&$0(m.item,i,x);let v=m.item&&m.item.from<f.from,S="";if(!v||/^[\s\d.)\-+*>]*/.exec(f.text)[0].length>=m.to)for(let w=0,j=h.length-1;w<=j;w++)S+=w==j&&!v?h[w].marker(i,1):h[w].blank(w<j?ua(f.text,4,h[w+1].from)-S.length:null);let k=u;for(;k>f.from&&/\s/.test(f.text.charAt(k-f.from-1));)k--;return S=Zk(S,e),_J(m.node,e.doc)&&(S=sP(h,e,f)+e.lineBreak+S),x.push({from:k,to:u,insert:e.lineBreak+S}),{range:pe.cursor(k+S.length+1),changes:x}});return s?!1:(n(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},$J=TJ();function iP(t){return t.name=="QuoteMark"||t.name=="ListMark"}function _J(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),s=e.lineAt(r.from),a=/^[\s>]*$/.test(i.text);return i.number+(a?0:1)<s.number}function sP(t,e,n){let r="";for(let i=0,s=t.length-2;i<=s;i++)r+=t[i].blank(i<s?ua(n.text,4,t[i+1].from)-r.length:null,i<s);return Zk(r,e)}function NJ(t,e){let n=t.resolveInner(e,-1),r=e;iP(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(iP(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const PJ=({state:t,dispatch:e})=>{let n=Kt(t),r=null,i=t.changeByRange(s=>{let a=s.from,{doc:o}=t;if(s.empty&&tx.isActiveAt(t,s.from)){let u=o.lineAt(a),f=SR(NJ(n,a),o);if(f.length){let h=f[f.length-1],m=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(a-u.from>m&&!/\S/.test(u.text.slice(m,a-u.from)))return{range:pe.cursor(u.from+m),changes:{from:u.from+m,to:a}};if(a-u.from==m&&(!h.item||u.from<=h.item.from||!/\S/.test(u.text.slice(0,h.to)))){let O=u.from+h.from;if(h.item&&h.node.from<h.item.from&&/\S/.test(u.text.slice(h.from,h.to))){let x=h.blank(ua(u.text,4,h.to)-ua(u.text,4,h.from));return O==u.from&&(x=Zk(x,t)),{range:pe.cursor(O+x.length),changes:{from:O,to:u.from+h.to,insert:x}}}if(O<a)return{range:pe.cursor(O),changes:{from:O,to:a}}}}}return r={range:s}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},EJ=[{key:"Enter",run:$J},{key:"Backspace",run:PJ}],kR=xR({matchClosingTags:!1});function AJ(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=QJ,completeHTMLTags:s=!0,pasteURLAsLink:a=!0,htmlTagLanguage:o=kR}=t;if(!(i instanceof Ux))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=t.extensions?[t.extensions]:[],f=[o.support,kJ],h;a&&f.push(DJ),n instanceof Eu?(f.push(n.support),h=n.language):n&&(h=n);let m=e||h?jJ(e,h):void 0;u.push(BG({codeParser:m,htmlParser:o.language.parser})),r&&f.push(gp.high(Ix.of(EJ)));let O=Xk(i.configure(u));return s&&f.push(O.data.of({autocomplete:MJ})),new Eu(O,f)}function MJ(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=Kt(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:RJ(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _0=null;function RJ(){if(_0)return _0;let t=xJ(new fG(ft.create({extensions:kR}),0,!0));return _0=t?t.options:[]}const zJ=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,DJ=Pe.domEventHandlers({paste:(t,e)=>{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!tx.isActiveAt(e.state,r.from,1)))return!1;let s=Kt(e.state),a=!1;return s.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||zJ.test(o.name))&&(a=!0)},leave:o=>{o.to<r.to&&(a=!0)}}),a?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Vc=63,aP=64,LJ=1,XJ=2,QR=3,ZJ=4,CR=5,BJ=6,qJ=7,jR=65,VJ=66,IJ=8,YJ=9,UJ=10,WJ=11,HJ=12,TR=13,GJ=19,FJ=20,KJ=29,JJ=33,eee=34,tee=47,nee=0,Bk=1,TS=2,Lh=3,$S=4;class oo{constructor(e,n,r){this.parent=e,this.depth=n,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+r}}oo.top=new oo(null,-1,nee);function sh(t,e){for(let n=0,r=e-t.pos-1;;r--,n++){let i=t.peek(r);if(da(i)||i==-1)return n}}function _S(t){return t==32||t==9}function da(t){return t==10||t==13}function $R(t){return _S(t)||da(t)}function go(t){return t<0||$R(t)}const ree=new Ak({start:oo.top,reduce(t,e){return t.type==Lh&&(e==FJ||e==eee)?t.parent:t},shift(t,e,n,r){if(e==QR)return new oo(t,sh(r,r.pos),Bk);if(e==jR||e==CR)return new oo(t,sh(r,r.pos),TS);if(e==Vc)return t.parent;if(e==GJ||e==JJ)return new oo(t,0,Lh);if(e==TR&&t.type==$S)return t.parent;if(e==tee){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new oo(t,t.depth+ +i[0],$S)}return t},hash(t){return t.hash}});function zu(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&go(t.peek(n+3))}const iee=new zn((t,e)=>{if(t.next==-1&&e.canShift(aP))return t.acceptToken(aP);let n=t.peek(-1);if((da(n)||n<0)&&e.context.type!=Lh){if(zu(t,45))if(e.canShift(Vc))t.acceptToken(Vc);else return t.acceptToken(LJ,3);if(zu(t,46))if(e.canShift(Vc))t.acceptToken(Vc);else return t.acceptToken(XJ,3);let r=0;for(;t.next==32;)r++,t.advance();(r<e.context.depth||r==e.context.depth&&e.context.type==Bk&&(t.next!=45||!go(t.peek(1))))&&t.next!=-1&&!da(t.next)&&t.next!=35&&t.acceptToken(Vc,-r)}},{contextual:!0}),see=new zn((t,e)=>{if(e.context.type==Lh){t.next==63&&(t.advance(),go(t.next)&&t.acceptToken(qJ));return}if(t.next==45)t.advance(),go(t.next)&&t.acceptToken(e.context.type==Bk&&e.context.depth==sh(t,t.pos-1)?ZJ:QR);else if(t.next==63)t.advance(),go(t.next)&&t.acceptToken(e.context.type==TS&&e.context.depth==sh(t,t.pos-1)?BJ:CR);else{let n=t.pos;for(;;)if(_S(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)_R(t);else if(t.next==38)NS(t);else if(t.next==42){NS(t);break}else if(t.next==39||t.next==34){if(qk(t,!0))break;return}else if(t.next==91||t.next==123){if(!lee(t))return;break}else{NR(t,!0,!1,0);break}for(;_S(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(KJ))return;let r=t.peek(1);go(r)&&t.acceptTokenTo(e.context.type==TS&&e.context.depth==sh(t,n)?VJ:jR,n)}}},{contextual:!0});function aee(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function lP(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function oP(t,e){return t.next==37?(t.advance(),lP(t.next)&&t.advance(),lP(t.next)&&t.advance(),!0):aee(t.next)||e&&t.next==44?(t.advance(),!0):!1}function _R(t){if(t.advance(),t.next==60){for(t.advance();;)if(!oP(t,!0)){t.next==62&&t.advance();break}}else for(;oP(t,!1););}function NS(t){for(t.advance();!go(t.next)&&nx(t.next)!="f";)t.advance()}function qk(t,e){let n=t.next,r=!1,i=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(da(s)){if(e)return!1;r=!0}else if(e&&t.pos>=i+1024)return!1}return!r}function lee(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!qk(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||da(t.next))return!1;t.advance()}}const oee="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function nx(t){return t<33?"u":t>125?"s":oee[t-33]}function N0(t,e){let n=nx(t);return n!="u"&&!(e&&n=="f")}function NR(t,e,n,r){if(nx(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&N0(t.peek(1),n))t.advance();else return!1;let i=t.pos;for(;;){let s=t.next,a=0,o=r+1;for(;$R(s);){if(da(s)){if(e)return!1;o=0}else o++;s=t.peek(++a)}if(!(s>=0&&(s==58?N0(t.peek(a+1),n):s==35?t.peek(a-1)!=32:N0(s,n)))||!n&&o<=r||o==0&&!n&&(zu(t,45,a)||zu(t,46,a)))break;if(e&&nx(s)=="f")return!1;for(let f=a;f>=0;f--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const cee=new zn((t,e)=>{if(t.next==33)_R(t),t.acceptToken(HJ);else if(t.next==38||t.next==42){let n=t.next==38?UJ:WJ;NS(t),t.acceptToken(n)}else t.next==39||t.next==34?(qk(t,!1),t.acceptToken(YJ)):NR(t,!1,e.context.type==Lh,e.context.depth)&&t.acceptToken(IJ)}),uee=new zn((t,e)=>{let n=e.context.type==$S?e.context.depth:-1,r=t.pos;e:for(;;){let i=0,s=t.next;for(;s==32;)s=t.peek(++i);if(!i&&(zu(t,45,i)||zu(t,46,i))||!da(s)&&(n<0&&(n=Math.max(e.context.depth+1,i)),i<n))break;for(;;){if(t.next<0)break e;let a=da(t.next);if(t.advance(),a)continue e;r=t.pos}}t.acceptTokenTo(TR,r)}),fee=Yo({DirectiveName:V.keyword,DirectiveContent:V.attributeValue,"DirectiveEnd DocEnd":V.meta,QuotedLiteral:V.string,BlockLiteralHeader:V.special(V.string),BlockLiteralContent:V.content,Literal:V.content,"Key/Literal Key/QuotedLiteral":V.definition(V.propertyName),"Anchor Alias":V.labelName,Tag:V.typeName,Comment:V.lineComment,": , -":V.separator,"?":V.punctuation,"[ ]":V.squareBracket,"{ }":V.brace}),dee=Ao.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X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ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:ree,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[fee],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[iee,see,cee,uee,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),hee=Eo.define({name:"yaml",parser:dee.configure({props:[sf.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:mS({closing:"}"}),FlowSequence:mS({closing:"]"})}),af.add({"FlowMapping FlowSequence":Ck,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function pee(){return new Eu(hee)}const mee=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Ik(t.state,n.from);return r.line?gee(t):r.block?xee(t):!1};function Vk(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const gee=Vk(bee,0),Oee=Vk(PR,0),xee=Vk((t,e)=>PR(t,e,vee(e)),0);function Ik(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Qd=50;function yee(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-Qd,r),a=t.sliceDoc(i,i+Qd),o=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,f=s.length-o;if(s.slice(f-e.length,f)==e&&a.slice(u,u+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+u,margin:u&&1}};let h,m;i-r<=2*Qd?h=m=t.sliceDoc(r,i):(h=t.sliceDoc(r,r+Qd),m=t.sliceDoc(i-Qd,i));let O=/^\s*/.exec(h)[0].length,x=/\s*$/.exec(m)[0].length,v=m.length-x-n.length;return h.slice(O,O+e.length)==e&&m.slice(v,v+n.length)==n?{open:{pos:r+O+e.length,margin:/\s/.test(h.charAt(O+e.length))?1:0},close:{pos:i-x-n.length,margin:/\s/.test(m.charAt(v-1))?1:0}}:null}function vee(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function PR(t,e,n=e.selection.ranges){let r=n.map(s=>Ik(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>yee(e,r[a],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let a=0,o;a<i.length;a++)if(o=i[a]){let u=r[a],{open:f,close:h}=o;s.push({from:f.pos-u.open.length,to:f.pos+f.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:s}}return null}function bee(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let o=r.length,u=1e9,f;for(let h=s;h<=a;){let m=e.doc.lineAt(h);if(f==null&&(f=Ik(e,m.from).line,!f))continue e;if(m.from>i&&(s==a||a>m.from)){i=m.from;let O=/^\s*/.exec(m.text)[0].length,x=O==m.length,v=m.text.slice(O,O+f.length)==f?O:-1;O<m.text.length&&O<u&&(u=O),r.push({line:m,comment:v,token:f,indent:O,empty:x,single:!1})}h=m.to+1}if(u<1e9)for(let h=o;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=u);r.length==o+1&&(r[o].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:u,indent:f,empty:h,single:m}of r)(m||!h)&&s.push({from:o.from+f,insert:u+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:o,token:u}of r)if(o>=0){let f=a.from+o,h=f+u.length;a.text[h-a.from]==" "&&h++,s.push({from:f,to:h})}return{changes:s}}return null}const PS=Oa.define(),See=Oa.define(),wee=Re.define(),ER=Re.define({combine(t){return kU(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),AR=ga.define({create(){return hs.empty},update(t,e){let n=e.state.facet(ER),r=e.annotation(PS);if(r){let u=br.fromTransaction(e,r.selection),f=r.side,h=f==0?t.undone:t.done;return u?h=rx(h,h.length,n.minDepth,u):h=zR(h,e.startState.selection),new hs(f==0?r.rest:h,f==0?h:r.rest)}let i=e.annotation(See);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(pn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=br.fromTransaction(e),a=e.annotation(pn.time),o=e.annotation(pn.userEvent);return s?t=t.addChanges(s,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new hs(t.done.map(br.fromJSON),t.undone.map(br.fromJSON))}});function kee(t={}){return[AR,ER.of(t),Pe.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?MR:e.inputType=="historyRedo"?ES:null;return r?(e.preventDefault(),r(n)):!1}})]}function Wx(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(AR,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const MR=Wx(0,!1),ES=Wx(1,!1),Qee=Wx(0,!0),Cee=Wx(1,!0);class br{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new br(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new br(e.changes&&vn.fromJSON(e.changes),[],e.mapped&&ms.fromJSON(e.mapped),e.startSelection&&pe.fromJSON(e.startSelection),e.selectionsAfter.map(pe.fromJSON))}static fromTransaction(e,n){let r=ci;for(let i of e.startState.facet(wee)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new br(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ci)}static selection(e){return new br(void 0,ci,void 0,void 0,e)}}function rx(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function jee(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,a,o)=>{for(let u=0;u<n.length;){let f=n[u++],h=n[u++];o>=f&&a<=h&&(r=!0)}}),r}function Tee(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function RR(t,e){return t.length?e.length?t.concat(e):t:e}const ci=[],$ee=200;function zR(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-$ee));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),rx(t,t.length-1,1e9,n.setSelAfter(r)))}else return[br.selection([e])]}function _ee(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function P0(t,e){if(!t.length)return t;let n=t.length,r=ci;for(;n;){let i=Nee(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[br.selection(r)]:ci}function Nee(t,e,n){let r=RR(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):ci,n);if(!t.changes)return br.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new br(i,Zt.mapEffects(t.effects,e),a,t.startSelection.map(s),r)}const Pee=/^(input\.type|delete)($|\.)/;class hs{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new hs(this.done,this.undone):this}addChanges(e,n,r,i,s){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||Pee.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,jee(o.changes,e.changes))||r=="input.type.compose")?a=rx(a,a.length-1,i.minDepth,new br(e.changes.compose(o.changes),RR(Zt.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,ci)):a=rx(a,a.length,i.minDepth,e),new hs(a,ci,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ci;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Tee(s[s.length-1],e)?this:new hs(zR(this.done,e),this.undone,n,r)}addMapping(e){return new hs(P0(this.done,e),P0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:PS.of({side:e,rest:_ee(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=i.length==1?ci:i.slice(0,i.length-1);return s.mapped&&(o=P0(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:PS.of({side:e,rest:o,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}hs.empty=new hs(ci,ci);const Eee=[{key:"Mod-z",run:MR,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ES,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ES,preventDefault:!0},{key:"Mod-u",run:Qee,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Cee,preventDefault:!0}];function of(t,e){return pe.create(t.ranges.map(e),t.mainIndex)}function Xi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Zi({state:t,dispatch:e},n){let r=of(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Xi(t,r)),!0)}function Hx(t,e){return pe.cursor(e?t.to:t.from)}function DR(t,e){return Zi(t,n=>n.empty?t.moveByChar(n,e):Hx(n,e))}function Wn(t){return t.textDirectionAt(t.state.selection.main.head)==mn.LTR}const LR=t=>DR(t,!Wn(t)),XR=t=>DR(t,Wn(t));function ZR(t,e){return Zi(t,n=>n.empty?t.moveByGroup(n,e):Hx(n,e))}const Aee=t=>ZR(t,!Wn(t)),Mee=t=>ZR(t,Wn(t));function Ree(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Gx(t,e,n){let r=Kt(t).resolveInner(e.head),i=n?Xe.closedBy:Xe.openedBy;for(let u=e.head;;){let f=n?r.childAfter(u):r.childBefore(u);if(!f)break;Ree(t,f,i)?r=f:u=n?f.to:f.from}let s=r.type.prop(i),a,o;return s&&(a=n?Kc(t,r.from,1):Kc(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,pe.cursor(o,n?-1:1)}const zee=t=>Zi(t,e=>Gx(t.state,e,!Wn(t))),Dee=t=>Zi(t,e=>Gx(t.state,e,Wn(t)));function BR(t,e){return Zi(t,n=>{if(!n.empty)return Hx(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const qR=t=>BR(t,!1),VR=t=>BR(t,!0);function IR(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(Pe.scrollMargins)){let a=s(t);a!=null&&a.top&&(n=Math.max(a==null?void 0:a.top,n)),a!=null&&a.bottom&&(r=Math.max(a==null?void 0:a.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function YR(t,e){let n=IR(t),{state:r}=t,i=of(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):Hx(a,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),u=o.top+n.marginTop,f=o.bottom-n.marginBottom;a&&a.top>u&&a.bottom<f&&(s=Pe.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-u}))}return t.dispatch(Xi(r,i),{effects:s}),!0}const cP=t=>YR(t,!1),AS=t=>YR(t,!0);function Tl(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=pe.cursor(r.from+s))}return i}const Lee=t=>Zi(t,e=>Tl(t,e,!0)),Xee=t=>Zi(t,e=>Tl(t,e,!1)),Zee=t=>Zi(t,e=>Tl(t,e,!Wn(t))),Bee=t=>Zi(t,e=>Tl(t,e,Wn(t))),qee=t=>Zi(t,e=>pe.cursor(t.lineBlockAt(e.head).from,1)),Vee=t=>Zi(t,e=>pe.cursor(t.lineBlockAt(e.head).to,-1));function Iee(t,e,n){let r=!1,i=of(t.selection,s=>{let a=Kc(t,s.head,-1)||Kc(t,s.head,1)||s.head>0&&Kc(t,s.head-1,1)||s.head<t.doc.length&&Kc(t,s.head+1,-1);if(!a||!a.end)return s;r=!0;let o=a.start.from==s.head?a.end.to:a.end.from;return pe.cursor(o)});return r?(e(Xi(t,i)),!0):!1}const Yee=({state:t,dispatch:e})=>Iee(t,e);function yi(t,e){let n=of(t.state.selection,r=>{let i=e(r);return pe.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Xi(t.state,n)),!0)}function UR(t,e){return yi(t,n=>t.moveByChar(n,e))}const WR=t=>UR(t,!Wn(t)),HR=t=>UR(t,Wn(t));function GR(t,e){return yi(t,n=>t.moveByGroup(n,e))}const Uee=t=>GR(t,!Wn(t)),Wee=t=>GR(t,Wn(t)),Hee=t=>yi(t,e=>Gx(t.state,e,!Wn(t))),Gee=t=>yi(t,e=>Gx(t.state,e,Wn(t)));function FR(t,e){return yi(t,n=>t.moveVertically(n,e))}const KR=t=>FR(t,!1),JR=t=>FR(t,!0);function ez(t,e){return yi(t,n=>t.moveVertically(n,e,IR(t).height))}const uP=t=>ez(t,!1),fP=t=>ez(t,!0),Fee=t=>yi(t,e=>Tl(t,e,!0)),Kee=t=>yi(t,e=>Tl(t,e,!1)),Jee=t=>yi(t,e=>Tl(t,e,!Wn(t))),ete=t=>yi(t,e=>Tl(t,e,Wn(t))),tte=t=>yi(t,e=>pe.cursor(t.lineBlockAt(e.head).from)),nte=t=>yi(t,e=>pe.cursor(t.lineBlockAt(e.head).to)),dP=({state:t,dispatch:e})=>(e(Xi(t,{anchor:0})),!0),hP=({state:t,dispatch:e})=>(e(Xi(t,{anchor:t.doc.length})),!0),pP=({state:t,dispatch:e})=>(e(Xi(t,{anchor:t.selection.main.anchor,head:0})),!0),mP=({state:t,dispatch:e})=>(e(Xi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),rte=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),ite=({state:t,dispatch:e})=>{let n=Fx(t).map(({from:r,to:i})=>pe.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:pe.create(n),userEvent:"select"})),!0},ste=({state:t,dispatch:e})=>{let n=of(t.selection,r=>{let i=Kt(t),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:o}=a;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return pe.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Xi(t,n)),!0)};function tz(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let o=s;;){let u=t.moveVertically(o,e);if(u.head<a.from||u.head>a.to){i.some(f=>f.head==u.head)||i.push(u);break}else{if(u.head==o.head)break;o=u}}}return i.length==r.ranges.length?!1:(t.dispatch(Xi(n,pe.create(i,i.length-1))),!0)}const ate=t=>tz(t,!1),lte=t=>tz(t,!0),ote=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=pe.create([n.main]):n.main.empty||(r=pe.create([pe.cursor(n.main.head)])),r?(e(Xi(t,r)),!0):!1};function kp(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:a,to:o}=s;if(a==o){let u=e(s);u<a?(n="delete.backward",u=Mg(t,u,!1)):u>a&&(n="delete.forward",u=Mg(t,u,!0)),a=Math.min(a,u),o=Math.max(o,u)}else a=Mg(t,a,!1),o=Mg(t,o,!0);return a==o?{range:s}:{changes:{from:a,to:o},range:pe.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Pe.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Mg(t,e,n){if(t instanceof Pe)for(let r of t.state.facet(Pe.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const nz=(t,e,n)=>kp(t,r=>{let i=r.from,{state:s}=t,a=s.doc.lineAt(i),o,u;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(o=a.text.slice(0,i-a.from))){if(o[o.length-1]==" ")return i-1;let f=ua(o,s.tabSize),h=f%YO(s)||YO(s);for(let m=0;m<h&&o[o.length-1-m]==" ";m++)i--;u=i}else u=In(a.text,i-a.from,e,e)+a.from,u==i&&a.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(u-a.from,i-a.from))&&(u=In(a.text,u-a.from,!1,!1)+a.from);return u}),MS=t=>nz(t,!1,!0),rz=t=>nz(t,!0,!1),iz=(t,e)=>kp(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=In(s.text,r-s.from,e)+s.from,f=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),h=a(f);if(o!=null&&h!=o)break;(f!=" "||r!=n.head)&&(o=h),r=u}return r}),sz=t=>iz(t,!1),cte=t=>iz(t,!0),ute=t=>kp(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),fte=t=>kp(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),dte=t=>kp(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),hte=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:st.of(["",""])},range:pe.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},pte=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),a=i==s.from?i-1:In(s.text,i-s.from,!1)+s.from,o=i==s.to?i+1:In(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(a,i))},range:pe.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Fx(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function az(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of Fx(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),o=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let u of s.ranges)i.push(pe.range(Math.min(t.doc.length,u.anchor+o),Math.min(t.doc.length,u.head+o)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let u of s.ranges)i.push(pe.range(u.anchor-o,u.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:pe.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const mte=({state:t,dispatch:e})=>az(t,e,!1),gte=({state:t,dispatch:e})=>az(t,e,!0);function lz(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of Fx(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ote=({state:t,dispatch:e})=>lz(t,e,!1),xte=({state:t,dispatch:e})=>lz(t,e,!0),yte=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Fx(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=of(e.selection,i=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(s=a.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function vte(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Kt(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Xe.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const gP=oz(!1),bte=oz(!0);function oz(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:a}=i,o=e.doc.lineAt(s),u=!t&&s==a&&vte(e,s);t&&(s=a=(a<=o.to?o:e.doc.lineAt(a)).to);let f=new Yx(e,{simulateBreak:s,simulateDoubleBreak:!!u}),h=l3(f,s);for(h==null&&(h=ua(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<o.to&&/\s/.test(o.text[a-o.from]);)a++;u?{from:s,to:a}=u:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let m=["",UO(e,h)];return u&&m.push(UO(e,f.lineIndent(o.from,-1))),{changes:{from:s,to:a,insert:st.of(m)},range:pe.cursor(s+1+m[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yk(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,i,r),n=o.number),a=o.to+1}let s=t.changes(i);return{changes:i,range:pe.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Ste=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Yx(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=Yk(t,(s,a,o)=>{let u=l3(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let f=/^\s*/.exec(s.text)[0],h=UO(t,u);(f!=h||o.from<s.from+f.length)&&(n[s.from]=u,a.push({from:s.from,to:s.from+f.length,insert:h}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},wte=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Yk(t,(n,r)=>{r.push({from:n.from,insert:t.facet(bp)})}),{userEvent:"input.indent"})),!0),kte=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Yk(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=ua(i,t.tabSize),a=0,o=UO(t,Math.max(0,s-YO(t)));for(;a<i.length&&a<o.length&&i.charCodeAt(a)==o.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:o.slice(a)})}),{userEvent:"delete.dedent"})),!0),Qte=t=>(t.setTabFocusMode(),!0),Cte=[{key:"Ctrl-b",run:LR,shift:WR,preventDefault:!0},{key:"Ctrl-f",run:XR,shift:HR},{key:"Ctrl-p",run:qR,shift:KR},{key:"Ctrl-n",run:VR,shift:JR},{key:"Ctrl-a",run:qee,shift:tte},{key:"Ctrl-e",run:Vee,shift:nte},{key:"Ctrl-d",run:rz},{key:"Ctrl-h",run:MS},{key:"Ctrl-k",run:ute},{key:"Ctrl-Alt-h",run:sz},{key:"Ctrl-o",run:hte},{key:"Ctrl-t",run:pte},{key:"Ctrl-v",run:AS}],jte=[{key:"ArrowLeft",run:LR,shift:WR,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Aee,shift:Uee,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Zee,shift:Jee,preventDefault:!0},{key:"ArrowRight",run:XR,shift:HR,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Mee,shift:Wee,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Bee,shift:ete,preventDefault:!0},{key:"ArrowUp",run:qR,shift:KR,preventDefault:!0},{mac:"Cmd-ArrowUp",run:dP,shift:pP},{mac:"Ctrl-ArrowUp",run:cP,shift:uP},{key:"ArrowDown",run:VR,shift:JR,preventDefault:!0},{mac:"Cmd-ArrowDown",run:hP,shift:mP},{mac:"Ctrl-ArrowDown",run:AS,shift:fP},{key:"PageUp",run:cP,shift:uP},{key:"PageDown",run:AS,shift:fP},{key:"Home",run:Xee,shift:Kee,preventDefault:!0},{key:"Mod-Home",run:dP,shift:pP},{key:"End",run:Lee,shift:Fee,preventDefault:!0},{key:"Mod-End",run:hP,shift:mP},{key:"Enter",run:gP,shift:gP},{key:"Mod-a",run:rte},{key:"Backspace",run:MS,shift:MS,preventDefault:!0},{key:"Delete",run:rz,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sz,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:cte,preventDefault:!0},{mac:"Mod-Backspace",run:fte,preventDefault:!0},{mac:"Mod-Delete",run:dte,preventDefault:!0}].concat(Cte.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Tte=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:zee,shift:Hee},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Dee,shift:Gee},{key:"Alt-ArrowUp",run:mte},{key:"Shift-Alt-ArrowUp",run:Ote},{key:"Alt-ArrowDown",run:gte},{key:"Shift-Alt-ArrowDown",run:xte},{key:"Mod-Alt-ArrowUp",run:ate},{key:"Mod-Alt-ArrowDown",run:lte},{key:"Escape",run:ote},{key:"Mod-Enter",run:bte},{key:"Alt-l",mac:"Ctrl-l",run:ite},{key:"Mod-i",run:ste,preventDefault:!0},{key:"Mod-[",run:kte},{key:"Mod-]",run:wte},{key:"Mod-Alt-\\",run:Ste},{key:"Shift-Mod-k",run:yte},{key:"Shift-Mod-\\",run:Yee},{key:"Mod-/",run:mee},{key:"Alt-A",run:Oee},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Qte}].concat(jte),$te="#e5c07b",OP="#e06c75",_te="#56b6c2",Nte="#ffffff",cO="#abb2bf",RS="#7d8799",Pte="#61afef",Ete="#98c379",xP="#d19a66",Ate="#c678dd",Mte="#21252b",yP="#2c313a",vP="#282c34",E0="#353a42",Rte="#3E4451",bP="#528bff",zte=Pe.theme({"&":{color:cO,backgroundColor:vP},".cm-content":{caretColor:bP},".cm-cursor, .cm-dropCursor":{borderLeftColor:bP},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Rte},".cm-panels":{backgroundColor:Mte,color:cO},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:vP,color:RS,border:"none"},".cm-activeLineGutter":{backgroundColor:yP},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:E0},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:E0,borderBottomColor:E0},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:yP,color:cO}}},{dark:!0}),Dte=Sp.define([{tag:V.keyword,color:Ate},{tag:[V.name,V.deleted,V.character,V.propertyName,V.macroName],color:OP},{tag:[V.function(V.variableName),V.labelName],color:Pte},{tag:[V.color,V.constant(V.name),V.standard(V.name)],color:xP},{tag:[V.definition(V.name),V.separator],color:cO},{tag:[V.typeName,V.className,V.number,V.changed,V.annotation,V.modifier,V.self,V.namespace],color:$te},{tag:[V.operator,V.operatorKeyword,V.url,V.escape,V.regexp,V.link,V.special(V.string)],color:_te},{tag:[V.meta,V.comment],color:RS},{tag:V.strong,fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.link,color:RS,textDecoration:"underline"},{tag:V.heading,fontWeight:"bold",color:OP},{tag:[V.atom,V.bool,V.special(V.variableName)],color:xP},{tag:[V.processingInstruction,V.string,V.inserted],color:Ete},{tag:V.invalid,color:Nte}]),Lte=[zte,u3(Dte)];function Xte(t){switch(t){case"markdown":return AJ();case"yaml":return pee();case"html":return xR();case"javascript":return cR();case"plaintext":return null}}function Zte(t){var n;switch(((n=t.split(".").pop())==null?void 0:n.toLowerCase())??""){case"md":case"markdown":return"markdown";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";case"js":case"jsx":case"ts":case"tsx":case"json":return"javascript";default:return"plaintext"}}const Bte=Pe.theme({"&":{backgroundColor:"var(--color-bg)",color:"var(--color-text)",height:"100%"},".cm-content":{fontFamily:"var(--font-mono)",fontSize:"13px",padding:"16px 0"},".cm-gutters":{backgroundColor:"var(--color-bg)",borderRight:"1px solid var(--color-border-subtle)",color:"var(--color-muted)"},".cm-activeLineGutter":{backgroundColor:"var(--color-surface-raised)"},".cm-activeLine":{backgroundColor:"var(--color-surface-raised)"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:"rgba(255, 74, 0, 0.15) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(255, 74, 0, 0.2) !important"},".cm-scroller":{overflow:"auto"}});function qte({content:t,onChange:e,onSave:n,readOnly:r=!1,dark:i=!1,placeholder:s,language:a="markdown"}){const o=C.useRef(null),u=C.useRef(null),f=C.useRef(e),h=C.useRef(n);f.current=e,h.current=n;const m=C.useCallback(()=>{const O=[kee(),Ix.of([...Tte,...Eee,{key:"Mod-s",run:v=>{var S;return(S=h.current)==null||S.call(h,v.state.doc.toString()),!0}}]),Pe.updateListener.of(v=>{var S;v.docChanged&&((S=f.current)==null||S.call(f,v.state.doc.toString()))}),Pe.lineWrapping],x=Xte(a);return x&&O.push(x),i?O.push(Lte):O.push(Bte,u3(rG)),r&&O.push(ft.readOnly.of(!0)),s&&O.push(bH(s)),O},[i,r,s,a]);return C.useEffect(()=>{if(!o.current)return;const O=ft.create({doc:t,extensions:m()}),x=new Pe({state:O,parent:o.current});return u.current=x,()=>{x.destroy(),u.current=null}},[m]),C.useEffect(()=>{const O=u.current;if(!O)return;const x=O.state.doc.toString();x!==t&&O.dispatch({changes:{from:0,to:x.length,insert:t}})},[t]),p.jsx("div",{ref:o,className:"h-full overflow-hidden"})}function pi({content:t,filePath:e,onChange:n,onSave:r,readOnly:i=!1,defaultMode:s}){const[a,o]=C.useState(s??"edit"),u=bh(O=>O.theme),f=Zte(e),h=f==="markdown",m=C.useCallback(O=>{(O.metaKey||O.ctrlKey)&&O.key==="s"&&(O.preventDefault(),r==null||r(t))},[t,r]);return p.jsxs("div",{className:"flex flex-col h-full",onKeyDown:m,children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[var(--color-border-subtle)] shrink-0",children:[p.jsx("span",{className:"text-xs font-[var(--font-mono)] text-[var(--color-muted)] truncate mr-4",children:e}),p.jsx("div",{className:"flex gap-0.5 shrink-0",children:["edit","preview","split"].map(O=>p.jsx("button",{onClick:()=>o(O),className:`px-2.5 py-1 text-xs rounded transition-colors ${a===O?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:O.charAt(0).toUpperCase()+O.slice(1)},O))})]}),p.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[(a==="edit"||a==="split")&&p.jsx("div",{className:`${a==="split"?"w-1/2":"w-full"} overflow-hidden`,children:p.jsx(qte,{content:t,onChange:n,onSave:r,readOnly:i,dark:u==="dark",language:f})}),(a==="preview"||a==="split")&&p.jsx("div",{className:`${a==="split"?"w-1/2 border-l border-[var(--color-border-subtle)]":"w-full"} overflow-auto p-6`,children:h?p.jsx("div",{className:"prose prose-sm max-w-none text-[var(--color-text)] prose-headings:text-[var(--color-text)] prose-headings:font-bold prose-h1:text-2xl prose-h1:border-b prose-h1:border-[var(--color-border-subtle)] prose-h1:pb-2 prose-h2:text-xl prose-h3:text-lg prose-h4:text-base prose-p:leading-relaxed prose-a:text-[var(--color-accent)] prose-strong:text-[var(--color-text)] prose-code:font-[var(--font-mono)] prose-code:text-xs prose-code:bg-[var(--color-surface-raised)] prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-pre:bg-[var(--color-surface-raised)] prose-pre:font-[var(--font-mono)] prose-li:marker:text-[var(--color-muted)] prose-blockquote:border-[var(--color-accent)] prose-blockquote:text-[var(--color-muted)] prose-hr:border-[var(--color-border-subtle)]",children:p.jsx(X5,{children:t})}):p.jsx("pre",{className:"text-sm font-[var(--font-mono)] whitespace-pre-wrap",children:t})})]})]})}function Vte(t){const e=t.indexOf("_bmad/");return e>=0?t.slice(e+6):t}function Ite(t){const e=t.replace(/\/$/,"").split("/");return e[e.length-1]??t}const Yte={"steps-c":"Conditional","steps-e":"Editorial","steps-v":"Validation"};function Ute(t){return t?Yte[t]??t.replace(/^steps-/,"").replace(/-steps$/,"").split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):"Primary"}function Wte(t){const e=new Map;return t.forEach((n,r)=>{const i=n.variantSet??"__primary";e.has(i)||e.set(i,{key:i,label:Ute(n.variantSet),steps:[]}),e.get(i).steps.push({...n,globalIndex:r})}),Array.from(e.values()).sort((n,r)=>n.key==="__primary"?-1:r.key==="__primary"?1:n.key.localeCompare(r.key))}function Hte({workflowId:t,onClose:e}){const{data:n,isLoading:r}=i5(t),[i,s]=C.useState(!1),[a,o]=C.useState(null),[u,f]=C.useState(null),[h,m]=C.useState(!1),[O,x]=C.useState(null),[v,S]=C.useState(null),[k,w]=C.useState(!1),[j,Q]=C.useState("__primary"),[T,N]=C.useState([]),[_,M]=C.useState(null),[I,U]=C.useState(null),[F,Z]=C.useState(!1);C.useEffect(()=>{if(!n||n.type!=="agent-based"){N([]);return}fetch(`/api/workflows/${t}/supporting-files`).then(z=>z.json()).then(z=>N(z.groups)).catch(()=>N([]))},[n,t]);const X=C.useCallback(async z=>{if(_===z){M(null),U(null);return}if(M(z),z.endsWith(".md")){Z(!0);try{const B=await fetch(`/api/files/${z}`);if(B.ok){const W=await B.json();U(W.content)}else U("Could not load file.")}catch{U("Failed to load file.")}finally{Z(!1)}}},[_]),H=C.useMemo(()=>n?Wte(n.steps):[],[n]),E=C.useMemo(()=>H.find(z=>z.key===j)??H[0],[H,j]),q=C.useCallback(async z=>{if(a===z){o(null),f(null);return}o(z),m(!0);try{const B=await fetch(`/api/workflows/${t}/steps/${z}`);if(B.ok){const W=await B.json();f(W.content)}else f("Could not load step instructions.")}catch{f("Failed to load step instructions.")}finally{m(!1)}},[a,t]),R=C.useCallback(async z=>{if(O===z){x(null),S(null);return}x(z),w(!0);try{const B=Vte(z),W=await fetch(`/api/files/${B}`);if(W.ok){const A=await W.json();S(A.content)}else S("Could not load template.")}catch{S("Failed to load template.")}finally{w(!1)}},[O]);return p.jsxs("div",{className:"slide-over-backdrop",onClick:z=>{z.target===z.currentTarget&&e()},children:[p.jsx("div",{className:"slide-over-bg",onClick:e}),p.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[p.jsx("h2",{className:"text-lg font-bold truncate",children:(n==null?void 0:n.name)??"Loading..."}),n&&p.jsx(f2,{type:n.type})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[n&&p.jsx("button",{onClick:()=>s(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Workflow",children:p.jsx(Qu,{size:16})}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]})]}),r&&p.jsxs("div",{className:"p-6 space-y-3",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),n&&p.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[p.jsx("div",{children:p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:n.description})}),p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.module&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:n.module}),n.phase&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:n.phase})]}),n.steps.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Steps (",n.steps.length,")"]}),H.length>1&&p.jsx("div",{className:"flex gap-1 mb-3 flex-wrap bg-[var(--color-surface-raised)] rounded-md p-1",children:H.map(z=>p.jsxs("button",{onClick:()=>Q(z.key),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded transition-colors ${j===z.key?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[z.label,p.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)] font-bold",children:z.steps.length})]},z.key))}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mb-3",children:"Click a step to view its instructions"}),p.jsx("div",{className:"space-y-1.5",children:E==null?void 0:E.steps.map((z,B)=>{var D,Y,P,ee;const W=String(B+1).padStart(2,"0"),A=z.description?z.description.split(`
400
+ `)[0].slice(0,80)+(z.description.length>80?"…":""):null;return p.jsxs("div",{className:z.isVariant?"ml-6 pl-4 border-l-2 border-[var(--color-border-subtle)]":"",children:[p.jsxs("button",{onClick:()=>z.filePath&&q(z.globalIndex),className:`w-full text-left px-3 py-2.5 rounded-lg border transition-colors ${a===z.globalIndex?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"} ${z.filePath?"cursor-pointer":""}`,children:[p.jsxs("div",{className:"flex items-center gap-2.5",children:[z.filePath?a===z.globalIndex?p.jsx(ea,{size:12,className:"text-[var(--color-accent)] shrink-0"}):p.jsx(ta,{size:12,className:"text-[var(--color-muted)] shrink-0"}):null,z.isVariant?p.jsx("span",{className:"text-xs text-[var(--color-muted)] shrink-0",children:"↳"}):p.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)] font-[var(--font-mono)] w-5 shrink-0 text-right",children:W}),p.jsx("span",{className:`text-sm font-bold truncate ${z.isVariant?"text-[var(--color-muted)]":""}`,children:z.title}),z.agent&&p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-accent)] font-bold shrink-0",children:[p.jsx(di,{size:9}),z.agent]})]}),A&&p.jsx("p",{className:`text-xs mt-1 ml-[calc(12px+0.625rem+1.25rem)] truncate ${z.isVariant?"text-[var(--color-muted)]/60":"text-[var(--color-muted)]"}`,children:A}),(((D=z.inputs)==null?void 0:D.length)||((Y=z.outputs)==null?void 0:Y.length))&&p.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1.5 ml-[calc(12px+0.625rem+1.25rem)]",children:[(P=z.inputs)==null?void 0:P.map(ae=>p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:[p.jsx(b9,{size:9}),ae]},ae)),(ee=z.outputs)==null?void 0:ee.map(ae=>p.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-success)]",children:[p.jsx(Mx,{size:9}),ae]},ae))]})]}),a===z.globalIndex&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-64",children:h?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(pi,{content:u??"",filePath:z.filePath,onChange:()=>{},readOnly:!0})})]},z.globalIndex)})})]}),n.templates&&n.templates.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Templates (",n.templates.length,")"]}),p.jsx("div",{className:"space-y-2",children:n.templates.map(z=>p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>R(z.filePath),className:`w-full flex items-center gap-2 p-3 rounded-lg border transition-colors cursor-pointer text-left ${O===z.filePath?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[O===z.filePath?p.jsx(ea,{size:12,className:"text-[var(--color-accent)]"}):p.jsx(ta,{size:12,className:"text-[var(--color-muted)]"}),p.jsx(jo,{size:14,className:"text-[var(--color-muted)]"}),p.jsxs("span",{className:"text-sm",children:[z.name,".template.md"]})]}),O===z.filePath&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-48",children:k?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(pi,{content:v??"",filePath:z.filePath,onChange:()=>{},readOnly:!0})})]},z.filePath))})]}),n.subWorkflows&&n.subWorkflows.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Sub-Workflows (",n.subWorkflows.length,")"]}),p.jsx("div",{className:"space-y-1",children:n.subWorkflows.map(z=>p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx(X9,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:z.name})]},z.filePath))})]}),n.type==="agent-based"&&T.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Agents & Resources"}),p.jsx("div",{className:"space-y-4",children:T.map(z=>p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(Q$,{size:12,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--color-muted)]",children:z.name}),p.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-accent)]/10 text-[var(--color-accent)] font-bold",children:z.files.length})]}),p.jsx("div",{className:"space-y-1",children:z.files.map(B=>p.jsxs("div",{children:[B.name.endsWith(".md")?p.jsxs("button",{onClick:()=>X(B.relativePath),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors cursor-pointer text-left ${_===B.relativePath?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[_===B.relativePath?p.jsx(ea,{size:12,className:"text-[var(--color-accent)]"}):p.jsx(ta,{size:12,className:"text-[var(--color-muted)]"}),p.jsx(jo,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:B.name})]}):p.jsxs(nr,{to:`/files?path=${encodeURIComponent(B.relativePath)}`,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(jo,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm text-[var(--color-accent)] hover:underline",children:B.name})]}),_===B.relativePath&&B.name.endsWith(".md")&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-48",children:F?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(pi,{content:I??"",filePath:B.relativePath,onChange:()=>{},readOnly:!0})})]},B.relativePath))})]},z.name))})]}),n.type!=="agent-based"&&n.supportingFiles&&n.supportingFiles.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Supporting Files"}),p.jsx("div",{className:"space-y-1",children:n.supportingFiles.map(z=>p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx(Q$,{size:14,className:"text-[var(--color-muted)]"}),p.jsxs("span",{className:"text-sm",children:[Ite(z),"/"]})]},z))})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-muted)]",children:[p.jsx(Mi,{size:12}),p.jsx("span",{className:"font-[var(--font-mono)]",children:n.filePath})]})]})]}),i&&n&&p.jsx(Dq,{workflow:n,onClose:()=>s(!1),onSaved:()=>s(!1)})]})}function gn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n<t.length;n++)(r=gn(t[n]))!==""&&(e+=(e&&" ")+r);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var Gte={value:()=>{}};function Kx(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new uO(n)}function uO(t){this._=t}function Fte(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}uO.prototype=Kx.prototype={constructor:uO,on:function(t,e){var n=this._,r=Fte(t+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(t=r[s]).type)&&(i=Kte(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(i=(t=r[s]).type)n[i]=SP(n[i],t.name,e);else if(e==null)for(i in n)n[i]=SP(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new uO(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(e,n)}};function Kte(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function SP(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Gte,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var zS="http://www.w3.org/1999/xhtml";const wP={svg:"http://www.w3.org/2000/svg",xhtml:zS,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jx(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),wP.hasOwnProperty(e)?{space:wP[e],local:t}:t}function Jte(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===zS&&e.documentElement.namespaceURI===zS?e.createElement(t):e.createElementNS(n,t)}}function ene(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function cz(t){var e=Jx(t);return(e.local?ene:Jte)(e)}function tne(){}function Uk(t){return t==null?tne:function(){return this.querySelector(t)}}function nne(t){typeof t!="function"&&(t=Uk(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,o=r[i]=new Array(a),u,f,h=0;h<a;++h)(u=s[h])&&(f=t.call(u,u.__data__,h,s))&&("__data__"in u&&(f.__data__=u.__data__),o[h]=f);return new Vr(r,this._parents)}function rne(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ine(){return[]}function uz(t){return t==null?ine:function(){return this.querySelectorAll(t)}}function sne(t){return function(){return rne(t.apply(this,arguments))}}function ane(t){typeof t=="function"?t=sne(t):t=uz(t);for(var e=this._groups,n=e.length,r=[],i=[],s=0;s<n;++s)for(var a=e[s],o=a.length,u,f=0;f<o;++f)(u=a[f])&&(r.push(t.call(u,u.__data__,f,a)),i.push(u));return new Vr(r,i)}function fz(t){return function(){return this.matches(t)}}function dz(t){return function(e){return e.matches(t)}}var lne=Array.prototype.find;function one(t){return function(){return lne.call(this.children,t)}}function cne(){return this.firstElementChild}function une(t){return this.select(t==null?cne:one(typeof t=="function"?t:dz(t)))}var fne=Array.prototype.filter;function dne(){return Array.from(this.children)}function hne(t){return function(){return fne.call(this.children,t)}}function pne(t){return this.selectAll(t==null?dne:hne(typeof t=="function"?t:dz(t)))}function mne(t){typeof t!="function"&&(t=fz(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,o=r[i]=[],u,f=0;f<a;++f)(u=s[f])&&t.call(u,u.__data__,f,s)&&o.push(u);return new Vr(r,this._parents)}function hz(t){return new Array(t.length)}function gne(){return new Vr(this._enter||this._groups.map(hz),this._parents)}function ix(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ix.prototype={constructor:ix,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function One(t){return function(){return t}}function xne(t,e,n,r,i,s){for(var a=0,o,u=e.length,f=s.length;a<f;++a)(o=e[a])?(o.__data__=s[a],r[a]=o):n[a]=new ix(t,s[a]);for(;a<u;++a)(o=e[a])&&(i[a]=o)}function yne(t,e,n,r,i,s,a){var o,u,f=new Map,h=e.length,m=s.length,O=new Array(h),x;for(o=0;o<h;++o)(u=e[o])&&(O[o]=x=a.call(u,u.__data__,o,e)+"",f.has(x)?i[o]=u:f.set(x,u));for(o=0;o<m;++o)x=a.call(t,s[o],o,s)+"",(u=f.get(x))?(r[o]=u,u.__data__=s[o],f.delete(x)):n[o]=new ix(t,s[o]);for(o=0;o<h;++o)(u=e[o])&&f.get(O[o])===u&&(i[o]=u)}function vne(t){return t.__data__}function bne(t,e){if(!arguments.length)return Array.from(this,vne);var n=e?yne:xne,r=this._parents,i=this._groups;typeof t!="function"&&(t=One(t));for(var s=i.length,a=new Array(s),o=new Array(s),u=new Array(s),f=0;f<s;++f){var h=r[f],m=i[f],O=m.length,x=Sne(t.call(h,h&&h.__data__,f,r)),v=x.length,S=o[f]=new Array(v),k=a[f]=new Array(v),w=u[f]=new Array(O);n(h,m,S,k,w,x,e);for(var j=0,Q=0,T,N;j<v;++j)if(T=S[j]){for(j>=Q&&(Q=j+1);!(N=k[Q])&&++Q<v;);T._next=N||null}}return a=new Vr(a,r),a._enter=o,a._exit=u,a}function Sne(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function wne(){return new Vr(this._exit||this._groups.map(hz),this._parents)}function kne(t,e,n){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Qne(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),u=0;u<a;++u)for(var f=n[u],h=r[u],m=f.length,O=o[u]=new Array(m),x,v=0;v<m;++v)(x=f[v]||h[v])&&(O[v]=x);for(;u<i;++u)o[u]=n[u];return new Vr(o,this._parents)}function Cne(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function jne(t){t||(t=Tne);function e(m,O){return m&&O?t(m.__data__,O.__data__):!m-!O}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,u=i[s]=new Array(o),f,h=0;h<o;++h)(f=a[h])&&(u[h]=f);u.sort(e)}return new Vr(i,this._parents).order()}function Tne(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function $ne(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function _ne(){return Array.from(this)}function Nne(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function Pne(){let t=0;for(const e of this)++t;return t}function Ene(){return!this.node()}function Ane(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&t.call(o,o.__data__,s,i);return this}function Mne(t){return function(){this.removeAttribute(t)}}function Rne(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zne(t,e){return function(){this.setAttribute(t,e)}}function Dne(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Lne(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Xne(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Zne(t,e){var n=Jx(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Rne:Mne:typeof e=="function"?n.local?Xne:Lne:n.local?Dne:zne)(n,e))}function pz(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Bne(t){return function(){this.style.removeProperty(t)}}function qne(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Vne(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ine(t,e,n){return arguments.length>1?this.each((e==null?Bne:typeof e=="function"?Vne:qne)(t,e,n??"")):Du(this.node(),t)}function Du(t,e){return t.style.getPropertyValue(e)||pz(t).getComputedStyle(t,null).getPropertyValue(e)}function Yne(t){return function(){delete this[t]}}function Une(t,e){return function(){this[t]=e}}function Wne(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Hne(t,e){return arguments.length>1?this.each((e==null?Yne:typeof e=="function"?Wne:Une)(t,e)):this.node()[t]}function mz(t){return t.trim().split(/^|\s+/)}function Wk(t){return t.classList||new gz(t)}function gz(t){this._node=t,this._names=mz(t.getAttribute("class")||"")}gz.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Oz(t,e){for(var n=Wk(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function xz(t,e){for(var n=Wk(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Gne(t){return function(){Oz(this,t)}}function Fne(t){return function(){xz(this,t)}}function Kne(t,e){return function(){(e.apply(this,arguments)?Oz:xz)(this,t)}}function Jne(t,e){var n=mz(t+"");if(arguments.length<2){for(var r=Wk(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Kne:e?Gne:Fne)(n,e))}function ere(){this.textContent=""}function tre(t){return function(){this.textContent=t}}function nre(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function rre(t){return arguments.length?this.each(t==null?ere:(typeof t=="function"?nre:tre)(t)):this.node().textContent}function ire(){this.innerHTML=""}function sre(t){return function(){this.innerHTML=t}}function are(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function lre(t){return arguments.length?this.each(t==null?ire:(typeof t=="function"?are:sre)(t)):this.node().innerHTML}function ore(){this.nextSibling&&this.parentNode.appendChild(this)}function cre(){return this.each(ore)}function ure(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fre(){return this.each(ure)}function dre(t){var e=typeof t=="function"?t:cz(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function hre(){return null}function pre(t,e){var n=typeof t=="function"?t:cz(t),r=e==null?hre:typeof e=="function"?e:Uk(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function mre(){var t=this.parentNode;t&&t.removeChild(this)}function gre(){return this.each(mre)}function Ore(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function xre(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function yre(t){return this.select(t?xre:Ore)}function vre(t){return arguments.length?this.property("__data__",t):this.node().__data__}function bre(t){return function(e){t.call(this,e,this.__data__)}}function Sre(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function wre(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function kre(t,e,n){return function(){var r=this.__on,i,s=bre(e);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Qre(t,e,n){var r=Sre(t+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,f=o.length,h;u<f;++u)for(i=0,h=o[u];i<s;++i)if((a=r[i]).type===h.type&&a.name===h.name)return h.value}return}for(o=e?kre:wre,i=0;i<s;++i)this.each(o(r[i],e,n));return this}function yz(t,e,n){var r=pz(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Cre(t,e){return function(){return yz(this,t,e)}}function jre(t,e){return function(){return yz(this,t,e.apply(this,arguments))}}function Tre(t,e){return this.each((typeof e=="function"?jre:Cre)(t,e))}function*$re(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var vz=[null];function Vr(t,e){this._groups=t,this._parents=e}function Qp(){return new Vr([[document.documentElement]],vz)}function _re(){return this}Vr.prototype=Qp.prototype={constructor:Vr,select:nne,selectAll:ane,selectChild:une,selectChildren:pne,filter:mne,data:bne,enter:gne,exit:wne,join:kne,merge:Qne,selection:_re,order:Cne,sort:jne,call:$ne,nodes:_ne,node:Nne,size:Pne,empty:Ene,each:Ane,attr:Zne,style:Ine,property:Hne,classed:Jne,text:rre,html:lre,raise:cre,lower:fre,append:dre,insert:pre,remove:gre,clone:yre,datum:vre,on:Qre,dispatch:Tre,[Symbol.iterator]:$re};function Br(t){return typeof t=="string"?new Vr([[document.querySelector(t)]],[document.documentElement]):new Vr([[t]],vz)}function Nre(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Ti(t,e){if(t=Nre(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Pre={passive:!1},Xh={capture:!0,passive:!1};function A0(t){t.stopImmediatePropagation()}function uu(t){t.preventDefault(),t.stopImmediatePropagation()}function bz(t){var e=t.document.documentElement,n=Br(t).on("dragstart.drag",uu,Xh);"onselectstart"in e?n.on("selectstart.drag",uu,Xh):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Sz(t,e){var n=t.document.documentElement,r=Br(t).on("dragstart.drag",null);e&&(r.on("click.drag",uu,Xh),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Rg=t=>()=>t;function DS(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:s,x:a,y:o,dx:u,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}DS.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Ere(t){return!t.ctrlKey&&!t.button}function Are(){return this.parentNode}function Mre(t,e){return e??{x:t.x,y:t.y}}function Rre(){return navigator.maxTouchPoints||"ontouchstart"in this}function wz(){var t=Ere,e=Are,n=Mre,r=Rre,i={},s=Kx("start","drag","end"),a=0,o,u,f,h,m=0;function O(T){T.on("mousedown.drag",x).filter(r).on("touchstart.drag",k).on("touchmove.drag",w,Pre).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(T,N){if(!(h||!t.call(this,T,N))){var _=Q(this,e.call(this,T,N),T,N,"mouse");_&&(Br(T.view).on("mousemove.drag",v,Xh).on("mouseup.drag",S,Xh),bz(T.view),A0(T),f=!1,o=T.clientX,u=T.clientY,_("start",T))}}function v(T){if(uu(T),!f){var N=T.clientX-o,_=T.clientY-u;f=N*N+_*_>m}i.mouse("drag",T)}function S(T){Br(T.view).on("mousemove.drag mouseup.drag",null),Sz(T.view,f),uu(T),i.mouse("end",T)}function k(T,N){if(t.call(this,T,N)){var _=T.changedTouches,M=e.call(this,T,N),I=_.length,U,F;for(U=0;U<I;++U)(F=Q(this,M,T,N,_[U].identifier,_[U]))&&(A0(T),F("start",T,_[U]))}}function w(T){var N=T.changedTouches,_=N.length,M,I;for(M=0;M<_;++M)(I=i[N[M].identifier])&&(uu(T),I("drag",T,N[M]))}function j(T){var N=T.changedTouches,_=N.length,M,I;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),M=0;M<_;++M)(I=i[N[M].identifier])&&(A0(T),I("end",T,N[M]))}function Q(T,N,_,M,I,U){var F=s.copy(),Z=Ti(U||_,N),X,H,E;if((E=n.call(T,new DS("beforestart",{sourceEvent:_,target:O,identifier:I,active:a,x:Z[0],y:Z[1],dx:0,dy:0,dispatch:F}),M))!=null)return X=E.x-Z[0]||0,H=E.y-Z[1]||0,function q(R,z,B){var W=Z,A;switch(R){case"start":i[I]=q,A=a++;break;case"end":delete i[I],--a;case"drag":Z=Ti(B||z,N),A=a;break}F.call(R,T,new DS(R,{sourceEvent:z,subject:E,target:O,identifier:I,active:A,x:Z[0]+X,y:Z[1]+H,dx:Z[0]-W[0],dy:Z[1]-W[1],dispatch:F}),M)}}return O.filter=function(T){return arguments.length?(t=typeof T=="function"?T:Rg(!!T),O):t},O.container=function(T){return arguments.length?(e=typeof T=="function"?T:Rg(T),O):e},O.subject=function(T){return arguments.length?(n=typeof T=="function"?T:Rg(T),O):n},O.touchable=function(T){return arguments.length?(r=typeof T=="function"?T:Rg(!!T),O):r},O.on=function(){var T=s.on.apply(s,arguments);return T===s?O:T},O.clickDistance=function(T){return arguments.length?(m=(T=+T)*T,O):Math.sqrt(m)},O}function Hk(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function kz(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Cp(){}var Zh=.7,sx=1/Zh,fu="\\s*([+-]?\\d+)\\s*",Bh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Os="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zre=/^#([0-9a-f]{3,8})$/,Dre=new RegExp(`^rgb\\(${fu},${fu},${fu}\\)$`),Lre=new RegExp(`^rgb\\(${Os},${Os},${Os}\\)$`),Xre=new RegExp(`^rgba\\(${fu},${fu},${fu},${Bh}\\)$`),Zre=new RegExp(`^rgba\\(${Os},${Os},${Os},${Bh}\\)$`),Bre=new RegExp(`^hsl\\(${Bh},${Os},${Os}\\)$`),qre=new RegExp(`^hsla\\(${Bh},${Os},${Os},${Bh}\\)$`),kP={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hk(Cp,Mo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:QP,formatHex:QP,formatHex8:Vre,formatHsl:Ire,formatRgb:CP,toString:CP});function QP(){return this.rgb().formatHex()}function Vre(){return this.rgb().formatHex8()}function Ire(){return Qz(this).formatHsl()}function CP(){return this.rgb().formatRgb()}function Mo(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=zre.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?jP(e):n===3?new Sr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?zg(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?zg(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Dre.exec(t))?new Sr(e[1],e[2],e[3],1):(e=Lre.exec(t))?new Sr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Xre.exec(t))?zg(e[1],e[2],e[3],e[4]):(e=Zre.exec(t))?zg(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Bre.exec(t))?_P(e[1],e[2]/100,e[3]/100,1):(e=qre.exec(t))?_P(e[1],e[2]/100,e[3]/100,e[4]):kP.hasOwnProperty(t)?jP(kP[t]):t==="transparent"?new Sr(NaN,NaN,NaN,0):null}function jP(t){return new Sr(t>>16&255,t>>8&255,t&255,1)}function zg(t,e,n,r){return r<=0&&(t=e=n=NaN),new Sr(t,e,n,r)}function Yre(t){return t instanceof Cp||(t=Mo(t)),t?(t=t.rgb(),new Sr(t.r,t.g,t.b,t.opacity)):new Sr}function LS(t,e,n,r){return arguments.length===1?Yre(t):new Sr(t,e,n,r??1)}function Sr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Hk(Sr,LS,kz(Cp,{brighter(t){return t=t==null?sx:Math.pow(sx,t),new Sr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Zh:Math.pow(Zh,t),new Sr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Sr(To(this.r),To(this.g),To(this.b),ax(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:TP,formatHex:TP,formatHex8:Ure,formatRgb:$P,toString:$P}));function TP(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}`}function Ure(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}${Oo((isNaN(this.opacity)?1:this.opacity)*255)}`}function $P(){const t=ax(this.opacity);return`${t===1?"rgb(":"rgba("}${To(this.r)}, ${To(this.g)}, ${To(this.b)}${t===1?")":`, ${t})`}`}function ax(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function To(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oo(t){return t=To(t),(t<16?"0":"")+t.toString(16)}function _P(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ni(t,e,n,r)}function Qz(t){if(t instanceof Ni)return new Ni(t.h,t.s,t.l,t.opacity);if(t instanceof Cp||(t=Mo(t)),!t)return new Ni;if(t instanceof Ni)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),a=NaN,o=s-i,u=(s+i)/2;return o?(e===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-e)/o+2:a=(e-n)/o+4,o/=u<.5?s+i:2-s-i,a*=60):o=u>0&&u<1?0:a,new Ni(a,o,u,t.opacity)}function Wre(t,e,n,r){return arguments.length===1?Qz(t):new Ni(t,e,n,r??1)}function Ni(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Hk(Ni,Wre,kz(Cp,{brighter(t){return t=t==null?sx:Math.pow(sx,t),new Ni(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Zh:Math.pow(Zh,t),new Ni(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Sr(M0(t>=240?t-240:t+120,i,r),M0(t,i,r),M0(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ni(NP(this.h),Dg(this.s),Dg(this.l),ax(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ax(this.opacity);return`${t===1?"hsl(":"hsla("}${NP(this.h)}, ${Dg(this.s)*100}%, ${Dg(this.l)*100}%${t===1?")":`, ${t})`}`}}));function NP(t){return t=(t||0)%360,t<0?t+360:t}function Dg(t){return Math.max(0,Math.min(1,t||0))}function M0(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Gk=t=>()=>t;function Hre(t,e){return function(n){return t+n*e}}function Gre(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Fre(t){return(t=+t)==1?Cz:function(e,n){return n-e?Gre(e,n,t):Gk(isNaN(e)?n:e)}}function Cz(t,e){var n=e-t;return n?Hre(t,n):Gk(isNaN(t)?e:t)}const lx=(function t(e){var n=Fre(e);function r(i,s){var a=n((i=LS(i)).r,(s=LS(s)).r),o=n(i.g,s.g),u=n(i.b,s.b),f=Cz(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=u(h),i.opacity=f(h),i+""}}return r.gamma=t,r})(1);function Kre(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=t[i]*(1-s)+e[i]*s;return r}}function Jre(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function eie(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=ah(t[a],e[a]);for(;a<n;++a)s[a]=e[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function tie(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function ss(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function nie(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=ah(t[i],e[i]):r[i]=e[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var XS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,R0=new RegExp(XS.source,"g");function rie(t){return function(){return t}}function iie(t){return function(e){return t(e)+""}}function jz(t,e){var n=XS.lastIndex=R0.lastIndex=0,r,i,s,a=-1,o=[],u=[];for(t=t+"",e=e+"";(r=XS.exec(t))&&(i=R0.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,u.push({i:a,x:ss(r,i)})),n=R0.lastIndex;return n<e.length&&(s=e.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?u[0]?iie(u[0].x):rie(e):(e=u.length,function(f){for(var h=0,m;h<e;++h)o[(m=u[h]).i]=m.x(f);return o.join("")})}function ah(t,e){var n=typeof e,r;return e==null||n==="boolean"?Gk(e):(n==="number"?ss:n==="string"?(r=Mo(e))?(e=r,lx):jz:e instanceof Mo?lx:e instanceof Date?tie:Jre(e)?Kre:Array.isArray(e)?eie:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?nie:ss)(t,e)}var PP=180/Math.PI,ZS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tz(t,e,n,r,i,s){var a,o,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,u/=o),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*PP,skewX:Math.atan(u)*PP,scaleX:a,scaleY:o}}var Lg;function sie(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ZS:Tz(e.a,e.b,e.c,e.d,e.e,e.f)}function aie(t){return t==null||(Lg||(Lg=document.createElementNS("http://www.w3.org/2000/svg","g")),Lg.setAttribute("transform",t),!(t=Lg.transform.baseVal.consolidate()))?ZS:(t=t.matrix,Tz(t.a,t.b,t.c,t.d,t.e,t.f))}function $z(t,e,n,r){function i(f){return f.length?f.pop()+" ":""}function s(f,h,m,O,x,v){if(f!==m||h!==O){var S=x.push("translate(",null,e,null,n);v.push({i:S-4,x:ss(f,m)},{i:S-2,x:ss(h,O)})}else(m||O)&&x.push("translate("+m+e+O+n)}function a(f,h,m,O){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),O.push({i:m.push(i(m)+"rotate(",null,r)-2,x:ss(f,h)})):h&&m.push(i(m)+"rotate("+h+r)}function o(f,h,m,O){f!==h?O.push({i:m.push(i(m)+"skewX(",null,r)-2,x:ss(f,h)}):h&&m.push(i(m)+"skewX("+h+r)}function u(f,h,m,O,x,v){if(f!==m||h!==O){var S=x.push(i(x)+"scale(",null,",",null,")");v.push({i:S-4,x:ss(f,m)},{i:S-2,x:ss(h,O)})}else(m!==1||O!==1)&&x.push(i(x)+"scale("+m+","+O+")")}return function(f,h){var m=[],O=[];return f=t(f),h=t(h),s(f.translateX,f.translateY,h.translateX,h.translateY,m,O),a(f.rotate,h.rotate,m,O),o(f.skewX,h.skewX,m,O),u(f.scaleX,f.scaleY,h.scaleX,h.scaleY,m,O),f=h=null,function(x){for(var v=-1,S=O.length,k;++v<S;)m[(k=O[v]).i]=k.x(x);return m.join("")}}}var lie=$z(sie,"px, ","px)","deg)"),oie=$z(aie,", ",")",")"),cie=1e-12;function EP(t){return((t=Math.exp(t))+1/t)/2}function uie(t){return((t=Math.exp(t))-1/t)/2}function fie(t){return((t=Math.exp(2*t))-1)/(t+1)}const fO=(function t(e,n,r){function i(s,a){var o=s[0],u=s[1],f=s[2],h=a[0],m=a[1],O=a[2],x=h-o,v=m-u,S=x*x+v*v,k,w;if(S<cie)w=Math.log(O/f)/e,k=function(M){return[o+M*x,u+M*v,f*Math.exp(e*M*w)]};else{var j=Math.sqrt(S),Q=(O*O-f*f+r*S)/(2*f*n*j),T=(O*O-f*f-r*S)/(2*O*n*j),N=Math.log(Math.sqrt(Q*Q+1)-Q),_=Math.log(Math.sqrt(T*T+1)-T);w=(_-N)/e,k=function(M){var I=M*w,U=EP(N),F=f/(n*j)*(U*fie(e*I+N)-uie(N));return[o+F*x,u+F*v,f*U/EP(e*I+N)]}}return k.duration=w*1e3*e/Math.SQRT2,k}return i.rho=function(s){var a=Math.max(.001,+s),o=a*a,u=o*o;return t(a,o,u)},i})(Math.SQRT2,2,4);var Lu=0,Ad=0,Cd=0,_z=1e3,ox,Md,cx=0,Ro=0,ey=0,qh=typeof performance=="object"&&performance.now?performance:Date,Nz=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Fk(){return Ro||(Nz(die),Ro=qh.now()+ey)}function die(){Ro=0}function ux(){this._call=this._time=this._next=null}ux.prototype=Pz.prototype={constructor:ux,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Fk():+n)+(e==null?0:+e),!this._next&&Md!==this&&(Md?Md._next=this:ox=this,Md=this),this._call=t,this._time=n,BS()},stop:function(){this._call&&(this._call=null,this._time=1/0,BS())}};function Pz(t,e,n){var r=new ux;return r.restart(t,e,n),r}function hie(){Fk(),++Lu;for(var t=ox,e;t;)(e=Ro-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Lu}function AP(){Ro=(cx=qh.now())+ey,Lu=Ad=0;try{hie()}finally{Lu=0,mie(),Ro=0}}function pie(){var t=qh.now(),e=t-cx;e>_z&&(ey-=e,cx=t)}function mie(){for(var t,e=ox,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ox=n);Md=t,BS(r)}function BS(t){if(!Lu){Ad&&(Ad=clearTimeout(Ad));var e=t-Ro;e>24?(t<1/0&&(Ad=setTimeout(AP,t-qh.now()-ey)),Cd&&(Cd=clearInterval(Cd))):(Cd||(cx=qh.now(),Cd=setInterval(pie,_z)),Lu=1,Nz(AP))}}function MP(t,e,n){var r=new ux;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var gie=Kx("start","end","cancel","interrupt"),Oie=[],Ez=0,RP=1,qS=2,dO=3,zP=4,VS=5,hO=6;function ty(t,e,n,r,i,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;xie(t,n,{name:e,index:r,group:i,on:gie,tween:Oie,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ez})}function Kk(t,e){var n=Bi(t,e);if(n.state>Ez)throw new Error("too late; already scheduled");return n}function ws(t,e){var n=Bi(t,e);if(n.state>dO)throw new Error("too late; already running");return n}function Bi(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function xie(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Pz(s,0,n.time);function s(f){n.state=RP,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var h,m,O,x;if(n.state!==RP)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===dO)return MP(a);x.state===zP?(x.state=hO,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[h]):+h<e&&(x.state=hO,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete r[h])}if(MP(function(){n.state===dO&&(n.state=zP,n.timer.restart(o,n.delay,n.time),o(f))}),n.state=qS,n.on.call("start",t,t.__data__,n.index,n.group),n.state===qS){for(n.state=dO,i=new Array(O=n.tween.length),h=0,m=-1;h<O;++h)(x=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(i[++m]=x);i.length=m+1}}function o(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=VS,1),m=-1,O=i.length;++m<O;)i[m].call(t,h);n.state===VS&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=hO,n.timer.stop(),delete r[e];for(var f in r)return;delete t.__transition}}function pO(t,e){var n=t.__transition,r,i,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){s=!1;continue}i=r.state>qS&&r.state<VS,r.state=hO,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}s&&delete t.__transition}}function yie(t){return this.each(function(){pO(this,t)})}function vie(t,e){var n,r;return function(){var i=ws(this,t),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function bie(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=ws(this,t),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:e,value:n},u=0,f=i.length;u<f;++u)if(i[u].name===e){i[u]=o;break}u===f&&i.push(o)}s.tween=i}}function Sie(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Bi(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?vie:bie)(n,t,e))}function Jk(t,e,n){var r=t._id;return t.each(function(){var i=ws(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Bi(i,r).value[e]}}function Az(t,e){var n;return(typeof e=="number"?ss:e instanceof Mo?lx:(n=Mo(e))?(e=n,lx):jz)(t,e)}function wie(t){return function(){this.removeAttribute(t)}}function kie(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qie(t,e,n){var r,i=n+"",s;return function(){var a=this.getAttribute(t);return a===i?null:a===r?s:s=e(r=a,n)}}function Cie(t,e,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?s:s=e(r=a,n)}}function jie(t,e,n){var r,i,s;return function(){var a,o=n(this),u;return o==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=o+"",a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,o)))}}function Tie(t,e,n){var r,i,s;return function(){var a,o=n(this),u;return o==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=o+"",a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,o)))}}function $ie(t,e){var n=Jx(t),r=n==="transform"?oie:Az;return this.attrTween(t,typeof e=="function"?(n.local?Tie:jie)(n,r,Jk(this,"attr."+t,e)):e==null?(n.local?kie:wie)(n):(n.local?Cie:Qie)(n,r,e))}function _ie(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Nie(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Pie(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&Nie(t,s)),n}return i._value=e,i}function Eie(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&_ie(t,s)),n}return i._value=e,i}function Aie(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Jx(t);return this.tween(n,(r.local?Pie:Eie)(r,e))}function Mie(t,e){return function(){Kk(this,t).delay=+e.apply(this,arguments)}}function Rie(t,e){return e=+e,function(){Kk(this,t).delay=e}}function zie(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Mie:Rie)(e,t)):Bi(this.node(),e).delay}function Die(t,e){return function(){ws(this,t).duration=+e.apply(this,arguments)}}function Lie(t,e){return e=+e,function(){ws(this,t).duration=e}}function Xie(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Die:Lie)(e,t)):Bi(this.node(),e).duration}function Zie(t,e){if(typeof e!="function")throw new Error;return function(){ws(this,t).ease=e}}function Bie(t){var e=this._id;return arguments.length?this.each(Zie(e,t)):Bi(this.node(),e).ease}function qie(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ws(this,t).ease=n}}function Vie(t){if(typeof t!="function")throw new Error;return this.each(qie(this._id,t))}function Iie(t){typeof t!="function"&&(t=fz(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,o=r[i]=[],u,f=0;f<a;++f)(u=s[f])&&t.call(u,u.__data__,f,s)&&o.push(u);return new ha(r,this._parents,this._name,this._id)}function Yie(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var u=e[o],f=n[o],h=u.length,m=a[o]=new Array(h),O,x=0;x<h;++x)(O=u[x]||f[x])&&(m[x]=O);for(;o<r;++o)a[o]=e[o];return new ha(a,this._parents,this._name,this._id)}function Uie(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Wie(t,e,n){var r,i,s=Uie(e)?Kk:ws;return function(){var a=s(this,t),o=a.on;o!==r&&(i=(r=o).copy()).on(e,n),a.on=i}}function Hie(t,e){var n=this._id;return arguments.length<2?Bi(this.node(),n).on.on(t):this.each(Wie(n,t,e))}function Gie(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Fie(){return this.on("end.remove",Gie(this._id))}function Kie(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Uk(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],u=o.length,f=s[a]=new Array(u),h,m,O=0;O<u;++O)(h=o[O])&&(m=t.call(h,h.__data__,O,o))&&("__data__"in h&&(m.__data__=h.__data__),f[O]=m,ty(f[O],e,n,O,f,Bi(h,n)));return new ha(s,this._parents,e,n)}function Jie(t){var e=this._name,n=this._id;typeof t!="function"&&(t=uz(t));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var u=r[o],f=u.length,h,m=0;m<f;++m)if(h=u[m]){for(var O=t.call(h,h.__data__,m,u),x,v=Bi(h,n),S=0,k=O.length;S<k;++S)(x=O[S])&&ty(x,e,n,S,O,v);s.push(O),a.push(h)}return new ha(s,a,e,n)}var ese=Qp.prototype.constructor;function tse(){return new ese(this._groups,this._parents)}function nse(t,e){var n,r,i;return function(){var s=Du(this,t),a=(this.style.removeProperty(t),Du(this,t));return s===a?null:s===n&&a===r?i:i=e(n=s,r=a)}}function Mz(t){return function(){this.style.removeProperty(t)}}function rse(t,e,n){var r,i=n+"",s;return function(){var a=Du(this,t);return a===i?null:a===r?s:s=e(r=a,n)}}function ise(t,e,n){var r,i,s;return function(){var a=Du(this,t),o=n(this),u=o+"";return o==null&&(u=o=(this.style.removeProperty(t),Du(this,t))),a===u?null:a===r&&u===i?s:(i=u,s=e(r=a,o))}}function sse(t,e){var n,r,i,s="style."+e,a="end."+s,o;return function(){var u=ws(this,t),f=u.on,h=u.value[s]==null?o||(o=Mz(e)):void 0;(f!==n||i!==h)&&(r=(n=f).copy()).on(a,i=h),u.on=r}}function ase(t,e,n){var r=(t+="")=="transform"?lie:Az;return e==null?this.styleTween(t,nse(t,r)).on("end.style."+t,Mz(t)):typeof e=="function"?this.styleTween(t,ise(t,r,Jk(this,"style."+t,e))).each(sse(this._id,t)):this.styleTween(t,rse(t,r,e),n).on("end.style."+t,null)}function lse(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ose(t,e,n){var r,i;function s(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&lse(t,a,n)),r}return s._value=e,s}function cse(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,ose(t,e,n??""))}function use(t){return function(){this.textContent=t}}function fse(t){return function(){var e=t(this);this.textContent=e??""}}function dse(t){return this.tween("text",typeof t=="function"?fse(Jk(this,"text",t)):use(t==null?"":t+""))}function hse(t){return function(e){this.textContent=t.call(this,e)}}function pse(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&hse(i)),e}return r._value=t,r}function mse(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,pse(t))}function gse(){for(var t=this._name,e=this._id,n=Rz(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,u,f=0;f<o;++f)if(u=a[f]){var h=Bi(u,e);ty(u,t,n,f,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new ha(r,this._parents,t,n)}function Ose(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},u={value:function(){--i===0&&s()}};n.each(function(){var f=ws(this,r),h=f.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(u)),f.on=e}),i===0&&s()})}var xse=0;function ha(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Rz(){return++xse}var Ys=Qp.prototype;ha.prototype={constructor:ha,select:Kie,selectAll:Jie,selectChild:Ys.selectChild,selectChildren:Ys.selectChildren,filter:Iie,merge:Yie,selection:tse,transition:gse,call:Ys.call,nodes:Ys.nodes,node:Ys.node,size:Ys.size,empty:Ys.empty,each:Ys.each,on:Hie,attr:$ie,attrTween:Aie,style:ase,styleTween:cse,text:dse,textTween:mse,remove:Fie,tween:Sie,delay:zie,duration:Xie,ease:Bie,easeVarying:Vie,end:Ose,[Symbol.iterator]:Ys[Symbol.iterator]};function yse(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vse={time:null,delay:0,duration:250,ease:yse};function bse(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Sse(t){var e,n;t instanceof ha?(e=t._id,t=t._name):(e=Rz(),(n=vse).time=Fk(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,u,f=0;f<o;++f)(u=a[f])&&ty(u,t,e,f,a,n||bse(u,e));return new ha(r,this._parents,t,e)}Qp.prototype.interrupt=yie;Qp.prototype.transition=Sse;const Xg=t=>()=>t;function wse(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Js(t,e,n){this.k=t,this.x=e,this.y=n}Js.prototype={constructor:Js,scale:function(t){return t===1?this:new Js(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Js(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ny=new Js(1,0,0);zz.prototype=Js.prototype;function zz(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ny;return t.__zoom}function z0(t){t.stopImmediatePropagation()}function jd(t){t.preventDefault(),t.stopImmediatePropagation()}function kse(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Qse(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function DP(){return this.__zoom||ny}function Cse(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function jse(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tse(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function Dz(){var t=kse,e=Qse,n=Tse,r=Cse,i=jse,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,u=fO,f=Kx("start","zoom","end"),h,m,O,x=500,v=150,S=0,k=10;function w(E){E.property("__zoom",DP).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",Z).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(E,q,R,z){var B=E.selection?E.selection():E;B.property("__zoom",DP),E!==B?N(E,q,R,z):B.interrupt().each(function(){_(this,arguments).event(z).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},w.scaleBy=function(E,q,R,z){w.scaleTo(E,function(){var B=this.__zoom.k,W=typeof q=="function"?q.apply(this,arguments):q;return B*W},R,z)},w.scaleTo=function(E,q,R,z){w.transform(E,function(){var B=e.apply(this,arguments),W=this.__zoom,A=R==null?T(B):typeof R=="function"?R.apply(this,arguments):R,D=W.invert(A),Y=typeof q=="function"?q.apply(this,arguments):q;return n(Q(j(W,Y),A,D),B,a)},R,z)},w.translateBy=function(E,q,R,z){w.transform(E,function(){return n(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof R=="function"?R.apply(this,arguments):R),e.apply(this,arguments),a)},null,z)},w.translateTo=function(E,q,R,z,B){w.transform(E,function(){var W=e.apply(this,arguments),A=this.__zoom,D=z==null?T(W):typeof z=="function"?z.apply(this,arguments):z;return n(ny.translate(D[0],D[1]).scale(A.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof R=="function"?-R.apply(this,arguments):-R),W,a)},z,B)};function j(E,q){return q=Math.max(s[0],Math.min(s[1],q)),q===E.k?E:new Js(q,E.x,E.y)}function Q(E,q,R){var z=q[0]-R[0]*E.k,B=q[1]-R[1]*E.k;return z===E.x&&B===E.y?E:new Js(E.k,z,B)}function T(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function N(E,q,R,z){E.on("start.zoom",function(){_(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(z).end()}).tween("zoom",function(){var B=this,W=arguments,A=_(B,W).event(z),D=e.apply(B,W),Y=R==null?T(D):typeof R=="function"?R.apply(B,W):R,P=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),ee=B.__zoom,ae=typeof q=="function"?q.apply(B,W):q,ne=u(ee.invert(Y).concat(P/ee.k),ae.invert(Y).concat(P/ae.k));return function(fe){if(fe===1)fe=ae;else{var oe=ne(fe),me=P/oe[2];fe=new Js(me,Y[0]-oe[0]*me,Y[1]-oe[1]*me)}A.zoom(null,fe)}})}function _(E,q,R){return!R&&E.__zooming||new M(E,q)}function M(E,q){this.that=E,this.args=q,this.active=0,this.sourceEvent=null,this.extent=e.apply(E,q),this.taps=0}M.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,q){return this.mouse&&E!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var q=Br(this.that).datum();f.call(E,this.that,new wse(E,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:f}),q)}};function I(E,...q){if(!t.apply(this,arguments))return;var R=_(this,q).event(E),z=this.__zoom,B=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),W=Ti(E);if(R.wheel)(R.mouse[0][0]!==W[0]||R.mouse[0][1]!==W[1])&&(R.mouse[1]=z.invert(R.mouse[0]=W)),clearTimeout(R.wheel);else{if(z.k===B)return;R.mouse=[W,z.invert(W)],pO(this),R.start()}jd(E),R.wheel=setTimeout(A,v),R.zoom("mouse",n(Q(j(z,B),R.mouse[0],R.mouse[1]),R.extent,a));function A(){R.wheel=null,R.end()}}function U(E,...q){if(O||!t.apply(this,arguments))return;var R=E.currentTarget,z=_(this,q,!0).event(E),B=Br(E.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",P,!0),W=Ti(E,R),A=E.clientX,D=E.clientY;bz(E.view),z0(E),z.mouse=[W,this.__zoom.invert(W)],pO(this),z.start();function Y(ee){if(jd(ee),!z.moved){var ae=ee.clientX-A,ne=ee.clientY-D;z.moved=ae*ae+ne*ne>S}z.event(ee).zoom("mouse",n(Q(z.that.__zoom,z.mouse[0]=Ti(ee,R),z.mouse[1]),z.extent,a))}function P(ee){B.on("mousemove.zoom mouseup.zoom",null),Sz(ee.view,z.moved),jd(ee),z.event(ee).end()}}function F(E,...q){if(t.apply(this,arguments)){var R=this.__zoom,z=Ti(E.changedTouches?E.changedTouches[0]:E,this),B=R.invert(z),W=R.k*(E.shiftKey?.5:2),A=n(Q(j(R,W),z,B),e.apply(this,q),a);jd(E),o>0?Br(this).transition().duration(o).call(N,A,z,E):Br(this).call(w.transform,A,z,E)}}function Z(E,...q){if(t.apply(this,arguments)){var R=E.touches,z=R.length,B=_(this,q,E.changedTouches.length===z).event(E),W,A,D,Y;for(z0(E),A=0;A<z;++A)D=R[A],Y=Ti(D,this),Y=[Y,this.__zoom.invert(Y),D.identifier],B.touch0?!B.touch1&&B.touch0[2]!==Y[2]&&(B.touch1=Y,B.taps=0):(B.touch0=Y,W=!0,B.taps=1+!!h);h&&(h=clearTimeout(h)),W&&(B.taps<2&&(m=Y[0],h=setTimeout(function(){h=null},x)),pO(this),B.start())}}function X(E,...q){if(this.__zooming){var R=_(this,q).event(E),z=E.changedTouches,B=z.length,W,A,D,Y;for(jd(E),W=0;W<B;++W)A=z[W],D=Ti(A,this),R.touch0&&R.touch0[2]===A.identifier?R.touch0[0]=D:R.touch1&&R.touch1[2]===A.identifier&&(R.touch1[0]=D);if(A=R.that.__zoom,R.touch1){var P=R.touch0[0],ee=R.touch0[1],ae=R.touch1[0],ne=R.touch1[1],fe=(fe=ae[0]-P[0])*fe+(fe=ae[1]-P[1])*fe,oe=(oe=ne[0]-ee[0])*oe+(oe=ne[1]-ee[1])*oe;A=j(A,Math.sqrt(fe/oe)),D=[(P[0]+ae[0])/2,(P[1]+ae[1])/2],Y=[(ee[0]+ne[0])/2,(ee[1]+ne[1])/2]}else if(R.touch0)D=R.touch0[0],Y=R.touch0[1];else return;R.zoom("touch",n(Q(A,D,Y),R.extent,a))}}function H(E,...q){if(this.__zooming){var R=_(this,q).event(E),z=E.changedTouches,B=z.length,W,A;for(z0(E),O&&clearTimeout(O),O=setTimeout(function(){O=null},x),W=0;W<B;++W)A=z[W],R.touch0&&R.touch0[2]===A.identifier?delete R.touch0:R.touch1&&R.touch1[2]===A.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(A=Ti(A,this),Math.hypot(m[0]-A[0],m[1]-A[1])<k)){var D=Br(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return w.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Xg(+E),w):r},w.filter=function(E){return arguments.length?(t=typeof E=="function"?E:Xg(!!E),w):t},w.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Xg(!!E),w):i},w.extent=function(E){return arguments.length?(e=typeof E=="function"?E:Xg([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),w):e},w.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],w):[s[0],s[1]]},w.translateExtent=function(E){return arguments.length?(a[0][0]=+E[0][0],a[1][0]=+E[1][0],a[0][1]=+E[0][1],a[1][1]=+E[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(E){return arguments.length?(n=E,w):n},w.duration=function(E){return arguments.length?(o=+E,w):o},w.interpolate=function(E){return arguments.length?(u=E,w):u},w.on=function(){var E=f.on.apply(f,arguments);return E===f?w:E},w.clickDistance=function(E){return arguments.length?(S=(E=+E)*E,w):Math.sqrt(S)},w.tapDistance=function(E){return arguments.length?(k=+E,w):k},w}const ys={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:r}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Vh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Lz=["Enter"," ","Escape"],Xz={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Xu;(function(t){t.Strict="strict",t.Loose="loose"})(Xu||(Xu={}));var $o;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})($o||($o={}));var Ih;(function(t){t.Partial="partial",t.Full="full"})(Ih||(Ih={}));const Zz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ll;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(ll||(ll={}));var fx;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(fx||(fx={}));var $e;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})($e||($e={}));const LP={[$e.Left]:$e.Right,[$e.Right]:$e.Left,[$e.Top]:$e.Bottom,[$e.Bottom]:$e.Top};function Bz(t){return t===null?null:t?"valid":"invalid"}const qz=t=>"id"in t&&"source"in t&&"target"in t,$se=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),e2=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),jp=(t,e=[0,0])=>{const{width:n,height:r}=xa(t),i=t.origin??e,s=n*i[0],a=r*i[1];return{x:t.position.x-s,y:t.position.y-a}},_se=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,i)=>{const s=typeof i=="string";let a=!e.nodeLookup&&!s?i:void 0;e.nodeLookup&&(a=s?e.nodeLookup.get(i):e2(i)?i:e.nodeLookup.get(i.id));const o=a?dx(a,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ry(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return iy(n)},Tp=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return t.forEach(i=>{(e.filter===void 0||e.filter(i))&&(n=ry(n,dx(i)),r=!0)}),r?iy(n):{x:0,y:0,width:0,height:0}},t2=(t,e,[n,r,i]=[0,0,1],s=!1,a=!1)=>{const o={..._p(e,[n,r,i]),width:e.width/i,height:e.height/i},u=[];for(const f of t.values()){const{measured:h,selectable:m=!0,hidden:O=!1}=f;if(a&&!m||O)continue;const x=h.width??f.width??f.initialWidth??null,v=h.height??f.height??f.initialHeight??null,S=Yh(o,Bu(f)),k=(x??0)*(v??0),w=s&&S>0;(!f.internals.handleBounds||w||S>=k||f.dragging)&&u.push(f)}return u},Nse=(t,e)=>{const n=new Set;return t.forEach(r=>{n.add(r.id)}),e.filter(r=>n.has(r.source)||n.has(r.target))};function Pse(t,e){const n=new Map,r=e!=null&&e.nodes?new Set(e.nodes.map(i=>i.id)):null;return t.forEach(i=>{i.measured.width&&i.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Ese({nodes:t,width:e,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(t.size===0)return Promise.resolve(!0);const o=Pse(t,a),u=Tp(o),f=n2(u,e,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await r.setViewport(f,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function Vz({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const a=n.get(t),o=a.parentId?n.get(a.parentId):void 0,{x:u,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},h=a.origin??r;let m=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!o)s==null||s("005",ys.error005());else{const x=o.measured.width,v=o.measured.height;x&&v&&(m=[[u,f],[u+x,f+v]])}else o&&qu(a.extent)&&(m=[[a.extent[0][0]+u,a.extent[0][1]+f],[a.extent[1][0]+u,a.extent[1][1]+f]]);const O=qu(m)?zo(e,m,a.measured):e;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",ys.error015())),{position:{x:O.x-u+(a.measured.width??0)*h[0],y:O.y-f+(a.measured.height??0)*h[1]},positionAbsolute:O}}async function Ase({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(t.map(O=>O.id)),a=[];for(const O of n){if(O.deletable===!1)continue;const x=s.has(O.id),v=!x&&O.parentId&&a.find(S=>S.id===O.parentId);(x||v)&&a.push(O)}const o=new Set(e.map(O=>O.id)),u=r.filter(O=>O.deletable!==!1),h=Nse(a,u);for(const O of u)o.has(O.id)&&!h.find(v=>v.id===O.id)&&h.push(O);if(!i)return{edges:h,nodes:a};const m=await i({nodes:a,edges:h});return typeof m=="boolean"?m?{edges:h,nodes:a}:{edges:[],nodes:[]}:m}const Zu=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),zo=(t={x:0,y:0},e,n)=>({x:Zu(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:Zu(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function Iz(t,e,n){const{width:r,height:i}=xa(n),{x:s,y:a}=n.internals.positionAbsolute;return zo(t,[[s,a],[s+r,a+i]],e)}const XP=(t,e,n)=>t<e?Zu(Math.abs(t-e),1,e)/e:t>n?-Zu(Math.abs(t-n),1,e)/e:0,Yz=(t,e,n=15,r=40)=>{const i=XP(t.x,r,e.width-r)*n,s=XP(t.y,r,e.height-r)*n;return[i,s]},ry=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),IS=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),iy=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),Bu=(t,e=[0,0])=>{var i,s;const{x:n,y:r}=e2(t)?t.internals.positionAbsolute:jp(t,e);return{x:n,y:r,width:((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},dx=(t,e=[0,0])=>{var i,s;const{x:n,y:r}=e2(t)?t.internals.positionAbsolute:jp(t,e);return{x:n,y:r,x2:n+(((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0),y2:r+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},Uz=(t,e)=>iy(ry(IS(t),IS(e))),Yh=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),r=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*r)},ZP=t=>Ei(t.width)&&Ei(t.height)&&Ei(t.x)&&Ei(t.y),Ei=t=>!isNaN(t)&&isFinite(t),Mse=(t,e)=>{},$p=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),_p=({x:t,y:e},[n,r,i],s=!1,a=[1,1])=>{const o={x:(t-n)/i,y:(e-r)/i};return s?$p(o,a):o},hx=({x:t,y:e},[n,r,i])=>({x:t*i+n,y:e*i+r});function Lc(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Rse(t,e,n){if(typeof t=="string"||typeof t=="number"){const r=Lc(t,n),i=Lc(t,e);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof t=="object"){const r=Lc(t.top??t.y??0,n),i=Lc(t.bottom??t.y??0,n),s=Lc(t.left??t.x??0,e),a=Lc(t.right??t.x??0,e);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zse(t,e,n,r,i,s){const{x:a,y:o}=hx(t,[e,n,r]),{x:u,y:f}=hx({x:t.x+t.width,y:t.y+t.height},[e,n,r]),h=i-u,m=s-f;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(h),bottom:Math.floor(m)}}const n2=(t,e,n,r,i,s)=>{const a=Rse(s,e,n),o=(e-a.x)/t.width,u=(n-a.y)/t.height,f=Math.min(o,u),h=Zu(f,r,i),m=t.x+t.width/2,O=t.y+t.height/2,x=e/2-m*h,v=n/2-O*h,S=zse(t,x,v,h,e,n),k={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:x-k.left+k.right,y:v-k.top+k.bottom,zoom:h}},Uh=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function qu(t){return t!=null&&t!=="parent"}function xa(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function Wz(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function Hz(t,e={width:0,height:0},n,r,i){const s={...t},a=r.get(n);if(a){const o=a.origin||i;s.x+=a.internals.positionAbsolute.x-(e.width??0)*o[0],s.y+=a.internals.positionAbsolute.y-(e.height??0)*o[1]}return s}function BP(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Dse(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}function Lse(t){return{...Xz,...t||{}}}function lh(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:a}=Ai(t),o=_p({x:s-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},r),{x:u,y:f}=n?$p(o,e):o;return{xSnapped:u,ySnapped:f,...o}}const r2=t=>({width:t.offsetWidth,height:t.offsetHeight}),Gz=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Xse=["INPUT","SELECT","TEXTAREA"];function Fz(t){var r,i;const e=((i=(r=t.composedPath)==null?void 0:r.call(t))==null?void 0:i[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:Xse.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Kz=t=>"clientX"in t,Ai=(t,e)=>{var s,a;const n=Kz(t),r=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,i=n?t.clientY:(a=t.touches)==null?void 0:a[0].clientY;return{x:r-((e==null?void 0:e.left)??0),y:i-((e==null?void 0:e.top)??0)}},qP=(t,e,n,r,i)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...r2(a)}})};function Jz({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:o}){const u=t*.125+i*.375+a*.375+n*.125,f=e*.125+s*.375+o*.375+r*.125,h=Math.abs(u-t),m=Math.abs(f-e);return[u,f,h,m]}function Zg(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function VP({pos:t,x1:e,y1:n,x2:r,y2:i,c:s}){switch(t){case $e.Left:return[e-Zg(e-r,s),n];case $e.Right:return[e+Zg(r-e,s),n];case $e.Top:return[e,n-Zg(n-i,s)];case $e.Bottom:return[e,n+Zg(i-n,s)]}}function e4({sourceX:t,sourceY:e,sourcePosition:n=$e.Bottom,targetX:r,targetY:i,targetPosition:s=$e.Top,curvature:a=.25}){const[o,u]=VP({pos:n,x1:t,y1:e,x2:r,y2:i,c:a}),[f,h]=VP({pos:s,x1:r,y1:i,x2:t,y2:e,c:a}),[m,O,x,v]=Jz({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:o,sourceControlY:u,targetControlX:f,targetControlY:h});return[`M${t},${e} C${o},${u} ${f},${h} ${r},${i}`,m,O,x,v]}function t4({sourceX:t,sourceY:e,targetX:n,targetY:r}){const i=Math.abs(n-t)/2,s=n<t?n+i:n-i,a=Math.abs(r-e)/2,o=r<e?r+a:r-a;return[s,o,i,a]}function Zse({sourceNode:t,targetNode:e,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const a=i&&n?r+1e3:r,o=Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0);return a+o}function Bse({sourceNode:t,targetNode:e,width:n,height:r,transform:i}){const s=ry(dx(t),dx(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Yh(a,iy(s))>0}const qse=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`xy-edge__${t}${e||""}-${n}${r||""}`,Vse=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),Ise=(t,e,n={})=>{if(!t.source||!t.target)return e;const r=n.getEdgeId||qse;let i;return qz(t)?i={...t}:i={...t,id:r(t)},Vse(i,e)?e:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,e.concat(i))};function n4({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[i,s,a,o]=t4({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,i,s,a,o]}const IP={[$e.Left]:{x:-1,y:0},[$e.Right]:{x:1,y:0},[$e.Top]:{x:0,y:-1},[$e.Bottom]:{x:0,y:1}},Yse=({source:t,sourcePosition:e=$e.Bottom,target:n})=>e===$e.Left||e===$e.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},YP=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function Use({source:t,sourcePosition:e=$e.Bottom,target:n,targetPosition:r=$e.Top,center:i,offset:s,stepPosition:a}){const o=IP[e],u=IP[r],f={x:t.x+o.x*s,y:t.y+o.y*s},h={x:n.x+u.x*s,y:n.y+u.y*s},m=Yse({source:f,sourcePosition:e,target:h}),O=m.x!==0?"x":"y",x=m[O];let v=[],S,k;const w={x:0,y:0},j={x:0,y:0},[,,Q,T]=t4({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(o[O]*u[O]===-1){O==="x"?(S=i.x??f.x+(h.x-f.x)*a,k=i.y??(f.y+h.y)/2):(S=i.x??(f.x+h.x)/2,k=i.y??f.y+(h.y-f.y)*a);const _=[{x:S,y:f.y},{x:S,y:h.y}],M=[{x:f.x,y:k},{x:h.x,y:k}];o[O]===x?v=O==="x"?_:M:v=O==="x"?M:_}else{const _=[{x:f.x,y:h.y}],M=[{x:h.x,y:f.y}];if(O==="x"?v=o.x===x?M:_:v=o.y===x?_:M,e===r){const X=Math.abs(t[O]-n[O]);if(X<=s){const H=Math.min(s-1,s-X);o[O]===x?w[O]=(f[O]>t[O]?-1:1)*H:j[O]=(h[O]>n[O]?-1:1)*H}}if(e!==r){const X=O==="x"?"y":"x",H=o[O]===u[X],E=f[X]>h[X],q=f[X]<h[X];(o[O]===1&&(!H&&E||H&&q)||o[O]!==1&&(!H&&q||H&&E))&&(v=O==="x"?_:M)}const I={x:f.x+w.x,y:f.y+w.y},U={x:h.x+j.x,y:h.y+j.y},F=Math.max(Math.abs(I.x-v[0].x),Math.abs(U.x-v[0].x)),Z=Math.max(Math.abs(I.y-v[0].y),Math.abs(U.y-v[0].y));F>=Z?(S=(I.x+U.x)/2,k=v[0].y):(S=v[0].x,k=(I.y+U.y)/2)}return[[t,{x:f.x+w.x,y:f.y+w.y},...v,{x:h.x+j.x,y:h.y+j.y},n],S,k,Q,T]}function Wse(t,e,n,r){const i=Math.min(YP(t,e)/2,YP(e,n)/2,r),{x:s,y:a}=e;if(t.x===s&&s===n.x||t.y===a&&a===n.y)return`L${s} ${a}`;if(t.y===a){const f=t.x<n.x?-1:1,h=t.y<n.y?1:-1;return`L ${s+i*f},${a}Q ${s},${a} ${s},${a+i*h}`}const o=t.x<n.x?1:-1,u=t.y<n.y?-1:1;return`L ${s},${a+i*u}Q ${s},${a} ${s+i*o},${a}`}function YS({sourceX:t,sourceY:e,sourcePosition:n=$e.Bottom,targetX:r,targetY:i,targetPosition:s=$e.Top,borderRadius:a=5,centerX:o,centerY:u,offset:f=20,stepPosition:h=.5}){const[m,O,x,v,S]=Use({source:{x:t,y:e},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:o,y:u},offset:f,stepPosition:h});return[m.reduce((w,j,Q)=>{let T="";return Q>0&&Q<m.length-1?T=Wse(m[Q-1],j,m[Q+1],a):T=`${Q===0?"M":"L"}${j.x} ${j.y}`,w+=T,w},""),O,x,v,S]}function UP(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Hse(t){var m;const{sourceNode:e,targetNode:n}=t;if(!UP(e)||!UP(n))return null;const r=e.internals.handleBounds||WP(e.handles),i=n.internals.handleBounds||WP(n.handles),s=HP((r==null?void 0:r.source)??[],t.sourceHandle),a=HP(t.connectionMode===Xu.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),t.targetHandle);if(!s||!a)return(m=t.onError)==null||m.call(t,"008",ys.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const o=(s==null?void 0:s.position)||$e.Bottom,u=(a==null?void 0:a.position)||$e.Top,f=Do(e,s,o),h=Do(n,a,u);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:o,targetPosition:u}}function WP(t){if(!t)return null;const e=[],n=[];for(const r of t)r.width=r.width??1,r.height=r.height??1,r.type==="source"?e.push(r):r.type==="target"&&n.push(r);return{source:e,target:n}}function Do(t,e,n=$e.Left,r=!1){const i=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:a,height:o}=e??xa(t);if(r)return{x:i+a/2,y:s+o/2};switch((e==null?void 0:e.position)??n){case $e.Top:return{x:i+a/2,y:s};case $e.Right:return{x:i+a,y:s+o/2};case $e.Bottom:return{x:i+a/2,y:s+o};case $e.Left:return{x:i,y:s+o/2}}}function HP(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function US(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`:""}function Gse(t,{id:e,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return t.reduce((a,o)=>([o.markerStart||r,o.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const f=US(u,e);s.has(f)||(a.push({id:f,color:u.color||n,...u}),s.add(f))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const r4=1e3,Fse=10,i2={nodeOrigin:[0,0],nodeExtent:Vh,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Kse={...i2,checkEquality:!0};function s2(t,e){const n={...t};for(const r in e)e[r]!==void 0&&(n[r]=e[r]);return n}function Jse(t,e,n){const r=s2(i2,n);for(const i of t.values())if(i.parentId)l2(i,t,e,r);else{const s=jp(i,r.nodeOrigin),a=qu(i.extent)?i.extent:r.nodeExtent,o=zo(s,a,xa(i));i.internals.positionAbsolute=o}}function eae(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],r=[];for(const i of t.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:t.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function a2(t){return t==="manual"}function WS(t,e,n,r={}){var f,h;const i=s2(Kse,r),s={i:0},a=new Map(e),o=i!=null&&i.elevateNodesOnSelect&&!a2(i.zIndexMode)?r4:0;let u=t.length>0;e.clear(),n.clear();for(const m of t){let O=a.get(m.id);if(i.checkEquality&&m===(O==null?void 0:O.internals.userNode))e.set(m.id,O);else{const x=jp(m,i.nodeOrigin),v=qu(m.extent)?m.extent:i.nodeExtent,S=zo(x,v,xa(m));O={...i.defaults,...m,measured:{width:(f=m.measured)==null?void 0:f.width,height:(h=m.measured)==null?void 0:h.height},internals:{positionAbsolute:S,handleBounds:eae(m,O),z:i4(m,o,i.zIndexMode),userNode:m}},e.set(m.id,O)}(O.measured===void 0||O.measured.width===void 0||O.measured.height===void 0)&&!O.hidden&&(u=!1),m.parentId&&l2(O,e,n,r,s)}return u}function tae(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function l2(t,e,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:o,zIndexMode:u}=s2(i2,r),f=t.parentId,h=e.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}tae(t,n),i&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++i.i,h.internals.z=h.internals.z+i.i*Fse),i&&h.internals.rootParentIndex!==void 0&&(i.i=h.internals.rootParentIndex);const m=s&&!a2(u)?r4:0,{x:O,y:x,z:v}=nae(t,h,a,o,m,u),{positionAbsolute:S}=t.internals,k=O!==S.x||x!==S.y;(k||v!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:k?{x:O,y:x}:S,z:v}})}function i4(t,e,n){const r=Ei(t.zIndex)?t.zIndex:0;return a2(n)?r:r+(t.selected?e:0)}function nae(t,e,n,r,i,s){const{x:a,y:o}=e.internals.positionAbsolute,u=xa(t),f=jp(t,n),h=qu(t.extent)?zo(f,t.extent,u):f;let m=zo({x:a+h.x,y:o+h.y},r,u);t.extent==="parent"&&(m=Iz(m,u,e));const O=i4(t,i,s),x=e.internals.z??0;return{x:m.x,y:m.y,z:x>=O?x+1:O}}function o2(t,e,n,r=[0,0]){var a;const i=[],s=new Map;for(const o of t){const u=e.get(o.parentId);if(!u)continue;const f=((a=s.get(o.parentId))==null?void 0:a.expandedRect)??Bu(u),h=Uz(f,o.rect);s.set(o.parentId,{expandedRect:h,parent:u})}return s.size>0&&s.forEach(({expandedRect:o,parent:u},f)=>{var Q;const h=u.internals.positionAbsolute,m=xa(u),O=u.origin??r,x=o.x<h.x?Math.round(Math.abs(h.x-o.x)):0,v=o.y<h.y?Math.round(Math.abs(h.y-o.y)):0,S=Math.max(m.width,Math.round(o.width)),k=Math.max(m.height,Math.round(o.height)),w=(S-m.width)*O[0],j=(k-m.height)*O[1];(x>0||v>0||w||j)&&(i.push({id:f,type:"position",position:{x:u.position.x-x+w,y:u.position.y-v+j}}),(Q=n.get(f))==null||Q.forEach(T=>{t.some(N=>N.id===T.id)||i.push({id:T.id,type:"position",position:{x:T.position.x+x,y:T.position.y+v}})})),(m.width<o.width||m.height<o.height||x||v)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:S+(x?O[0]*x-w:0),height:k+(v?O[1]*v-j:0)}})}),i}function rae(t,e,n,r,i,s,a){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!o)return{changes:[],updatedInternals:u};const f=[],h=window.getComputedStyle(o),{m22:m}=new window.DOMMatrixReadOnly(h.transform),O=[];for(const x of t.values()){const v=e.get(x.id);if(!v)continue;if(v.hidden){e.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),u=!0;continue}const S=r2(x.nodeElement),k=v.measured.width!==S.width||v.measured.height!==S.height;if(!!(S.width&&S.height&&(k||!v.internals.handleBounds||x.force))){const j=x.nodeElement.getBoundingClientRect(),Q=qu(v.extent)?v.extent:s;let{positionAbsolute:T}=v.internals;v.parentId&&v.extent==="parent"?T=Iz(T,S,e.get(v.parentId)):Q&&(T=zo(T,Q,S));const N={...v,measured:S,internals:{...v.internals,positionAbsolute:T,handleBounds:{source:qP("source",x.nodeElement,j,m,v.id),target:qP("target",x.nodeElement,j,m,v.id)}}};e.set(v.id,N),v.parentId&&l2(N,e,n,{nodeOrigin:i,zIndexMode:a}),u=!0,k&&(f.push({id:v.id,type:"dimensions",dimensions:S}),v.expandParent&&v.parentId&&O.push({id:v.id,parentId:v.parentId,rect:Bu(N,i)}))}}if(O.length>0){const x=o2(O,e,n,i);f.push(...x)}return{changes:f,updatedInternals:u}}async function iae({delta:t,panZoom:e,transform:n,translateExtent:r,width:i,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,s]],r),o=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(o)}function GP(t,e,n,r,i,s){let a=i;const o=r.get(a)||new Map;r.set(a,o.set(n,e)),a=`${i}-${t}`;const u=r.get(a)||new Map;if(r.set(a,u.set(n,e)),s){a=`${i}-${t}-${s}`;const f=r.get(a)||new Map;r.set(a,f.set(n,e))}}function s4(t,e,n){t.clear(),e.clear();for(const r of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:o=null}=r,u={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:o},f=`${i}-${a}--${s}-${o}`,h=`${s}-${o}--${i}-${a}`;GP("source",u,h,t,i,a),GP("target",u,f,t,s,o),e.set(r.id,r)}}function a4(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:a4(n,e):!1}function FP(t,e,n){var i;let r=t;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,e))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function sae(t,e,n,r){const i=new Map;for(const[s,a]of t)if((a.selected||a.id===r)&&(!a.parentId||!a4(a,t))&&(a.draggable||e&&typeof a.draggable>"u")){const o=t.get(s);o&&i.set(s,{id:s,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return i}function D0({nodeId:t,dragItems:e,nodeLookup:n,dragging:r=!0}){var a,o,u;const i=[];for(const[f,h]of e){const m=(a=n.get(f))==null?void 0:a.internals.userNode;m&&i.push({...m,position:h.position,dragging:r})}if(!t)return[i[0],i];const s=(o=n.get(t))==null?void 0:o.internals.userNode;return[s?{...s,position:((u=e.get(t))==null?void 0:u.position)||s.position,dragging:r}:i[0],i]}function aae({dragItems:t,snapGrid:e,x:n,y:r}){const i=t.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},a=$p(s,e);return{x:a.x-s.x,y:a.y-s.y}}function lae({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,o=new Map,u=!1,f={x:0,y:0},h=null,m=!1,O=null,x=!1,v=!1,S=null;function k({noDragClassName:j,handleSelector:Q,domNode:T,isSelectable:N,nodeId:_,nodeClickDistance:M=0}){O=Br(T);function I({x:X,y:H}){const{nodeLookup:E,nodeExtent:q,snapGrid:R,snapToGrid:z,nodeOrigin:B,onNodeDrag:W,onSelectionDrag:A,onError:D,updateNodePositions:Y}=e();s={x:X,y:H};let P=!1;const ee=o.size>1,ae=ee&&q?IS(Tp(o)):null,ne=ee&&z?aae({dragItems:o,snapGrid:R,x:X,y:H}):null;for(const[fe,oe]of o){if(!E.has(fe))continue;let me={x:X-oe.distance.x,y:H-oe.distance.y};z&&(me=ne?{x:Math.round(me.x+ne.x),y:Math.round(me.y+ne.y)}:$p(me,R));let je=null;if(ee&&q&&!oe.extent&&ae){const{positionAbsolute:Qe}=oe.internals,Le=Qe.x-ae.x+q[0][0],He=Qe.x+oe.measured.width-ae.x2+q[1][0],ze=Qe.y-ae.y+q[0][1],vt=Qe.y+oe.measured.height-ae.y2+q[1][1];je=[[Le,ze],[He,vt]]}const{position:ke,positionAbsolute:we}=Vz({nodeId:fe,nextPosition:me,nodeLookup:E,nodeExtent:je||q,nodeOrigin:B,onError:D});P=P||oe.position.x!==ke.x||oe.position.y!==ke.y,oe.position=ke,oe.internals.positionAbsolute=we}if(v=v||P,!!P&&(Y(o,!0),S&&(r||W||!_&&A))){const[fe,oe]=D0({nodeId:_,dragItems:o,nodeLookup:E});r==null||r(S,o,fe,oe),W==null||W(S,fe,oe),_||A==null||A(S,oe)}}async function U(){if(!h)return;const{transform:X,panBy:H,autoPanSpeed:E,autoPanOnNodeDrag:q}=e();if(!q){u=!1,cancelAnimationFrame(a);return}const[R,z]=Yz(f,h,E);(R!==0||z!==0)&&(s.x=(s.x??0)-R/X[2],s.y=(s.y??0)-z/X[2],await H({x:R,y:z})&&I(s)),a=requestAnimationFrame(U)}function F(X){var ee;const{nodeLookup:H,multiSelectionActive:E,nodesDraggable:q,transform:R,snapGrid:z,snapToGrid:B,selectNodesOnDrag:W,onNodeDragStart:A,onSelectionDragStart:D,unselectNodesAndEdges:Y}=e();m=!0,(!W||!N)&&!E&&_&&((ee=H.get(_))!=null&&ee.selected||Y()),N&&W&&_&&(t==null||t(_));const P=lh(X.sourceEvent,{transform:R,snapGrid:z,snapToGrid:B,containerBounds:h});if(s=P,o=sae(H,q,P,_),o.size>0&&(n||A||!_&&D)){const[ae,ne]=D0({nodeId:_,dragItems:o,nodeLookup:H});n==null||n(X.sourceEvent,o,ae,ne),A==null||A(X.sourceEvent,ae,ne),_||D==null||D(X.sourceEvent,ne)}}const Z=wz().clickDistance(M).on("start",X=>{const{domNode:H,nodeDragThreshold:E,transform:q,snapGrid:R,snapToGrid:z}=e();h=(H==null?void 0:H.getBoundingClientRect())||null,x=!1,v=!1,S=X.sourceEvent,E===0&&F(X),s=lh(X.sourceEvent,{transform:q,snapGrid:R,snapToGrid:z,containerBounds:h}),f=Ai(X.sourceEvent,h)}).on("drag",X=>{const{autoPanOnNodeDrag:H,transform:E,snapGrid:q,snapToGrid:R,nodeDragThreshold:z,nodeLookup:B}=e(),W=lh(X.sourceEvent,{transform:E,snapGrid:q,snapToGrid:R,containerBounds:h});if(S=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||_&&!B.has(_))&&(x=!0),!x){if(!u&&H&&m&&(u=!0,U()),!m){const A=Ai(X.sourceEvent,h),D=A.x-f.x,Y=A.y-f.y;Math.sqrt(D*D+Y*Y)>z&&F(X)}(s.x!==W.xSnapped||s.y!==W.ySnapped)&&o&&m&&(f=Ai(X.sourceEvent,h),I(W))}}).on("end",X=>{if(!(!m||x)&&(u=!1,m=!1,cancelAnimationFrame(a),o.size>0)){const{nodeLookup:H,updateNodePositions:E,onNodeDragStop:q,onSelectionDragStop:R}=e();if(v&&(E(o,!1),v=!1),i||q||!_&&R){const[z,B]=D0({nodeId:_,dragItems:o,nodeLookup:H,dragging:!1});i==null||i(X.sourceEvent,o,z,B),q==null||q(X.sourceEvent,z,B),_||R==null||R(X.sourceEvent,B)}}}).filter(X=>{const H=X.target;return!X.button&&(!j||!FP(H,`.${j}`,T))&&(!Q||FP(H,Q,T))});O.call(Z)}function w(){O==null||O.on(".drag",null)}return{update:k,destroy:w}}function oae(t,e,n){const r=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())Yh(i,Bu(s))>0&&r.push(s);return r}const cae=250;function uae(t,e,n,r){var o,u;let i=[],s=1/0;const a=oae(t,n,e+cae);for(const f of a){const h=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const m of h){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:O,y:x}=Do(f,m,m.position,!0),v=Math.sqrt(Math.pow(O-t.x,2)+Math.pow(x-t.y,2));v>e||(v<s?(i=[{...m,x:O,y:x}],s=v):v===s&&i.push({...m,x:O,y:x}))}}if(!i.length)return null;if(i.length>1){const f=r.type==="source"?"target":"source";return i.find(h=>h.type===f)??i[0]}return i[0]}function l4(t,e,n,r,i,s=!1){var f,h,m;const a=r.get(t);if(!a)return null;const o=i==="strict"?(f=a.internals.handleBounds)==null?void 0:f[e]:[...((h=a.internals.handleBounds)==null?void 0:h.source)??[],...((m=a.internals.handleBounds)==null?void 0:m.target)??[]],u=(n?o==null?void 0:o.find(O=>O.id===n):o==null?void 0:o[0])??null;return u&&s?{...u,...Do(a,u,u.position,!0)}:u}function o4(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function fae(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const c4=()=>!0;function dae(t,{connectionMode:e,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:o,nodeLookup:u,lib:f,autoPanOnConnect:h,flowId:m,panBy:O,cancelConnection:x,onConnectStart:v,onConnect:S,onConnectEnd:k,isValidConnection:w=c4,onReconnectEnd:j,updateConnection:Q,getTransform:T,getFromHandle:N,autoPanSpeed:_,dragThreshold:M=1,handleDomNode:I}){const U=Gz(t.target);let F=0,Z;const{x:X,y:H}=Ai(t),E=o4(s,I),q=o==null?void 0:o.getBoundingClientRect();let R=!1;if(!q||!E)return;const z=l4(i,E,r,u,e);if(!z)return;let B=Ai(t,q),W=!1,A=null,D=!1,Y=null;function P(){if(!h||!q)return;const[ke,we]=Yz(B,q,_);O({x:ke,y:we}),F=requestAnimationFrame(P)}const ee={...z,nodeId:i,type:E,position:z.position},ae=u.get(i);let fe={inProgress:!0,isValid:null,from:Do(ae,ee,$e.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:ae,to:B,toHandle:null,toPosition:LP[ee.position],toNode:null,pointer:B};function oe(){R=!0,Q(fe),v==null||v(t,{nodeId:i,handleId:r,handleType:E})}M===0&&oe();function me(ke){if(!R){const{x:vt,y:Qn}=Ai(ke),Jt=vt-X,Cn=Qn-H;if(!(Jt*Jt+Cn*Cn>M*M))return;oe()}if(!N()||!ee){je(ke);return}const we=T();B=Ai(ke,q),Z=uae(_p(B,we,!1,[1,1]),n,u,ee),W||(P(),W=!0);const Qe=u4(ke,{handle:Z,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:w,doc:U,lib:f,flowId:m,nodeLookup:u});Y=Qe.handleDomNode,A=Qe.connection,D=fae(!!Z,Qe.isValid);const Le=u.get(i),He=Le?Do(Le,ee,$e.Left,!0):fe.from,ze={...fe,from:He,isValid:D,to:Qe.toHandle&&D?hx({x:Qe.toHandle.x,y:Qe.toHandle.y},we):B,toHandle:Qe.toHandle,toPosition:D&&Qe.toHandle?Qe.toHandle.position:LP[ee.position],toNode:Qe.toHandle?u.get(Qe.toHandle.nodeId):null,pointer:B};Q(ze),fe=ze}function je(ke){if(!("touches"in ke&&ke.touches.length>0)){if(R){(Z||Y)&&A&&D&&(S==null||S(A));const{inProgress:we,...Qe}=fe,Le={...Qe,toPosition:fe.toHandle?fe.toPosition:null};k==null||k(ke,Le),s&&(j==null||j(ke,Le))}x(),cancelAnimationFrame(F),W=!1,D=!1,A=null,Y=null,U.removeEventListener("mousemove",me),U.removeEventListener("mouseup",je),U.removeEventListener("touchmove",me),U.removeEventListener("touchend",je)}}U.addEventListener("mousemove",me),U.addEventListener("mouseup",je),U.addEventListener("touchmove",me),U.addEventListener("touchend",je)}function u4(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:o,flowId:u,isValidConnection:f=c4,nodeLookup:h}){const m=s==="target",O=e?a.querySelector(`.${o}-flow__handle[data-id="${u}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x,y:v}=Ai(t),S=a.elementFromPoint(x,v),k=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:O,w={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const j=o4(void 0,k),Q=k.getAttribute("data-nodeid"),T=k.getAttribute("data-handleid"),N=k.classList.contains("connectable"),_=k.classList.contains("connectableend");if(!Q||!j)return w;const M={source:m?Q:r,sourceHandle:m?T:i,target:m?r:Q,targetHandle:m?i:T};w.connection=M;const U=N&&_&&(n===Xu.Strict?m&&j==="source"||!m&&j==="target":Q!==r||T!==i);w.isValid=U&&f(M),w.toHandle=l4(Q,j,T,h,n,!0)}return w}const HS={onPointerDown:dae,isValid:u4};function hae({domNode:t,panZoom:e,getTransform:n,getViewScale:r}){const i=Br(t);function s({translateExtent:o,width:u,height:f,zoomStep:h=1,pannable:m=!0,zoomable:O=!0,inversePan:x=!1}){const v=Q=>{if(Q.sourceEvent.type!=="wheel"||!e)return;const T=n(),N=Q.sourceEvent.ctrlKey&&Uh()?10:1,_=-Q.sourceEvent.deltaY*(Q.sourceEvent.deltaMode===1?.05:Q.sourceEvent.deltaMode?1:.002)*h,M=T[2]*Math.pow(2,_*N);e.scaleTo(M)};let S=[0,0];const k=Q=>{(Q.sourceEvent.type==="mousedown"||Q.sourceEvent.type==="touchstart")&&(S=[Q.sourceEvent.clientX??Q.sourceEvent.touches[0].clientX,Q.sourceEvent.clientY??Q.sourceEvent.touches[0].clientY])},w=Q=>{const T=n();if(Q.sourceEvent.type!=="mousemove"&&Q.sourceEvent.type!=="touchmove"||!e)return;const N=[Q.sourceEvent.clientX??Q.sourceEvent.touches[0].clientX,Q.sourceEvent.clientY??Q.sourceEvent.touches[0].clientY],_=[N[0]-S[0],N[1]-S[1]];S=N;const M=r()*Math.max(T[2],Math.log(T[2]))*(x?-1:1),I={x:T[0]-_[0]*M,y:T[1]-_[1]*M},U=[[0,0],[u,f]];e.setViewportConstrained({x:I.x,y:I.y,zoom:T[2]},U,o)},j=Dz().on("start",k).on("zoom",m?w:null).on("zoom.wheel",O?v:null);i.call(j,{})}function a(){i.on("zoom",null)}return{update:s,destroy:a,pointer:Ti}}const sy=t=>({x:t.x,y:t.y,zoom:t.k}),L0=({x:t,y:e,zoom:n})=>ny.translate(t,e).scale(n),Jc=(t,e)=>t.target.closest(`.${e}`),f4=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),pae=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,X0=(t,e=0,n=pae,r=()=>{})=>{const i=typeof e=="number"&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t},d4=t=>{const e=t.ctrlKey&&Uh()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function mae({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:u,onPanZoomEnd:f}){return h=>{if(Jc(h,e))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(h.ctrlKey&&a){const k=Ti(h),w=d4(h),j=m*Math.pow(2,w);r.scaleTo(n,j,k,h);return}const O=h.deltaMode===1?20:1;let x=i===$o.Vertical?0:h.deltaX*O,v=i===$o.Horizontal?0:h.deltaY*O;!Uh()&&h.shiftKey&&i!==$o.Vertical&&(x=h.deltaY*O,v=0),r.translateBy(n,-(x/m)*s,-(v/m)*s,{internal:!0});const S=sy(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(u==null||u(h,S),t.panScrollTimeout=setTimeout(()=>{f==null||f(h,S),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,o==null||o(h,S))}}function gae({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",a=!e&&s&&!r.ctrlKey,o=Jc(r,t);if(r.ctrlKey&&s&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,i)}}function Oae({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return r=>{var s,a,o;if((s=r.sourceEvent)!=null&&s.internal)return;const i=sy(r.transform);t.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=i,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&e(!0),n&&(n==null||n(r.sourceEvent,i))}}function xae({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var a,o;t.usedRightMouseButton=!!(n&&f4(e,t.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((o=s.sourceEvent)!=null&&o.internal)&&(i==null||i(s.sourceEvent,sy(s.transform)))}}function yae({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(t.isZoomingOrPanning=!1,s&&f4(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),t.usedRightMouseButton=!1,r(!1),i)){const u=sy(a.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,u)},n?150:0)}}}function vae({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:o,noPanClassName:u,lib:f,connectionInProgress:h}){return m=>{var k;const O=t||e,x=n&&m.ctrlKey,v=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Jc(m,`${f}-flow__node`)||Jc(m,`${f}-flow__edge`)))return!0;if(!r&&!O&&!i&&!s&&!n||a||h&&!v||Jc(m,o)&&v||Jc(m,u)&&(!v||i&&v&&!t)||!n&&m.ctrlKey&&v)return!1;if(!n&&m.type==="touchstart"&&((k=m.touches)==null?void 0:k.length)>1)return m.preventDefault(),!1;if(!O&&!i&&!x&&v||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||v)&&S}}function bae({domNode:t,minZoom:e,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=t.getBoundingClientRect(),m=Dz().scaleExtent([e,n]).translateExtent(r),O=Br(t).call(m);j({x:i.x,y:i.y,zoom:Zu(i.zoom,e,n)},[[0,0],[h.width,h.height]],r);const x=O.on("wheel.zoom"),v=O.on("dblclick.zoom");m.wheelDelta(d4);function S(Z,X){return O?new Promise(H=>{m==null||m.interpolate((X==null?void 0:X.interpolate)==="linear"?ah:fO).transform(X0(O,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>H(!0)),Z)}):Promise.resolve(!1)}function k({noWheelClassName:Z,noPanClassName:X,onPaneContextMenu:H,userSelectionActive:E,panOnScroll:q,panOnDrag:R,panOnScrollMode:z,panOnScrollSpeed:B,preventScrolling:W,zoomOnPinch:A,zoomOnScroll:D,zoomOnDoubleClick:Y,zoomActivationKeyPressed:P,lib:ee,onTransformChange:ae,connectionInProgress:ne,paneClickDistance:fe,selectionOnDrag:oe}){E&&!f.isZoomingOrPanning&&w();const me=q&&!P&&!E;m.clickDistance(oe?1/0:!Ei(fe)||fe<0?0:fe);const je=me?mae({zoomPanValues:f,noWheelClassName:Z,d3Selection:O,d3Zoom:m,panOnScrollMode:z,panOnScrollSpeed:B,zoomOnPinch:A,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:o}):gae({noWheelClassName:Z,preventScrolling:W,d3ZoomHandler:x});if(O.on("wheel.zoom",je,{passive:!1}),!E){const we=Oae({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:a});m.on("start",we);const Qe=xae({zoomPanValues:f,panOnDrag:R,onPaneContextMenu:!!H,onPanZoom:s,onTransformChange:ae});m.on("zoom",Qe);const Le=yae({zoomPanValues:f,panOnDrag:R,panOnScroll:q,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:u});m.on("end",Le)}const ke=vae({zoomActivationKeyPressed:P,panOnDrag:R,zoomOnScroll:D,panOnScroll:q,zoomOnDoubleClick:Y,zoomOnPinch:A,userSelectionActive:E,noPanClassName:X,noWheelClassName:Z,lib:ee,connectionInProgress:ne});m.filter(ke),Y?O.on("dblclick.zoom",v):O.on("dblclick.zoom",null)}function w(){m.on("zoom",null)}async function j(Z,X,H){const E=L0(Z),q=m==null?void 0:m.constrain()(E,X,H);return q&&await S(q),new Promise(R=>R(q))}async function Q(Z,X){const H=L0(Z);return await S(H,X),new Promise(E=>E(H))}function T(Z){if(O){const X=L0(Z),H=O.property("__zoom");(H.k!==Z.zoom||H.x!==Z.x||H.y!==Z.y)&&(m==null||m.transform(O,X,null,{sync:!0}))}}function N(){const Z=O?zz(O.node()):{x:0,y:0,k:1};return{x:Z.x,y:Z.y,zoom:Z.k}}function _(Z,X){return O?new Promise(H=>{m==null||m.interpolate((X==null?void 0:X.interpolate)==="linear"?ah:fO).scaleTo(X0(O,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>H(!0)),Z)}):Promise.resolve(!1)}function M(Z,X){return O?new Promise(H=>{m==null||m.interpolate((X==null?void 0:X.interpolate)==="linear"?ah:fO).scaleBy(X0(O,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>H(!0)),Z)}):Promise.resolve(!1)}function I(Z){m==null||m.scaleExtent(Z)}function U(Z){m==null||m.translateExtent(Z)}function F(Z){const X=!Ei(Z)||Z<0?0:Z;m==null||m.clickDistance(X)}return{update:k,destroy:w,setViewport:Q,setViewportConstrained:j,getViewport:N,scaleTo:_,scaleBy:M,setScaleExtent:I,setTranslateExtent:U,syncViewport:T,setClickDistance:F}}var Vu;(function(t){t.Line="line",t.Handle="handle"})(Vu||(Vu={}));function Sae({width:t,prevWidth:e,height:n,prevHeight:r,affectsX:i,affectsY:s}){const a=t-e,o=n-r,u=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&i&&(u[0]=u[0]*-1),o&&s&&(u[1]=u[1]*-1),u}function KP(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),r=t.includes("left"),i=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:r,affectsY:i}}function Ka(t,e){return Math.max(0,e-t)}function Ja(t,e){return Math.max(0,t-e)}function Bg(t,e,n){return Math.max(0,e-t,t-n)}function JP(t,e){return t?!e:e}function wae(t,e,n,r,i,s,a,o){let{affectsX:u,affectsY:f}=e;const{isHorizontal:h,isVertical:m}=e,O=h&&m,{xSnapped:x,ySnapped:v}=n,{minWidth:S,maxWidth:k,minHeight:w,maxHeight:j}=r,{x:Q,y:T,width:N,height:_,aspectRatio:M}=t;let I=Math.floor(h?x-t.pointerX:0),U=Math.floor(m?v-t.pointerY:0);const F=N+(u?-I:I),Z=_+(f?-U:U),X=-s[0]*N,H=-s[1]*_;let E=Bg(F,S,k),q=Bg(Z,w,j);if(a){let B=0,W=0;u&&I<0?B=Ka(Q+I+X,a[0][0]):!u&&I>0&&(B=Ja(Q+F+X,a[1][0])),f&&U<0?W=Ka(T+U+H,a[0][1]):!f&&U>0&&(W=Ja(T+Z+H,a[1][1])),E=Math.max(E,B),q=Math.max(q,W)}if(o){let B=0,W=0;u&&I>0?B=Ja(Q+I,o[0][0]):!u&&I<0&&(B=Ka(Q+F,o[1][0])),f&&U>0?W=Ja(T+U,o[0][1]):!f&&U<0&&(W=Ka(T+Z,o[1][1])),E=Math.max(E,B),q=Math.max(q,W)}if(i){if(h){const B=Bg(F/M,w,j)*M;if(E=Math.max(E,B),a){let W=0;!u&&!f||u&&!f&&O?W=Ja(T+H+F/M,a[1][1])*M:W=Ka(T+H+(u?I:-I)/M,a[0][1])*M,E=Math.max(E,W)}if(o){let W=0;!u&&!f||u&&!f&&O?W=Ka(T+F/M,o[1][1])*M:W=Ja(T+(u?I:-I)/M,o[0][1])*M,E=Math.max(E,W)}}if(m){const B=Bg(Z*M,S,k)/M;if(q=Math.max(q,B),a){let W=0;!u&&!f||f&&!u&&O?W=Ja(Q+Z*M+X,a[1][0])/M:W=Ka(Q+(f?U:-U)*M+X,a[0][0])/M,q=Math.max(q,W)}if(o){let W=0;!u&&!f||f&&!u&&O?W=Ka(Q+Z*M,o[1][0])/M:W=Ja(Q+(f?U:-U)*M,o[0][0])/M,q=Math.max(q,W)}}}U=U+(U<0?q:-q),I=I+(I<0?E:-E),i&&(O?F>Z*M?U=(JP(u,f)?-I:I)/M:I=(JP(u,f)?-U:U)*M:h?(U=I/M,f=u):(I=U*M,u=f));const R=u?Q+I:Q,z=f?T+U:T;return{width:N+(u?-I:I),height:_+(f?-U:U),x:s[0]*I*(u?-1:1)+R,y:s[1]*U*(f?-1:1)+z}}const h4={width:0,height:0,x:0,y:0},kae={...h4,pointerX:0,pointerY:0,aspectRatio:1};function Qae(t){return[[0,0],[t.measured.width,t.measured.height]]}function Cae(t,e,n){const r=e.position.x+t.position.x,i=e.position.y+t.position.y,s=t.measured.width??0,a=t.measured.height??0,o=n[0]*s,u=n[1]*a;return[[r-o,i-u],[r+s-o,i+a-u]]}function jae({domNode:t,nodeId:e,getStoreItems:n,onChange:r,onEnd:i}){const s=Br(t);let a={controlDirection:KP("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:h,keepAspectRatio:m,resizeDirection:O,onResizeStart:x,onResize:v,onResizeEnd:S,shouldResize:k}){let w={...h4},j={...kae};a={boundaries:h,resizeDirection:O,keepAspectRatio:m,controlDirection:KP(f)};let Q,T=null,N=[],_,M,I,U=!1;const F=wz().on("start",Z=>{const{nodeLookup:X,transform:H,snapGrid:E,snapToGrid:q,nodeOrigin:R,paneDomNode:z}=n();if(Q=X.get(e),!Q)return;T=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:B,ySnapped:W}=lh(Z.sourceEvent,{transform:H,snapGrid:E,snapToGrid:q,containerBounds:T});w={width:Q.measured.width??0,height:Q.measured.height??0,x:Q.position.x??0,y:Q.position.y??0},j={...w,pointerX:B,pointerY:W,aspectRatio:w.width/w.height},_=void 0,Q.parentId&&(Q.extent==="parent"||Q.expandParent)&&(_=X.get(Q.parentId),M=_&&Q.extent==="parent"?Qae(_):void 0),N=[],I=void 0;for(const[A,D]of X)if(D.parentId===e&&(N.push({id:A,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const Y=Cae(D,Q,D.origin??R);I?I=[[Math.min(Y[0][0],I[0][0]),Math.min(Y[0][1],I[0][1])],[Math.max(Y[1][0],I[1][0]),Math.max(Y[1][1],I[1][1])]]:I=Y}x==null||x(Z,{...w})}).on("drag",Z=>{const{transform:X,snapGrid:H,snapToGrid:E,nodeOrigin:q}=n(),R=lh(Z.sourceEvent,{transform:X,snapGrid:H,snapToGrid:E,containerBounds:T}),z=[];if(!Q)return;const{x:B,y:W,width:A,height:D}=w,Y={},P=Q.origin??q,{width:ee,height:ae,x:ne,y:fe}=wae(j,a.controlDirection,R,a.boundaries,a.keepAspectRatio,P,M,I),oe=ee!==A,me=ae!==D,je=ne!==B&&oe,ke=fe!==W&&me;if(!je&&!ke&&!oe&&!me)return;if((je||ke||P[0]===1||P[1]===1)&&(Y.x=je?ne:w.x,Y.y=ke?fe:w.y,w.x=Y.x,w.y=Y.y,N.length>0)){const He=ne-B,ze=fe-W;for(const vt of N)vt.position={x:vt.position.x-He+P[0]*(ee-A),y:vt.position.y-ze+P[1]*(ae-D)},z.push(vt)}if((oe||me)&&(Y.width=oe&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ee:w.width,Y.height=me&&(!a.resizeDirection||a.resizeDirection==="vertical")?ae:w.height,w.width=Y.width,w.height=Y.height),_&&Q.expandParent){const He=P[0]*(Y.width??0);Y.x&&Y.x<He&&(w.x=He,j.x=j.x-(Y.x-He));const ze=P[1]*(Y.height??0);Y.y&&Y.y<ze&&(w.y=ze,j.y=j.y-(Y.y-ze))}const we=Sae({width:w.width,prevWidth:A,height:w.height,prevHeight:D,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),Qe={...w,direction:we};(k==null?void 0:k(Z,Qe))!==!1&&(U=!0,v==null||v(Z,Qe),r(Y,z))}).on("end",Z=>{U&&(S==null||S(Z,{...w}),i==null||i({...w}),U=!1)});s.call(F)}function u(){s.on(".drag",null)}return{update:o,destroy:u}}var Z0={exports:{}},B0={},q0={exports:{}},V0={};/**
401
+ * @license React
402
+ * use-sync-external-store-shim.production.js
403
+ *
404
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
405
+ *
406
+ * This source code is licensed under the MIT license found in the
407
+ * LICENSE file in the root directory of this source tree.
408
+ */var eE;function Tae(){if(eE)return V0;eE=1;var t=op();function e(m,O){return m===O&&(m!==0||1/m===1/O)||m!==m&&O!==O}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function o(m,O){var x=O(),v=r({inst:{value:x,getSnapshot:O}}),S=v[0].inst,k=v[1];return s(function(){S.value=x,S.getSnapshot=O,u(S)&&k({inst:S})},[m,x,O]),i(function(){return u(S)&&k({inst:S}),m(function(){u(S)&&k({inst:S})})},[m]),a(x),x}function u(m){var O=m.getSnapshot;m=m.value;try{var x=O();return!n(m,x)}catch{return!0}}function f(m,O){return O()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return V0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,V0}var tE;function $ae(){return tE||(tE=1,q0.exports=Tae()),q0.exports}/**
409
+ * @license React
410
+ * use-sync-external-store-shim/with-selector.production.js
411
+ *
412
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
413
+ *
414
+ * This source code is licensed under the MIT license found in the
415
+ * LICENSE file in the root directory of this source tree.
416
+ */var nE;function _ae(){if(nE)return B0;nE=1;var t=op(),e=$ae();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,o=t.useMemo,u=t.useDebugValue;return B0.useSyncExternalStoreWithSelector=function(f,h,m,O,x){var v=s(null);if(v.current===null){var S={hasValue:!1,value:null};v.current=S}else S=v.current;v=o(function(){function w(_){if(!j){if(j=!0,Q=_,_=O(_),x!==void 0&&S.hasValue){var M=S.value;if(x(M,_))return T=M}return T=_}if(M=T,r(Q,_))return M;var I=O(_);return x!==void 0&&x(M,I)?(Q=_,M):(Q=_,T=I)}var j=!1,Q,T,N=m===void 0?null:m;return[function(){return w(h())},N===null?void 0:function(){return w(N())}]},[h,m,O,x]);var k=i(f,v[0],v[1]);return a(function(){S.hasValue=!0,S.value=k},[k]),u(k),k},B0}var rE;function Nae(){return rE||(rE=1,Z0.exports=_ae()),Z0.exports}var Pae=Nae();const Eae=Px(Pae),Aae={},iE=t=>{let e;const n=new Set,r=(h,m)=>{const O=typeof h=="function"?h(e):h;if(!Object.is(O,e)){const x=e;e=m??(typeof O!="object"||O===null)?O:Object.assign({},e,O),n.forEach(v=>v(e,x))}},i=()=>e,u={setState:r,getState:i,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(Aae?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=e=t(r,i,u);return u},Mae=t=>t?iE(t):iE,{useDebugValue:Rae}=$d,{useSyncExternalStoreWithSelector:zae}=Eae,Dae=t=>t;function p4(t,e=Dae,n){const r=zae(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Rae(r),r}const sE=(t,e)=>{const n=Mae(t),r=(i,s=e)=>p4(n,i,s);return Object.assign(r,n),r},Lae=(t,e)=>t?sE(t,e):sE;function Bt(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}const ay=C.createContext(null),Xae=ay.Provider,m4=ys.error001();function at(t,e){const n=C.useContext(ay);if(n===null)throw new Error(m4);return p4(n,t,e)}function qt(){const t=C.useContext(ay);if(t===null)throw new Error(m4);return C.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const aE={display:"none"},Zae={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},g4="react-flow__node-desc",O4="react-flow__edge-desc",Bae="react-flow__aria-live",qae=t=>t.ariaLiveMessage,Vae=t=>t.ariaLabelConfig;function Iae({rfId:t}){const e=at(qae);return p.jsx("div",{id:`${Bae}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Zae,children:e})}function Yae({rfId:t,disableKeyboardA11y:e}){const n=at(Vae);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${g4}-${t}`,style:aE,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${O4}-${t}`,style:aE,children:n["edge.a11yDescription.default"]}),!e&&p.jsx(Iae,{rfId:t})]})}const ly=C.forwardRef(({position:t="top-left",children:e,className:n,style:r,...i},s)=>{const a=`${t}`.split("-");return p.jsx("div",{className:gn(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:e})});ly.displayName="Panel";function Uae({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:p.jsx(ly,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Wae=t=>{const e=[],n=[];for(const[,r]of t.nodeLookup)r.selected&&e.push(r.internals.userNode);for(const[,r]of t.edgeLookup)r.selected&&n.push(r);return{selectedNodes:e,selectedEdges:n}},qg=t=>t.id;function Hae(t,e){return Bt(t.selectedNodes.map(qg),e.selectedNodes.map(qg))&&Bt(t.selectedEdges.map(qg),e.selectedEdges.map(qg))}function Gae({onSelectionChange:t}){const e=qt(),{selectedNodes:n,selectedEdges:r}=at(Wae,Hae);return C.useEffect(()=>{const i={nodes:n,edges:r};t==null||t(i),e.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,t]),null}const Fae=t=>!!t.onSelectionChangeHandlers;function Kae({onSelectionChange:t}){const e=at(Fae);return t||e?p.jsx(Gae,{onSelectionChange:t}):null}const x4=[0,0],Jae={x:0,y:0,zoom:1},ele=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],lE=[...ele,"rfId"],tle=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),oE={translateExtent:Vh,nodeOrigin:x4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function nle(t){const{setNodes:e,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:u}=at(tle,Bt),f=qt();C.useEffect(()=>(u(t.defaultNodes,t.defaultEdges),()=>{h.current=oE,o()}),[]);const h=C.useRef(oE);return C.useEffect(()=>{for(const m of lE){const O=t[m],x=h.current[m];O!==x&&(typeof t[m]>"u"||(m==="nodes"?e(O):m==="edges"?n(O):m==="minZoom"?r(O):m==="maxZoom"?i(O):m==="translateExtent"?s(O):m==="nodeExtent"?a(O):m==="ariaLabelConfig"?f.setState({ariaLabelConfig:Lse(O)}):m==="fitView"?f.setState({fitViewQueued:O}):m==="fitViewOptions"?f.setState({fitViewOptions:O}):f.setState({[m]:O})))}h.current=t},lE.map(m=>t[m])),null}function cE(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rle(t){var r;const[e,n]=C.useState(t==="system"?null:t);return C.useEffect(()=>{if(t!=="system"){n(t);return}const i=cE(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[t]),e!==null?e:(r=cE())!=null&&r.matches?"dark":"light"}const uE=typeof document<"u"?document:null;function Wh(t=null,e={target:uE,actInsideInputWithModifier:!0}){const[n,r]=C.useState(!1),i=C.useRef(!1),s=C.useRef(new Set([])),[a,o]=C.useMemo(()=>{if(t!==null){const f=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
417
+ `).replace(`
418
+
419
+ `,`
420
+ +`).split(`
421
+ `)),h=f.reduce((m,O)=>m.concat(...O),[]);return[f,h]}return[[],[]]},[t]);return C.useEffect(()=>{const u=(e==null?void 0:e.target)??uE,f=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const h=x=>{var k,w;if(i.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!i.current||i.current&&!f)&&Fz(x))return!1;const S=dE(x.code,o);if(s.current.add(x[S]),fE(a,s.current,!1)){const j=((w=(k=x.composedPath)==null?void 0:k.call(x))==null?void 0:w[0])||x.target,Q=(j==null?void 0:j.nodeName)==="BUTTON"||(j==null?void 0:j.nodeName)==="A";e.preventDefault!==!1&&(i.current||!Q)&&x.preventDefault(),r(!0)}},m=x=>{const v=dE(x.code,o);fE(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(x[v]),x.key==="Meta"&&s.current.clear(),i.current=!1},O=()=>{s.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",m),window.addEventListener("blur",O),window.addEventListener("contextmenu",O),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",m),window.removeEventListener("blur",O),window.removeEventListener("contextmenu",O)}}},[t,r]),n}function fE(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(i=>e.has(i)))}function dE(t,e){return e.includes(t)?"code":"key"}const ile=()=>{const t=qt();return C.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:r}=t.getState();return r?r.scaleTo(e,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[r,i,s],panZoom:a}=t.getState();return a?(await a.setViewport({x:e.x??r,y:e.y??i,zoom:e.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},setCenter:async(e,n,r)=>t.getState().setCenter(e,n,r),fitBounds:async(e,n)=>{const{width:r,height:i,minZoom:s,maxZoom:a,panZoom:o}=t.getState(),u=n2(e,r,i,s,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:r,snapGrid:i,snapToGrid:s,domNode:a}=t.getState();if(!a)return e;const{x:o,y:u}=a.getBoundingClientRect(),f={x:e.x-o,y:e.y-u},h=n.snapGrid??i,m=n.snapToGrid??s;return _p(f,r,m,h)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:i,y:s}=r.getBoundingClientRect(),a=hx(e,n);return{x:a.x+i,y:a.y+s}}}),[])};function y4(t,e){const n=[],r=new Map,i=[];for(const s of t)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of e){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...s};for(const u of a)sle(u,o);n.push(o)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function sle(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function ale(t,e){return y4(t,e)}function lle(t,e){return y4(t,e)}function eo(t,e){return{id:t,type:"select",selected:e}}function eu(t,e=new Set,n=!1){const r=[];for(const[i,s]of t){const a=e.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(eo(s.id,a)))}return r}function hE({items:t=[],lookup:e}){var i;const n=[],r=new Map(t.map(s=>[s.id,s]));for(const[s,a]of t.entries()){const o=e.get(a.id),u=((i=o==null?void 0:o.internals)==null?void 0:i.userNode)??o;u!==void 0&&u!==a&&n.push({id:a.id,item:a,type:"replace"}),u===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of e)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function pE(t){return{id:t.id,type:"remove"}}const mE=t=>$se(t),ole=t=>qz(t);function v4(t){return C.forwardRef(t)}const cle=typeof window<"u"?C.useLayoutEffect:C.useEffect;function gE(t){const[e,n]=C.useState(BigInt(0)),[r]=C.useState(()=>ule(()=>n(i=>i+BigInt(1))));return cle(()=>{const i=r.get();i.length&&(t(i),r.reset())},[e]),r}function ule(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const b4=C.createContext(null);function fle({children:t}){const e=qt(),n=C.useCallback(o=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:h,onNodesChange:m,nodeLookup:O,fitViewQueued:x,onNodesChangeMiddlewareMap:v}=e.getState();let S=u;for(const w of o)S=typeof w=="function"?w(S):w;let k=hE({items:S,lookup:O});for(const w of v.values())k=w(k);h&&f(S),k.length>0?m==null||m(k):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:j,setNodes:Q}=e.getState();w&&Q(j)})},[]),r=gE(n),i=C.useCallback(o=>{const{edges:u=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:m,edgeLookup:O}=e.getState();let x=u;for(const v of o)x=typeof v=="function"?v(x):v;h?f(x):m&&m(hE({items:x,lookup:O}))},[]),s=gE(i),a=C.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return p.jsx(b4.Provider,{value:a,children:t})}function dle(){const t=C.useContext(b4);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const hle=t=>!!t.panZoom;function c2(){const t=ile(),e=qt(),n=dle(),r=at(hle),i=C.useMemo(()=>{const s=m=>e.getState().nodeLookup.get(m),a=m=>{n.nodeQueue.push(m)},o=m=>{n.edgeQueue.push(m)},u=m=>{var w,j;const{nodeLookup:O,nodeOrigin:x}=e.getState(),v=mE(m)?m:O.get(m.id),S=v.parentId?Hz(v.position,v.measured,v.parentId,O,x):v.position,k={...v,position:S,width:((w=v.measured)==null?void 0:w.width)??v.width,height:((j=v.measured)==null?void 0:j.height)??v.height};return Bu(k)},f=(m,O,x={replace:!1})=>{a(v=>v.map(S=>{if(S.id===m){const k=typeof O=="function"?O(S):O;return x.replace&&mE(k)?k:{...S,...k}}return S}))},h=(m,O,x={replace:!1})=>{o(v=>v.map(S=>{if(S.id===m){const k=typeof O=="function"?O(S):O;return x.replace&&ole(k)?k:{...S,...k}}return S}))};return{getNodes:()=>e.getState().nodes.map(m=>({...m})),getNode:m=>{var O;return(O=s(m))==null?void 0:O.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:m=[]}=e.getState();return m.map(O=>({...O}))},getEdge:m=>e.getState().edgeLookup.get(m),setNodes:a,setEdges:o,addNodes:m=>{const O=Array.isArray(m)?m:[m];n.nodeQueue.push(x=>[...x,...O])},addEdges:m=>{const O=Array.isArray(m)?m:[m];n.edgeQueue.push(x=>[...x,...O])},toObject:()=>{const{nodes:m=[],edges:O=[],transform:x}=e.getState(),[v,S,k]=x;return{nodes:m.map(w=>({...w})),edges:O.map(w=>({...w})),viewport:{x:v,y:S,zoom:k}}},deleteElements:async({nodes:m=[],edges:O=[]})=>{const{nodes:x,edges:v,onNodesDelete:S,onEdgesDelete:k,triggerNodeChanges:w,triggerEdgeChanges:j,onDelete:Q,onBeforeDelete:T}=e.getState(),{nodes:N,edges:_}=await Ase({nodesToRemove:m,edgesToRemove:O,nodes:x,edges:v,onBeforeDelete:T}),M=_.length>0,I=N.length>0;if(M){const U=_.map(pE);k==null||k(_),j(U)}if(I){const U=N.map(pE);S==null||S(N),w(U)}return(I||M)&&(Q==null||Q({nodes:N,edges:_})),{deletedNodes:N,deletedEdges:_}},getIntersectingNodes:(m,O=!0,x)=>{const v=ZP(m),S=v?m:u(m),k=x!==void 0;return S?(x||e.getState().nodes).filter(w=>{const j=e.getState().nodeLookup.get(w.id);if(j&&!v&&(w.id===m.id||!j.internals.positionAbsolute))return!1;const Q=Bu(k?w:j),T=Yh(Q,S);return O&&T>0||T>=Q.width*Q.height||T>=S.width*S.height}):[]},isNodeIntersecting:(m,O,x=!0)=>{const S=ZP(m)?m:u(m);if(!S)return!1;const k=Yh(S,O);return x&&k>0||k>=O.width*O.height||k>=S.width*S.height},updateNode:f,updateNodeData:(m,O,x={replace:!1})=>{f(m,v=>{const S=typeof O=="function"?O(v):O;return x.replace?{...v,data:S}:{...v,data:{...v.data,...S}}},x)},updateEdge:h,updateEdgeData:(m,O,x={replace:!1})=>{h(m,v=>{const S=typeof O=="function"?O(v):O;return x.replace?{...v,data:S}:{...v,data:{...v.data,...S}}},x)},getNodesBounds:m=>{const{nodeLookup:O,nodeOrigin:x}=e.getState();return _se(m,{nodeLookup:O,nodeOrigin:x})},getHandleConnections:({type:m,id:O,nodeId:x})=>{var v;return Array.from(((v=e.getState().connectionLookup.get(`${x}-${m}${O?`-${O}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:m,handleId:O,nodeId:x})=>{var v;return Array.from(((v=e.getState().connectionLookup.get(`${x}${m?O?`-${m}-${O}`:`-${m}`:""}`))==null?void 0:v.values())??[])},fitView:async m=>{const O=e.getState().fitViewResolver??Dse();return e.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:O}),n.nodeQueue.push(x=>[...x]),O.promise}}},[]);return C.useMemo(()=>({...i,...t,viewportInitialized:r}),[r])}const OE=t=>t.selected,ple=typeof window<"u"?window:void 0;function mle({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=qt(),{deleteElements:r}=c2(),i=Wh(t,{actInsideInputWithModifier:!1}),s=Wh(e,{target:ple});C.useEffect(()=>{if(i){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(OE),edges:a.filter(OE)}),n.setState({nodesSelectionActive:!1})}},[i]),C.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function gle(t){const e=qt();C.useEffect(()=>{const n=()=>{var i,s,a,o;if(!t.current||!(((s=(i=t.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=r2(t.current);(r.height===0||r.width===0)&&((o=(a=e.getState()).onError)==null||o.call(a,"004",ys.error004())),e.setState({width:r.width||500,height:r.height||500})};if(t.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(t.current),()=>{window.removeEventListener("resize",n),r&&t.current&&r.unobserve(t.current)}}},[])}const oy={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ole=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function xle({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=$o.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:u,translateExtent:f,minZoom:h,maxZoom:m,zoomActivationKeyCode:O,preventScrolling:x=!0,children:v,noWheelClassName:S,noPanClassName:k,onViewportChange:w,isControlledViewport:j,paneClickDistance:Q,selectionOnDrag:T}){const N=qt(),_=C.useRef(null),{userSelectionActive:M,lib:I,connectionInProgress:U}=at(Ole,Bt),F=Wh(O),Z=C.useRef();gle(_);const X=C.useCallback(H=>{w==null||w({x:H[0],y:H[1],zoom:H[2]}),j||N.setState({transform:H})},[w,j]);return C.useEffect(()=>{if(_.current){Z.current=bae({domNode:_.current,minZoom:h,maxZoom:m,translateExtent:f,viewport:u,onDraggingChange:R=>N.setState(z=>z.paneDragging===R?z:{paneDragging:R}),onPanZoomStart:(R,z)=>{const{onViewportChangeStart:B,onMoveStart:W}=N.getState();W==null||W(R,z),B==null||B(z)},onPanZoom:(R,z)=>{const{onViewportChange:B,onMove:W}=N.getState();W==null||W(R,z),B==null||B(z)},onPanZoomEnd:(R,z)=>{const{onViewportChangeEnd:B,onMoveEnd:W}=N.getState();W==null||W(R,z),B==null||B(z)}});const{x:H,y:E,zoom:q}=Z.current.getViewport();return N.setState({panZoom:Z.current,transform:[H,E,q],domNode:_.current.closest(".react-flow")}),()=>{var R;(R=Z.current)==null||R.destroy()}}},[]),C.useEffect(()=>{var H;(H=Z.current)==null||H.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:F,preventScrolling:x,noPanClassName:k,userSelectionActive:M,noWheelClassName:S,lib:I,onTransformChange:X,connectionInProgress:U,selectionOnDrag:T,paneClickDistance:Q})},[t,e,n,r,i,s,a,o,F,x,k,M,S,I,X,U,T,Q]),p.jsx("div",{className:"react-flow__renderer",ref:_,style:oy,children:v})}const yle=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function vle(){const{userSelectionActive:t,userSelectionRect:e}=at(yle,Bt);return t&&e?p.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const I0=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},ble=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function Sle({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Ih.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:o,onPaneClick:u,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:O,onPaneMouseLeave:x,children:v}){const S=qt(),{userSelectionActive:k,elementsSelectable:w,dragging:j,connectionInProgress:Q}=at(ble,Bt),T=w&&(t||k),N=C.useRef(null),_=C.useRef(),M=C.useRef(new Set),I=C.useRef(new Set),U=C.useRef(!1),F=B=>{if(U.current||Q){U.current=!1;return}u==null||u(B),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},Z=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}f==null||f(B)},X=h?B=>h(B):void 0,H=B=>{U.current&&(B.stopPropagation(),U.current=!1)},E=B=>{var ae,ne;const{domNode:W}=S.getState();if(_.current=W==null?void 0:W.getBoundingClientRect(),!_.current)return;const A=B.target===N.current;if(!A&&!!B.target.closest(".nokey")||!t||!(s&&A||e)||B.button!==0||!B.isPrimary)return;(ne=(ae=B.target)==null?void 0:ae.setPointerCapture)==null||ne.call(ae,B.pointerId),U.current=!1;const{x:P,y:ee}=Ai(B.nativeEvent,_.current);S.setState({userSelectionRect:{width:0,height:0,startX:P,startY:ee,x:P,y:ee}}),A||(B.stopPropagation(),B.preventDefault())},q=B=>{const{userSelectionRect:W,transform:A,nodeLookup:D,edgeLookup:Y,connectionLookup:P,triggerNodeChanges:ee,triggerEdgeChanges:ae,defaultEdgeOptions:ne,resetSelectedElements:fe}=S.getState();if(!_.current||!W)return;const{x:oe,y:me}=Ai(B.nativeEvent,_.current),{startX:je,startY:ke}=W;if(!U.current){const ze=e?0:i;if(Math.hypot(oe-je,me-ke)<=ze)return;fe(),a==null||a(B)}U.current=!0;const we={startX:je,startY:ke,x:oe<je?oe:je,y:me<ke?me:ke,width:Math.abs(oe-je),height:Math.abs(me-ke)},Qe=M.current,Le=I.current;M.current=new Set(t2(D,we,A,n===Ih.Partial,!0).map(ze=>ze.id)),I.current=new Set;const He=(ne==null?void 0:ne.selectable)??!0;for(const ze of M.current){const vt=P.get(ze);if(vt)for(const{edgeId:Qn}of vt.values()){const Jt=Y.get(Qn);Jt&&(Jt.selectable??He)&&I.current.add(Qn)}}if(!BP(Qe,M.current)){const ze=eu(D,M.current,!0);ee(ze)}if(!BP(Le,I.current)){const ze=eu(Y,I.current);ae(ze)}S.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},R=B=>{var W,A;B.button===0&&((A=(W=B.target)==null?void 0:W.releasePointerCapture)==null||A.call(W,B.pointerId),!k&&B.target===N.current&&S.getState().userSelectionRect&&(F==null||F(B)),S.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(o==null||o(B),S.setState({nodesSelectionActive:M.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:gn(["react-flow__pane",{draggable:z,dragging:j,selection:t}]),onClick:T?void 0:I0(F,N),onContextMenu:I0(Z,N),onWheel:I0(X,N),onPointerEnter:T?void 0:m,onPointerMove:T?q:O,onPointerUp:T?R:void 0,onPointerDownCapture:T?E:void 0,onClickCapture:T?H:void 0,onPointerLeave:x,ref:N,style:oy,children:[v,p.jsx(vle,{})]})}function GS({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:o,onError:u}=e.getState(),f=o.get(t);if(!f){u==null||u("012",ys.error012(t));return}e.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(s({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([t])}function S4({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){const o=qt(),[u,f]=C.useState(!1),h=C.useRef();return C.useEffect(()=>{h.current=lae({getStoreItems:()=>o.getState(),onNodeMouseDown:m=>{GS({id:m,store:o,nodeRef:t})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),C.useEffect(()=>{if(!(e||!t.current||!h.current))return h.current.update({noDragClassName:n,handleSelector:r,domNode:t.current,isSelectable:s,nodeId:i,nodeClickDistance:a}),()=>{var m;(m=h.current)==null||m.destroy()}},[n,r,e,s,t,i,a]),u}const wle=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function w4(){const t=qt();return C.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:o,updateNodePositions:u,nodeLookup:f,nodeOrigin:h}=t.getState(),m=new Map,O=wle(a),x=i?s[0]:5,v=i?s[1]:5,S=n.direction.x*x*n.factor,k=n.direction.y*v*n.factor;for(const[,w]of f){if(!O(w))continue;let j={x:w.internals.positionAbsolute.x+S,y:w.internals.positionAbsolute.y+k};i&&(j=$p(j,s));const{position:Q,positionAbsolute:T}=Vz({nodeId:w.id,nextPosition:j,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:o});w.position=Q,w.internals.positionAbsolute=T,m.set(w.id,w)}u(m)},[])}const u2=C.createContext(null),kle=u2.Provider;u2.Consumer;const k4=()=>C.useContext(u2),Qle=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),Cle=(t,e,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:o,toHandle:u,isValid:f}=a,h=(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===e&&(u==null?void 0:u.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===t&&(o==null?void 0:o.id)===e&&(o==null?void 0:o.type)===n,connectingTo:h,clickConnecting:(i==null?void 0:i.nodeId)===t&&(i==null?void 0:i.id)===e&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===Xu.Strict?(o==null?void 0:o.type)!==n:t!==(o==null?void 0:o.nodeId)||e!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!i,valid:h&&f}};function jle({type:t="source",position:e=$e.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:o,children:u,className:f,onMouseDown:h,onTouchStart:m,...O},x){var q,R;const v=a||null,S=t==="target",k=qt(),w=k4(),{connectOnClick:j,noPanClassName:Q,rfId:T}=at(Qle,Bt),{connectingFrom:N,connectingTo:_,clickConnecting:M,isPossibleEndHandle:I,connectionInProcess:U,clickConnectionInProcess:F,valid:Z}=at(Cle(w,v,t),Bt);w||(R=(q=k.getState()).onError)==null||R.call(q,"010",ys.error010());const X=z=>{const{defaultEdgeOptions:B,onConnect:W,hasDefaultEdges:A}=k.getState(),D={...B,...z};if(A){const{edges:Y,setEdges:P}=k.getState();P(Ise(D,Y))}W==null||W(D),o==null||o(D)},H=z=>{if(!w)return;const B=Kz(z.nativeEvent);if(i&&(B&&z.button===0||!B)){const W=k.getState();HS.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:W.autoPanOnConnect,connectionMode:W.connectionMode,connectionRadius:W.connectionRadius,domNode:W.domNode,nodeLookup:W.nodeLookup,lib:W.lib,isTarget:S,handleId:v,nodeId:w,flowId:W.rfId,panBy:W.panBy,cancelConnection:W.cancelConnection,onConnectStart:W.onConnectStart,onConnectEnd:(...A)=>{var D,Y;return(Y=(D=k.getState()).onConnectEnd)==null?void 0:Y.call(D,...A)},updateConnection:W.updateConnection,onConnect:X,isValidConnection:n||((...A)=>{var D,Y;return((Y=(D=k.getState()).isValidConnection)==null?void 0:Y.call(D,...A))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:W.autoPanSpeed,dragThreshold:W.connectionDragThreshold})}B?h==null||h(z):m==null||m(z)},E=z=>{const{onClickConnectStart:B,onClickConnectEnd:W,connectionClickStartHandle:A,connectionMode:D,isValidConnection:Y,lib:P,rfId:ee,nodeLookup:ae,connection:ne}=k.getState();if(!w||!A&&!i)return;if(!A){B==null||B(z.nativeEvent,{nodeId:w,handleId:v,handleType:t}),k.setState({connectionClickStartHandle:{nodeId:w,type:t,id:v}});return}const fe=Gz(z.target),oe=n||Y,{connection:me,isValid:je}=HS.isValid(z.nativeEvent,{handle:{nodeId:w,id:v,type:t},connectionMode:D,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:oe,flowId:ee,doc:fe,lib:P,nodeLookup:ae});je&&me&&X(me);const ke=structuredClone(ne);delete ke.inProgress,ke.toPosition=ke.toHandle?ke.toHandle.position:null,W==null||W(z,ke),k.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":v,"data-nodeid":w,"data-handlepos":e,"data-id":`${T}-${w}-${v}-${t}`,className:gn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",Q,f,{source:!S,target:S,connectable:r,connectablestart:i,connectableend:s,clickconnecting:M,connectingfrom:N,connectingto:_,valid:Z,connectionindicator:r&&(!U||I)&&(U||F?s:i)}]),onMouseDown:H,onTouchStart:H,onClick:j?E:void 0,ref:x,...O,children:u})}const Iu=C.memo(v4(jle));function Tle({data:t,isConnectable:e,sourcePosition:n=$e.Bottom}){return p.jsxs(p.Fragment,{children:[t==null?void 0:t.label,p.jsx(Iu,{type:"source",position:n,isConnectable:e})]})}function $le({data:t,isConnectable:e,targetPosition:n=$e.Top,sourcePosition:r=$e.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Iu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,p.jsx(Iu,{type:"source",position:r,isConnectable:e})]})}function _le(){return null}function Nle({data:t,isConnectable:e,targetPosition:n=$e.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Iu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const px={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},xE={input:Tle,default:$le,output:Nle,group:_le};function Ple(t){var e,n,r,i;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((r=t.style)==null?void 0:r.width),height:t.height??((i=t.style)==null?void 0:i.height)}}const Ele=t=>{const{width:e,height:n,x:r,y:i}=Tp(t.nodeLookup,{filter:s=>!!s.selected});return{width:Ei(e)?e:null,height:Ei(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${r}px,${i}px)`}};function Ale({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=qt(),{width:i,height:s,transformString:a,userSelectionActive:o}=at(Ele,Bt),u=w4(),f=C.useRef(null);C.useEffect(()=>{var x;n||(x=f.current)==null||x.focus({preventScroll:!0})},[n]);const h=!o&&i!==null&&s!==null;if(S4({nodeRef:f,disabled:!h}),!h)return null;const m=t?x=>{const v=r.getState().nodes.filter(S=>S.selected);t(x,v)}:void 0,O=x=>{Object.prototype.hasOwnProperty.call(px,x.key)&&(x.preventDefault(),u({direction:px[x.key],factor:x.shiftKey?4:1}))};return p.jsx("div",{className:gn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:a},children:p.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:O,style:{width:i,height:s}})})}const yE=typeof window<"u"?window:void 0,Mle=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Q4({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:h,selectionMode:m,onSelectionStart:O,onSelectionEnd:x,multiSelectionKeyCode:v,panActivationKeyCode:S,zoomActivationKeyCode:k,elementsSelectable:w,zoomOnScroll:j,zoomOnPinch:Q,panOnScroll:T,panOnScrollSpeed:N,panOnScrollMode:_,zoomOnDoubleClick:M,panOnDrag:I,defaultViewport:U,translateExtent:F,minZoom:Z,maxZoom:X,preventScrolling:H,onSelectionContextMenu:E,noWheelClassName:q,noPanClassName:R,disableKeyboardA11y:z,onViewportChange:B,isControlledViewport:W}){const{nodesSelectionActive:A,userSelectionActive:D}=at(Mle,Bt),Y=Wh(f,{target:yE}),P=Wh(S,{target:yE}),ee=P||I,ae=P||T,ne=h&&ee!==!0,fe=Y||D||ne;return mle({deleteKeyCode:u,multiSelectionKeyCode:v}),p.jsx(xle,{onPaneContextMenu:s,elementsSelectable:w,zoomOnScroll:j,zoomOnPinch:Q,panOnScroll:ae,panOnScrollSpeed:N,panOnScrollMode:_,zoomOnDoubleClick:M,panOnDrag:!Y&&ee,defaultViewport:U,translateExtent:F,minZoom:Z,maxZoom:X,zoomActivationKeyCode:k,preventScrolling:H,noWheelClassName:q,noPanClassName:R,onViewportChange:B,isControlledViewport:W,paneClickDistance:o,selectionOnDrag:ne,children:p.jsxs(Sle,{onSelectionStart:O,onSelectionEnd:x,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:ee,isSelecting:!!fe,selectionMode:m,selectionKeyPressed:Y,paneClickDistance:o,selectionOnDrag:ne,children:[t,A&&p.jsx(Ale,{onSelectionContextMenu:E,noPanClassName:R,disableKeyboardA11y:z})]})})}Q4.displayName="FlowRenderer";const Rle=C.memo(Q4),zle=t=>e=>t?t2(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function Dle(t){return at(C.useCallback(zle(t),[t]),Bt)}const Lle=t=>t.updateNodeInternals;function Xle(){const t=at(Lle),[e]=C.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),t(r)}));return C.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function Zle({node:t,nodeType:e,hasDimensions:n,resizeObserver:r}){const i=qt(),s=C.useRef(null),a=C.useRef(null),o=C.useRef(t.sourcePosition),u=C.useRef(t.targetPosition),f=C.useRef(e),h=n&&!!t.internals.handleBounds;return C.useEffect(()=>{s.current&&!t.hidden&&(!h||a.current!==s.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(s.current),a.current=s.current)},[h,t.hidden]),C.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),C.useEffect(()=>{if(s.current){const m=f.current!==e,O=o.current!==t.sourcePosition,x=u.current!==t.targetPosition;(m||O||x)&&(f.current=e,o.current=t.sourcePosition,u.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function Ble({id:t,onClick:e,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:o,elementsSelectable:u,nodesConnectable:f,nodesFocusable:h,resizeObserver:m,noDragClassName:O,noPanClassName:x,disableKeyboardA11y:v,rfId:S,nodeTypes:k,nodeClickDistance:w,onError:j}){const{node:Q,internals:T,isParent:N}=at(oe=>{const me=oe.nodeLookup.get(t),je=oe.parentLookup.has(t);return{node:me,internals:me.internals,isParent:je}},Bt);let _=Q.type||"default",M=(k==null?void 0:k[_])||xE[_];M===void 0&&(j==null||j("003",ys.error003(_)),_="default",M=(k==null?void 0:k.default)||xE.default);const I=!!(Q.draggable||o&&typeof Q.draggable>"u"),U=!!(Q.selectable||u&&typeof Q.selectable>"u"),F=!!(Q.connectable||f&&typeof Q.connectable>"u"),Z=!!(Q.focusable||h&&typeof Q.focusable>"u"),X=qt(),H=Wz(Q),E=Zle({node:Q,nodeType:_,hasDimensions:H,resizeObserver:m}),q=S4({nodeRef:E,disabled:Q.hidden||!I,noDragClassName:O,handleSelector:Q.dragHandle,nodeId:t,isSelectable:U,nodeClickDistance:w}),R=w4();if(Q.hidden)return null;const z=xa(Q),B=Ple(Q),W=U||I||e||n||r||i,A=n?oe=>n(oe,{...T.userNode}):void 0,D=r?oe=>r(oe,{...T.userNode}):void 0,Y=i?oe=>i(oe,{...T.userNode}):void 0,P=s?oe=>s(oe,{...T.userNode}):void 0,ee=a?oe=>a(oe,{...T.userNode}):void 0,ae=oe=>{const{selectNodesOnDrag:me,nodeDragThreshold:je}=X.getState();U&&(!me||!I||je>0)&&GS({id:t,store:X,nodeRef:E}),e&&e(oe,{...T.userNode})},ne=oe=>{if(!(Fz(oe.nativeEvent)||v)){if(Lz.includes(oe.key)&&U){const me=oe.key==="Escape";GS({id:t,store:X,unselect:me,nodeRef:E})}else if(I&&Q.selected&&Object.prototype.hasOwnProperty.call(px,oe.key)){oe.preventDefault();const{ariaLabelConfig:me}=X.getState();X.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:oe.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),R({direction:px[oe.key],factor:oe.shiftKey?4:1})}}},fe=()=>{var Le;if(v||!((Le=E.current)!=null&&Le.matches(":focus-visible")))return;const{transform:oe,width:me,height:je,autoPanOnNodeFocus:ke,setCenter:we}=X.getState();if(!ke)return;t2(new Map([[t,Q]]),{x:0,y:0,width:me,height:je},oe,!0).length>0||we(Q.position.x+z.width/2,Q.position.y+z.height/2,{zoom:oe[2]})};return p.jsx("div",{className:gn(["react-flow__node",`react-flow__node-${_}`,{[x]:I},Q.className,{selected:Q.selected,selectable:U,parent:N,draggable:I,dragging:q}]),ref:E,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:H?"visible":"hidden",...Q.style,...B},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:A,onMouseMove:D,onMouseLeave:Y,onContextMenu:P,onClick:ae,onDoubleClick:ee,onKeyDown:Z?ne:void 0,tabIndex:Z?0:void 0,onFocus:Z?fe:void 0,role:Q.ariaRole??(Z?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${g4}-${S}`,"aria-label":Q.ariaLabel,...Q.domAttributes,children:p.jsx(kle,{value:t,children:p.jsx(M,{id:t,data:Q.data,type:_,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:Q.selected??!1,selectable:U,draggable:I,deletable:Q.deletable??!0,isConnectable:F,sourcePosition:Q.sourcePosition,targetPosition:Q.targetPosition,dragging:q,dragHandle:Q.dragHandle,zIndex:T.z,parentId:Q.parentId,...z})})})}var qle=C.memo(Ble);const Vle=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function C4(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=at(Vle,Bt),a=Dle(t.onlyRenderVisibleElements),o=Xle();return p.jsx("div",{className:"react-flow__nodes",style:oy,children:a.map(u=>p.jsx(qle,{id:u,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:t.nodeClickDistance,onError:s},u))})}C4.displayName="NodeRenderer";const Ile=C.memo(C4);function Yle(t){return at(C.useCallback(n=>{if(!t)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&Bse({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[t]),Bt)}const Ule=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return p.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Wle=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return p.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},vE={[fx.Arrow]:Ule,[fx.ArrowClosed]:Wle};function Hle(t){const e=qt();return C.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(vE,t)?vE[t]:((s=(i=e.getState()).onError)==null||s.call(i,"009",ys.error009(t)),null)},[t])}const Gle=({id:t,type:e,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const u=Hle(e);return u?p.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:o,refX:"0",refY:"0",children:p.jsx(u,{color:n,strokeWidth:a})}):null},j4=({defaultColor:t,rfId:e})=>{const n=at(s=>s.edges),r=at(s=>s.defaultEdgeOptions),i=C.useMemo(()=>Gse(n,{id:e,defaultColor:t,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,e,t]);return i.length?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:i.map(s=>p.jsx(Gle,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};j4.displayName="MarkerDefinitions";var Fle=C.memo(j4);function T4({x:t,y:e,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:u,className:f,...h}){const[m,O]=C.useState({x:1,y:0,width:0,height:0}),x=gn(["react-flow__edge-textwrapper",f]),v=C.useRef(null);return C.useEffect(()=>{if(v.current){const S=v.current.getBBox();O({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?p.jsxs("g",{transform:`translate(${t-m.width/2} ${e-m.height/2})`,className:x,visibility:m.width?"visible":"hidden",...h,children:[i&&p.jsx("rect",{width:m.width+2*a[0],x:-a[0],y:-a[1],height:m.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:o,ry:o}),p.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:v,style:r,children:n}),u]}):null}T4.displayName="EdgeText";const Kle=C.memo(T4);function cy({path:t,labelX:e,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:u,interactionWidth:f=20,...h}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...h,d:t,fill:"none",className:gn(["react-flow__edge-path",h.className])}),f?p.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Ei(e)&&Ei(n)?p.jsx(Kle,{x:e,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:u}):null]})}function bE({pos:t,x1:e,y1:n,x2:r,y2:i}){return t===$e.Left||t===$e.Right?[.5*(e+r),n]:[e,.5*(n+i)]}function $4({sourceX:t,sourceY:e,sourcePosition:n=$e.Bottom,targetX:r,targetY:i,targetPosition:s=$e.Top}){const[a,o]=bE({pos:n,x1:t,y1:e,x2:r,y2:i}),[u,f]=bE({pos:s,x1:r,y1:i,x2:t,y2:e}),[h,m,O,x]=Jz({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:a,sourceControlY:o,targetControlX:u,targetControlY:f});return[`M${t},${e} C${a},${o} ${u},${f} ${r},${i}`,h,m,O,x]}function _4(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:o,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:O,labelBgBorderRadius:x,style:v,markerEnd:S,markerStart:k,interactionWidth:w})=>{const[j,Q,T]=$4({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o}),N=t.isInternal?void 0:e;return p.jsx(cy,{id:N,path:j,labelX:Q,labelY:T,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:O,labelBgBorderRadius:x,style:v,markerEnd:S,markerStart:k,interactionWidth:w})})}const Jle=_4({isInternal:!1}),N4=_4({isInternal:!0});Jle.displayName="SimpleBezierEdge";N4.displayName="SimpleBezierEdgeInternal";function P4(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:O,sourcePosition:x=$e.Bottom,targetPosition:v=$e.Top,markerEnd:S,markerStart:k,pathOptions:w,interactionWidth:j})=>{const[Q,T,N]=YS({sourceX:n,sourceY:r,sourcePosition:x,targetX:i,targetY:s,targetPosition:v,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),_=t.isInternal?void 0:e;return p.jsx(cy,{id:_,path:Q,labelX:T,labelY:N,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:O,markerEnd:S,markerStart:k,interactionWidth:j})})}const E4=P4({isInternal:!1}),A4=P4({isInternal:!0});E4.displayName="SmoothStepEdge";A4.displayName="SmoothStepEdgeInternal";function M4(t){return C.memo(({id:e,...n})=>{var i;const r=t.isInternal?void 0:e;return p.jsx(E4,{...n,id:r,pathOptions:C.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const eoe=M4({isInternal:!1}),R4=M4({isInternal:!0});eoe.displayName="StepEdge";R4.displayName="StepEdgeInternal";function z4(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:O,markerEnd:x,markerStart:v,interactionWidth:S})=>{const[k,w,j]=n4({sourceX:n,sourceY:r,targetX:i,targetY:s}),Q=t.isInternal?void 0:e;return p.jsx(cy,{id:Q,path:k,labelX:w,labelY:j,label:a,labelStyle:o,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:O,markerEnd:x,markerStart:v,interactionWidth:S})})}const toe=z4({isInternal:!1}),D4=z4({isInternal:!0});toe.displayName="StraightEdge";D4.displayName="StraightEdgeInternal";function L4(t){return C.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=$e.Bottom,targetPosition:o=$e.Top,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:O,labelBgBorderRadius:x,style:v,markerEnd:S,markerStart:k,pathOptions:w,interactionWidth:j})=>{const[Q,T,N]=e4({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o,curvature:w==null?void 0:w.curvature}),_=t.isInternal?void 0:e;return p.jsx(cy,{id:_,path:Q,labelX:T,labelY:N,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:m,labelBgPadding:O,labelBgBorderRadius:x,style:v,markerEnd:S,markerStart:k,interactionWidth:j})})}const noe=L4({isInternal:!1}),X4=L4({isInternal:!0});noe.displayName="BezierEdge";X4.displayName="BezierEdgeInternal";const SE={default:X4,straight:D4,step:R4,smoothstep:A4,simplebezier:N4},wE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},roe=(t,e,n)=>n===$e.Left?t-e:n===$e.Right?t+e:t,ioe=(t,e,n)=>n===$e.Top?t-e:n===$e.Bottom?t+e:t,kE="react-flow__edgeupdater";function QE({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:o}){return p.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:gn([kE,`${kE}-${o}`]),cx:roe(e,r,t),cy:ioe(n,r,t),r,stroke:"transparent",fill:"transparent"})}function soe({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:o,targetPosition:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,setReconnecting:O,setUpdateHover:x}){const v=qt(),S=(T,N)=>{if(T.button!==0)return;const{autoPanOnConnect:_,domNode:M,connectionMode:I,connectionRadius:U,lib:F,onConnectStart:Z,cancelConnection:X,nodeLookup:H,rfId:E,panBy:q,updateConnection:R}=v.getState(),z=N.type==="target",B=(D,Y)=>{O(!1),m==null||m(D,n,N.type,Y)},W=D=>f==null?void 0:f(n,D),A=(D,Y)=>{O(!0),h==null||h(T,n,N.type),Z==null||Z(D,Y)};HS.onPointerDown(T.nativeEvent,{autoPanOnConnect:_,connectionMode:I,connectionRadius:U,domNode:M,handleId:N.id,nodeId:N.nodeId,nodeLookup:H,isTarget:z,edgeUpdaterType:N.type,lib:F,flowId:E,cancelConnection:X,panBy:q,isValidConnection:(...D)=>{var Y,P;return((P=(Y=v.getState()).isValidConnection)==null?void 0:P.call(Y,...D))??!0},onConnect:W,onConnectStart:A,onConnectEnd:(...D)=>{var Y,P;return(P=(Y=v.getState()).onConnectEnd)==null?void 0:P.call(Y,...D)},onReconnectEnd:B,updateConnection:R,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},k=T=>S(T,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=T=>S(T,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),j=()=>x(!0),Q=()=>x(!1);return p.jsxs(p.Fragment,{children:[(t===!0||t==="source")&&p.jsx(QE,{position:o,centerX:r,centerY:i,radius:e,onMouseDown:k,onMouseEnter:j,onMouseOut:Q,type:"source"}),(t===!0||t==="target")&&p.jsx(QE,{position:u,centerX:s,centerY:a,radius:e,onMouseDown:w,onMouseEnter:j,onMouseOut:Q,type:"target"})]})}function aoe({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:o,onMouseMove:u,onMouseLeave:f,reconnectRadius:h,onReconnect:m,onReconnectStart:O,onReconnectEnd:x,rfId:v,edgeTypes:S,noPanClassName:k,onError:w,disableKeyboardA11y:j}){let Q=at(we=>we.edgeLookup.get(t));const T=at(we=>we.defaultEdgeOptions);Q=T?{...T,...Q}:Q;let N=Q.type||"default",_=(S==null?void 0:S[N])||SE[N];_===void 0&&(w==null||w("011",ys.error011(N)),N="default",_=(S==null?void 0:S.default)||SE.default);const M=!!(Q.focusable||e&&typeof Q.focusable>"u"),I=typeof m<"u"&&(Q.reconnectable||n&&typeof Q.reconnectable>"u"),U=!!(Q.selectable||r&&typeof Q.selectable>"u"),F=C.useRef(null),[Z,X]=C.useState(!1),[H,E]=C.useState(!1),q=qt(),{zIndex:R,sourceX:z,sourceY:B,targetX:W,targetY:A,sourcePosition:D,targetPosition:Y}=at(C.useCallback(we=>{const Qe=we.nodeLookup.get(Q.source),Le=we.nodeLookup.get(Q.target);if(!Qe||!Le)return{zIndex:Q.zIndex,...wE};const He=Hse({id:t,sourceNode:Qe,targetNode:Le,sourceHandle:Q.sourceHandle||null,targetHandle:Q.targetHandle||null,connectionMode:we.connectionMode,onError:w});return{zIndex:Zse({selected:Q.selected,zIndex:Q.zIndex,sourceNode:Qe,targetNode:Le,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...He||wE}},[Q.source,Q.target,Q.sourceHandle,Q.targetHandle,Q.selected,Q.zIndex]),Bt),P=C.useMemo(()=>Q.markerStart?`url('#${US(Q.markerStart,v)}')`:void 0,[Q.markerStart,v]),ee=C.useMemo(()=>Q.markerEnd?`url('#${US(Q.markerEnd,v)}')`:void 0,[Q.markerEnd,v]);if(Q.hidden||z===null||B===null||W===null||A===null)return null;const ae=we=>{var ze;const{addSelectedEdges:Qe,unselectNodesAndEdges:Le,multiSelectionActive:He}=q.getState();U&&(q.setState({nodesSelectionActive:!1}),Q.selected&&He?(Le({nodes:[],edges:[Q]}),(ze=F.current)==null||ze.blur()):Qe([t])),i&&i(we,Q)},ne=s?we=>{s(we,{...Q})}:void 0,fe=a?we=>{a(we,{...Q})}:void 0,oe=o?we=>{o(we,{...Q})}:void 0,me=u?we=>{u(we,{...Q})}:void 0,je=f?we=>{f(we,{...Q})}:void 0,ke=we=>{var Qe;if(!j&&Lz.includes(we.key)&&U){const{unselectNodesAndEdges:Le,addSelectedEdges:He}=q.getState();we.key==="Escape"?((Qe=F.current)==null||Qe.blur(),Le({edges:[Q]})):He([t])}};return p.jsx("svg",{style:{zIndex:R},children:p.jsxs("g",{className:gn(["react-flow__edge",`react-flow__edge-${N}`,Q.className,k,{selected:Q.selected,animated:Q.animated,inactive:!U&&!i,updating:Z,selectable:U}]),onClick:ae,onDoubleClick:ne,onContextMenu:fe,onMouseEnter:oe,onMouseMove:me,onMouseLeave:je,onKeyDown:M?ke:void 0,tabIndex:M?0:void 0,role:Q.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":Q.ariaLabel===null?void 0:Q.ariaLabel||`Edge from ${Q.source} to ${Q.target}`,"aria-describedby":M?`${O4}-${v}`:void 0,ref:F,...Q.domAttributes,children:[!H&&p.jsx(_,{id:t,source:Q.source,target:Q.target,type:Q.type,selected:Q.selected,animated:Q.animated,selectable:U,deletable:Q.deletable??!0,label:Q.label,labelStyle:Q.labelStyle,labelShowBg:Q.labelShowBg,labelBgStyle:Q.labelBgStyle,labelBgPadding:Q.labelBgPadding,labelBgBorderRadius:Q.labelBgBorderRadius,sourceX:z,sourceY:B,targetX:W,targetY:A,sourcePosition:D,targetPosition:Y,data:Q.data,style:Q.style,sourceHandleId:Q.sourceHandle,targetHandleId:Q.targetHandle,markerStart:P,markerEnd:ee,pathOptions:"pathOptions"in Q?Q.pathOptions:void 0,interactionWidth:Q.interactionWidth}),I&&p.jsx(soe,{edge:Q,isReconnectable:I,reconnectRadius:h,onReconnect:m,onReconnectStart:O,onReconnectEnd:x,sourceX:z,sourceY:B,targetX:W,targetY:A,sourcePosition:D,targetPosition:Y,setUpdateHover:X,setReconnecting:E})]})})}var loe=C.memo(aoe);const ooe=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Z4({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:m,onEdgeDoubleClick:O,onReconnectStart:x,onReconnectEnd:v,disableKeyboardA11y:S}){const{edgesFocusable:k,edgesReconnectable:w,elementsSelectable:j,onError:Q}=at(ooe,Bt),T=Yle(e);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(Fle,{defaultColor:t,rfId:n}),T.map(N=>p.jsx(loe,{id:N,edgesFocusable:k,edgesReconnectable:w,elementsSelectable:j,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:o,onMouseMove:u,onMouseLeave:f,onClick:h,reconnectRadius:m,onDoubleClick:O,onReconnectStart:x,onReconnectEnd:v,rfId:n,onError:Q,edgeTypes:r,disableKeyboardA11y:S},N))]})}Z4.displayName="EdgeRenderer";const coe=C.memo(Z4),uoe=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function foe({children:t}){const e=at(uoe);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function doe(t){const e=c2(),n=C.useRef(!1);C.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const hoe=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function poe(t){const e=at(hoe),n=qt();return C.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function moe(t){return t.connection.inProgress?{...t.connection,to:_p(t.connection.to,t.transform)}:{...t.connection}}function goe(t){return moe}function Ooe(t){const e=goe();return at(e,Bt)}const xoe=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function yoe({containerStyle:t,style:e,type:n,component:r}){const{nodesConnectable:i,width:s,height:a,isValid:o,inProgress:u}=at(xoe,Bt);return!(s&&i&&u)?null:p.jsx("svg",{style:t,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:gn(["react-flow__connection",Bz(o)]),children:p.jsx(B4,{style:e,type:n,CustomComponent:r,isValid:o})})})}const B4=({style:t,type:e=ll.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:a,fromHandle:o,fromPosition:u,to:f,toNode:h,toHandle:m,toPosition:O,pointer:x}=Ooe();if(!i)return;if(n)return p.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:a,fromHandle:o,fromX:s.x,fromY:s.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:O,connectionStatus:Bz(r),toNode:h,toHandle:m,pointer:x});let v="";const S={sourceX:s.x,sourceY:s.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:O};switch(e){case ll.Bezier:[v]=e4(S);break;case ll.SimpleBezier:[v]=$4(S);break;case ll.Step:[v]=YS({...S,borderRadius:0});break;case ll.SmoothStep:[v]=YS(S);break;default:[v]=n4(S)}return p.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:t})};B4.displayName="ConnectionLine";const voe={};function CE(t=voe){C.useRef(t),qt(),C.useEffect(()=>{},[t])}function boe(){qt(),C.useRef(!1),C.useEffect(()=>{},[])}function q4({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:O,onSelectionEnd:x,connectionLineType:v,connectionLineStyle:S,connectionLineComponent:k,connectionLineContainerStyle:w,selectionKeyCode:j,selectionOnDrag:Q,selectionMode:T,multiSelectionKeyCode:N,panActivationKeyCode:_,zoomActivationKeyCode:M,deleteKeyCode:I,onlyRenderVisibleElements:U,elementsSelectable:F,defaultViewport:Z,translateExtent:X,minZoom:H,maxZoom:E,preventScrolling:q,defaultMarkerColor:R,zoomOnScroll:z,zoomOnPinch:B,panOnScroll:W,panOnScrollSpeed:A,panOnScrollMode:D,zoomOnDoubleClick:Y,panOnDrag:P,onPaneClick:ee,onPaneMouseEnter:ae,onPaneMouseMove:ne,onPaneMouseLeave:fe,onPaneScroll:oe,onPaneContextMenu:me,paneClickDistance:je,nodeClickDistance:ke,onEdgeContextMenu:we,onEdgeMouseEnter:Qe,onEdgeMouseMove:Le,onEdgeMouseLeave:He,reconnectRadius:ze,onReconnect:vt,onReconnectStart:Qn,onReconnectEnd:Jt,noDragClassName:Cn,noWheelClassName:sr,noPanClassName:jr,disableKeyboardA11y:Yr,nodeExtent:en,rfId:Si,viewport:ce,onViewportChange:ge}){return CE(t),CE(e),boe(),doe(n),poe(ce),p.jsx(Rle,{onPaneClick:ee,onPaneMouseEnter:ae,onPaneMouseMove:ne,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:oe,paneClickDistance:je,deleteKeyCode:I,selectionKeyCode:j,selectionOnDrag:Q,selectionMode:T,onSelectionStart:O,onSelectionEnd:x,multiSelectionKeyCode:N,panActivationKeyCode:_,zoomActivationKeyCode:M,elementsSelectable:F,zoomOnScroll:z,zoomOnPinch:B,zoomOnDoubleClick:Y,panOnScroll:W,panOnScrollSpeed:A,panOnScrollMode:D,panOnDrag:P,defaultViewport:Z,translateExtent:X,minZoom:H,maxZoom:E,onSelectionContextMenu:m,preventScrolling:q,noDragClassName:Cn,noWheelClassName:sr,noPanClassName:jr,disableKeyboardA11y:Yr,onViewportChange:ge,isControlledViewport:!!ce,children:p.jsxs(foe,{children:[p.jsx(coe,{edgeTypes:e,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Qn,onReconnectEnd:Jt,onlyRenderVisibleElements:U,onEdgeContextMenu:we,onEdgeMouseEnter:Qe,onEdgeMouseMove:Le,onEdgeMouseLeave:He,reconnectRadius:ze,defaultMarkerColor:R,noPanClassName:jr,disableKeyboardA11y:Yr,rfId:Si}),p.jsx(yoe,{style:S,type:v,component:k,containerStyle:w}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(Ile,{nodeTypes:t,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:o,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:ke,onlyRenderVisibleElements:U,noPanClassName:jr,noDragClassName:Cn,disableKeyboardA11y:Yr,nodeExtent:en,rfId:Si}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}q4.displayName="GraphView";const Soe=C.memo(q4),jE=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:u=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:m,zIndexMode:O="basic"}={})=>{const x=new Map,v=new Map,S=new Map,k=new Map,w=r??e??[],j=n??t??[],Q=h??[0,0],T=m??Vh;s4(S,k,w);const N=WS(j,x,v,{nodeOrigin:Q,nodeExtent:T,zIndexMode:O});let _=[0,0,1];if(a&&i&&s){const M=Tp(x,{filter:Z=>!!((Z.width||Z.initialWidth)&&(Z.height||Z.initialHeight))}),{x:I,y:U,zoom:F}=n2(M,i,s,u,f,(o==null?void 0:o.padding)??.1);_=[I,U,F]}return{rfId:"1",width:i??0,height:s??0,transform:_,nodes:j,nodesInitialized:N,nodeLookup:x,parentLookup:v,edges:w,edgeLookup:k,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:Vh,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Xu.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:Q,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...Zz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Mse,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Xz,zIndexMode:O,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},woe=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:m,zIndexMode:O})=>Lae((x,v)=>{async function S(){const{nodeLookup:k,panZoom:w,fitViewOptions:j,fitViewResolver:Q,width:T,height:N,minZoom:_,maxZoom:M}=v();w&&(await Ese({nodes:k,width:T,height:N,panZoom:w,minZoom:_,maxZoom:M},j),Q==null||Q.resolve(!0),x({fitViewResolver:null}))}return{...jE({nodes:t,edges:e,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:O}),setNodes:k=>{const{nodeLookup:w,parentLookup:j,nodeOrigin:Q,elevateNodesOnSelect:T,fitViewQueued:N,zIndexMode:_}=v(),M=WS(k,w,j,{nodeOrigin:Q,nodeExtent:m,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:_});N&&M?(S(),x({nodes:k,nodesInitialized:M,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:k,nodesInitialized:M})},setEdges:k=>{const{connectionLookup:w,edgeLookup:j}=v();s4(w,j,k),x({edges:k})},setDefaultNodesAndEdges:(k,w)=>{if(k){const{setNodes:j}=v();j(k),x({hasDefaultNodes:!0})}if(w){const{setEdges:j}=v();j(w),x({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:w,nodeLookup:j,parentLookup:Q,domNode:T,nodeOrigin:N,nodeExtent:_,debug:M,fitViewQueued:I,zIndexMode:U}=v(),{changes:F,updatedInternals:Z}=rae(k,j,Q,T,N,_,U);Z&&(Jse(j,Q,{nodeOrigin:N,nodeExtent:_,zIndexMode:U}),I?(S(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(F==null?void 0:F.length)>0&&(M&&console.log("React Flow: trigger node changes",F),w==null||w(F)))},updateNodePositions:(k,w=!1)=>{const j=[];let Q=[];const{nodeLookup:T,triggerNodeChanges:N,connection:_,updateConnection:M,onNodesChangeMiddlewareMap:I}=v();for(const[U,F]of k){const Z=T.get(U),X=!!(Z!=null&&Z.expandParent&&(Z!=null&&Z.parentId)&&(F!=null&&F.position)),H={id:U,type:"position",position:X?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:w};if(Z&&_.inProgress&&_.fromNode.id===Z.id){const E=Do(Z,_.fromHandle,$e.Left,!0);M({..._,from:E})}X&&Z.parentId&&j.push({id:U,parentId:Z.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),Q.push(H)}if(j.length>0){const{parentLookup:U,nodeOrigin:F}=v(),Z=o2(j,T,U,F);Q.push(...Z)}for(const U of I.values())Q=U(Q);N(Q)},triggerNodeChanges:k=>{const{onNodesChange:w,setNodes:j,nodes:Q,hasDefaultNodes:T,debug:N}=v();if(k!=null&&k.length){if(T){const _=ale(k,Q);j(_)}N&&console.log("React Flow: trigger node changes",k),w==null||w(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:w,setEdges:j,edges:Q,hasDefaultEdges:T,debug:N}=v();if(k!=null&&k.length){if(T){const _=lle(k,Q);j(_)}N&&console.log("React Flow: trigger edge changes",k),w==null||w(k)}},addSelectedNodes:k=>{const{multiSelectionActive:w,edgeLookup:j,nodeLookup:Q,triggerNodeChanges:T,triggerEdgeChanges:N}=v();if(w){const _=k.map(M=>eo(M,!0));T(_);return}T(eu(Q,new Set([...k]),!0)),N(eu(j))},addSelectedEdges:k=>{const{multiSelectionActive:w,edgeLookup:j,nodeLookup:Q,triggerNodeChanges:T,triggerEdgeChanges:N}=v();if(w){const _=k.map(M=>eo(M,!0));N(_);return}N(eu(j,new Set([...k]))),T(eu(Q,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:w}={})=>{const{edges:j,nodes:Q,nodeLookup:T,triggerNodeChanges:N,triggerEdgeChanges:_}=v(),M=k||Q,I=w||j,U=[];for(const Z of M){if(!Z.selected)continue;const X=T.get(Z.id);X&&(X.selected=!1),U.push(eo(Z.id,!1))}const F=[];for(const Z of I)Z.selected&&F.push(eo(Z.id,!1));N(U),_(F)},setMinZoom:k=>{const{panZoom:w,maxZoom:j}=v();w==null||w.setScaleExtent([k,j]),x({minZoom:k})},setMaxZoom:k=>{const{panZoom:w,minZoom:j}=v();w==null||w.setScaleExtent([j,k]),x({maxZoom:k})},setTranslateExtent:k=>{var w;(w=v().panZoom)==null||w.setTranslateExtent(k),x({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:w,triggerNodeChanges:j,triggerEdgeChanges:Q,elementsSelectable:T}=v();if(!T)return;const N=w.reduce((M,I)=>I.selected?[...M,eo(I.id,!1)]:M,[]),_=k.reduce((M,I)=>I.selected?[...M,eo(I.id,!1)]:M,[]);j(N),Q(_)},setNodeExtent:k=>{const{nodes:w,nodeLookup:j,parentLookup:Q,nodeOrigin:T,elevateNodesOnSelect:N,nodeExtent:_,zIndexMode:M}=v();k[0][0]===_[0][0]&&k[0][1]===_[0][1]&&k[1][0]===_[1][0]&&k[1][1]===_[1][1]||(WS(w,j,Q,{nodeOrigin:T,nodeExtent:k,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:M}),x({nodeExtent:k}))},panBy:k=>{const{transform:w,width:j,height:Q,panZoom:T,translateExtent:N}=v();return iae({delta:k,panZoom:T,transform:w,translateExtent:N,width:j,height:Q})},setCenter:async(k,w,j)=>{const{width:Q,height:T,maxZoom:N,panZoom:_}=v();if(!_)return Promise.resolve(!1);const M=typeof(j==null?void 0:j.zoom)<"u"?j.zoom:N;return await _.setViewport({x:Q/2-k*M,y:T/2-w*M,zoom:M},{duration:j==null?void 0:j.duration,ease:j==null?void 0:j.ease,interpolate:j==null?void 0:j.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...Zz}})},updateConnection:k=>{x({connection:k})},reset:()=>x({...jE()})}},Object.is);function koe({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:u,fitView:f,nodeOrigin:h,nodeExtent:m,zIndexMode:O,children:x}){const[v]=C.useState(()=>woe({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:f,minZoom:a,maxZoom:o,fitViewOptions:u,nodeOrigin:h,nodeExtent:m,zIndexMode:O}));return p.jsx(Xae,{value:v,children:p.jsx(fle,{children:x})})}function Qoe({children:t,nodes:e,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:o,fitViewOptions:u,minZoom:f,maxZoom:h,nodeOrigin:m,nodeExtent:O,zIndexMode:x}){return C.useContext(ay)?p.jsx(p.Fragment,{children:t}):p.jsx(koe,{initialNodes:e,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:o,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:m,nodeExtent:O,zIndexMode:x,children:t})}const Coe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function joe({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:o,onEdgeClick:u,onInit:f,onMove:h,onMoveStart:m,onMoveEnd:O,onConnect:x,onConnectStart:v,onConnectEnd:S,onClickConnectStart:k,onClickConnectEnd:w,onNodeMouseEnter:j,onNodeMouseMove:Q,onNodeMouseLeave:T,onNodeContextMenu:N,onNodeDoubleClick:_,onNodeDragStart:M,onNodeDrag:I,onNodeDragStop:U,onNodesDelete:F,onEdgesDelete:Z,onDelete:X,onSelectionChange:H,onSelectionDragStart:E,onSelectionDrag:q,onSelectionDragStop:R,onSelectionContextMenu:z,onSelectionStart:B,onSelectionEnd:W,onBeforeDelete:A,connectionMode:D,connectionLineType:Y=ll.Bezier,connectionLineStyle:P,connectionLineComponent:ee,connectionLineContainerStyle:ae,deleteKeyCode:ne="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:oe=!1,selectionMode:me=Ih.Full,panActivationKeyCode:je="Space",multiSelectionKeyCode:ke=Uh()?"Meta":"Control",zoomActivationKeyCode:we=Uh()?"Meta":"Control",snapToGrid:Qe,snapGrid:Le,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:ze,nodesDraggable:vt,autoPanOnNodeFocus:Qn,nodesConnectable:Jt,nodesFocusable:Cn,nodeOrigin:sr=x4,edgesFocusable:jr,edgesReconnectable:Yr,elementsSelectable:en=!0,defaultViewport:Si=Jae,minZoom:ce=.5,maxZoom:ge=2,translateExtent:Ne=Vh,preventScrolling:Be=!0,nodeExtent:Ke,defaultMarkerColor:Ie="#b1b1b7",zoomOnScroll:ht=!0,zoomOnPinch:kt=!0,panOnScroll:Qt=!1,panOnScrollSpeed:Vt=.5,panOnScrollMode:ot=$o.Free,zoomOnDoubleClick:Ur=!0,panOnDrag:jn=!0,onPaneClick:Of,onPaneMouseEnter:Wr,onPaneMouseMove:Jo,onPaneMouseLeave:ec,onPaneScroll:ks,onPaneContextMenu:tc,paneClickDistance:_l=1,nodeClickDistance:vy=0,children:qp,onReconnect:xf,onReconnectStart:Nl,onReconnectEnd:by,onEdgeContextMenu:Vp,onEdgeDoubleClick:Ip,onEdgeMouseEnter:Yp,onEdgeMouseMove:yf,onEdgeMouseLeave:vf,reconnectRadius:Up=10,onNodesChange:Wp,onEdgesChange:Vi,noDragClassName:On="nodrag",noWheelClassName:Dn="nowheel",noPanClassName:Qs="nopan",fitView:nc,fitViewOptions:Hp,connectOnClick:Sy,attributionPosition:Gp,proOptions:Pl,defaultEdgeOptions:bf,elevateNodesOnSelect:ba=!0,elevateEdgesOnSelect:Sa=!1,disableKeyboardA11y:wa=!1,autoPanOnConnect:ka,autoPanOnNodeDrag:ln,autoPanSpeed:Fp,connectionRadius:Kp,isValidConnection:Cs,onError:Qa,style:wy,id:Sf,nodeDragThreshold:Jp,connectionDragThreshold:ky,viewport:rc,onViewportChange:ic,width:wi,height:ar,colorMode:em="light",debug:Qy,onScroll:Ca,ariaLabelConfig:tm,zIndexMode:El="basic",...Cy},lr){const Al=Sf||"1",nm=rle(em),wf=C.useCallback(js=>{js.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ca==null||Ca(js)},[Ca]);return p.jsx("div",{"data-testid":"rf__wrapper",...Cy,onScroll:wf,style:{...wy,...Coe},ref:lr,className:gn(["react-flow",i,nm]),id:Sf,role:"application",children:p.jsxs(Qoe,{nodes:t,edges:e,width:wi,height:ar,fitView:nc,fitViewOptions:Hp,minZoom:ce,maxZoom:ge,nodeOrigin:sr,nodeExtent:Ke,zIndexMode:El,children:[p.jsx(Soe,{onInit:f,onNodeClick:o,onEdgeClick:u,onNodeMouseEnter:j,onNodeMouseMove:Q,onNodeMouseLeave:T,onNodeContextMenu:N,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:a,connectionLineType:Y,connectionLineStyle:P,connectionLineComponent:ee,connectionLineContainerStyle:ae,selectionKeyCode:fe,selectionOnDrag:oe,selectionMode:me,deleteKeyCode:ne,multiSelectionKeyCode:ke,panActivationKeyCode:je,zoomActivationKeyCode:we,onlyRenderVisibleElements:He,defaultViewport:Si,translateExtent:Ne,minZoom:ce,maxZoom:ge,preventScrolling:Be,zoomOnScroll:ht,zoomOnPinch:kt,zoomOnDoubleClick:Ur,panOnScroll:Qt,panOnScrollSpeed:Vt,panOnScrollMode:ot,panOnDrag:jn,onPaneClick:Of,onPaneMouseEnter:Wr,onPaneMouseMove:Jo,onPaneMouseLeave:ec,onPaneScroll:ks,onPaneContextMenu:tc,paneClickDistance:_l,nodeClickDistance:vy,onSelectionContextMenu:z,onSelectionStart:B,onSelectionEnd:W,onReconnect:xf,onReconnectStart:Nl,onReconnectEnd:by,onEdgeContextMenu:Vp,onEdgeDoubleClick:Ip,onEdgeMouseEnter:Yp,onEdgeMouseMove:yf,onEdgeMouseLeave:vf,reconnectRadius:Up,defaultMarkerColor:Ie,noDragClassName:On,noWheelClassName:Dn,noPanClassName:Qs,rfId:Al,disableKeyboardA11y:wa,nodeExtent:Ke,viewport:rc,onViewportChange:ic}),p.jsx(nle,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:v,onConnectEnd:S,onClickConnectStart:k,onClickConnectEnd:w,nodesDraggable:vt,autoPanOnNodeFocus:Qn,nodesConnectable:Jt,nodesFocusable:Cn,edgesFocusable:jr,edgesReconnectable:Yr,elementsSelectable:en,elevateNodesOnSelect:ba,elevateEdgesOnSelect:Sa,minZoom:ce,maxZoom:ge,nodeExtent:Ke,onNodesChange:Wp,onEdgesChange:Vi,snapToGrid:Qe,snapGrid:Le,connectionMode:D,translateExtent:Ne,connectOnClick:Sy,defaultEdgeOptions:bf,fitView:nc,fitViewOptions:Hp,onNodesDelete:F,onEdgesDelete:Z,onDelete:X,onNodeDragStart:M,onNodeDrag:I,onNodeDragStop:U,onSelectionDrag:q,onSelectionDragStart:E,onSelectionDragStop:R,onMove:h,onMoveStart:m,onMoveEnd:O,noPanClassName:Qs,nodeOrigin:sr,rfId:Al,autoPanOnConnect:ka,autoPanOnNodeDrag:ln,autoPanSpeed:Fp,onError:Qa,connectionRadius:Kp,isValidConnection:Cs,selectNodesOnDrag:ze,nodeDragThreshold:Jp,connectionDragThreshold:ky,onBeforeDelete:A,debug:Qy,ariaLabelConfig:tm,zIndexMode:El}),p.jsx(Kae,{onSelectionChange:H}),qp,p.jsx(Uae,{proOptions:Pl,position:Gp}),p.jsx(Yae,{rfId:Al,disableKeyboardA11y:wa})]})})}var Toe=v4(joe);function $oe({dimensions:t,lineWidth:e,variant:n,className:r}){return p.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:gn(["react-flow__background-pattern",n,r])})}function _oe({radius:t,className:e}){return p.jsx("circle",{cx:t,cy:t,r:t,className:gn(["react-flow__background-pattern","dots",e])})}var vl;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(vl||(vl={}));const Noe={[vl.Dots]:1,[vl.Lines]:1,[vl.Cross]:6},Poe=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function V4({id:t,variant:e=vl.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:o,style:u,className:f,patternClassName:h}){const m=C.useRef(null),{transform:O,patternId:x}=at(Poe,Bt),v=r||Noe[e],S=e===vl.Dots,k=e===vl.Cross,w=Array.isArray(n)?n:[n,n],j=[w[0]*O[2]||1,w[1]*O[2]||1],Q=v*O[2],T=Array.isArray(s)?s:[s,s],N=k?[Q,Q]:j,_=[T[0]*O[2]||1+N[0]/2,T[1]*O[2]||1+N[1]/2],M=`${x}${t||""}`;return p.jsxs("svg",{className:gn(["react-flow__background",f]),style:{...u,...oy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:m,"data-testid":"rf__background",children:[p.jsx("pattern",{id:M,x:O[0]%j[0],y:O[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:S?p.jsx(_oe,{radius:Q/2,className:h}):p.jsx($oe,{dimensions:N,lineWidth:i,variant:e,className:h})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}V4.displayName="Background";const Eoe=C.memo(V4);function Aoe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Moe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Roe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function zoe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Doe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Vg({children:t,className:e,...n}){return p.jsx("button",{type:"button",className:gn(["react-flow__controls-button",e]),...n,children:t})}const Loe=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function I4({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:o,onInteractiveChange:u,className:f,children:h,position:m="bottom-left",orientation:O="vertical","aria-label":x}){const v=qt(),{isInteractive:S,minZoomReached:k,maxZoomReached:w,ariaLabelConfig:j}=at(Loe,Bt),{zoomIn:Q,zoomOut:T,fitView:N}=c2(),_=()=>{Q(),s==null||s()},M=()=>{T(),a==null||a()},I=()=>{N(i),o==null||o()},U=()=>{v.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u==null||u(!S)},F=O==="horizontal"?"horizontal":"vertical";return p.jsxs(ly,{className:gn(["react-flow__controls",F,f]),position:m,style:t,"data-testid":"rf__controls","aria-label":x??j["controls.ariaLabel"],children:[e&&p.jsxs(p.Fragment,{children:[p.jsx(Vg,{onClick:_,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:w,children:p.jsx(Aoe,{})}),p.jsx(Vg,{onClick:M,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:k,children:p.jsx(Moe,{})})]}),n&&p.jsx(Vg,{className:"react-flow__controls-fitview",onClick:I,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:p.jsx(Roe,{})}),r&&p.jsx(Vg,{className:"react-flow__controls-interactive",onClick:U,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:S?p.jsx(Doe,{}):p.jsx(zoe,{})}),h]})}I4.displayName="Controls";const Xoe=C.memo(I4);function Zoe({id:t,x:e,y:n,width:r,height:i,style:s,color:a,strokeColor:o,strokeWidth:u,className:f,borderRadius:h,shapeRendering:m,selected:O,onClick:x}){const{background:v,backgroundColor:S}=s||{},k=a||v||S;return p.jsx("rect",{className:gn(["react-flow__minimap-node",{selected:O},f]),x:e,y:n,rx:h,ry:h,width:r,height:i,style:{fill:k,stroke:o,strokeWidth:u},shapeRendering:m,onClick:x?w=>x(w,t):void 0})}const Boe=C.memo(Zoe),qoe=t=>t.nodes.map(e=>e.id),Y0=t=>t instanceof Function?t:()=>t;function Voe({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=Boe,onClick:a}){const o=at(qoe,Bt),u=Y0(e),f=Y0(t),h=Y0(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:o.map(O=>p.jsx(Yoe,{id:O,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:m},O))})}function Ioe({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:o,onClick:u}){const{node:f,x:h,y:m,width:O,height:x}=at(v=>{const S=v.nodeLookup.get(t);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const k=S.internals.userNode,{x:w,y:j}=S.internals.positionAbsolute,{width:Q,height:T}=xa(k);return{node:k,x:w,y:j,width:Q,height:T}},Bt);return!f||f.hidden||!Wz(f)?null:p.jsx(o,{x:h,y:m,width:O,height:x,style:f.style,selected:!!f.selected,className:r(f),color:e(f),borderRadius:i,strokeColor:n(f),strokeWidth:s,shapeRendering:a,onClick:u,id:f.id})}const Yoe=C.memo(Ioe);var Uoe=C.memo(Voe);const Woe=200,Hoe=150,Goe=t=>!t.hidden,Foe=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?Uz(Tp(t.nodeLookup,{filter:Goe}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},Koe="react-flow__minimap-desc";function Y4({style:t,className:e,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:u,maskColor:f,maskStrokeColor:h,maskStrokeWidth:m,position:O="bottom-right",onClick:x,onNodeClick:v,pannable:S=!1,zoomable:k=!1,ariaLabel:w,inversePan:j,zoomStep:Q=1,offsetScale:T=5}){const N=qt(),_=C.useRef(null),{boundingRect:M,viewBB:I,rfId:U,panZoom:F,translateExtent:Z,flowWidth:X,flowHeight:H,ariaLabelConfig:E}=at(Foe,Bt),q=(t==null?void 0:t.width)??Woe,R=(t==null?void 0:t.height)??Hoe,z=M.width/q,B=M.height/R,W=Math.max(z,B),A=W*q,D=W*R,Y=T*W,P=M.x-(A-M.width)/2-Y,ee=M.y-(D-M.height)/2-Y,ae=A+Y*2,ne=D+Y*2,fe=`${Koe}-${U}`,oe=C.useRef(0),me=C.useRef();oe.current=W,C.useEffect(()=>{if(_.current&&F)return me.current=hae({domNode:_.current,panZoom:F,getTransform:()=>N.getState().transform,getViewScale:()=>oe.current}),()=>{var Qe;(Qe=me.current)==null||Qe.destroy()}},[F]),C.useEffect(()=>{var Qe;(Qe=me.current)==null||Qe.update({translateExtent:Z,width:X,height:H,inversePan:j,pannable:S,zoomStep:Q,zoomable:k})},[S,k,j,Q,Z,X,H]);const je=x?Qe=>{var ze;const[Le,He]=((ze=me.current)==null?void 0:ze.pointer(Qe))||[0,0];x(Qe,{x:Le,y:He})}:void 0,ke=v?C.useCallback((Qe,Le)=>{const He=N.getState().nodeLookup.get(Le).internals.userNode;v(Qe,He)},[]):void 0,we=w??E["minimap.ariaLabel"];return p.jsx(ly,{position:O,style:{...t,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*W:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:gn(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:q,height:R,viewBox:`${P} ${ee} ${ae} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:_,onClick:je,children:[we&&p.jsx("title",{id:fe,children:we}),p.jsx(Uoe,{onClick:ke,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:o}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-Y},${ee-Y}h${ae+Y*2}v${ne+Y*2}h${-ae-Y*2}z
422
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Y4.displayName="MiniMap";C.memo(Y4);const Joe=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,ece={[Vu.Line]:"right",[Vu.Handle]:"bottom-right"};function tce({nodeId:t,position:e,variant:n=Vu.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:o=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:O,autoScale:x=!0,shouldResize:v,onResizeStart:S,onResize:k,onResizeEnd:w}){const j=k4(),Q=typeof t=="string"?t:j,T=qt(),N=C.useRef(null),_=n===Vu.Handle,M=at(C.useCallback(Joe(_&&x),[_,x]),Bt),I=C.useRef(null),U=e??ece[n];C.useEffect(()=>{if(!(!N.current||!Q))return I.current||(I.current=jae({domNode:N.current,nodeId:Q,getStoreItems:()=>{const{nodeLookup:Z,transform:X,snapGrid:H,snapToGrid:E,nodeOrigin:q,domNode:R}=T.getState();return{nodeLookup:Z,transform:X,snapGrid:H,snapToGrid:E,nodeOrigin:q,paneDomNode:R}},onChange:(Z,X)=>{const{triggerNodeChanges:H,nodeLookup:E,parentLookup:q,nodeOrigin:R}=T.getState(),z=[],B={x:Z.x,y:Z.y},W=E.get(Q);if(W&&W.expandParent&&W.parentId){const A=W.origin??R,D=Z.width??W.measured.width??0,Y=Z.height??W.measured.height??0,P={id:W.id,parentId:W.parentId,rect:{width:D,height:Y,...Hz({x:Z.x??W.position.x,y:Z.y??W.position.y},{width:D,height:Y},W.parentId,E,A)}},ee=o2([P],E,q,R);z.push(...ee),B.x=Z.x?Math.max(A[0]*D,Z.x):void 0,B.y=Z.y?Math.max(A[1]*Y,Z.y):void 0}if(B.x!==void 0&&B.y!==void 0){const A={id:Q,type:"position",position:{...B}};z.push(A)}if(Z.width!==void 0&&Z.height!==void 0){const D={id:Q,type:"dimensions",resizing:!0,setAttributes:O?O==="horizontal"?"width":"height":!0,dimensions:{width:Z.width,height:Z.height}};z.push(D)}for(const A of X){const D={...A,type:"position"};z.push(D)}H(z)},onEnd:({width:Z,height:X})=>{const H={id:Q,type:"dimensions",resizing:!1,dimensions:{width:Z,height:X}};T.getState().triggerNodeChanges([H])}})),I.current.update({controlPosition:U,boundaries:{minWidth:o,minHeight:u,maxWidth:f,maxHeight:h},keepAspectRatio:m,resizeDirection:O,onResizeStart:S,onResize:k,onResizeEnd:w,shouldResize:v}),()=>{var Z;(Z=I.current)==null||Z.destroy()}},[U,o,u,f,h,m,S,k,w,v]);const F=U.split("-");return p.jsx("div",{className:gn(["react-flow__resize-control","nodrag",...F,n,r]),ref:N,style:{...i,scale:M,...a&&{[_?"backgroundColor":"borderColor"]:a}},children:s})}C.memo(tce);function nce({data:t}){return p.jsxs("div",{className:"px-4 py-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] shadow-sm min-w-[180px] max-w-[240px]",children:[p.jsx(Iu,{type:"target",position:$e.Top,className:"!bg-[var(--color-accent)]"}),p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)] font-[var(--font-mono)]",children:t.index+1}),p.jsx("span",{className:"text-sm font-bold text-[var(--color-text)] truncate",children:t.label})]}),t.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] line-clamp-2",children:t.description}),t.agent&&p.jsx("span",{className:"inline-block mt-1.5 text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:t.agent}),p.jsx(Iu,{type:"source",position:$e.Bottom,className:"!bg-[var(--color-accent)]"})]})}const rce={step:nce};function ice({workflow:t,onStepClick:e}){const{nodes:n,edges:r}=C.useMemo(()=>{const o=t.steps.map((f,h)=>({id:`step-${h}`,type:"step",position:{x:250,y:h*120},data:{label:f.title,description:f.description,agent:f.agent,index:h}})),u=t.steps.slice(0,-1).map((f,h)=>({id:`edge-${h}`,source:`step-${h}`,target:`step-${h+1}`,animated:!0,style:{stroke:"var(--color-accent)",strokeWidth:2}}));return{nodes:o,edges:u}},[t.steps]),i=C.useCallback((s,a)=>{const o=parseInt(a.id.replace("step-",""),10);e==null||e(o)},[e]);return p.jsx("div",{className:"h-[500px] rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:p.jsxs(Toe,{nodes:n,edges:r,nodeTypes:rce,onNodeClick:i,fitView:!0,fitViewOptions:{padding:.3},proOptions:{hideAttribution:!0},children:[p.jsx(Eoe,{gap:16,size:1,color:"var(--color-border-subtle)"}),p.jsx(Xoe,{showInteractive:!1,className:"!bg-[var(--color-surface-raised)] !border-[var(--color-border-subtle)] !shadow-md [&>button]:!bg-[var(--color-surface-raised)] [&>button]:!border-[var(--color-border-subtle)] [&>button]:!text-[var(--color-text)]"})]})})}function uy({title:t,count:e,modules:n,moduleCounts:r,activeModule:i,onModuleChange:s,search:a,onSearchChange:o,searchPlaceholder:u,filteredCount:f,actions:h}){return p.jsxs("div",{className:"mb-6",children:[p.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[p.jsxs("h1",{className:"text-2xl font-extrabold shrink-0",children:[t," (",e,")"]}),n.length>0&&p.jsxs("div",{className:"flex gap-1 flex-wrap",children:[p.jsx("button",{onClick:()=>s("all"),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i==="all"?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"All"}),n.map(m=>p.jsxs("button",{onClick:()=>s(m),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i===m?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[m,r&&r[m]!==void 0&&p.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["(",r[m],")"]})]},m))]}),p.jsxs("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:[p.jsxs("div",{className:"relative",children:[p.jsx(Vo,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",placeholder:u??`Search ${t.toLowerCase()}...`,value:a,onChange:m=>o(m.target.value),className:"pl-9 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)] w-64"})]}),h]})]}),f!==void 0&&f!==e&&p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-3",children:["Showing ",f," of ",e," ",t.toLowerCase()]})]})}const TE=/^[a-z][a-z0-9-]*$/;function $E(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function sce({onClose:t,onCreated:e}){const n=qo(),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState("step-based"),[f,h]=C.useState(""),[m,O]=C.useState(""),[x,v]=C.useState(""),[S,k]=C.useState([]),[w,j]=C.useState(!1),[Q,T]=C.useState(!1),[N,_]=C.useState("create"),[M,I]=C.useState([]),[U,F]=C.useState([]),[Z,X]=C.useState([]),[H,E]=C.useState(null),[q,R]=C.useState(!1);C.useEffect(()=>{fetch("/api/modules").then(ne=>ne.json()).then(ne=>{const fe=ne;I(fe.map(oe=>({name:oe.name}))),fe.length===1&&v(fe[0].name)}).catch(()=>{}),fetch("/api/workflows").then(ne=>ne.json()).then(ne=>{const fe=ne,oe=new Set;for(const me of fe)me.phase&&oe.add(me.phase);F(Array.from(oe).sort())}).catch(()=>{}),fetch("/api/agents").then(ne=>ne.json()).then(ne=>X(ne)).catch(()=>{})},[]);const z=r.length===0||TE.test(r),B=f==="__custom"?m.trim():f,W=r.trim().length>0&&TE.test(r)&&x.length>0,A=C.useCallback(ne=>{var me;const fe=(me=ne.target.files)==null?void 0:me[0];if(!fe)return;const oe=new FileReader;oe.onload=()=>{const ke=oe.result.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(ke){const we=ke[1],Qe=we.match(/^name:\s*(.+)$/m),Le=we.match(/^description:\s*"?(.+?)"?$/m),He=we.match(/^type:\s*(.+)$/m);if(Qe&&i(Qe[1].trim()),Le&&a(Le[1].trim()),He){const ze=He[1].trim();(ze==="step-based"||ze==="agent-based"||ze==="composite")&&u(ze)}}else{const we=fe.name.replace(/\.md$/i,"");i($E(we))}_("create")},oe.readAsText(fe)},[]),D=()=>k([...S,{title:"",agent:""}]),Y=ne=>k(S.filter((fe,oe)=>oe!==ne)),P=(ne,fe,oe)=>{k(S.map((me,je)=>je===ne?{...me,[fe]:oe}:me))},ee=[];if(W){const ne=B?`_bmad/${x}/workflows/${B}/${r}/`:`_bmad/${x}/workflows/${r}/`;ee.push(ne),ee.push("├── workflow.md"),o==="step-based"&&S.length>0&&(ee.push("├── steps/"),S.forEach((fe,oe)=>{const me=String(oe+1).padStart(2,"0"),je=$E(fe.title||"untitled"),ke=oe===S.length-1?"│ └──":"│ ├──";ee.push(`${ke} step-${me}-${je}.md`)}))}const ae=async()=>{var ne;if(W){R(!0),E(null);try{const fe=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),description:s.trim(),type:o,phase:B||void 0,module:x,steps:o==="step-based"?S.filter(oe=>oe.title.trim()):void 0})});if(!fe.ok){const oe=await fe.json();throw new Error(((ne=oe.error)==null?void 0:ne.message)??"Failed to create workflow")}await n.invalidateQueries({queryKey:["workflows"]}),e()}catch(fe){E(fe instanceof Error?fe.message:"Failed to create workflow")}finally{R(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"New Workflow"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"flex gap-1 mb-4 bg-[var(--color-surface-raised)] rounded-md p-0.5 self-start",children:[p.jsx("button",{onClick:()=>_("create"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${N==="create"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Create"}),p.jsx("button",{onClick:()=>_("import"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${N==="import"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Import"})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[N==="import"?p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Upload workflow file"}),p.jsxs("label",{className:"flex items-center justify-center gap-2 w-full px-4 py-6 border-2 border-dashed border-[var(--color-border-subtle)] rounded-lg cursor-pointer hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(NO,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm text-[var(--color-muted)]",children:"Click to upload a .md workflow file"}),p.jsx("input",{type:"file",accept:".md",onChange:A,className:"hidden"})]})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Uploading will parse the file and switch to the Create tab with fields pre-populated. The workflow type is auto-detected from frontmatter."})]}):Q?p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Directory Structure Preview"}),p.jsx("pre",{className:"p-4 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre",children:ee.join(`
423
+ `)})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:r,onChange:ne=>i(ne.target.value),onBlur:()=>j(!0),placeholder:"e.g. create-product-brief",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),w&&!z&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Name must be kebab-case"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:s,onChange:ne=>a(ne.target.value),placeholder:"What does this workflow do?",rows:2,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Type"}),p.jsx("div",{className:"flex gap-3",children:["step-based","agent-based","composite"].map(ne=>p.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[p.jsx("input",{type:"radio",name:"workflow-type",checked:o===ne,onChange:()=>u(ne),className:"accent-[var(--color-accent)]"}),ne==="step-based"?"Step-based":ne==="agent-based"?"Agent-based":"Composite"]},ne))})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Phase (optional)"}),p.jsxs("select",{value:f,onChange:ne=>h(ne.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"No phase grouping"}),U.map(ne=>p.jsx("option",{value:ne,children:ne},ne)),p.jsx("option",{value:"__custom",children:"Custom..."})]}),f==="__custom"&&p.jsx("input",{type:"text",value:m,onChange:ne=>O(ne.target.value),placeholder:"e.g. 5-deployment",className:"w-full mt-2 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module"}),p.jsxs("select",{value:x,onChange:ne=>v(ne.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Select a module..."}),M.map(ne=>p.jsx("option",{value:ne.name,children:ne.name},ne.name))]})]}),o==="step-based"&&p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Initial Steps (",S.length,")"]}),p.jsx("div",{className:"space-y-2",children:S.map((ne,fe)=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs text-[var(--color-muted)] w-6 text-right shrink-0",children:String(fe+1).padStart(2,"0")}),p.jsx("input",{type:"text",value:ne.title,onChange:oe=>P(fe,"title",oe.target.value),placeholder:"Step title...",className:"flex-1 px-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),p.jsxs("select",{value:ne.agent,onChange:oe=>P(fe,"agent",oe.target.value),className:"w-36 px-2 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Agent..."}),Z.map(oe=>p.jsx("option",{value:oe.name,children:oe.title||oe.name},oe.id))]}),p.jsx("button",{onClick:()=>Y(fe),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] shrink-0",children:p.jsx(ef,{size:14})})]},fe))}),p.jsxs("button",{onClick:D,className:"mt-2 flex items-center gap-1.5 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)]",children:[p.jsx(hn,{size:14})," Add step"]})]})]}),H&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:H})]}),p.jsx("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:Q?p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>T(!1),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Back"}),p.jsxs("button",{onClick:ae,disabled:!W||q,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),q?"Creating...":"Create Workflow"]})]}):p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:()=>T(!0),disabled:!W,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Preview & Create"})]})})]})]})}function cf(t="detail"){const[e,n]=aB(),r=e.get(t),i=C.useCallback(s=>{n(a=>(s?a.set(t,s):a.delete(t),a),{replace:!1})},[t,n]);return[r,i]}const _E={"step-based":"border-[var(--color-border-subtle)] text-[var(--color-muted)]","agent-based":"border-purple-400/50 text-purple-400",composite:"border-blue-400/50 text-blue-400"};function f2({type:t}){if(!t)return null;const e=t==="step-based"?"Step":t==="agent-based"?"Agent":"Composite";return p.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs border ${_E[t]??_E["step-based"]}`,children:e})}function ace(t){return t.replace(/^\d+-/,"").split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function lce(t){const e=new Map;for(const n of t){const r=n.phase??"__ungrouped";e.has(r)||e.set(r,[]),e.get(r).push(n)}return Array.from(e.entries()).sort(([n],[r])=>{if(n==="__ungrouped")return 1;if(r==="__ungrouped")return-1;const i=parseInt(n)||999,s=parseInt(r)||999;return i-s})}function oce(){const{data:t,isLoading:e,refetch:n}=r5(),[r,i]=C.useState("list"),[s,a]=C.useState(!1),[o,u]=cf("detail"),[f,h]=C.useState("all"),[m,O]=C.useState(""),[x,v]=C.useState(null),{data:S}=i5(x??""),k=C.useMemo(()=>{if(!t)return[];const T=new Set;for(const N of t)N.module&&T.add(N.module);return Array.from(T).sort()},[t]),w=C.useMemo(()=>{if(!t)return{};const T={};for(const N of t)N.module&&(T[N.module]=(T[N.module]??0)+1);return T},[t]),j=C.useMemo(()=>{if(!t)return[];let T=t;if(f!=="all"&&(T=T.filter(N=>N.module===f)),m){const N=m.toLowerCase();T=T.filter(_=>_.name.toLowerCase().includes(N)||_.description&&_.description.toLowerCase().includes(N))}return T},[t,f,m]),Q=C.useMemo(()=>lce(j),[j]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workflows"}),p.jsx("div",{className:"space-y-3",children:[1,2,3].map(T=>p.jsx("div",{className:"h-16 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},T))})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workflows"}),p.jsx(Li,{icon:Mi,title:"No workflows found",description:"Install a module or create a workflow to get started."})]}):p.jsxs("div",{children:[p.jsxs("div",{children:[p.jsx(uy,{title:"Workflows",count:t.length,modules:k,moduleCounts:w,activeModule:f,onModuleChange:h,search:m,onSearchChange:O,actions:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("button",{onClick:()=>a(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"New Workflow"]}),p.jsxs("div",{className:"flex gap-1 bg-[var(--color-surface-raised)] rounded-md p-0.5",children:[p.jsxs("button",{onClick:()=>i("list"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors ${r==="list"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[p.jsx(Y9,{size:14}),"List"]}),p.jsxs("button",{onClick:()=>i("graph"),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors ${r==="graph"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:[p.jsx(B9,{size:14}),"Graph"]})]})]})}),r==="list"&&p.jsx("div",{className:"space-y-6",children:Q.map(([T,N])=>p.jsxs("div",{children:[p.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2 px-1",children:[T==="__ungrouped"?"Ungrouped":ace(T),p.jsxs("span",{className:"ml-2 font-normal",children:["(",N.length,")"]})]}),p.jsx("div",{className:"space-y-2",children:N.map(_=>p.jsxs("button",{onClick:()=>u(o===_.id?null:_.id),className:`w-full flex items-center justify-between p-4 rounded-lg border transition-colors cursor-pointer text-left ${o===_.id?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Mi,{size:18,className:"text-[var(--color-muted)]"}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:_.name}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate max-w-md",children:_.description})]})]}),p.jsxs("div",{className:"flex items-center gap-3 text-xs text-[var(--color-muted)]",children:[p.jsx(f2,{type:_.type}),p.jsxs("span",{children:[_.stepCount," steps"]}),_.module&&p.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)]",children:_.module})]})]},_.id))})]},T))}),r==="graph"&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("select",{value:x??"",onChange:T=>v(T.target.value||null),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] outline-none focus:border-[var(--color-accent)] min-h-[36px]",children:[p.jsx("option",{value:"",children:"Select a workflow..."}),t.map(T=>p.jsxs("option",{value:T.id,children:[T.name,T.module?` (${T.module})`:""]},T.id))]}),!x&&p.jsx("div",{className:"flex items-center justify-center h-64 rounded-lg border border-dashed border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:p.jsx("p",{className:"text-sm",children:"Select a workflow above to view its graph"})}),S&&p.jsx(ice,{workflow:S,onStepClick:()=>{u(x)}})]})]}),o&&p.jsx(Hte,{workflowId:o,onClose:()=>u(null)}),s&&p.jsx(sce,{onClose:()=>a(!1),onCreated:()=>{a(!1),n()}})]})}const cce=["1-analysis","2-planning","3-solutioning","4-implementation"];function uce(t){const e=t.replace(/^\d+-/,"");return e.charAt(0).toUpperCase()+e.slice(1)}function fce({commands:t}){const e=pa(),n=C.useMemo(()=>{const s=new Map;for(const a of t){const o=a.phase||"anytime";s.has(o)||s.set(o,[]),s.get(o).push(a)}for(const[,a]of s)a.sort((o,u)=>(o.sequence??999)-(u.sequence??999));return s},[t]),r=cce.filter(s=>n.has(s)),i=n.get("anytime")??[];return r.length===0&&i.length===0?null:p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"The BMAD Process"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Workflow lifecycle from analysis to implementation"})]}),p.jsx("button",{onClick:()=>e("/commands"),className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors cursor-pointer",children:"View all commands →"})]}),p.jsx("div",{className:"flex gap-0 overflow-x-auto pb-2",children:r.map((s,a)=>{const o=n.get(s)??[];return p.jsxs("div",{className:"flex items-start",children:[p.jsxs("div",{className:"min-w-[180px] flex-1",children:[p.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-accent)] mb-3 px-1",children:uce(s)}),p.jsx("div",{className:"flex flex-wrap gap-1.5 px-1",children:o.map(u=>{var f;return p.jsxs("div",{title:`${u.name}
424
+ ${u.description}`,className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs border transition-colors ${u.required?"border-[var(--color-accent)] bg-[var(--color-accent)]/5":"border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)]"}`,children:[u.agentTitle&&p.jsx("span",{className:"text-xs leading-none",role:"img",children:((f=u.agentTitle.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:f[0])??""}),p.jsx("span",{className:"font-[var(--font-mono)] font-bold",children:u.code}),p.jsx("span",{className:"text-[var(--color-muted)] hidden sm:inline truncate max-w-[80px]",children:u.name})]},`${u.code}-${u.module}`)})})]}),a<r.length-1&&p.jsx("div",{className:"flex items-center pt-8 px-2 text-[var(--color-muted)]",children:p.jsx(s9,{size:16})})]},s)})}),i.length>0&&p.jsxs("div",{className:"mt-4 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-2 px-1",children:"Anytime"}),p.jsx("div",{className:"flex flex-wrap gap-1.5 px-1",children:i.map(s=>{var a;return p.jsxs("div",{title:`${s.name}
425
+ ${s.description}`,className:"inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs border border-[var(--color-border-subtle)] bg-[var(--color-surface-raised)]",children:[s.agentTitle&&p.jsx("span",{className:"text-xs leading-none",role:"img",children:((a=s.agentTitle.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:a[0])??""}),p.jsx("span",{className:"font-[var(--font-mono)] font-bold",children:s.code}),p.jsx("span",{className:"text-[var(--color-muted)] hidden sm:inline truncate max-w-[80px]",children:s.name})]},`${s.code}-${s.module}`)})})]})]})}function Xc({title:t,count:e,to:n}){return p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:t}),p.jsxs(nr,{to:n,className:"text-sm font-bold text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:["View all (",e,") →"]})]})}const U0=5,W0=8;function dce(){const t=pa(),[e,n]=C.useState(null),[r,i]=C.useState([]),[s,a]=C.useState(!0);if(C.useEffect(()=>{Promise.all([fetch("/api/overview").then(u=>u.json()),fetch("/api/commands").then(u=>u.json()).catch(()=>[])]).then(([u,f])=>{n(u),i(f),a(!1)}).catch(()=>a(!1))},[]),s)return p.jsx("div",{className:"space-y-8",children:[1,2,3].map(u=>p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},u))});if(!(e!=null&&e.detected))return p.jsx(Li,{icon:lq,title:"Welcome to BMAD Studio",description:"No BMAD project detected. Start by creating a BMAD project or point Studio to an existing one with --dir."});const{sections:o}=e;return p.jsxs("div",{children:[p.jsx("h1",{className:"text-3xl font-extrabold mb-10",children:"Overview"}),p.jsxs("div",{className:"space-y-0",children:[o.team&&o.team.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Xc,{title:"Agents",count:o.team.count,to:"/agents"}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.team.agents.filter(u=>u.name||u.title).slice(0,W0).map(u=>{const f=u.communicationStyle?u.communicationStyle.length>60?u.communicationStyle.slice(0,60)+"...":u.communicationStyle:void 0;return p.jsxs("button",{onClick:()=>t(`/agents/${u.id}`),className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[u.icon?p.jsx("span",{className:"text-2xl leading-none",role:"img",children:u.icon}):p.jsx("span",{className:"w-7 h-7 rounded-lg bg-[var(--color-accent)] text-white text-xs font-bold flex items-center justify-center shrink-0",children:u.name.charAt(0).toUpperCase()}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("span",{className:"font-bold text-sm block truncate",children:u.name}),u.title&&p.jsx("span",{className:"text-xs text-[var(--color-muted)] block truncate",children:u.title})]})]}),f&&p.jsxs("p",{className:"text-xs italic text-[var(--color-muted)] line-clamp-1 mb-1.5",children:["“",f,"”"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[u.skillCount," skills"]}),u.module&&p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:u.module})]})]},u.id)})}),o.team.count>W0&&p.jsxs(nr,{to:"/agents",className:"block text-center text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] py-2 mt-2",children:["+ ",o.team.count-W0," more agents"]})]}),o.teams&&o.teams.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Xc,{title:"Teams",count:o.teams.count,to:"/teams"}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.teams.teams.map(u=>p.jsxs("button",{onClick:()=>t("/teams"),className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.icon?p.jsx("span",{className:"text-lg leading-none",role:"img",children:u.icon}):p.jsx(di,{size:18,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"font-bold text-sm truncate",children:u.name})]}),u.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] line-clamp-2 mb-1",children:u.description}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[u.memberCount," members"]})]},u.id))})]}),o.process&&o.process.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Xc,{title:"Workflows",count:o.process.count,to:"/workflows"}),p.jsxs("div",{className:"space-y-2",children:[o.process.workflows.slice(0,U0).map(u=>p.jsxs("button",{onClick:()=>t("/workflows"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Mi,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm font-bold",children:u.name})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(f2,{type:u.type}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[u.stepCount," steps"]}),u.module&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:u.module})]})]},u.id)),o.process.count>U0&&p.jsxs(nr,{to:"/workflows",className:"block text-center text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] py-2",children:["+ ",o.process.count-U0," more workflows"]})]})]}),r.length>0&&p.jsx(fce,{commands:r}),o.toolkit&&o.toolkit.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Xc,{title:"Skills",count:o.toolkit.count,to:"/skills"}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:o.toolkit.skills.slice(0,8).map(u=>p.jsxs("button",{onClick:()=>t("/skills"),className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] transition-colors cursor-pointer",children:[p.jsx(na,{size:14,className:"text-[var(--color-accent)] shrink-0"}),p.jsx("span",{className:"text-sm truncate",children:u.name})]},u.id))}),o.toolkit.count>8&&p.jsxs(nr,{to:"/skills",className:"block text-center text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] py-2 mt-2",children:["+ ",o.toolkit.count-8," more skills"]})]}),o.ideConfigs&&o.ideConfigs.count>0&&p.jsxs("section",{className:"border-b border-[var(--color-border-subtle)] pb-10 mb-10",children:[p.jsx(Xc,{title:"Data Sources",count:o.ideConfigs.count,to:"/connections"}),p.jsx("div",{className:"flex gap-3 flex-wrap",children:o.ideConfigs.ides.map(u=>p.jsxs("button",{onClick:()=>t("/connections"),className:"flex items-center gap-2 px-4 py-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsx(Vw,{size:16,className:"text-[var(--color-success)]"}),p.jsx("span",{className:"text-sm",children:u})]},u))})]}),o.packages&&o.packages.count>0&&p.jsxs("section",{children:[p.jsx(Xc,{title:"Modules",count:o.packages.count,to:"/modules"}),p.jsx("div",{className:"flex gap-4 flex-wrap",children:o.packages.packages.map(u=>p.jsxs("button",{onClick:()=>t("/modules"),className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-left hover:border-[var(--color-accent)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(xh,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"font-bold text-sm",children:u.name})]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:["v",u.version]})]},u.name))})]})]})]})}async function hce(){const t=await fetch("/api/agents");if(!t.ok)throw new Error("Failed to fetch agents");return t.json()}function pce(){return ma({queryKey:["agents"],queryFn:hce,staleTime:3e4})}function mce({agent:t}){const e=pa(),n=t.title||t.role||t.name,r=t.title?t.name:void 0;return p.jsxs("div",{onClick:()=>e(`/agents/${t.id}`),onKeyDown:i=>i.key==="Enter"&&e(`/agents/${t.id}`),role:"button",tabIndex:0,className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:-translate-y-0.5 hover:shadow-md transition-all cursor-pointer",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.icon?p.jsx("span",{className:"text-lg leading-none",role:"img",children:t.icon}):p.jsx("span",{className:"w-5 h-5 rounded bg-[var(--color-accent)] text-white text-[10px] font-bold flex items-center justify-center shrink-0",children:t.name.charAt(0).toUpperCase()}),p.jsx("span",{className:"font-bold text-sm truncate",children:n}),t.hasOverrides&&p.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-warning)] shrink-0",title:"Has overrides"})]}),r&&p.jsxs("p",{className:"text-xs text-[var(--color-muted)] truncate mb-2",children:["(",r,")"]}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--color-muted)]",children:[p.jsxs("span",{children:[t.skillCount," skills"]}),t.module&&p.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)]",children:t.module})]})]})}function d2({className:t=""}){return p.jsx("div",{className:`rounded-lg bg-[var(--color-surface-raised)] animate-pulse ${t}`})}function gce({count:t=3,height:e="h-16"}){return p.jsx("div",{className:"space-y-3",children:Array.from({length:t},(n,r)=>p.jsx(d2,{className:e},r))})}function fy({count:t=3}){return p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:t},(e,n)=>p.jsx(d2,{className:"h-24"},n))})}function Oce(){const{data:t,isLoading:e,error:n}=pce(),[r,i]=C.useState("all"),[s,a]=C.useState(""),o=C.useMemo(()=>{if(!t)return[];const h=new Set;for(const m of t)m.module&&h.add(m.module);return Array.from(h).sort()},[t]),u=C.useMemo(()=>{if(!t)return{};const h={};for(const m of t)m.module&&(h[m.module]=(h[m.module]??0)+1);return h},[t]),f=C.useMemo(()=>{if(!t)return[];let h=t;if(r!=="all"&&(h=h.filter(m=>m.module===r)),s){const m=s.toLowerCase();h=h.filter(O=>O.name.toLowerCase().includes(m)||O.title.toLowerCase().includes(m)||O.role.toLowerCase().includes(m))}return h},[t,r,s]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Agents"}),p.jsx(fy,{count:4})]}):n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Agents"}),p.jsxs("p",{className:"text-[var(--color-error)]",children:["Failed to load agents: ",n.message]})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Agents"}),p.jsx(Li,{icon:di,title:"No agents found",description:"This project doesn't have any agents yet. Load a module or create a custom agent to get started."})]}):p.jsxs("div",{children:[p.jsx(uy,{title:"Agents",count:t.length,modules:o,moduleCounts:u,activeModule:r,onModuleChange:i,search:s,onSearchChange:a,filteredCount:r!=="all"||s?f.length:void 0}),p.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:f.map(h=>p.jsx(mce,{agent:h},h.id))}),f.length===0&&p.jsx("p",{className:"text-center text-sm text-[var(--color-muted)] py-8",children:"No agents match the current filter"})]})}async function xce(t){const e=await fetch(`/api/agents/${t}`);if(!e.ok)throw new Error(`Failed to fetch agent ${t}`);return e.json()}function U4(t){return ma({queryKey:["agents",{id:t}],queryFn:()=>xce(t),enabled:!!t})}function W4(){return ma({queryKey:["teams"],queryFn:async()=>{const t=await fetch("/api/teams");if(!t.ok)throw new Error("Failed to fetch teams");return t.json()},staleTime:3e4})}function yce(t){return ma({queryKey:["teams",{id:t}],queryFn:async()=>{const e=await fetch(`/api/teams/${t}`);if(!e.ok)throw new Error(`Failed to fetch team ${t}`);return e.json()},enabled:!!t})}function vce(t){return ma({queryKey:["teams",{id:t,include:"party"}],queryFn:async()=>{const e=await fetch(`/api/teams/${t}/party`);if(!e.ok)throw new Error(`Failed to fetch party CSV for ${t}`);return e.json()},enabled:!!t})}var bce=Symbol.for("preact-signals");function dy(){if(sa>1)sa--;else{var t,e=!1;for((function(){var i=gx;for(gx=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();oh!==void 0;){var n=oh;for(oh=void 0,mx++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&G4(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(mx=0,sa--,e)throw t}}function Lo(t){if(sa>0)return t();FS=++Sce,sa++;try{return t()}finally{dy()}}var Ot=void 0;function _t(t){var e=Ot;Ot=void 0;try{return t()}finally{Ot=e}}var oh=void 0,sa=0,mx=0,Sce=0,FS=0,gx=void 0,Ox=0;function H4(t){if(Ot!==void 0){var e=t.n;if(e===void 0||e.t!==Ot)return e={i:0,S:t,p:Ot.s,n:void 0,t:Ot,e:void 0,x:void 0,r:e},Ot.s!==void 0&&(Ot.s.n=e),Ot.s=e,t.n=e,32&Ot.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ot.s,e.n=void 0,Ot.s.n=e,Ot.s=e),e}}function ir(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}ir.prototype.brand=bce;ir.prototype.h=function(){return!0};ir.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:_t(function(){var r;(r=e.W)==null||r.call(e)}))};ir.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,r=t.x;n!==void 0&&(n.x=r,t.e=void 0),r!==void 0&&(r.e=n,t.x=void 0),t===this.t&&(this.t=r,r===void 0&&_t(function(){var i;(i=e.Z)==null||i.call(e)}))}};ir.prototype.subscribe=function(t){var e=this;return vi(function(){var n=e.value,r=Ot;Ot=void 0;try{t(n)}finally{Ot=r}},{name:"sub"})};ir.prototype.valueOf=function(){return this.value};ir.prototype.toString=function(){return this.value+""};ir.prototype.toJSON=function(){return this.value};ir.prototype.peek=function(){var t=Ot;Ot=void 0;try{return this.value}finally{Ot=t}};Object.defineProperty(ir.prototype,"value",{get:function(){var t=H4(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(mx>100)throw new Error("Cycle detected");(function(n){sa!==0&&mx===0&&n.l!==FS&&(n.l=FS,gx={S:n,v:n.v,i:n.i,o:gx})})(this),this.v=t,this.i++,Ox++,sa++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{dy()}}}});function Np(t,e){return new ir(t,e)}function G4(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function F4(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function K4(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function Uo(t,e){ir.call(this,void 0),this.x=t,this.s=void 0,this.g=Ox-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}Uo.prototype=new ir;Uo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ox))return!0;if(this.g=Ox,this.f|=1,this.i>0&&!G4(this))return this.f&=-2,!0;var t=Ot;try{F4(this),Ot=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Ot=t,K4(this),this.f&=-2,!0};Uo.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ir.prototype.S.call(this,t)};Uo.prototype.U=function(t){if(this.t!==void 0&&(ir.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Uo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Uo.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=H4(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function NE(t,e){return new Uo(t,e)}function J4(t){var e=t.m;if(t.m=void 0,typeof e=="function"){sa++;var n=Ot;Ot=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,h2(t),r}finally{Ot=n,dy()}}}function h2(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,J4(t)}function wce(t){if(Ot!==this)throw new Error("Out-of-order effect");K4(this),Ot=t,this.f&=-2,8&this.f&&h2(this),dy()}function uf(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e==null?void 0:e.name}uf.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};uf.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,J4(this),F4(this),sa++;var t=Ot;return Ot=this,wce.bind(this,t)};uf.prototype.N=function(){2&this.f||(this.f|=2,this.u=oh,oh=this)};uf.prototype.d=function(){this.f|=8,1&this.f||h2(this)};uf.prototype.dispose=function(){this.d()};function vi(t,e){var n=new uf(t,e);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var kce=Object.create,p2=Object.defineProperty,Qce=Object.defineProperties,Cce=Object.getOwnPropertyDescriptor,jce=Object.getOwnPropertyDescriptors,PE=Object.getOwnPropertySymbols,Tce=Object.prototype.hasOwnProperty,$ce=Object.prototype.propertyIsEnumerable,_ce=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ff=t=>{throw TypeError(t)},KS=(t,e,n)=>e in t?p2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nce=(t,e)=>{for(var n in e||(e={}))Tce.call(e,n)&&KS(t,n,e[n]);if(PE)for(var n of PE(e))$ce.call(e,n)&&KS(t,n,e[n]);return t},Pce=(t,e)=>Qce(t,jce(e)),EE=(t,e)=>p2(t,"name",{value:e,configurable:!0}),Ece=t=>{var e;return[,,,kce((e=void 0)!=null?e:null)]},eD=["class","method","getter","setter","accessor","field","value","get","set"],Rd=t=>t!==void 0&&typeof t!="function"?ff("Function expected"):t,Ace=(t,e,n,r,i)=>({kind:eD[t],name:e,metadata:r,addInitializer:s=>n._?ff("Already initialized"):i.push(Rd(s||null))}),tD=(t,e)=>KS(e,_ce("metadata"),t[3]),Kl=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},df=(t,e,n,r,i,s)=>{var a,o,u,f,h,m=e&7,O=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?O?1:2:0,S=eD[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),j=m&&(!x&&!O&&(i=i.prototype),m<5&&(m>3||!x)&&Cce(m<4?i:{get[n](){return co(this,s)},set[n](T){return sl(this,s,T)}},n));m?x&&m<4&&EE(s,(m>2?"set ":m>1?"get ":"")+n):EE(i,n);for(var Q=r.length-1;Q>=0;Q--)f=Ace(m,n,u={},t[3],w),m&&(f.static=O,f.private=x,h=f.access={has:x?T=>Mce(i,T):T=>n in T},m^3&&(h.get=x?T=>(m^1?co:Rce)(T,i,m^4?s:j.get):T=>T[n]),m>2&&(h.set=x?(T,N)=>sl(T,i,N,m^4?s:j.set):(T,N)=>T[n]=N)),o=(0,r[Q])(m?m<4?x?s:j[S]:m>4?void 0:{get:j.get,set:j.set}:i,f),u._=1,m^4||o===void 0?Rd(o)&&(m>4?k.unshift(o):m?x?s=o:j[S]=o:i=o):typeof o!="object"||o===null?ff("Object expected"):(Rd(a=o.get)&&(j.get=a),Rd(a=o.set)&&(j.set=a),Rd(a=o.init)&&k.unshift(a));return m||tD(t,i),j&&p2(i,n,j),x?m^4?s:j:i},m2=(t,e,n)=>e.has(t)||ff("Cannot "+n),Mce=(t,e)=>Object(e)!==e?ff('Cannot use the "in" operator on this value'):t.has(e),co=(t,e,n)=>(m2(t,e,"read from private field"),n?n.call(t):e.get(t)),Ig=(t,e,n)=>e.has(t)?ff("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),sl=(t,e,n,r)=>(m2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Rce=(t,e,n)=>(m2(t,e,"access private method"),n);function xx(t,e){if(e){let n;return NE(()=>{const r=t();return r&&n&&e(n,r)?n:(n=r,r)})}return NE(t)}function Yu(t,e){if(Object.is(t,e))return!0;if(t===null||e===null)return!1;if(typeof t=="function"&&typeof e=="function")return t===e;if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:!t.some((r,i)=>!Yu(r,e[i]));if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:!n.some(s=>!Yu(t[s],e[s]))}return!1}function dt({get:t},e){return{init(n){return Np(n)},get(){return t.call(this).value},set(n){const r=t.call(this);r.peek()!==n&&(r.value=n)}}}function sn(t,e){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=xx(t.bind(this)),n.set(this,r)),r.value}}function H0(t=!0){return function(e,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),i=Object.getOwnPropertyDescriptor(r,n.name);i&&Object.defineProperty(r,n.name,Pce(Nce({},i),{enumerable:t}))})}}function Pp(...t){const e=t.map(n=>vi(n));return()=>e.forEach(n=>n())}var nD,rD,iD,sD,aD,lD,Kn,g2,G0,JS,ew,Zn,O2,F0,oD,tw,x2,K0,nw,rw;lD=[dt],aD=[dt],sD=[dt],iD=[H0()],rD=[H0()],nD=[H0()];var Wo=class{constructor(t,e=Object.is){this.defaultValue=t,this.equals=e,Kl(Kn,5,this),Ig(this,Zn),Ig(this,g2,Kl(Kn,8,this)),Kl(Kn,11,this),Ig(this,O2,Kl(Kn,12,this)),Kl(Kn,15,this),Ig(this,x2,Kl(Kn,16,this)),Kl(Kn,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return co(this,Zn,nw)}get initial(){return co(this,Zn,JS)}get previous(){return co(this,Zn,oD)}set current(t){const e=_t(()=>co(this,Zn,nw));t&&e&&this.equals(e,t)||Lo(()=>{co(this,Zn,JS)||sl(this,Zn,t,ew),sl(this,Zn,e,tw),sl(this,Zn,t,rw)})}reset(t=this.defaultValue){Lo(()=>{sl(this,Zn,void 0,tw),sl(this,Zn,t,ew),sl(this,Zn,t,rw)})}};Kn=Ece();g2=new WeakMap;Zn=new WeakSet;O2=new WeakMap;x2=new WeakMap;G0=df(Kn,20,"#initial",lD,Zn,g2),JS=G0.get,ew=G0.set;F0=df(Kn,20,"#previous",aD,Zn,O2),oD=F0.get,tw=F0.set;K0=df(Kn,20,"#current",sD,Zn,x2),nw=K0.get,rw=K0.set;df(Kn,2,"current",iD,Wo);df(Kn,2,"initial",rD,Wo);df(Kn,2,"previous",nD,Wo);tD(Kn,Wo);function J0(t){return _t(()=>{const e={};for(const n in t)e[n]=t[n];return e})}var zce=Object.create,cD=Object.defineProperty,Dce=Object.getOwnPropertyDescriptor,AE=Object.getOwnPropertySymbols,Lce=Object.prototype.hasOwnProperty,Xce=Object.prototype.propertyIsEnumerable,uD=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),hy=t=>{throw TypeError(t)},ME=Math.pow,iw=(t,e,n)=>e in t?cD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Zce=(t,e)=>{for(var n in e||(e={}))Lce.call(e,n)&&iw(t,n,e[n]);if(AE)for(var n of AE(e))Xce.call(e,n)&&iw(t,n,e[n]);return t},Bce=t=>{var e;return[,,,zce((e=t==null?void 0:t[uD("metadata")])!=null?e:null)]},fD=["class","method","getter","setter","accessor","field","value","get","set"],dD=t=>t!==void 0&&typeof t!="function"?hy("Function expected"):t,qce=(t,e,n,r,i)=>({kind:fD[t],name:e,metadata:r,addInitializer:s=>n._?hy("Already initialized"):i.push(dD(s||null))}),Vce=(t,e)=>iw(e,uD("metadata"),t[3]),Ice=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)s[i].call(n);return r},hD=(t,e,n,r,i,s)=>{for(var a,o,u,f,h=e&7,m=!1,O=!1,x=2,v=fD[h+5],S=t[x]||(t[x]=[]),k=(i=i.prototype,Dce(i,n)),w=r.length-1;w>=0;w--)u=qce(h,n,o={},t[3],S),u.static=m,u.private=O,f=u.access={has:j=>n in j},f.get=j=>j[n],a=(0,r[w])(k[v],u),o._=1,dD(a)&&(k[v]=a);return k&&cD(i,n,k),i},pD=(t,e,n)=>e.has(t)||hy("Cannot "+n),Yce=(t,e,n)=>(pD(t,e,"read from private field"),e.get(t)),Uce=(t,e,n)=>e.has(t)?hy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Wce=(t,e,n,r)=>(pD(t,e,"write to private field"),e.set(t,n),n),cs=class sw{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new sw(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new sw(e,n)}},Ep=class to{constructor(e,n,r,i){this.left=e,this.top=n,this.width=r,this.height=i,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(e,n){const{top:r,left:i,width:s,height:a,scale:o}=this,u=new to(i+e,r+n,s,a);return u.scale=Zce({},o),u}get boundingRectangle(){const{width:e,height:n,left:r,top:i,right:s,bottom:a}=this;return{width:e,height:n,left:r,top:i,right:s,bottom:a}}get center(){const{left:e,top:n,right:r,bottom:i}=this;return new cs((e+r)/2,(n+i)/2)}get area(){const{width:e,height:n}=this;return e*n}equals(e){if(!(e instanceof to))return!1;const{left:n,top:r,width:i,height:s}=this;return n===e.left&&r===e.top&&i===e.width&&s===e.height}containsPoint(e){const{top:n,left:r,bottom:i,right:s}=this;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}intersectionArea(e){return e instanceof to?Hce(this,e):0}intersectionRatio(e){const{area:n}=this,r=this.intersectionArea(e);return r/(e.area+n-r)}get bottom(){const{top:e,height:n}=this;return e+n}get right(){const{left:e,width:n}=this;return e+n}get aspectRatio(){const{width:e,height:n}=this;return e/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:e,left:n,width:r,height:i}){return new to(n,e,r,i)}static delta(e,n,r={x:"center",y:"center"}){const i=(s,a)=>{const o=r[a],u=a==="x"?s.left:s.top,f=a==="x"?s.width:s.height;return o=="start"?u:o=="end"?u+f:u+f/2};return cs.delta({x:i(e,"x"),y:i(e,"y")},{x:i(n,"x"),y:i(n,"y")})}static intersectionRatio(e,n){return to.from(e).intersectionRatio(to.from(n))}};function Hce(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=i-r,o=s-n;return r<i&&n<s?a*o:0}var mD,gD,aw,mO,Ap,py=class extends(aw=Wo,gD=[sn],mD=[sn],aw){constructor(e){const n=cs.from(e);super(n,(r,i)=>cs.equals(r,i)),Ice(Ap,5,this),Uce(this,mO,0),this.velocity={x:0,y:0}}get delta(){return cs.delta(this.current,this.initial)}get direction(){const{current:e,previous:n}=this;if(!n)return null;const r={x:e.x-n.x,y:e.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:n}=this,r=cs.from(e),i={x:r.x-n.x,y:r.y-n.y},s=Date.now(),a=s-Yce(this,mO),o=u=>Math.round(u/a*100);Lo(()=>{Wce(this,mO,s),this.velocity={x:o(i.x),y:o(i.y)},super.current=r})}reset(e=this.defaultValue){super.reset(cs.from(e)),this.velocity={x:0,y:0}}};Ap=Bce(aw);mO=new WeakMap;hD(Ap,2,"delta",gD,py);hD(Ap,2,"direction",mD,py);Vce(Ap,py);function lw({x:t,y:e},n){const r=Math.abs(t),i=Math.abs(e);return typeof n=="number"?Math.sqrt(ME(r,2)+ME(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var OD=(t=>(t.Horizontal="x",t.Vertical="y",t))(OD||{}),xD=Object.values(OD),Gce=Object.create,y2=Object.defineProperty,Fce=Object.defineProperties,Kce=Object.getOwnPropertyDescriptor,Jce=Object.getOwnPropertyDescriptors,yx=Object.getOwnPropertySymbols,yD=Object.prototype.hasOwnProperty,vD=Object.prototype.propertyIsEnumerable,bD=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),hf=t=>{throw TypeError(t)},ow=(t,e,n)=>e in t?y2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,SD=(t,e)=>{for(var n in e||(e={}))yD.call(e,n)&&ow(t,n,e[n]);if(yx)for(var n of yx(e))vD.call(e,n)&&ow(t,n,e[n]);return t},wD=(t,e)=>Fce(t,Jce(e)),RE=(t,e)=>y2(t,"name",{value:e,configurable:!0}),kD=(t,e)=>{var n={};for(var r in t)yD.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&yx)for(var r of yx(t))e.indexOf(r)<0&&vD.call(t,r)&&(n[r]=t[r]);return n},pf=t=>{var e;return[,,,Gce((e=t==null?void 0:t[bD("metadata")])!=null?e:null)]},QD=["class","method","getter","setter","accessor","field","value","get","set"],zd=t=>t!==void 0&&typeof t!="function"?hf("Function expected"):t,eue=(t,e,n,r,i)=>({kind:QD[t],name:e,metadata:r,addInitializer:s=>n._?hf("Already initialized"):i.push(zd(s||null))}),Ho=(t,e)=>ow(e,bD("metadata"),t[3]),Ve=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},lt=(t,e,n,r,i,s)=>{var a,o,u,f,h,m=e&7,O=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?O?1:2:0,S=QD[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),j=m&&(!x&&!O&&(i=i.prototype),m<5&&(m>3||!x)&&Kce(m<4?i:{get[n](){return kn(this,s)},set[n](T){return ui(this,s,T)}},n));m?x&&m<4&&RE(s,(m>2?"set ":m>1?"get ":"")+n):RE(i,n);for(var Q=r.length-1;Q>=0;Q--)f=eue(m,n,u={},t[3],w),m&&(f.static=O,f.private=x,h=f.access={has:x?T=>tue(i,T):T=>n in T},m^3&&(h.get=x?T=>(m^1?kn:nue)(T,i,m^4?s:j.get):T=>T[n]),m>2&&(h.set=x?(T,N)=>ui(T,i,N,m^4?s:j.set):(T,N)=>T[n]=N)),o=(0,r[Q])(m?m<4?x?s:j[S]:m>4?void 0:{get:j.get,set:j.set}:i,f),u._=1,m^4||o===void 0?zd(o)&&(m>4?k.unshift(o):m?x?s=o:j[S]=o:i=o):typeof o!="object"||o===null?hf("Object expected"):(zd(a=o.get)&&(j.get=a),zd(a=o.set)&&(j.set=a),zd(a=o.init)&&k.unshift(a));return m||Ho(t,i),j&&y2(i,n,j),x?m^4?s:j:i},v2=(t,e,n)=>e.has(t)||hf("Cannot "+n),tue=(t,e)=>Object(e)!==e?hf('Cannot use the "in" operator on this value'):t.has(e),kn=(t,e,n)=>(v2(t,e,"read from private field"),n?n.call(t):e.get(t)),$t=(t,e,n)=>e.has(t)?hf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ui=(t,e,n,r)=>(v2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),nue=(t,e,n)=>(v2(t,e,"access private method"),n);function CD(t,e){return{plugin:t,options:e}}function b2(t){return e=>CD(t,e)}function S2(t){return typeof t=="function"?{plugin:t,options:void 0}:t}var jD,Hh,w2,gO;jD=[dt];var Qr=class{constructor(t,e){this.manager=t,this.options=e,$t(this,w2,Ve(Hh,8,this,!1)),Ve(Hh,11,this),$t(this,gO,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return _t(()=>this.disabled)}configure(t){this.options=t}registerEffect(t){const e=vi(t.bind(this));return kn(this,gO).add(e),e}destroy(){kn(this,gO).forEach(t=>t())}static configure(t){return CD(this,t)}};Hh=pf(null);w2=new WeakMap;gO=new WeakMap;lt(Hh,4,"disabled",jD,Qr,w2);Ho(Hh,Qr);var Mp=class extends Qr{},OO,e1=class{constructor(t){this.manager=t,this.instances=new Map,$t(this,OO,[])}get values(){return Array.from(this.instances.values())}set values(t){const e=t.map(S2).reduceRight((r,i)=>r.some(({plugin:s})=>s===i.plugin)?r:[i,...r],[]),n=e.map(({plugin:r})=>r);for(const r of kn(this,OO))if(!n.includes(r)){if(r.prototype instanceof Mp)continue;this.unregister(r)}for(const{plugin:r,options:i}of e)this.register(r,i);ui(this,OO,n)}get(t){return this.instances.get(t)}register(t,e){const n=this.instances.get(t);if(n)return n.options!==e&&(n.options=e),n;const r=new t(this.manager,e);return this.instances.set(t,r),r}unregister(t){const e=this.instances.get(t);e&&(e.destroy(),this.instances.delete(t))}destroy(){for(const t of this.instances.values())t.destroy();this.instances.clear()}};OO=new WeakMap;function rue(t,e){return t.priority===e.priority?t.type===e.type?e.value-t.value:e.type-t.type:e.priority-t.priority}var Yg=[],Ic,Yc,iue=class extends Qr{constructor(t){super(t),$t(this,Ic),$t(this,Yc),this.computeCollisions=this.computeCollisions.bind(this),ui(this,Yc,Np(Yg)),this.destroy=Pp(()=>{const e=this.computeCollisions(),n=_t(()=>this.manager.dragOperation.position.current);if(e!==Yg){const r=kn(this,Ic);if(ui(this,Ic,n),r&&n.x==r.x&&n.y==r.y)return}else ui(this,Ic,void 0);kn(this,Yc).value=e},()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(t=!0){_t(()=>{t?kn(this,Yc).value=this.computeCollisions():ui(this,Ic,void 0)})}computeCollisions(t,e){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:s,status:a}=r;if(!a.initialized||!s)return Yg;const o=[],u=[];for(const f of t??n.droppables){if(f.disabled||i&&!f.accepts(i))continue;const h=e??f.collisionDetector;if(!h)continue;u.push(f),f.shape;const m=_t(()=>h({droppable:f,dragOperation:r}));m&&(f.collisionPriority!=null&&(m.priority=f.collisionPriority),o.push(m))}return u.length===0?Yg:(o.sort(rue),o)}get collisions(){return kn(this,Yc).value}};Ic=new WeakMap;Yc=new WeakMap;var sue=class{constructor(){this.registry=new Map}addEventListener(t,e){const{registry:n}=this,r=new Set(n.get(t));return r.add(e),n.set(t,r),()=>this.removeEventListener(t,e)}removeEventListener(t,e){const{registry:n}=this,r=new Set(n.get(t));r.delete(e),n.set(t,r)}dispatch(t,...e){const{registry:n}=this,r=n.get(t);if(r)for(const i of r)i(...e)}},aue=class extends sue{constructor(t){super(),this.manager=t}dispatch(t,e){const n=[e,this.manager];super.dispatch(t,...n)}};function xO(t,e=!0){let n=!1;return wD(SD({},t),{cancelable:e,get defaultPrevented(){return n},preventDefault(){e&&(n=!0)}})}var lue=class extends Mp{constructor(t){super(t);const e=(r,i)=>r.map(({id:s})=>s).join("")===i.map(({id:s})=>s).join("");let n=[];this.destroy=Pp(()=>{const{dragOperation:r,collisionObserver:i}=t;r.status.initializing&&(n=[],i.enable())},()=>{const{collisionObserver:r,monitor:i}=t,{collisions:s}=r;if(r.isDisabled())return;const a=xO({collisions:s});if(i.dispatch("collision",a),a.defaultPrevented||e(s,n))return;n=s;const[o]=s;_t(()=>{var u;(o==null?void 0:o.id)!==((u=t.dragOperation.target)==null?void 0:u.id)&&(r.disable(),t.actions.setDropTarget(o==null?void 0:o.id).then(()=>{r.enable()}))})})}},Rp=(t=>(t[t.Lowest=0]="Lowest",t[t.Low=1]="Low",t[t.Normal=2]="Normal",t[t.High=3]="High",t[t.Highest=4]="Highest",t))(Rp||{}),zp=(t=>(t[t.Collision=0]="Collision",t[t.ShapeIntersection=1]="ShapeIntersection",t[t.PointerIntersection=2]="PointerIntersection",t))(zp||{}),TD,$D,_D,ND,PD,ED,AD,mi,k2;AD=[dt],ED=[sn],PD=[sn],ND=[sn],_D=[sn],$D=[sn],TD=[sn];var ya=class{constructor(){Ve(mi,5,this),$t(this,k2,Ve(mi,8,this,"idle")),Ve(mi,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:t}=this;return t!=="idle"&&t!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(t){this.value=t}};mi=pf(null);k2=new WeakMap;lt(mi,4,"value",AD,ya,k2);lt(mi,2,"current",ED,ya);lt(mi,2,"idle",PD,ya);lt(mi,2,"initializing",ND,ya);lt(mi,2,"initialized",_D,ya);lt(mi,2,"dragging",$D,ya);lt(mi,2,"dropped",TD,ya);Ho(mi,ya);var oue=class{constructor(t){this.manager=t}setDragSource(t){const{dragOperation:e}=this.manager;e.sourceIdentifier=typeof t=="string"||typeof t=="number"?t:t.id}setDropTarget(t){return _t(()=>{const{dragOperation:e}=this.manager,n=t??null;if(e.targetIdentifier===n)return Promise.resolve(!1);e.targetIdentifier=n;const r=xO({operation:e.snapshot()});return e.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(t){return _t(()=>{const{dragOperation:e}=this.manager;if(t.source!=null&&this.setDragSource(t.source),!e.source)throw new Error("Cannot start a drag operation without a drag source");if(!e.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:i,coordinates:s}=t;Lo(()=>{e.status.set("initialization-pending"),e.shape=null,e.canceled=!1,e.activatorEvent=i??null,e.position.reset(s)});const a=xO({operation:e.snapshot()});return this.manager.monitor.dispatch("beforedragstart",a),a.defaultPrevented?(e.reset(),r.abort(),r):(e.status.set("initializing"),e.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:o}=e;o.current==="initializing"&&(e.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:e.snapshot(),cancelable:!1}))}),r)})}move(t){return _t(()=>{var e,n;const{dragOperation:r}=this.manager,{status:i,controller:s}=r;if(!i.dragging||!s||s.signal.aborted)return;const a=xO({nativeEvent:t.event,operation:r.snapshot(),by:t.by,to:t.to},(e=t.cancelable)!=null?e:!0);((n=t.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var o,u,f,h,m;if(a.defaultPrevented)return;const O=(m=t.to)!=null?m:{x:r.position.current.x+((u=(o=t.by)==null?void 0:o.x)!=null?u:0),y:r.position.current.y+((h=(f=t.by)==null?void 0:f.y)!=null?h:0)};r.position.current=O})})}stop(t={}){return _t(()=>{var e,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let s;const a=()=>{const u={resume:()=>{},abort:()=>{}};return s=new Promise((f,h)=>{u.resume=f,u.abort=h}),u};i.abort();const o=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const u=_t(()=>{var h;return((h=r.source)==null?void 0:h.status)==="dropping"}),f=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(u){const{source:h}=r,m=vi(()=>{(h==null?void 0:h.status)==="idle"&&(m(),f())})}else this.manager.renderer.rendering.then(f)})};r.canceled=(e=t.canceled)!=null?e:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:t.event,operation:r.snapshot(),canceled:(n=t.canceled)!=null?n:!1,suspend:a}),s?s.then(o).catch(()=>r.reset()):o()})}},MD,RD,zD,DD,yr,Q2,C2,j2,T2;DD=[dt],zD=[dt],RD=[dt],MD=[dt];var $l=class{constructor(t,e){$t(this,Q2,Ve(yr,8,this)),Ve(yr,11,this),$t(this,C2,Ve(yr,12,this)),Ve(yr,15,this),$t(this,j2,Ve(yr,16,this)),Ve(yr,19,this),$t(this,T2,Ve(yr,20,this)),Ve(yr,23,this);const{effects:n,id:r,data:i={},disabled:s=!1,register:a=!0}=t;let o=r;this.manager=e,this.id=r,this.data=i,this.disabled=s,this.effects=()=>{var u;return[()=>{const{id:f,manager:h}=this;if(f!==o)return h==null||h.registry.register(this),()=>h==null?void 0:h.registry.unregister(this)},...(u=n==null?void 0:n())!=null?u:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),e&&a&&queueMicrotask(this.register)}register(){var t;return(t=this.manager)==null?void 0:t.registry.register(this)}unregister(){var t;(t=this.manager)==null||t.registry.unregister(this)}destroy(){var t;(t=this.manager)==null||t.registry.unregister(this)}};yr=pf(null);Q2=new WeakMap;C2=new WeakMap;j2=new WeakMap;T2=new WeakMap;lt(yr,4,"manager",DD,$l,Q2);lt(yr,4,"id",zD,$l,C2);lt(yr,4,"data",RD,$l,j2);lt(yr,4,"disabled",MD,$l,T2);Ho(yr,$l);var zE=class{constructor(){this.map=Np(new Map),this.cleanupFunctions=new WeakMap,this.register=(t,e)=>{const n=this.map.peek(),r=n.get(t),i=()=>this.unregister(t,e);if(r===e)return i;if(r){const o=this.cleanupFunctions.get(r);o==null||o(),this.cleanupFunctions.delete(r)}const s=new Map(n);s.set(t,e),this.map.value=s;const a=Pp(...e.effects());return this.cleanupFunctions.set(e,a),i},this.unregister=(t,e)=>{const n=this.map.peek();if(n.get(t)!==e)return;const r=this.cleanupFunctions.get(e);r==null||r(),this.cleanupFunctions.delete(e);const i=new Map(n);i.delete(t),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(t){return this.map.value.has(t)}get(t){return this.map.value.get(t)}destroy(){for(const t of this){const e=this.cleanupFunctions.get(t);e==null||e(),t.destroy()}this.map.value=new Map}},LD,XD,ZD,BD,qD,VD,cw,Jn,$2,_2,N2,vs=class extends(cw=$l,VD=[dt],qD=[dt],BD=[dt],ZD=[sn],XD=[sn],LD=[sn],cw){constructor(e,n){var r=e,{modifiers:i,type:s,sensors:a}=r,o=kD(r,["modifiers","type","sensors"]);super(o,n),Ve(Jn,5,this),$t(this,$2,Ve(Jn,8,this)),Ve(Jn,11,this),$t(this,_2,Ve(Jn,12,this)),Ve(Jn,15,this),$t(this,N2,Ve(Jn,16,this,this.isDragSource?"dragging":"idle")),Ve(Jn,19,this),this.type=s,this.sensors=a,this.modifiers=i,this.alignment=o.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var e,n;return((n=(e=this.manager)==null?void 0:e.dragOperation.source)==null?void 0:n.id)===this.id}};Jn=pf(cw);$2=new WeakMap;_2=new WeakMap;N2=new WeakMap;lt(Jn,4,"type",VD,vs,$2);lt(Jn,4,"modifiers",qD,vs,_2);lt(Jn,4,"status",BD,vs,N2);lt(Jn,2,"isDropping",ZD,vs);lt(Jn,2,"isDragging",XD,vs);lt(Jn,2,"isDragSource",LD,vs);Ho(Jn,vs);var ID,YD,UD,WD,HD,GD,uw,yn,P2,E2,A2,M2,R2,bs=class extends(uw=$l,GD=[dt],HD=[dt],WD=[dt],UD=[dt],YD=[dt],ID=[sn],uw){constructor(e,n){var r=e,{accept:i,collisionDetector:s,collisionPriority:a,type:o}=r,u=kD(r,["accept","collisionDetector","collisionPriority","type"]);super(u,n),Ve(yn,5,this),$t(this,P2,Ve(yn,8,this)),Ve(yn,11,this),$t(this,E2,Ve(yn,12,this)),Ve(yn,15,this),$t(this,A2,Ve(yn,16,this)),Ve(yn,19,this),$t(this,M2,Ve(yn,20,this)),Ve(yn,23,this),$t(this,R2,Ve(yn,24,this)),Ve(yn,27,this),this.accept=i,this.collisionDetector=s,this.collisionPriority=a,this.type=o}accepts(e){const{accept:n}=this;return n?typeof n=="function"?n(e):e.type?Array.isArray(n)?n.includes(e.type):e.type===n:!1:!0}get isDropTarget(){var e,n;return((n=(e=this.manager)==null?void 0:e.dragOperation.target)==null?void 0:n.id)===this.id}};yn=pf(uw);P2=new WeakMap;E2=new WeakMap;A2=new WeakMap;M2=new WeakMap;R2=new WeakMap;lt(yn,4,"accept",GD,bs,P2);lt(yn,4,"type",HD,bs,E2);lt(yn,4,"collisionDetector",WD,bs,A2);lt(yn,4,"collisionPriority",UD,bs,M2);lt(yn,4,"shape",YD,bs,R2);lt(yn,2,"isDropTarget",ID,bs);Ho(yn,bs);var Uu=class extends Qr{constructor(t,e){super(t,e),this.manager=t,this.options=e}},cue=class extends AbortController{constructor(t,e){super(),this.constraints=t,this.onActivate=e,this.activated=!1;for(const n of t??[])n.controller=this}onEvent(t){var e;if(!this.activated)if((e=this.constraints)!=null&&e.length)for(const n of this.constraints)n.onEvent(t);else this.activate(t)}activate(t){this.activated||(this.activated=!0,this.onActivate(t))}abort(t){this.activated=!1,super.abort(t)}},yO,FD=class{constructor(t){this.options=t,$t(this,yO)}set controller(t){ui(this,yO,t),t.signal.addEventListener("abort",()=>this.abort())}activate(t){var e;(e=kn(this,yO))==null||e.activate(t)}};yO=new WeakMap;var DE=class extends Qr{constructor(t,e){super(t,e),this.manager=t,this.options=e}apply(t){return t.transform}},uue=class{constructor(t){this.draggables=new zE,this.droppables=new zE,this.plugins=new e1(t),this.sensors=new e1(t),this.modifiers=new e1(t)}register(t,e){if(t instanceof vs)return this.draggables.register(t.id,t);if(t instanceof bs)return this.droppables.register(t.id,t);if(t.prototype instanceof DE)return this.modifiers.register(t,e);if(t.prototype instanceof Uu)return this.sensors.register(t,e);if(t.prototype instanceof Qr)return this.plugins.register(t,e);throw new Error("Invalid instance type")}unregister(t){if(t instanceof $l)return t instanceof vs?this.draggables.unregister(t.id,t):t instanceof bs?this.droppables.unregister(t.id,t):()=>{};if(t.prototype instanceof DE)return this.modifiers.unregister(t);if(t.prototype instanceof Uu)return this.sensors.unregister(t);if(t.prototype instanceof Qr)return this.plugins.unregister(t);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},KD,JD,eL,tL,nL,rL,iL,sL,aL,Dd,vO,Uc,Ht,z2,D2,L2,X2,Z2,Ld;aL=[sn],sL=[dt],iL=[dt],rL=[dt],nL=[dt],tL=[dt],eL=[sn],JD=[sn],KD=[sn];var qi=class{constructor(t){Ve(Ht,5,this),$t(this,Dd),$t(this,vO),$t(this,Uc,new Wo(void 0,(e,n)=>e&&n?e.equals(n):e===n)),this.status=new ya,$t(this,z2,Ve(Ht,8,this,!1)),Ve(Ht,11,this),$t(this,D2,Ve(Ht,12,this,null)),Ve(Ht,15,this),$t(this,L2,Ve(Ht,16,this,null)),Ve(Ht,19,this),$t(this,X2,Ve(Ht,20,this,null)),Ve(Ht,23,this),$t(this,Z2,Ve(Ht,24,this,[])),Ve(Ht,27,this),this.position=new py({x:0,y:0}),$t(this,Ld,{x:0,y:0}),ui(this,Dd,t)}get shape(){const{current:t,initial:e,previous:n}=kn(this,Uc);return!t||!e?null:{current:t,initial:e,previous:n}}set shape(t){t?kn(this,Uc).current=t:kn(this,Uc).reset()}get source(){var t;const e=this.sourceIdentifier;if(e==null)return null;const n=kn(this,Dd).registry.draggables.get(e);return n&&ui(this,vO,n),(t=n??kn(this,vO))!=null?t:null}get target(){var t;const e=this.targetIdentifier;return e!=null&&(t=kn(this,Dd).registry.droppables.get(e))!=null?t:null}get transform(){const{x:t,y:e}=this.position.delta;let n={x:t,y:e};for(const r of this.modifiers)n=r.apply(wD(SD({},this.snapshot()),{transform:n}));return ui(this,Ld,n),n}snapshot(){return _t(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:kn(this,Ld),shape:this.shape?J0(this.shape):null,position:J0(this.position),status:J0(this.status),canceled:this.canceled}))}reset(){Lo(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,kn(this,Uc).reset(),this.position.reset({x:0,y:0}),ui(this,Ld,{x:0,y:0}),this.modifiers=[]})}};Ht=pf(null);Dd=new WeakMap;vO=new WeakMap;Uc=new WeakMap;z2=new WeakMap;D2=new WeakMap;L2=new WeakMap;X2=new WeakMap;Z2=new WeakMap;Ld=new WeakMap;lt(Ht,2,"shape",aL,qi);lt(Ht,4,"canceled",sL,qi,z2);lt(Ht,4,"activatorEvent",iL,qi,D2);lt(Ht,4,"sourceIdentifier",rL,qi,L2);lt(Ht,4,"targetIdentifier",nL,qi,X2);lt(Ht,4,"modifiers",tL,qi,Z2);lt(Ht,2,"source",eL,qi);lt(Ht,2,"target",JD,qi);lt(Ht,2,"transform",KD,qi);Ho(Ht,qi);var fue={get rendering(){return Promise.resolve()}};function aa(t,e){return typeof t=="function"?t(e):t??e}var due=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(O=>O.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var n;const r=e??{},i=aa(r.plugins,[]),s=aa(r.sensors,[]),a=aa(r.modifiers,[]),o=(n=r.renderer)!=null?n:fue,u=new aue(this),f=new uue(this);this.registry=f,this.monitor=u,this.renderer=o,this.actions=new oue(this),this.dragOperation=new qi(this),this.collisionObserver=new iue(this),this.plugins=[lue,...i],this.modifiers=a,this.sensors=s;const{destroy:h}=this,m=Pp(()=>{var O,x,v;const S=_t(()=>this.dragOperation.modifiers),k=this.modifiers;for(const w of S)k.includes(w)||w.destroy();this.dragOperation.modifiers=(v=(x=(O=this.dragOperation.source)==null?void 0:O.modifiers)==null?void 0:x.map(w=>{const{plugin:j,options:Q}=S2(w);return new j(this,Q)}))!=null?v:k});this.destroy=()=>{m(),h()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},lL=t=>{throw TypeError(t)},B2=(t,e,n)=>e.has(t)||lL("Cannot "+n),We=(t,e,n)=>(B2(t,e,"read from private field"),e.get(t)),Or=(t,e,n)=>e.has(t)?lL("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xr=(t,e,n,r)=>(B2(t,e,"write to private field"),e.set(t,n),n),oL=(t,e,n)=>(B2(t,e,"access private method"),n);function my(t){return t?t instanceof KeyframeEffect?!0:"getKeyframes"in t&&typeof t.getKeyframes=="function":!1}function hue(t,e){const n=t.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:i}=r,a=(my(i)?i.getKeyframes():[]).filter(e);if(a.length>0)return[a[a.length-1],r]}return null}function gy(t){const{width:e,height:n,top:r,left:i,bottom:s,right:a}=t.getBoundingClientRect();return{width:e,height:n,top:r,left:i,bottom:s,right:a}}function q2(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Dp(t){return"nodeType"in t}function bi(t){var e,n,r;return t?q2(t)?t:Dp(t)?"defaultView"in t?(e=t.defaultView)!=null?e:window:(r=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function V2(t){const{Document:e}=bi(t);return t instanceof e||"nodeType"in t&&t.nodeType===Node.DOCUMENT_NODE}function Xo(t){return!t||q2(t)?!1:t instanceof bi(t).HTMLElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("html")}function cL(t){return t instanceof bi(t).SVGElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("svg")}function Go(t){return t?q2(t)?t.document:Dp(t)?V2(t)?t:Xo(t)||cL(t)?t.ownerDocument:document:document:document}function pue(t){var e,n,r,i;const{documentElement:s}=Go(t),a=bi(t).visualViewport,o=(e=a==null?void 0:a.width)!=null?e:s.clientWidth,u=(n=a==null?void 0:a.height)!=null?n:s.clientHeight,f=(r=a==null?void 0:a.offsetTop)!=null?r:0,h=(i=a==null?void 0:a.offsetLeft)!=null?i:0;return{top:f,left:h,right:h+o,bottom:f+u,width:o,height:u}}function mue(t,e){if(gue(t)&&t.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(t);return n==="visible"&&r==="visible"&&i==="visible"}function gue(t){return t.tagName==="DETAILS"}function vx(t,e=t.getBoundingClientRect(),n=0){var r,i,s,a,o;let u=e;const{ownerDocument:f}=t,h=(r=f.defaultView)!=null?r:window;let m=t.parentElement;for(;m&&m!==f.documentElement;){if(!mue(m)){const Q=m.getBoundingClientRect(),T=n*(Q.bottom-Q.top),N=n*(Q.right-Q.left),_=n*(Q.bottom-Q.top),M=n*(Q.right-Q.left);u={top:Math.max(u.top,Q.top-T),right:Math.min(u.right,Q.right+N),bottom:Math.min(u.bottom,Q.bottom+_),left:Math.max(u.left,Q.left-M),width:0,height:0},u.width=u.right-u.left,u.height=u.bottom-u.top}m=m.parentElement}const O=h.visualViewport,x=(i=O==null?void 0:O.offsetTop)!=null?i:0,v=(s=O==null?void 0:O.offsetLeft)!=null?s:0,S=(a=O==null?void 0:O.width)!=null?a:h.innerWidth,k=(o=O==null?void 0:O.height)!=null?o:h.innerHeight,w=n*k,j=n*S;return u={top:Math.max(u.top,x-w),right:Math.min(u.right,v+S+j),bottom:Math.min(u.bottom,x+k+w),left:Math.max(u.left,v-j),width:0,height:0},u.width=u.right-u.left,u.height=u.bottom-u.top,u.width<0&&(u.width=0),u.height<0&&(u.height=0),u}function Wu(t){return{x:t.clientX,y:t.clientY}}var uL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fw(t=document,e=new Set){if(e.has(t))return[];e.add(t);const n=[t];for(const r of Array.from(t.querySelectorAll("iframe, frame")))try{const i=r.contentDocument;i&&!e.has(i)&&n.push(...fw(i,e))}catch{}try{const r=t.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==t&&n.push(...fw(i.document,e))}}catch{}return n}function I2(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function fL(){var t,e;const n=I2()?window.visualViewport:null;return{x:(t=n==null?void 0:n.offsetLeft)!=null?t:0,y:(e=n==null?void 0:n.offsetTop)!=null?e:0}}function Y2(t){return!t||!Dp(t)?!1:t instanceof bi(t).ShadowRoot}function bx(t){if(t&&Dp(t)){let e=t.getRootNode();if(Y2(e))return e;if(e instanceof Document)return e}return Go(t)}function dL(t){return t.matchMedia("(prefers-reduced-motion: reduce)").matches}function Oue(t){const e="input, textarea, select, canvas, [contenteditable]",n=t.cloneNode(!0),r=Array.from(t.querySelectorAll(e));return Array.from(n.querySelectorAll(e)).forEach((s,a)=>{const o=r[a];if(LE(s)&&LE(o)&&(s.type!=="file"&&(s.value=o.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),XE(s)&&XE(o)&&o.width>0&&o.height>0){const u=s.getContext("2d");u==null||u.drawImage(o,0,0)}}),n}function LE(t){return"value"in t}function XE(t){return t.tagName==="CANVAS"}function hL(t,{x:e,y:n}){const r=t.elementFromPoint(e,n);if(xue(r)){const{contentDocument:i}=r;if(i){const{left:s,top:a}=r.getBoundingClientRect();return hL(i,{x:e-s,y:n-a})}}return r}function xue(t){return(t==null?void 0:t.tagName)==="IFRAME"}var ZE=new WeakMap;function yue(t){return!!t.closest(`
426
+ input:not([disabled]),
427
+ select:not([disabled]),
428
+ textarea:not([disabled]),
429
+ button:not([disabled]),
430
+ a[href],
431
+ [contenteditable]:not([contenteditable="false"])
432
+ `)}var pL=class{constructor(){this.entries=new Set,this.clear=()=>{for(const t of this.entries){const[e,{type:n,listener:r,options:i}]=t;e.removeEventListener(n,r,i)}this.entries.clear()}}bind(t,e){const n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e],i=[];for(const s of n)for(const a of r){const{type:o,listener:u,options:f}=a,h=[s,a];s.addEventListener(o,u,f),this.entries.add(h),i.push(h)}return function(){for(const[a,{type:o,listener:u,options:f}]of i)a.removeEventListener(o,u,f)}}};function Hu(t){const e=t==null?void 0:t.ownerDocument.defaultView;if(e&&e.self!==e.parent)return e.frameElement}function vue(t){const e=new Set;let n=Hu(t);for(;n;)e.add(n),n=Hu(n);return e}function bue(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)}function mL(t,e){const n=()=>performance.now();let r,i;return function(...s){const a=this;i?(r==null||r(),r=bue(()=>{t.apply(a,s),i=n()},e-(n()-i))):(t.apply(a,s),i=n())}}function Sue(t,e){return t===e?!0:!t||!e?!1:t.top==e.top&&t.left==e.left&&t.right==e.right&&t.bottom==e.bottom}function wue(t,e=t.getBoundingClientRect()){const{width:n,height:r}=vx(t,e);return n>0&&r>0}var kue=uL?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},bO,Que=class extends kue{constructor(t){super(e=>{if(!We(this,bO)){Xr(this,bO,!0);return}t(e,this)}),Or(this,bO,!1)}};bO=new WeakMap;var BE=Array.from({length:100},(t,e)=>e/100),gL=75,no,Sx,tl,ro,Xd,An,ch,Zd,wx,OL,xL,yL=class{constructor(t,e,n={debug:!1,skipInitial:!1}){this.element=t,this.callback=e,Or(this,wx),this.disconnect=()=>{var s,a,o;Xr(this,ch,!0),(s=We(this,tl))==null||s.disconnect(),(a=We(this,ro))==null||a.disconnect(),We(this,Xd).disconnect(),(o=We(this,An))==null||o.remove()},Or(this,no,!0),Or(this,Sx),Or(this,tl),Or(this,ro),Or(this,Xd),Or(this,An),Or(this,ch,!1),Or(this,Zd,mL(()=>{var s,a,o;const{element:u}=this;if((s=We(this,ro))==null||s.disconnect(),We(this,ch)||!We(this,no)||!u.isConnected)return;const f=(a=u.ownerDocument)!=null?a:document,{innerHeight:h,innerWidth:m}=(o=f.defaultView)!=null?o:window,O=u.getBoundingClientRect(),x=vx(u,O),{top:v,left:S,bottom:k,right:w}=x,j=-Math.floor(v),Q=-Math.floor(S),T=-Math.floor(m-w),N=-Math.floor(h-k),_=`${j}px ${T}px ${N}px ${Q}px`;this.boundingClientRect=O,Xr(this,ro,new IntersectionObserver(M=>{const[I]=M,{intersectionRect:U}=I;(I.intersectionRatio!==1?I.intersectionRatio:Ep.intersectionRatio(U,vx(u)))!==1&&We(this,Zd).call(this)},{threshold:BE,rootMargin:_,root:f})),We(this,ro).observe(u),oL(this,wx,OL).call(this)},gL)),this.boundingClientRect=t.getBoundingClientRect(),Xr(this,no,wue(t,this.boundingClientRect));let r=!0;this.callback=s=>{r&&(r=!1,n.skipInitial)||e(s)};const i=t.ownerDocument;n!=null&&n.debug&&(Xr(this,An,document.createElement("div")),We(this,An).style.background="rgba(0,0,0,0.15)",We(this,An).style.position="fixed",We(this,An).style.pointerEvents="none",i.body.appendChild(We(this,An))),Xr(this,Xd,new IntersectionObserver(s=>{var a,o;const u=s[s.length-1],{boundingClientRect:f,isIntersecting:h}=u,{width:m,height:O}=f,x=We(this,no);Xr(this,no,h),!(!m&&!O)&&(x&&!h?((a=We(this,ro))==null||a.disconnect(),this.callback(null),(o=We(this,tl))==null||o.disconnect(),Xr(this,tl,void 0),We(this,An)&&(We(this,An).style.visibility="hidden")):We(this,Zd).call(this),h&&!We(this,tl)&&(Xr(this,tl,new Que(We(this,Zd))),We(this,tl).observe(t)))},{threshold:BE,root:i})),We(this,no)&&!n.skipInitial&&this.callback(this.boundingClientRect),We(this,Xd).observe(t)}};no=new WeakMap;Sx=new WeakMap;tl=new WeakMap;ro=new WeakMap;Xd=new WeakMap;An=new WeakMap;ch=new WeakMap;Zd=new WeakMap;wx=new WeakSet;OL=function(){We(this,ch)||(oL(this,wx,xL).call(this),!Sue(this.boundingClientRect,We(this,Sx))&&(this.callback(this.boundingClientRect),Xr(this,Sx,this.boundingClientRect)))};xL=function(){if(We(this,An)){const{top:t,left:e,width:n,height:r}=vx(this.element);We(this,An).style.overflow="hidden",We(this,An).style.visibility="visible",We(this,An).style.top=`${Math.floor(t)}px`,We(this,An).style.left=`${Math.floor(e)}px`,We(this,An).style.width=`${Math.floor(n)}px`,We(this,An).style.height=`${Math.floor(r)}px`}};var Ug=new WeakMap,Wg=new WeakMap;function Cue(t,e){let n=Ug.get(t);return n||(n={disconnect:new yL(t,i=>{const s=Ug.get(t);s&&s.callbacks.forEach(a=>a(i))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(e),Ug.set(t,n),()=>{n.callbacks.delete(e),n.callbacks.size===0&&(Ug.delete(t),n.disconnect())}}function jue(t,e){const n=new Set;for(const r of t){const i=Cue(r,e);n.add(i)}return()=>n.forEach(r=>r())}function Tue(t,e){var n;const r=t.ownerDocument;if(!Wg.has(r)){const a=new AbortController,o=new Set;document.addEventListener("scroll",u=>o.forEach(f=>f(u)),{capture:!0,passive:!0,signal:a.signal}),Wg.set(r,{disconnect:()=>a.abort(),listeners:o})}const{listeners:i,disconnect:s}=(n=Wg.get(r))!=null?n:{};return!i||!s?()=>{}:(i.add(e),()=>{i.delete(e),i.size===0&&(s(),Wg.delete(r))})}var Bd,qd,SO,dw,$ue=class{constructor(t,e,n){this.callback=e,Or(this,Bd),Or(this,qd,!1),Or(this,SO),Or(this,dw,mL(a=>{if(!We(this,qd)&&a.target&&"contains"in a.target&&typeof a.target.contains=="function"){for(const o of We(this,SO))if(a.target.contains(o)){this.callback(We(this,Bd).boundingClientRect);break}}},gL));const r=vue(t),i=jue(r,e),s=Tue(t,We(this,dw));Xr(this,SO,r),Xr(this,Bd,new yL(t,e,n)),this.disconnect=()=>{We(this,qd)||(Xr(this,qd,!0),i(),s(),We(this,Bd).disconnect())}}};Bd=new WeakMap;qd=new WeakMap;SO=new WeakMap;dw=new WeakMap;function hw(t){return"showPopover"in t&&"hidePopover"in t&&typeof t.showPopover=="function"&&typeof t.hidePopover=="function"}function Gh(t){try{hw(t)&&t.isConnected&&t.hasAttribute("popover")&&!t.matches(":popover-open")&&t.showPopover()}catch{}}function qE(t){return!uL||!t?!1:t===Go(t).scrollingElement}function vL(t){var e,n;const r=bi(t),i=qE(t)?pue(t):gy(t),s=r.visualViewport,a=qE(t)?{height:(e=s==null?void 0:s.height)!=null?e:r.innerHeight,width:(n=s==null?void 0:s.width)!=null?n:r.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={current:{x:t.scrollLeft,y:t.scrollTop},max:{x:t.scrollWidth-a.width,y:t.scrollHeight-a.height}},u=o.current.y<=0,f=o.current.x<=0,h=o.current.y>=o.max.y,m=o.current.x>=o.max.x;return{rect:i,position:o,isTop:u,isLeft:f,isBottom:h,isRight:m}}function _ue(t,e){const{isTop:n,isBottom:r,isLeft:i,isRight:s,position:a}=vL(t),{x:o,y:u}=e??{x:0,y:0},f=!n&&a.current.y+u>0,h=!r&&a.current.y+u<a.max.y,m=!i&&a.current.x+o>0,O=!s&&a.current.x+o<a.max.x;return{top:f,bottom:h,left:m,right:O,x:m||O,y:f||h}}var U2=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const i of n)i();for(const i of r)i()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},kx=new U2(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),Nue=new U2(t=>setTimeout(t,50)),Qx=new Map,Pue=Qx.clear.bind(Qx);function va(t,e=!1){if(!e)return VE(t);let n=Qx.get(t);return n||(n=VE(t),Qx.set(t,n),Nue.schedule(Pue),n)}function VE(t){return bi(t).getComputedStyle(t)}function Eue(t,e=va(t,!0)){return e.position==="fixed"||e.position==="sticky"}function Aue(t,e=va(t,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=e[i];return typeof s=="string"?n.test(s):!1})}var Mue={excludeElement:!0,escapeShadowDOM:!0};function pw(t,e=Mue){const{limit:n,excludeElement:r,escapeShadowDOM:i}=e,s=new Set;function a(o){if(n!=null&&s.size>=n||!o)return s;if(V2(o)&&o.scrollingElement!=null&&!s.has(o.scrollingElement))return s.add(o.scrollingElement),s;if(i&&Y2(o))return a(o.host);if(!Xo(o))return cL(o)?a(o.parentElement):s;if(s.has(o))return s;const u=va(o,!0);if(r&&o===t||Aue(o,u)&&s.add(o),Eue(o,u)){const{scrollingElement:f}=o.ownerDocument;return f&&s.add(f),s}return a(o.parentNode)}return t?a(t):s}function Rue(t){const[e]=pw(t,{limit:1});return e??null}function Gu(t,e=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!t)return n;let r=Hu(t);for(;r;){if(r===e)return n;const i=gy(r),{x:s,y:a}=zue(r,i);n.x=n.x+i.left,n.y=n.y+i.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*a,r=Hu(r)}return n}function zue(t,e=gy(t)){const n=Math.round(e.width),r=Math.round(e.height);if(Xo(t))return{x:n/t.offsetWidth,y:r/t.offsetHeight};const i=va(t,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function Due(t){if(t==="none")return null;const e=t.split(" "),n=parseFloat(e[0]),r=parseFloat(e[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function W2(t){if(t==="none")return null;const[e,n,r="0"]=t.split(" "),i={x:parseFloat(e),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function H2(t){var e,n,r,i,s,a,o,u,f;const{scale:h,transform:m,translate:O}=t,x=Due(h),v=W2(O),S=Lue(m);if(!S&&!x&&!v)return null;const k={x:(e=x==null?void 0:x.x)!=null?e:1,y:(n=x==null?void 0:x.y)!=null?n:1},w={x:(r=v==null?void 0:v.x)!=null?r:0,y:(i=v==null?void 0:v.y)!=null?i:0},j={x:(s=S==null?void 0:S.x)!=null?s:0,y:(a=S==null?void 0:S.y)!=null?a:0,scaleX:(o=S==null?void 0:S.scaleX)!=null?o:1,scaleY:(u=S==null?void 0:S.scaleY)!=null?u:1};return{x:w.x+j.x,y:w.y+j.y,z:(f=v==null?void 0:v.z)!=null?f:0,scaleX:k.x*j.scaleX,scaleY:k.y*j.scaleY}}function Lue(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}var fi=(t=>(t[t.Idle=0]="Idle",t[t.Forward=1]="Forward",t[t.Reverse=-1]="Reverse",t))(fi||{}),Xue={x:.2,y:.2},Zue={x:10,y:10};function Bue(t,e,n,r=25,i=Xue,s=Zue){const{x:a,y:o}=e,{rect:u,isTop:f,isBottom:h,isLeft:m,isRight:O}=vL(t),x=Gu(t),v=va(t,!0),S=H2(v),k=S!==null?(S==null?void 0:S.scaleX)<0:!1,w=S!==null?(S==null?void 0:S.scaleY)<0:!1,j=new Ep(u.left*x.scaleX+x.x,u.top*x.scaleY+x.y,u.width*x.scaleX,u.height*x.scaleY),Q={x:0,y:0},T={x:0,y:0},N={height:j.height*i.y,width:j.width*i.x};return(!f||w&&!h)&&o<=j.top+N.height&&(n==null?void 0:n.y)!==1&&a>=j.left-s.x&&a<=j.right+s.x?(Q.y=w?1:-1,T.y=r*Math.abs((j.top+N.height-o)/N.height)):(!h||w&&!f)&&o>=j.bottom-N.height&&(n==null?void 0:n.y)!==-1&&a>=j.left-s.x&&a<=j.right+s.x&&(Q.y=w?-1:1,T.y=r*Math.abs((j.bottom-N.height-o)/N.height)),(!O||k&&!m)&&a>=j.right-N.width&&(n==null?void 0:n.x)!==-1&&o>=j.top-s.y&&o<=j.bottom+s.y?(Q.x=k?-1:1,T.x=r*Math.abs((j.right-N.width-a)/N.width)):(!m||k&&!O)&&a<=j.left+N.width&&(n==null?void 0:n.x)!==1&&o>=j.top-s.y&&o<=j.bottom+s.y&&(Q.x=k?1:-1,T.x=r*Math.abs((j.left+N.width-a)/N.width)),{direction:Q,speed:T}}function que(t){return"scrollIntoViewIfNeeded"in t&&typeof t.scrollIntoViewIfNeeded=="function"}function Vue(t,e=!1){if(que(t)){t.scrollIntoViewIfNeeded(e);return}if(!Xo(t))return t.scrollIntoView();var n=Rue(t);if(!Xo(n))return;const r=va(n,!0),i=parseInt(r.getPropertyValue("border-top-width")),s=parseInt(r.getPropertyValue("border-left-width")),a=t.offsetTop-n.offsetTop<n.scrollTop,o=t.offsetTop-n.offsetTop+t.clientHeight-i>n.scrollTop+n.clientHeight,u=t.offsetLeft-n.offsetLeft<n.scrollLeft,f=t.offsetLeft-n.offsetLeft+t.clientWidth-s>n.scrollLeft+n.clientWidth,h=a&&!o;(a||o)&&e&&(n.scrollTop=t.offsetTop-n.offsetTop-n.clientHeight/2-i+t.clientHeight/2),(u||f)&&e&&(n.scrollLeft=t.offsetLeft-n.offsetLeft-n.clientWidth/2-s+t.clientWidth/2),(a||o||u||f)&&!e&&t.scrollIntoView(h)}function Iue(t,e,n){const{scaleX:r,scaleY:i,x:s,y:a}=e,o=t.left+s+(1-r)*parseFloat(n),u=t.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=r?t.width*r:t.width,h=i?t.height*i:t.height;return{width:f,height:h,top:u,right:o+f,bottom:u+h,left:o}}function Yue(t,e,n){const{scaleX:r,scaleY:i,x:s,y:a}=e,o=t.left-s-(1-r)*parseFloat(n),u=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=r?t.width/r:t.width,h=i?t.height/i:t.height;return{width:f,height:h,top:u,right:o+f,bottom:u+h,left:o}}function Uue({element:t,keyframes:e,options:n}){return t.animate(e,n).finished}var Wue=new U2(t=>setTimeout(t,0)),uh=new Map,Hue=uh.clear.bind(uh);function Gue(t){const e=t.ownerDocument;let n=uh.get(e);if(n)return n;n=e.getAnimations(),uh.set(e,n),Wue.schedule(Hue);const r=n.filter(i=>my(i.effect)&&i.effect.target===t);return uh.set(t,r),n}function Fue(t,e){const n=Gue(t).filter(r=>{var i,s;if(my(r.effect)){const{target:a}=r.effect;if((s=a&&((i=e.isValidTarget)==null?void 0:i.call(e,a)))!=null?s:!0)return r.effect.getKeyframes().some(u=>{for(const f of e.properties)if(u[f])return!0})}}).map(r=>{const{effect:i,currentTime:s}=r,a=i==null?void 0:i.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof a=="number"&&typeof s=="number"&&s<a)return r.currentTime=a,()=>{r.currentTime=s}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var la=class extends Ep{constructor(t,e={}){var n,r,i,s;const{frameTransform:a=Gu(t),ignoreTransforms:o,getBoundingClientRect:u=gy}=e,f=Fue(t,{properties:["transform","translate","scale","width","height"],isValidTarget:N=>(N!==t||I2())&&N.contains(t)}),h=u(t);let{top:m,left:O,width:x,height:v}=h,S;const k=va(t),w=H2(k),j={x:(n=w==null?void 0:w.scaleX)!=null?n:1,y:(r=w==null?void 0:w.scaleY)!=null?r:1},Q=Kue(t,k);f==null||f(),w&&(S=Yue(h,w,k.transformOrigin),(o||Q)&&(m=S.top,O=S.left,x=S.width,v=S.height));const T={width:(i=S==null?void 0:S.width)!=null?i:x,height:(s=S==null?void 0:S.height)!=null?s:v};if(Q&&!o&&S){const N=Iue(S,Q,k.transformOrigin);m=N.top,O=N.left,x=N.width,v=N.height,j.x=Q.scaleX,j.y=Q.scaleY}a&&(o||(O*=a.scaleX,x*=a.scaleX,m*=a.scaleY,v*=a.scaleY),O+=a.x,m+=a.y),super(O,m,x,v),this.scale=j,this.intrinsicWidth=T.width,this.intrinsicHeight=T.height}};function Kue(t,e){var n;const r=t.getAnimations();let i=null;if(!r.length)return null;for(const s of r){if(s.playState!=="running")continue;const a=my(s.effect)?s.effect.getKeyframes():[],o=a[a.length-1];if(!o)continue;const{transform:u,translate:f,scale:h}=o;if(u||f||h){const m=H2({transform:typeof u=="string"&&u?u:e.transform,translate:typeof f=="string"&&f?f:e.translate,scale:typeof h=="string"&&h?h:e.scale});m&&(i=i?{x:i.x+m.x,y:i.y+m.y,z:(n=i.z)!=null?n:m.z,scaleX:i.scaleX*m.scaleX,scaleY:i.scaleY*m.scaleY}:m)}}return i}function fh(t){return"style"in t&&typeof t.style=="object"&&t.style!==null&&"setProperty"in t.style&&"removeProperty"in t.style&&typeof t.style.setProperty=="function"&&typeof t.style.removeProperty=="function"}var Jue=class{constructor(t){this.element=t,this.initial=new Map}set(t,e=""){const{element:n}=this;if(fh(n))for(const[r,i]of Object.entries(t)){const s=`${e}${r}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof i=="string"?i:`${i}px`)}}remove(t,e=""){const{element:n}=this;if(fh(n))for(const r of t){const i=`${e}${r}`;n.style.removeProperty(i)}}reset(){const{element:t}=this;if(fh(t)){for(const[e,n]of this.initial)t.style.setProperty(e,n);t.getAttribute("style")===""&&t.removeAttribute("style")}}};function Zo(t){return t?t instanceof bi(t).Element||Dp(t)&&t.nodeType===Node.ELEMENT_NODE:!1}function G2(t){if(!t)return!1;const{KeyboardEvent:e}=bi(t.target);return t instanceof e}function efe(t){if(!t)return!1;const{PointerEvent:e}=bi(t.target);return t instanceof e}function tfe(t){if(!Zo(t))return!1;const{tagName:e}=t;return e==="INPUT"||e==="TEXTAREA"||nfe(t)}function nfe(t){return t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"}var t1={};function mw(t){const e=t1[t]==null?0:t1[t]+1;return t1[t]=e,`${t}-${e}`}var rfe=({dragOperation:t,droppable:e})=>{const n=t.position.current;if(!n)return null;const{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){const i=cs.distance(e.shape.center,n);return{id:r,value:1/i,type:zp.PointerIntersection,priority:Rp.High}}return null},ife=({dragOperation:t,droppable:e})=>{const{shape:n}=t;if(!e.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(e.shape);if(r){const{position:i}=t,s=cs.distance(e.shape.center,i.current),o=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:o,type:zp.ShapeIntersection,priority:Rp.Normal}}return null},sfe=t=>{var e;return(e=rfe(t))!=null?e:ife(t)},afe=Object.create,F2=Object.defineProperty,lfe=Object.defineProperties,ofe=Object.getOwnPropertyDescriptor,cfe=Object.getOwnPropertyDescriptors,Cx=Object.getOwnPropertySymbols,bL=Object.prototype.hasOwnProperty,SL=Object.prototype.propertyIsEnumerable,wL=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),mf=t=>{throw TypeError(t)},gw=(t,e,n)=>e in t?F2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fh=(t,e)=>{for(var n in e||(e={}))bL.call(e,n)&&gw(t,n,e[n]);if(Cx)for(var n of Cx(e))SL.call(e,n)&&gw(t,n,e[n]);return t},K2=(t,e)=>lfe(t,cfe(e)),IE=(t,e)=>F2(t,"name",{value:e,configurable:!0}),kL=(t,e)=>{var n={};for(var r in t)bL.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Cx)for(var r of Cx(t))e.indexOf(r)<0&&SL.call(t,r)&&(n[r]=t[r]);return n},gf=t=>{var e;return[,,,afe((e=t==null?void 0:t[wL("metadata")])!=null?e:null)]},QL=["class","method","getter","setter","accessor","field","value","get","set"],Vd=t=>t!==void 0&&typeof t!="function"?mf("Function expected"):t,ufe=(t,e,n,r,i)=>({kind:QL[t],name:e,metadata:r,addInitializer:s=>n._?mf("Already initialized"):i.push(Vd(s||null))}),Fo=(t,e)=>gw(e,wL("metadata"),t[3]),an=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Ir=(t,e,n,r,i,s)=>{var a,o,u,f,h,m=e&7,O=!!(e&8),x=!!(e&16),v=m>3?t.length+1:m?O?1:2:0,S=QL[m+5],k=m>3&&(t[v-1]=[]),w=t[v]||(t[v]=[]),j=m&&(!x&&!O&&(i=i.prototype),m<5&&(m>3||!x)&&ofe(m<4?i:{get[n](){return Rt(this,s)},set[n](T){return tr(this,s,T)}},n));m?x&&m<4&&IE(s,(m>2?"set ":m>1?"get ":"")+n):IE(i,n);for(var Q=r.length-1;Q>=0;Q--)f=ufe(m,n,u={},t[3],w),m&&(f.static=O,f.private=x,h=f.access={has:x?T=>ffe(i,T):T=>n in T},m^3&&(h.get=x?T=>(m^1?Rt:Bo)(T,i,m^4?s:j.get):T=>T[n]),m>2&&(h.set=x?(T,N)=>tr(T,i,N,m^4?s:j.set):(T,N)=>T[n]=N)),o=(0,r[Q])(m?m<4?x?s:j[S]:m>4?void 0:{get:j.get,set:j.set}:i,f),u._=1,m^4||o===void 0?Vd(o)&&(m>4?k.unshift(o):m?x?s=o:j[S]=o:i=o):typeof o!="object"||o===null?mf("Object expected"):(Vd(a=o.get)&&(j.get=a),Vd(a=o.set)&&(j.set=a),Vd(a=o.init)&&k.unshift(a));return m||Fo(t,i),j&&F2(i,n,j),x?m^4?s:j:i},J2=(t,e,n)=>e.has(t)||mf("Cannot "+n),ffe=(t,e)=>Object(e)!==e?mf('Cannot use the "in" operator on this value'):t.has(e),Rt=(t,e,n)=>(J2(t,e,"read from private field"),n?n.call(t):e.get(t)),Ft=(t,e,n)=>e.has(t)?mf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),tr=(t,e,n,r)=>(J2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Bo=(t,e,n)=>(J2(t,e,"access private method"),n),YE={role:"button",roleDescription:"draggable"},dfe="dnd-kit-description",hfe="dnd-kit-announcement",pfe={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},mfe={dragstart({operation:{source:t}}){if(t)return`Picked up draggable item ${t.id}.`},dragover({operation:{source:t,target:e}}){if(!(!t||t.id===(e==null?void 0:e.id)))return e?`Draggable item ${t.id} was moved over droppable target ${e.id}.`:`Draggable item ${t.id} is no longer over a droppable target.`},dragend({operation:{source:t,target:e},canceled:n}){if(t)return n?`Dragging was cancelled. Draggable item ${t.id} was dropped.`:e?`Draggable item ${t.id} was dropped over droppable target ${e.id}`:`Draggable item ${t.id} was dropped.`}};function gfe(t){const e=t.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(e)}function Ofe(t,e){const n=document.createElement("div");return n.id=t,n.style.setProperty("display","none"),n.textContent=e,n}function xfe(t){const e=document.createElement("div");return e.id=t,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.style.setProperty("position","fixed"),e.style.setProperty("width","1px"),e.style.setProperty("height","1px"),e.style.setProperty("margin","-1px"),e.style.setProperty("border","0"),e.style.setProperty("padding","0"),e.style.setProperty("overflow","hidden"),e.style.setProperty("clip","rect(0 0 0 0)"),e.style.setProperty("clip-path","inset(100%)"),e.style.setProperty("white-space","nowrap"),e}var yfe=["dragover","dragmove"],vfe=class extends Qr{constructor(t,e){super(t);const{id:n,idPrefix:{description:r=dfe,announcement:i=hfe}={},announcements:s=mfe,screenReaderInstructions:a=pfe,debounce:o=500}=e??{},u=n?`${r}-${n}`:mw(r),f=n?`${i}-${n}`:mw(i);let h,m,O,x;const v=(N=x)=>{!O||!N||(O==null?void 0:O.nodeValue)!==N&&(O.nodeValue=N)},S=()=>kx.schedule(v),k=bfe(S,o),w=Object.entries(s).map(([N,_])=>this.manager.monitor.addEventListener(N,(M,I)=>{const U=O;if(!U)return;const F=_==null?void 0:_(M,I);F&&U.nodeValue!==F&&(x=F,yfe.includes(N)?k():(S(),k.cancel()))})),j=()=>{let N=[];h!=null&&h.isConnected||(h=Ofe(u,a.draggable),N.push(h)),m!=null&&m.isConnected||(m=xfe(f),O=document.createTextNode(""),m.appendChild(O),N.push(m)),N.length>0&&document.body.append(...N)},Q=new Set;function T(){for(const N of Q)N()}this.registerEffect(()=>{var N;Q.clear();for(const _ of this.manager.registry.draggables.value){const M=(N=_.handle)!=null?N:_.element;if(M){(!h||!m)&&Q.add(j),(!gfe(M)||I2())&&!M.hasAttribute("tabindex")&&Q.add(()=>M.setAttribute("tabindex","0")),!M.hasAttribute("role")&&M.tagName.toLowerCase()!=="button"&&Q.add(()=>M.setAttribute("role",YE.role)),M.hasAttribute("aria-roledescription")||Q.add(()=>M.setAttribute("aria-roledescription",YE.roleDescription)),M.hasAttribute("aria-describedby")||Q.add(()=>M.setAttribute("aria-describedby",u));for(const U of["aria-pressed","aria-grabbed"]){const F=String(_.isDragging);M.getAttribute(U)!==F&&Q.add(()=>M.setAttribute(U,F))}const I=String(_.disabled);M.getAttribute("aria-disabled")!==I&&Q.add(()=>M.setAttribute("aria-disabled",I))}}Q.size>0&&kx.schedule(T)}),this.destroy=()=>{super.destroy(),h==null||h.remove(),m==null||m.remove(),w.forEach(N=>N())}}};function bfe(t,e){let n;const r=()=>{clearTimeout(n),n=setTimeout(t,e)};return r.cancel=()=>clearTimeout(n),r}var Sfe=class extends Qr{constructor(t,e){super(t,e),this.manager=t;const n=xx(()=>{var r;return Go((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=vi(()=>{var r;const{dragOperation:i}=this.manager,{cursor:s="grabbing",nonce:a}=(r=this.options)!=null?r:{};if(i.status.initialized){const o=n.value,u=o.createElement("style");return a&&u.setAttribute("nonce",a),u.textContent=`* { cursor: ${s} !important; }`,o.head.appendChild(u),()=>u.remove()}})}},jx=new Map,CL,jL,TL,$L,Ow,dh,oa,eQ,Fu,_L,NL,PL,EL,Ko=class extends(Ow=Mp,$L=[dt],TL=[sn],jL=[sn],CL=[sn],Ow){constructor(t){super(t),an(oa,5,this),Ft(this,Fu),Ft(this,dh,new Set),Ft(this,eQ,an(oa,8,this,new Set)),an(oa,11,this),this.registerEffect(Bo(this,Fu,_L))}register(t){return Rt(this,dh).add(t),()=>{Rt(this,dh).delete(t)}}addRoot(t){return _t(()=>{const e=new Set(this.additionalRoots);e.add(t),this.additionalRoots=e}),()=>{_t(()=>{const e=new Set(this.additionalRoots);e.delete(t),this.additionalRoots=e})}}get sourceRoot(){var t;const{source:e}=this.manager.dragOperation;return bx((t=e==null?void 0:e.element)!=null?t:null)}get targetRoot(){var t;const{target:e}=this.manager.dragOperation;return bx((t=e==null?void 0:e.element)!=null?t:null)}get roots(){const{status:t}=this.manager.dragOperation;if(t.initializing||t.initialized){const e=[this.sourceRoot,this.targetRoot].filter(n=>n!=null);return new Set([...e,...this.additionalRoots])}return new Set}};oa=gf(Ow);dh=new WeakMap;eQ=new WeakMap;Fu=new WeakSet;_L=function(){const{roots:t}=this,e=[];for(const n of t)for(const r of Rt(this,dh))e.push(Bo(this,Fu,NL).call(this,n,r));return()=>{for(const n of e)n()}};NL=function(t,e){let n=jx.get(t);n||(n=new Map,jx.set(t,n));let r=n.get(e);if(!r){const s=V2(t)?Bo(this,Fu,PL).call(this,t,n,e):Bo(this,Fu,EL).call(this,t,n,e);if(!s)return()=>{};r=s,n.set(e,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,r.refCount===0&&r.cleanup())}};PL=function(t,e,n){const r=t.createElement("style");r.textContent=n,t.head.prepend(r);const i=new MutationObserver(s=>{for(const a of s)for(const o of Array.from(a.removedNodes))if(o===r){t.head.prepend(r);return}});return i.observe(t.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),e.delete(n),e.size===0&&jx.delete(t)}}};EL=function(t,e,n){"adoptedStyleSheets"in t&&Array.isArray(t.adoptedStyleSheets);const r=t.ownerDocument.defaultView,{CSSStyleSheet:i}=r??{};if(!i)return null;const s=new i;return s.replaceSync(n),t.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var a;if(Y2(t)&&((a=t.host)!=null&&a.isConnected)){const o=t.adoptedStyleSheets.indexOf(s);o!==-1&&t.adoptedStyleSheets.splice(o,1)}e.delete(n),e.size===0&&jx.delete(t)}}};Ir(oa,4,"additionalRoots",$L,Ko,eQ);Ir(oa,2,"sourceRoot",TL,Ko);Ir(oa,2,"targetRoot",jL,Ko);Ir(oa,2,"roots",CL,Ko);Fo(oa,Ko);var Lp="data-dnd-",xw=`${Lp}dropping`,Bn="--dnd-",es=`${Lp}dragging`,Tx=`${Lp}placeholder`,wfe=[es,Tx,"popover","aria-pressed","aria-grabbing"],kfe=["view-transition-name"],Qfe=`
433
+ :is(:root,:host) [${es}] {
434
+ position: fixed !important;
435
+ pointer-events: none !important;
436
+ touch-action: none;
437
+ z-index: calc(infinity);
438
+ will-change: translate;
439
+ top: var(${Bn}top, 0px) !important;
440
+ left: var(${Bn}left, 0px) !important;
441
+ right: unset !important;
442
+ bottom: unset !important;
443
+ width: var(${Bn}width, auto);
444
+ max-width: var(${Bn}width, auto);
445
+ height: var(${Bn}height, auto);
446
+ max-height: var(${Bn}height, auto);
447
+ transition: var(${Bn}transition) !important;
448
+ }
449
+
450
+ :is(:root,:host) [${Tx}] {
451
+ transition: none;
452
+ }
453
+
454
+ :is(:root,:host) [${Tx}='hidden'] {
455
+ visibility: hidden;
456
+ }
457
+
458
+ [${es}] * {
459
+ pointer-events: none !important;
460
+ }
461
+
462
+ [${es}]:not([${xw}]) {
463
+ translate: var(${Bn}translate) !important;
464
+ }
465
+
466
+ [${es}][style*='${Bn}scale'] {
467
+ scale: var(${Bn}scale) !important;
468
+ transform-origin: var(${Bn}transform-origin) !important;
469
+ }
470
+
471
+ @layer dnd-kit {
472
+ :where([${es}][popover]) {
473
+ overflow: visible;
474
+ background: unset;
475
+ border: unset;
476
+ margin: unset;
477
+ padding: unset;
478
+ color: inherit;
479
+
480
+ &:is(input, button) {
481
+ border: revert;
482
+ background: revert;
483
+ }
484
+ }
485
+ }
486
+ [${es}]::backdrop, [${Lp}overlay]:not([${es}]) {
487
+ display: none;
488
+ visibility: hidden;
489
+ }
490
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function Cfe(t,e="hidden"){return _t(()=>{const{element:n,manager:r}=t;if(!n||!r)return;const i=jfe(n,r.registry.droppables),s=[],a=Oue(n),{remove:o}=a;return Tfe(i,a,s),$fe(a,e),a.remove=()=>{s.forEach(u=>u()),o.call(a)},a})}function jfe(t,e){const n=new Map;for(const r of e)if(r.element&&(t===r.element||t.contains(r.element))){const i=`${Lp}${mw("dom-id")}`;r.element.setAttribute(i,""),n.set(r,i)}return n}function Tfe(t,e,n){for(const[r,i]of t){if(!r.element)continue;const s=`[${i}]`,a=e.matches(s)?e:e.querySelector(s);if(r.element.removeAttribute(i),!a)continue;const o=r.element;r.proxy=a,a.removeAttribute(i),ZE.set(o,a),n.push(()=>{ZE.delete(o),r.proxy=void 0})}}function $fe(t,e="hidden"){t.setAttribute("inert","true"),t.setAttribute("tab-index","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute(Tx,e)}function AL(t,e){return t===e?!0:Hu(t)===Hu(e)}function UE(t){const{target:e}=t;"newState"in t&&t.newState==="closed"&&Zo(e)&&e.hasAttribute("popover")&&requestAnimationFrame(()=>Gh(e))}function yw(t){return t.tagName==="TR"}function _fe(t,e,n){const r=new MutationObserver(i=>{let s=!1;for(const a of i){if(a.target!==t){s=!0;continue}if(a.type!=="attributes")continue;const o=a.attributeName;if(o.startsWith("aria-")||wfe.includes(o))continue;const u=t.getAttribute(o);if(o==="style"){if(fh(t)&&fh(e)){const f=t.style;for(const h of Array.from(e.style))f.getPropertyValue(h)===""&&e.style.removeProperty(h);for(const h of Array.from(f)){if(kfe.includes(h)||h.startsWith(Bn))continue;const m=f.getPropertyValue(h);e.style.setProperty(h,m)}}}else u!==null?e.setAttribute(o,u):e.removeAttribute(o)}s&&n&&(e.innerHTML=t.innerHTML)});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function Nfe(t,e,n){const r=new MutationObserver(i=>{for(const s of i)if(s.addedNodes.length!==0)for(const a of Array.from(s.addedNodes)){if(a.contains(t)&&t.nextElementSibling!==e){t.insertAdjacentElement("afterend",e),Gh(n);return}if(a.contains(e)&&e.previousElementSibling!==t){e.insertAdjacentElement("beforebegin",t),Gh(n);return}}});return r.observe(t.ownerDocument.body,{childList:!0,subtree:!0}),r}function Pfe(t){return new ResizeObserver(()=>{var e,n;const r=new la(t.placeholder,{frameTransform:t.frameTransform,ignoreTransforms:!0}),i=(e=t.transformOrigin)!=null?e:{x:1,y:1},s=(t.width-r.width)*i.x+t.delta.x,a=(t.height-r.height)*i.y+t.delta.y,o=fL();if(t.styles.set({width:r.width-t.widthOffset,height:r.height-t.heightOffset,top:t.top+a+o.y,left:t.left+s+o.x},Bn),(n=t.getElementMutationObserver())==null||n.takeRecords(),yw(t.element)&&yw(t.placeholder)){const u=Array.from(t.element.cells),f=Array.from(t.placeholder.cells);t.getSavedCellWidths()||t.setSavedCellWidths(u.map(h=>h.style.width));for(const[h,m]of u.entries()){const O=f[h];m.style.width=`${O.getBoundingClientRect().width}px`}}t.dragOperation.shape=new la(t.feedbackElement)})}var Efe=250,Afe="ease";function Mfe(t){var e,n,r,i;const{animation:s}=t;if(typeof s=="function"){const j=s({element:t.element,feedbackElement:t.feedbackElement,placeholder:t.placeholder,translate:t.translate,moved:t.moved});Promise.resolve(j).then(()=>{t.cleanup(),requestAnimationFrame(t.restoreFocus)});return}const{duration:a=Efe,easing:o=Afe}=s??{};Gh(t.feedbackElement);const[,u]=(e=hue(t.feedbackElement,j=>"translate"in j))!=null?e:[];u==null||u.pause();const f=(n=t.placeholder)!=null?n:t.element,h={frameTransform:AL(t.feedbackElement,f)?null:void 0},m=new la(t.feedbackElement,h),O=(r=W2(va(t.feedbackElement).translate))!=null?r:t.translate,x=new la(f,h),v=Ep.delta(m,x,t.alignment),S={x:O.x-v.x,y:O.y-v.y},k=Math.round(m.intrinsicHeight)!==Math.round(x.intrinsicHeight)?{minHeight:[`${m.intrinsicHeight}px`,`${x.intrinsicHeight}px`],maxHeight:[`${m.intrinsicHeight}px`,`${x.intrinsicHeight}px`]}:{},w=Math.round(m.intrinsicWidth)!==Math.round(x.intrinsicWidth)?{minWidth:[`${m.intrinsicWidth}px`,`${x.intrinsicWidth}px`],maxWidth:[`${m.intrinsicWidth}px`,`${x.intrinsicWidth}px`]}:{};t.styles.set({transition:t.transition},Bn),t.feedbackElement.setAttribute(xw,""),(i=t.getElementMutationObserver())==null||i.takeRecords(),Uue({element:t.feedbackElement,keyframes:K2(Fh(Fh({},k),w),{translate:[`${O.x}px ${O.y}px 0`,`${S.x}px ${S.y}px 0`]}),options:{duration:dL(bi(t.feedbackElement))?0:t.moved||t.feedbackElement!==t.element?a:0,easing:o}}).then(()=>{t.feedbackElement.removeAttribute(xw),u==null||u.finish(),t.cleanup(),requestAnimationFrame(t.restoreFocus)})}var ML,vw,Kh,tQ,wO,RL,zL,Jh=class extends(vw=Qr,ML=[dt],vw){constructor(e,n){super(e,n),Ft(this,wO),Ft(this,tQ,an(Kh,8,this)),an(Kh,11,this),this.state={initial:{},current:{}};const r=e.registry.plugins.get(Ko),i=r==null?void 0:r.register(Qfe);if(i){const s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}this.registerEffect(Bo(this,wO,RL).bind(this,r)),this.registerEffect(Bo(this,wO,zL))}};Kh=gf(vw);tQ=new WeakMap;wO=new WeakSet;RL=function(t){const{overlay:e}=this;if(!e||!t)return;const n=bx(e);if(n)return t.addRoot(n)};zL=function(){var t,e,n;const{state:r,manager:i,options:s}=this,{dragOperation:a}=i,{position:o,source:u,status:f}=a;if(f.idle){r.current={},r.initial={};return}if(!u)return;const{element:h,feedback:m}=u;if(!h||m==="none"||!f.initialized||f.initializing)return;const{initial:O}=r,x=(t=this.overlay)!=null?t:h,v=Gu(x),S=Gu(h),k=!AL(h,x),w=new la(h,{frameTransform:k?S:null,ignoreTransforms:!k}),j={x:S.scaleX/v.scaleX,y:S.scaleY/v.scaleY};let{width:Q,height:T,top:N,left:_}=w;k&&(Q=Q/j.x,T=T/j.y);const M=new Jue(x),{transition:I,translate:U,boxSizing:F,paddingBlockStart:Z,paddingBlockEnd:X,paddingInlineStart:H,paddingInlineEnd:E,borderInlineStartWidth:q,borderInlineEndWidth:R,borderBlockStartWidth:z,borderBlockEndWidth:B}=va(h),W=m==="clone",A=F==="content-box",D=A?parseInt(H)+parseInt(E)+parseInt(q)+parseInt(R):0,Y=A?parseInt(Z)+parseInt(X)+parseInt(z)+parseInt(B):0,P=m!=="move"&&!this.overlay?Cfe(u,W?"clone":"hidden"):null,ee=_t(()=>G2(i.dragOperation.activatorEvent));if(U!=="none"){const Ie=W2(U);Ie&&!O.translate&&(O.translate=Ie)}if(!O.transformOrigin){const Ie=_t(()=>o.current);O.transformOrigin={x:(Ie.x-_*v.scaleX-v.x)/(Q*v.scaleX),y:(Ie.y-N*v.scaleY-v.y)/(T*v.scaleY)}}const{transformOrigin:ae}=O,ne=N*v.scaleY+v.y,fe=_*v.scaleX+v.x;if(!O.coordinates&&(O.coordinates={x:fe,y:ne},j.x!==1||j.y!==1)){const{scaleX:Ie,scaleY:ht}=S,{x:kt,y:Qt}=ae;O.coordinates.x+=(Q*Ie-Q)*kt,O.coordinates.y+=(T*ht-T)*Qt}O.dimensions||(O.dimensions={width:Q,height:T}),O.frameTransform||(O.frameTransform=v);const oe={x:O.coordinates.x-fe,y:O.coordinates.y-ne},me={width:(O.dimensions.width*O.frameTransform.scaleX-Q*v.scaleX)*ae.x,height:(O.dimensions.height*O.frameTransform.scaleY-T*v.scaleY)*ae.y},je={x:oe.x/v.scaleX+me.width,y:oe.y/v.scaleY+me.height},ke={left:_+je.x,top:N+je.y};x.setAttribute(es,"true");const we=_t(()=>a.transform),Qe=(e=O.translate)!=null?e:{x:0,y:0},Le=we.x*v.scaleX+Qe.x,He=we.y*v.scaleY+Qe.y,ze=fL();M.set({width:Q-D,height:T-Y,top:ke.top+ze.y,left:ke.left+ze.x,translate:`${Le}px ${He}px 0`,transition:I?`${I}, translate 0ms linear`:"",scale:k?`${j.x} ${j.y}`:"","transform-origin":`${ae.x*100}% ${ae.y*100}%`},Bn),P&&(h.insertAdjacentElement("afterend",P),s!=null&&s.rootElement&&(typeof s.rootElement=="function"?s.rootElement(u):s.rootElement).appendChild(h)),hw(x)&&(x.hasAttribute("popover")||x.setAttribute("popover","manual"),Gh(x),x.addEventListener("beforetoggle",UE));let vt,Qn,Jt;const Cn=Pfe({placeholder:P,element:h,feedbackElement:x,frameTransform:v,transformOrigin:ae,width:Q,height:T,top:N,left:_,widthOffset:D,heightOffset:Y,delta:je,styles:M,dragOperation:a,getElementMutationObserver:()=>vt,getSavedCellWidths:()=>Jt,setSavedCellWidths:Ie=>{Jt=Ie}}),sr=new la(x);_t(()=>a.shape=sr);const jr=bi(x),Yr=Ie=>{this.manager.actions.stop({event:Ie})},en=dL(jr);ee&&jr.addEventListener("resize",Yr),_t(()=>u.status)==="idle"&&requestAnimationFrame(()=>u.status="dragging"),P&&(Cn.observe(P),vt=_fe(h,P,W),Qn=Nfe(h,P,x));const Si=(n=i.dragOperation.source)==null?void 0:n.id,ce=()=>{var Ie;if(!ee||Si==null)return;const ht=i.registry.draggables.get(Si),kt=(Ie=ht==null?void 0:ht.handle)!=null?Ie:ht==null?void 0:ht.element;Xo(kt)&&kt.focus()},ge=()=>{var Ie;if(vt==null||vt.disconnect(),Qn==null||Qn.disconnect(),Cn.disconnect(),jr.removeEventListener("resize",Yr),hw(x)&&(x.removeEventListener("beforetoggle",UE),x.removeAttribute("popover")),x.removeAttribute(es),M.reset(),Jt&&yw(h)){const kt=Array.from(h.cells);for(const[Qt,Vt]of kt.entries())Vt.style.width=(Ie=Jt[Qt])!=null?Ie:""}u.status="idle";const ht=r.current.translate!=null;P&&(ht||P.parentElement!==x.parentElement)&&x.isConnected&&P.replaceWith(x),P==null||P.remove()},Ne=s==null?void 0:s.dropAnimation,Be=this,Ke=Pp(()=>{var Ie;const{transform:ht,status:kt}=a;if(!(!ht.x&&!ht.y&&!r.current.translate)&&kt.dragging){const Qt=(Ie=O.translate)!=null?Ie:{x:0,y:0},Vt={x:ht.x/v.scaleX+Qt.x,y:ht.y/v.scaleY+Qt.y},ot=r.current.translate,Ur=_t(()=>a.modifiers),jn=_t(()=>{var Wr;return(Wr=a.shape)==null?void 0:Wr.current}),Of=ee&&!en?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(M.set({transition:`${I}, translate ${Of}`,translate:`${Vt.x}px ${Vt.y}px 0`},Bn),vt==null||vt.takeRecords(),jn&&jn!==sr&&ot&&!Ur.length){const Wr=cs.delta(Vt,ot);a.shape=Ep.from(jn.boundingRectangle).translate(Wr.x*v.scaleX,Wr.y*v.scaleY)}else a.shape=new la(x);r.current.translate=Vt}},function(){if(a.status.dropped){this.dispose(),u.status="dropping";const Ie=Be.dropAnimation!==void 0?Be.dropAnimation:Ne;let ht=r.current.translate;const kt=ht!=null;if(!ht&&h!==x&&(ht={x:0,y:0}),!ht||Ie===null){ge();return}i.renderer.rendering.then(()=>{Mfe({element:h,feedbackElement:x,placeholder:P,translate:ht,moved:kt,transition:I,alignment:u.alignment,styles:M,animation:Ie??void 0,getElementMutationObserver:()=>vt,cleanup:ge,restoreFocus:ce})})}});return()=>{ge(),Ke()}};Ir(Kh,4,"overlay",ML,Jh,tQ);Fo(Kh,Jh);Jh.configure=b2(Jh);var Rfe=Jh,Td=!0,zfe=!1,DL,LL,XL,ZL,Ol,nQ,rQ;ZL=(XL=[dt],fi.Forward),LL=(DL=[dt],fi.Reverse);var ep=class{constructor(){Ft(this,nQ,an(Ol,8,this,Td)),an(Ol,11,this),Ft(this,rQ,an(Ol,12,this,Td)),an(Ol,15,this)}isLocked(t){return t===fi.Idle?!1:t==null?this[fi.Forward]===Td&&this[fi.Reverse]===Td:this[t]===Td}unlock(t){t!==fi.Idle&&(this[t]=zfe)}};Ol=gf(null);nQ=new WeakMap;rQ=new WeakMap;Ir(Ol,4,ZL,XL,ep,nQ);Ir(Ol,4,LL,DL,ep,rQ);Fo(Ol,ep);var Dfe=[fi.Forward,fi.Reverse],WE=class{constructor(){this.x=new ep,this.y=new ep}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},Lfe=class extends Qr{constructor(t){super(t);const e=Np(new WE);let n=null;this.signal=e,vi(()=>{const{status:r}=t.dragOperation;if(!r.initialized){n=null,e.value=new WE;return}const{delta:i}=t.dragOperation.position;if(n){const s={x:HE(i.x,n.x),y:HE(i.y,n.y)},a=e.peek();Lo(()=>{for(const o of xD)for(const u of Dfe)s[o]===u&&a[o].unlock(u);e.value=a})}n=i})}get current(){return this.signal.peek()}};function HE(t,e){return Math.sign(t-e)}var BL,bw,tp,iQ,nl,Sw,Oy=class extends(bw=Mp,BL=[dt],bw){constructor(t){super(t),Ft(this,iQ,an(tp,8,this,!1)),an(tp,11,this),Ft(this,nl),Ft(this,Sw,()=>{if(!Rt(this,nl))return;const{element:s,by:a}=Rt(this,nl);a.y&&(s.scrollTop+=a.y),a.x&&(s.scrollLeft+=a.x)}),this.scroll=s=>{var a;if(this.disabled)return!1;const o=this.getScrollableElements();if(!o)return tr(this,nl,void 0),!1;const{position:u}=this.manager.dragOperation,f=u==null?void 0:u.current;if(f){const{by:h}=s??{},m=h?{x:GE(h.x),y:GE(h.y)}:void 0,O=m?void 0:this.scrollIntentTracker.current;if(O!=null&&O.isLocked())return!1;for(const x of o){const v=_ue(x,h);if(v.x||v.y){const{speed:S,direction:k}=Bue(x,f,m);if(O)for(const w of xD)O[w].isLocked(k[w])&&(S[w]=0,k[w]=0);if(k.x||k.y){const{x:w,y:j}=h??k,Q=w*S.x,T=j*S.y;if(Q||T){const N=(a=Rt(this,nl))==null?void 0:a.by;if(this.autoScrolling&&N&&(N.x&&!Q||N.y&&!T))continue;return tr(this,nl,{element:x,by:{x:Q,y:T}}),kx.schedule(Rt(this,Sw)),!0}}}}}return tr(this,nl,void 0),!1};let e=null,n=null;const r=xx(()=>{const{position:s,source:a}=t.dragOperation;if(!s)return null;const o=hL(bx(a==null?void 0:a.element),s.current);return o&&(e=o),o??e}),i=xx(()=>{const s=r.value,{documentElement:a}=Go(s);if(!s||s===a){const{target:o}=t.dragOperation,u=o==null?void 0:o.element;if(u){const f=pw(u,{excludeElement:!1});return n=f,f}}if(s){const o=pw(s,{excludeElement:!1});return this.autoScrolling&&n&&o.size<(n==null?void 0:n.size)?n:(n=o,o)}return n=null,null},Yu);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new Lfe(t),this.destroy=t.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!G2(t.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};tp=gf(bw);iQ=new WeakMap;nl=new WeakMap;Sw=new WeakMap;Ir(tp,4,"autoScrolling",BL,Oy,iQ);Fo(tp,Oy);function GE(t){return t>0?fi.Forward:t<0?fi.Reverse:fi.Idle}var Xfe=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of e)r();for(const r of n)r()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},Zfe=new Xfe(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),Bfe=10,qL=class extends Qr{constructor(t,e){super(t);const n=t.registry.plugins.get(Oy);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=vi(()=>{if(this.disabled)return;const{position:r,status:i}=t.dragOperation;if(i.dragging)if(n.scroll()){n.autoScrolling=!0;const a=setInterval(()=>Zfe.schedule(n.scroll),Bfe);return()=>{clearInterval(a)}}else n.autoScrolling=!1})}},FE={capture:!0,passive:!0},Id,qfe=class extends Mp{constructor(t){super(t),Ft(this,Id),this.handleScroll=()=>{Rt(this,Id)==null&&tr(this,Id,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),tr(this,Id,void 0)},50))};const{dragOperation:e}=this.manager;this.destroy=vi(()=>{var n,r,i;if(e.status.dragging){const a=(i=(r=(n=e.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?i:document;return a.addEventListener("scroll",this.handleScroll,FE),()=>{a.removeEventListener("scroll",this.handleScroll,FE)}}})}};Id=new WeakMap;var Vfe=class extends Qr{constructor(t,e){super(t,e),this.manager=t,this.destroy=vi(()=>{var n;const{dragOperation:r}=this.manager,{nonce:i}=(n=this.options)!=null?n:{};if(r.status.initialized){const s=document.createElement("style");return i&&s.setAttribute("nonce",i),s.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(s),n1(),document.addEventListener("selectionchange",n1,{capture:!0}),()=>{document.removeEventListener("selectionchange",n1,{capture:!0}),s.remove()}}})}};function n1(){var t;(t=document.getSelection())==null||t.removeAllRanges()}var Yd=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(t,e){var n;const r=(n=e.handle)!=null?n:e.element;return t.target!==r}}),Wc,$x=class extends Uu{constructor(e,n){super(e),this.manager=e,this.options=n,Ft(this,Wc,[]),this.listeners=new pL,this.handleSourceKeyDown=(r,i,s)=>{if(this.disabled||r.defaultPrevented||!Zo(r.target)||i.disabled)return;const{keyboardCodes:a=Yd.keyboardCodes,preventActivation:o=Yd.preventActivation}=s??{};a.start.includes(r.code)&&this.manager.dragOperation.status.idle&&(o!=null&&o(r,i)||this.handleStart(r,i,s))}}bind(e,n=this.options){return vi(()=>{var i;const s=(i=e.handle)!=null?i:e.element,a=o=>{G2(o)&&this.handleSourceKeyDown(o,e,n)};if(s)return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}})}handleStart(e,n,r){const{element:i}=n;if(!i)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),Vue(i);const{center:s}=new la(i);if(this.manager.actions.start({event:e,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const o=Go(i),u=[this.listeners.bind(o,[{type:"keydown",listener:f=>this.handleKeyDown(f,n,r),options:{capture:!0}}])];Rt(this,Wc).push(...u)}handleKeyDown(e,n,r){const{keyboardCodes:i=Yd.keyboardCodes}=r??{};if(Zc(e,[...i.end,...i.cancel])){e.preventDefault();const s=Zc(e,i.cancel);this.handleEnd(e,s);return}Zc(e,i.up)?this.handleMove("up",e):Zc(e,i.down)&&this.handleMove("down",e),Zc(e,i.left)?this.handleMove("left",e):Zc(e,i.right)&&this.handleMove("right",e)}handleEnd(e,n){this.manager.actions.stop({event:e,canceled:n}),this.cleanup()}handleMove(e,n){var r,i;const{shape:s}=this.manager.dragOperation,a=n.shiftKey?5:1;let o={x:0,y:0},u=(i=(r=this.options)==null?void 0:r.offset)!=null?i:Yd.offset;if(typeof u=="number"&&(u={x:u,y:u}),!!s){switch(e){case"up":o={x:0,y:-u.y*a};break;case"down":o={x:0,y:u.y*a};break;case"left":o={x:-u.x*a,y:0};break;case"right":o={x:u.x*a,y:0};break}(o.x||o.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:o}))}}sideEffects(){const e=this.manager.registry.plugins.get(qL);(e==null?void 0:e.disabled)===!1&&(e.disable(),Rt(this,Wc).push(()=>{e.enable()}))}cleanup(){Rt(this,Wc).forEach(e=>e()),tr(this,Wc,[])}destroy(){this.cleanup(),this.listeners.clear()}};Wc=new WeakMap;$x.configure=b2($x);$x.defaults=Yd;var Ife=$x;function Zc(t,e){return e.includes(t.code)}var io,Yfe=class extends FD{constructor(){super(...arguments),Ft(this,io)}onEvent(t){switch(t.type){case"pointerdown":tr(this,io,Wu(t));break;case"pointermove":if(!Rt(this,io))return;const{x:e,y:n}=Wu(t),r={x:e-Rt(this,io).x,y:n-Rt(this,io).y},{tolerance:i}=this.options;if(i&&lw(r,i)){this.abort();return}lw(r,this.options.value)&&this.activate(t);break;case"pointerup":this.abort();break}}abort(){tr(this,io,void 0)}};io=new WeakMap;var Hc,so,Ufe=class extends FD{constructor(){super(...arguments),Ft(this,Hc),Ft(this,so)}onEvent(t){switch(t.type){case"pointerdown":tr(this,so,Wu(t)),tr(this,Hc,setTimeout(()=>this.activate(t),this.options.value));break;case"pointermove":if(!Rt(this,so))return;const{x:e,y:n}=Wu(t),r={x:e-Rt(this,so).x,y:n-Rt(this,so).y};lw(r,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){Rt(this,Hc)&&(clearTimeout(Rt(this,Hc)),tr(this,so,void 0),tr(this,Hc,void 0))}};Hc=new WeakMap;so=new WeakMap;var tu=class{};tu.Delay=Ufe;tu.Distance=Yfe;var ww=Object.freeze({activationConstraints(t,e){var n;const{pointerType:r,target:i}=t;if(!(r==="mouse"&&Zo(i)&&(e.handle===i||(n=e.handle)!=null&&n.contains(i))))return r==="touch"?[new tu.Delay({value:250,tolerance:5})]:tfe(i)&&!t.defaultPrevented?[new tu.Delay({value:200,tolerance:0})]:[new tu.Delay({value:200,tolerance:10}),new tu.Distance({value:5})]},preventActivation(t,e){var n;const{target:r}=t;return r===e.element||r===e.handle||!Zo(r)||(n=e.handle)!=null&&n.contains(r)?!1:yue(r)}}),Gc,_x=class extends Uu{constructor(e,n){super(e),this.manager=e,this.options=n,Ft(this,Gc,new Set),this.listeners=new pL,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:i}=this.latest;!r||!i||this.manager.actions.move({event:r,to:i})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,n,r=this.options){const{activationConstraints:i=ww.activationConstraints}=r??{};return typeof i=="function"?i(e,n):i}bind(e,n=this.options){return vi(()=>{var i;const s=new AbortController,{signal:a}=s,o=f=>{efe(f)&&this.handlePointerDown(f,e,n)};let u=[(i=e.handle)!=null?i:e.element];n!=null&&n.activatorElements&&(Array.isArray(n.activatorElements)?u=n.activatorElements:u=n.activatorElements(e));for(const f of u)f&&(Ffe(f.ownerDocument.defaultView),f.addEventListener("pointerdown",o,{signal:a}));return()=>s.abort()})}handlePointerDown(e,n,r){if(this.disabled||!e.isPrimary||e.button!==0||!Zo(e.target)||n.disabled||Hfe(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:i=ww.preventActivation}=r??{};if(i!=null&&i(e,n))return;const{target:s}=e,a=Xo(s)&&s.draggable&&s.getAttribute("draggable")==="true",o=Gu(n.element),{x:u,y:f}=Wu(e);this.initialCoordinates={x:u*o.scaleX+o.x,y:f*o.scaleY+o.y};const h=this.activationConstraints(e,n,r);e.sensor=this;const m=new cue(h,S=>this.handleStart(n,S));m.signal.onabort=()=>this.handleCancel(e),m.onEvent(e),this.controller=m;const O=fw(),x=this.listeners.bind(O,[{type:"pointermove",listener:S=>this.handlePointerMove(S,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:a?this.handleCancel:Hg,options:{capture:!0}}]),v=()=>{x(),this.initialCoordinates=void 0};Rt(this,Gc).add(v)}handlePointerMove(e,n){var r,i;if(((r=this.controller)==null?void 0:r.activated)===!1){(i=this.controller)==null||i.onEvent(e);return}if(this.manager.dragOperation.status.dragging){const s=Wu(e),a=Gu(n.element);s.x=s.x*a.scaleX+a.x,s.y=s.y*a.scaleY+a.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=s,kx.schedule(this.handleMove)}}handlePointerUp(e){const{status:n}=this.manager.dragOperation;if(!n.idle){e.preventDefault(),e.stopPropagation();const r=!n.initialized;this.manager.actions.stop({event:e,canceled:r})}this.cleanup()}handleKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,n){const{manager:r,initialCoordinates:i}=this;if(!i||!r.dragOperation.status.idle||n.defaultPrevented)return;if(r.actions.start({coordinates:i,event:n,source:e}).signal.aborted)return this.cleanup();n.preventDefault();const o=Go(n.target).body;o.setPointerCapture(n.pointerId);const u=Zo(n.target)?[n.target,o]:o,f=this.listeners.bind(u,[{type:"touchmove",listener:Hg,options:{passive:!1}},{type:"click",listener:Hg},{type:"contextmenu",listener:Hg},{type:"keydown",listener:this.handleKeyDown}]);Rt(this,Gc).add(f)}handleCancel(e){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},Rt(this,Gc).forEach(e=>e()),Rt(this,Gc).clear()}destroy(){this.cleanup(),this.listeners.clear()}};Gc=new WeakMap;_x.configure=b2(_x);_x.defaults=ww;var Wfe=_x;function Hfe(t){return"sensor"in t}function Hg(t){t.preventDefault()}function Gfe(){}var KE=new WeakSet;function Ffe(t){!t||KE.has(t)||(t.addEventListener("touchmove",Gfe,{capture:!1,passive:!1}),KE.add(t))}var du={modifiers:[],plugins:[vfe,qL,Sfe,Rfe,Vfe],sensors:[Wfe,Ife]},VL=class extends due{constructor(t={}){const e=aa(t.plugins,du.plugins),n=aa(t.sensors,du.sensors),r=aa(t.modifiers,du.modifiers);super(K2(Fh({},t),{plugins:[qfe,Oy,Ko,...e],sensors:n,modifiers:r}))}},IL,YL,UL,kw,$i,sQ,aQ,lQ,Xp=class extends(kw=vs,UL=[dt],YL=[dt],IL=[dt],kw){constructor(t,e){var n=t,{element:r,effects:i=()=>[],handle:s,feedback:a="default"}=n,o=kL(n,["element","effects","handle","feedback"]);super(Fh({effects:()=>[...i(),()=>{var u,f;const{manager:h}=this;if(!h)return;const O=((f=(u=this.sensors)==null?void 0:u.map(S2))!=null?f:[...h.sensors]).map(x=>{const v=x instanceof Uu?x:h.registry.register(x.plugin),S=x instanceof Uu?void 0:x.options;return v.bind(this,S)});return function(){O.forEach(v=>v())}}]},o),e),Ft(this,sQ,an($i,8,this)),an($i,11,this),Ft(this,aQ,an($i,12,this)),an($i,15,this),Ft(this,lQ,an($i,16,this)),an($i,19,this),this.element=r,this.handle=s,this.feedback=a}};$i=gf(kw);sQ=new WeakMap;aQ=new WeakMap;lQ=new WeakMap;Ir($i,4,"handle",UL,Xp,sQ);Ir($i,4,"element",YL,Xp,aQ);Ir($i,4,"feedback",IL,Xp,lQ);Fo($i,Xp);var WL,HL,Qw,xl,oQ,r1,GL,FL,hh,cQ,uQ=class extends(Qw=bs,HL=[dt],WL=[dt],Qw){constructor(t,e){var n=t,{element:r,effects:i=()=>[]}=n,s=kL(n,["element","effects"]);const{collisionDetector:a=sfe}=s,o=f=>{const{manager:h,element:m}=this;if(!m||f===null){this.shape=void 0;return}if(!h)return;const O=new la(m),x=_t(()=>this.shape);return O&&(x!=null&&x.equals(O))?x:(this.shape=O,O)},u=Np(!1);super(K2(Fh({},s),{collisionDetector:a,effects:()=>[...i(),()=>{const{element:f,manager:h}=this;if(!h)return;const{dragOperation:m}=h,{source:O}=m;u.value=!!(O&&m.status.initialized&&f&&!this.disabled&&this.accepts(O))},()=>{const{element:f}=this;if(u.value&&f){const h=new $ue(f,o);return()=>{h.disconnect(),this.shape=void 0}}},()=>{var f;if((f=this.manager)!=null&&f.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),e),Ft(this,hh),Ft(this,oQ,an(xl,8,this)),an(xl,11,this),Ft(this,cQ,an(xl,12,this)),an(xl,15,this),this.element=r,this.refreshShape=()=>o()}set element(t){tr(this,hh,t,FL)}get element(){var t;return(t=this.proxy)!=null?t:Rt(this,hh,GL)}};xl=gf(Qw);oQ=new WeakMap;hh=new WeakSet;cQ=new WeakMap;r1=Ir(xl,20,"#element",HL,hh,oQ),GL=r1.get,FL=r1.set;Ir(xl,4,"proxy",WL,uQ,cQ);Fo(xl,uQ);function Kfe(t){return t!=null&&typeof t=="object"&&"current"in t}function np(t){var e;if(t!=null)return Kfe(t)?(e=t.current)!=null?e:void 0:t}var Jfe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zp=Jfe?C.useLayoutEffect:C.useEffect;function ede(){const t=C.useState(0)[1];return C.useCallback(()=>{t(e=>e+1)},[t])}function KL(t,e){const n=C.useRef(new Map),r=ede();return Zp(()=>{if(!t){n.current.clear();return}return vi(()=>{var i;let s=!1,a=!1;for(const o of n.current){const[u]=o,f=_t(()=>o[1]),h=t[u];f!==h&&(s=!0,n.current.set(u,h),a=(i=e==null?void 0:e(u,f,h))!=null?i:!1)}s&&(a?dB.flushSync(r):r())})},[t]),C.useMemo(()=>t&&new Proxy(t,{get(i,s){const a=i[s];return n.current.set(s,a),a}}),[t])}function Bc(t){const e=C.useRef(t);return Zp(()=>{e.current=t},[t]),e}function Vn(t,e,n=C.useEffect,r=Object.is){const i=C.useRef(t);n(()=>{const s=i.current;r(t,s)||(i.current=t,e(t,s))},[e,t])}function Cw(t,e){const n=C.useRef(np(t));Zp(()=>{const r=np(t);r!==n.current&&(n.current=r,e(r))})}var tde=Object.defineProperty,nde=Object.defineProperties,rde=Object.getOwnPropertyDescriptors,Nx=Object.getOwnPropertySymbols,JL=Object.prototype.hasOwnProperty,eX=Object.prototype.propertyIsEnumerable,JE=(t,e,n)=>e in t?tde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tX=(t,e)=>{for(var n in e||(e={}))JL.call(e,n)&&JE(t,n,e[n]);if(Nx)for(var n of Nx(e))eX.call(e,n)&&JE(t,n,e[n]);return t},nX=(t,e)=>nde(t,rde(e)),ide=(t,e)=>{var n={};for(var r in t)JL.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Nx)for(var r of Nx(t))e.indexOf(r)<0&&eX.call(t,r)&&(n[r]=t[r]);return n},sde=new VL,rX=C.createContext(sde),ade=C.memo(C.forwardRef(({children:t},e)=>{const[n,r]=C.useState(0),i=C.useRef(null),s=C.useRef(null),a=C.useMemo(()=>({renderer:{get rendering(){var o;return(o=i.current)!=null?o:Promise.resolve()}},trackRendering(o){i.current||(i.current=new Promise(u=>{s.current=u})),C.startTransition(()=>{o(),r(u=>u+1)})}}),[]);return Zp(()=>{var o;(o=s.current)==null||o.call(s),i.current=null},[t,n]),C.useImperativeHandle(e,()=>a),null})),i1=[void 0,Yu];function lde(t){var e=t,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:s,onDragMove:a,onDragOver:o,onDragEnd:u}=e,f=ide(e,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const h=C.useRef(null),{plugins:m,modifiers:O,sensors:x}=f,v=aa(m,du.plugins),S=aa(x,du.sensors),k=aa(O,du.modifiers),w=Bc(i),j=Bc(s),Q=Bc(o),T=Bc(a),N=Bc(u),_=Bc(r),M=ode(()=>{var I;return(I=f.manager)!=null?I:new VL(f)});return C.useEffect(()=>{if(!h.current)throw new Error("Renderer not found");const{renderer:I,trackRendering:U}=h.current,{monitor:F}=M;M.renderer=I;const Z=[F.addEventListener("beforedragstart",X=>{const H=w.current;H&&U(()=>H(X,M))}),F.addEventListener("dragstart",X=>{var H;return(H=j.current)==null?void 0:H.call(j,X,M)}),F.addEventListener("dragover",X=>{const H=Q.current;H&&U(()=>H(X,M))}),F.addEventListener("dragmove",X=>{const H=T.current;H&&U(()=>H(X,M))}),F.addEventListener("dragend",X=>{const H=N.current;H&&U(()=>H(X,M))}),F.addEventListener("collision",X=>{var H;return(H=_.current)==null?void 0:H.call(_,X,M)})];return()=>Z.forEach(X=>X())},[M]),Vn(v,()=>M&&(M.plugins=v),...i1),Vn(S,()=>M&&(M.sensors=S),...i1),Vn(k,()=>M&&(M.modifiers=k),...i1),p.jsxs(rX.Provider,{value:M,children:[p.jsx(ade,{ref:h,children:n}),n]})}function ode(t){const e=C.useRef(null);return e.current||(e.current=t()),C.useInsertionEffect(()=>()=>{var n;return(n=e.current)==null?void 0:n.destroy()},[]),e.current}function cde(){return C.useContext(rX)}function iX(t){var e;const n=(e=cde())!=null?e:void 0,[r]=C.useState(()=>t(n));return r.manager!==n&&(r.manager=n),Zp(r.register,[n,r]),r}function ude(t){const{disabled:e,data:n,element:r,handle:i,id:s,modifiers:a,sensors:o}=t,u=iX(h=>new Xp(nX(tX({},t),{register:!1,handle:np(i),element:np(r)}),h)),f=KL(u,fde);return Vn(s,()=>u.id=s),Cw(i,h=>u.handle=h),Cw(r,h=>u.element=h),Vn(n,()=>n&&(u.data=n)),Vn(e,()=>u.disabled=e===!0),Vn(o,()=>u.sensors=o),Vn(a,()=>u.modifiers=a,void 0,Yu),Vn(t.feedback,()=>{var h;return u.feedback=(h=t.feedback)!=null?h:"default"}),Vn(t.alignment,()=>u.alignment=t.alignment),{draggable:f,get isDragging(){return f.isDragging},get isDropping(){return f.isDropping},get isDragSource(){return f.isDragSource},handleRef:C.useCallback(h=>{u.handle=h??void 0},[u]),ref:C.useCallback(h=>{var m,O;!h&&((m=u.element)!=null&&m.isConnected)&&!((O=u.manager)!=null&&O.dragOperation.status.idle)||(u.element=h??void 0)},[u])}}function fde(t,e,n){return!!(t==="isDragSource"&&!n&&e)}var dde=Object.create,sX=Object.defineProperty,hde=Object.getOwnPropertyDescriptor,aX=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),xy=t=>{throw TypeError(t)},pde=(t,e,n)=>e in t?sX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mde=t=>{var e;return[,,,dde((e=t==null?void 0:t[aX("metadata")])!=null?e:null)]},lX=["class","method","getter","setter","accessor","field","value","get","set"],oX=t=>t!==void 0&&typeof t!="function"?xy("Function expected"):t,gde=(t,e,n,r,i)=>({kind:lX[t],name:e,metadata:r,addInitializer:s=>n._?xy("Already initialized"):i.push(oX(s||null))}),Ode=(t,e)=>pde(e,aX("metadata"),t[3]),xde=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)s[i].call(n);return r},cX=(t,e,n,r,i,s)=>{for(var a,o,u,f,h=e&7,m=!1,O=!1,x=2,v=lX[h+5],S=t[x]||(t[x]=[]),k=(i=i.prototype,hde(i,n)),w=r.length-1;w>=0;w--)u=gde(h,n,o={},t[3],S),u.static=m,u.private=O,f=u.access={has:j=>n in j},f.get=j=>j[n],a=(0,r[w])(k[v],u),o._=1,oX(a)&&(k[v]=a);return k&&sX(i,n,k),i},uX=(t,e,n)=>e.has(t)||xy("Cannot "+n),yde=(t,e,n)=>(uX(t,e,"read from private field"),e.get(t)),vde=(t,e,n)=>e.has(t)?xy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),bde=(t,e,n,r)=>(uX(t,e,"write to private field"),e.set(t,n),n),uo=class jw{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new jw(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new jw(e,n)}},fX,dX,Tw,kO,Bp,fQ=class extends(Tw=Wo,dX=[sn],fX=[sn],Tw){constructor(t){const e=uo.from(t);super(e,(n,r)=>uo.equals(n,r)),xde(Bp,5,this),vde(this,kO,0),this.velocity={x:0,y:0}}get delta(){return uo.delta(this.current,this.initial)}get direction(){const{current:t,previous:e}=this;if(!e)return null;const n={x:t.x-e.x,y:t.y-e.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:e}=this,n=uo.from(t),r={x:n.x-e.x,y:n.y-e.y},i=Date.now(),s=i-yde(this,kO),a=o=>Math.round(o/s*100);Lo(()=>{bde(this,kO,i),this.velocity={x:a(r.x),y:a(r.y)},super.current=n})}reset(t=this.defaultValue){super.reset(uo.from(t)),this.velocity={x:0,y:0}}};Bp=mde(Tw);kO=new WeakMap;cX(Bp,2,"delta",dX,fQ);cX(Bp,2,"direction",fX,fQ);Ode(Bp,fQ);var hX=(t=>(t.Horizontal="x",t.Vertical="y",t))(hX||{});Object.values(hX);var Sde=({dragOperation:t,droppable:e})=>{const n=t.position.current;if(!n)return null;const{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){const i=uo.distance(e.shape.center,n);return{id:r,value:1/i,type:zp.PointerIntersection,priority:Rp.High}}return null},wde=({dragOperation:t,droppable:e})=>{const{shape:n}=t;if(!e.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(e.shape);if(r){const{position:i}=t,s=uo.distance(e.shape.center,i.current),o=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:o,type:zp.ShapeIntersection,priority:Rp.Normal}}return null},kde=t=>{var e;return(e=Sde(t))!=null?e:wde(t)};function Qde(t){const{collisionDetector:e,data:n,disabled:r,element:i,id:s,accept:a,type:o}=t,u=iX(h=>new uQ(nX(tX({},t),{register:!1,element:np(i)}),h)),f=KL(u);return Vn(s,()=>u.id=s),Cw(i,h=>u.element=h),Vn(a,()=>u.accept=a,void 0,Yu),Vn(e,()=>u.collisionDetector=e??kde),Vn(n,()=>n&&(u.data=n)),Vn(r,()=>u.disabled=r===!0),Vn(o,()=>u.type=o),{droppable:f,get isDropTarget(){return f.isDropTarget},ref:C.useCallback(h=>{var m,O;!h&&((m=u.element)!=null&&m.isConnected)&&!((O=u.manager)!=null&&O.dragOperation.status.idle)||(u.element=h??void 0)},[u])}}function pX(){return ma({queryKey:["skills"],queryFn:async()=>{const t=await fetch("/api/skills");if(!t.ok)throw new Error("Failed to fetch skills");return t.json()},staleTime:3e4})}function Cde(t){return ma({queryKey:["skills",{id:t}],queryFn:async()=>{const e=await fetch(`/api/skills/${t}`);if(!e.ok)throw new Error(`Failed to fetch skill ${t}`);return e.json()},enabled:!!t})}function jde(t,e){const n=t.split(`
491
+ `),r=e.split(`
492
+ `),i=[],s=Math.max(n.length,r.length);for(let a=0;a<s;a++){const o=n[a],u=r[a];o===u?i.push({type:"unchanged",content:o??"",lineNumber:a+1}):(o!==void 0&&i.push({type:"removed",content:o,lineNumber:a+1}),u!==void 0&&i.push({type:"added",content:u,lineNumber:a+1}))}return i}function mX({original:t,modified:e,onConfirm:n,onCancel:r}){if(t===e)return p.jsx("div",{className:"p-8 text-center text-[var(--color-muted)]",children:p.jsx("p",{className:"text-sm",children:"No changes to save"})});const i=jde(t,e);return p.jsxs("div",{className:"flex flex-col h-full",children:[p.jsx("div",{className:"flex-1 overflow-auto font-[var(--font-mono)] text-sm",children:i.map((s,a)=>p.jsxs("div",{className:`px-4 py-0.5 ${s.type==="added"?"bg-green-950/30 text-green-400":s.type==="removed"?"bg-red-950/30 text-red-400":"text-[var(--color-text)]"}`,children:[p.jsx("span",{className:"inline-block w-6 text-right mr-3 text-[var(--color-muted)] select-none",children:s.type==="added"?"+":s.type==="removed"?"-":" "}),s.content]},a))}),(n||r)&&p.jsxs("div",{className:"flex justify-end gap-3 px-4 py-3 border-t border-[var(--color-border-subtle)]",children:[r&&p.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),n&&p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md bg-[var(--color-accent)] text-white font-bold hover:bg-[var(--color-accent-hover)] transition-colors",children:"Confirm Save"})]})]})}function Tde({skill:t,onAdd:e}){const{ref:n,isDragging:r}=ude({id:`available-${t.id}`,data:{skillName:t.name,skillId:t.id}});return p.jsxs("div",{ref:n,className:`w-full flex items-center gap-2 px-3 py-2 text-left rounded-md hover:bg-[var(--color-surface-raised)] transition-colors group cursor-grab active:cursor-grabbing ${r?"opacity-40":""}`,children:[p.jsx(A9,{size:14,className:"text-[var(--color-muted)] shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("p",{className:"text-sm font-bold truncate",children:t.name}),t.module&&p.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:t.module})]}),t.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate",children:t.description})]}),p.jsx("button",{onClick:i=>{i.stopPropagation(),e()},className:"text-[var(--color-success)] shrink-0 opacity-0 group-hover:opacity-100 transition-opacity hover:scale-110",title:"Add skill",children:p.jsx(hn,{size:14})})]})}function $de({children:t,isEmpty:e}){const{ref:n,isDropTarget:r}=Qde({id:"assigned-skills-zone"});return p.jsxs("div",{ref:n,className:`flex-1 overflow-y-auto p-2 transition-colors ${r?"bg-[var(--color-accent)]/5 ring-2 ring-inset ring-[var(--color-accent)]/30 rounded-lg":""}`,children:[t,e&&!r&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:"No skills assigned"}),p.jsx("div",{className:`mt-2 py-3 border-2 border-dashed rounded-lg text-center transition-all ${r?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-[var(--color-border-subtle)] text-[var(--color-muted)]"}`,children:p.jsx("p",{className:"text-xs",children:"Drop skills here to assign"})})]})}function _de({agentName:t,currentSkills:e,onSave:n,onClose:r}){const{data:i}=pX(),[s,a]=C.useState(e),[o,u]=C.useState(""),[f,h]=C.useState(!1),m=C.useMemo(()=>{if(!i)return[];const k=new Set(s);let w=i.filter(j=>!k.has(j.id)&&!k.has(j.name));if(o){const j=o.toLowerCase();w=w.filter(Q=>Q.name.toLowerCase().includes(j)||Q.description.toLowerCase().includes(j))}return w},[i,s,o]),O=C.useCallback(k=>{a(w=>w.includes(k)?w:[...w,k])},[]),x=C.useCallback(k=>{a(w=>w.filter(j=>j!==k))},[]),v=C.useCallback(k=>{var Q;const{source:w,target:j}=k.operation;(Q=w==null?void 0:w.data)!=null&&Q.skillName&&(j==null?void 0:j.id)==="assigned-skills-zone"&&O(w.data.skillName)},[O]),S=JSON.stringify(s)!==JSON.stringify(e);if(f){const k=e.join(`
493
+ `),w=s.join(`
494
+ `);return p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsx("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)]",children:p.jsxs("h2",{className:"text-lg font-bold",children:["Review Skill Changes: ",t]})}),p.jsx("div",{className:"flex-1 overflow-hidden",children:p.jsx(mX,{original:k,modified:w,onConfirm:()=>n(s),onCancel:()=>h(!1)})})]})}return p.jsx(lde,{onDragEnd:v,children:p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Assign Skills: ",t]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:()=>h(!0),disabled:!S,className:"px-3 py-1.5 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Review Changes"}),p.jsx("button",{onClick:r,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]})]}),p.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[p.jsxs("div",{className:"w-1/2 border-r border-[var(--color-border-subtle)] flex flex-col",children:[p.jsxs("div",{className:"p-4 border-b border-[var(--color-border-subtle)]",children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Available Skills"}),p.jsxs("div",{className:"relative",children:[p.jsx(Vo,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",placeholder:"Search skills...",value:o,onChange:k=>u(k.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)]"})]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[m.map(k=>p.jsx(Tde,{skill:k,onAdd:()=>O(k.name)},k.id)),m.length===0&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-4",children:o?"No matching skills":"All skills assigned"})]})]}),p.jsxs("div",{className:"w-1/2 flex flex-col",children:[p.jsx("div",{className:"p-4 border-b border-[var(--color-border-subtle)]",children:p.jsxs("h3",{className:"text-sm font-bold",children:["Assigned Skills (",s.length,")"]})}),p.jsx($de,{isEmpty:s.length===0,children:s.map(k=>p.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-md hover:bg-[var(--color-surface-raised)] transition-colors group",children:[p.jsx("span",{className:"text-sm",children:k}),p.jsx("button",{onClick:()=>x(k),className:"text-[var(--color-error)] opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove skill",children:p.jsx(H9,{size:14})})]},k))})]})]})]})})}function Nde({agent:t,onClose:e,onSaved:n}){const r=qo(),i=t.module==="bmm"||t.module==="core",[s,a]=C.useState(t.title||""),[o,u]=C.useState(t.role||""),[f,h]=C.useState(t.icon||""),[m,O]=C.useState(t.role||""),[x,v]=C.useState(t.discussion),[S,k]=C.useState(new Set(t.skills)),[w,j]=C.useState([]),[Q,T]=C.useState(""),[N,_]=C.useState(null),[M,I]=C.useState(!1);C.useEffect(()=>{fetch("/api/skills").then(X=>X.json()).then(X=>j(X)).catch(()=>{})},[]);const U=w.filter(X=>{if(!Q)return!0;const H=Q.toLowerCase();return X.name.toLowerCase().includes(H)||X.description.toLowerCase().includes(H)}),F=X=>{k(H=>{const E=new Set(H);return E.has(X)?E.delete(X):E.add(X),E})},Z=async()=>{var X,H;I(!0),_(null);try{const E=Array.from(S);if(E.length!==t.skills.length||E.some(R=>!t.skills.includes(R))){const R=await fetch(`/api/agents/${encodeURIComponent(t.id)}/skills`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({skills:E})});if(!R.ok){const z=await R.json();throw new Error(((X=z.error)==null?void 0:X.message)??"Failed to update skills")}}if(i){const R=["# Agent Override","",`title: "${s}"`,`role: "${o}"`,f?`icon: "${f}"`:"",`discussion: ${x}`,""].filter(Boolean).join(`
495
+ `),z=await fetch(`/api/agents/${encodeURIComponent(t.id)}/override`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:R})});if(!z.ok){const B=await z.json();throw new Error(((H=B.error)==null?void 0:H.message)??"Failed to save override")}}await r.invalidateQueries({queryKey:["agents"]}),await r.invalidateQueries({queryKey:["agent",t.id]}),n()}catch(E){_(E instanceof Error?E.message:"Failed to save agent")}finally{I(!1)}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-bold",children:"Edit Agent"}),i&&p.jsx("p",{className:"text-xs text-[var(--color-warning)] mt-1",children:"Override mode — base file will not be modified"})]}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Title"}),p.jsx("input",{type:"text",value:s,onChange:X=>a(X.target.value),placeholder:"e.g. Project Manager",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Role"}),p.jsx("textarea",{value:o,onChange:X=>u(X.target.value),rows:2,placeholder:"Describe the agent's role...",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),p.jsx("input",{type:"text",value:f,onChange:X=>h(X.target.value),placeholder:"e.g. a single emoji",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("label",{className:"text-sm font-bold",children:"Discussion mode"}),p.jsx("button",{onClick:()=>v(!x),className:`relative w-10 h-5 rounded-full transition-colors ${x?"bg-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]"}`,children:p.jsx("span",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${x?"translate-x-5":"translate-x-0.5"}`})})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Skills (",S.size," assigned)"]}),p.jsxs("div",{className:"relative mb-2",children:[p.jsx(Vo,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",value:Q,onChange:X=>T(X.target.value),placeholder:"Search skills...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:U.length===0?p.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No skills found"}):U.map(X=>p.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:S.has(X.id),onChange:()=>F(X.id),className:"accent-[var(--color-accent)]"}),p.jsx("span",{className:"truncate font-bold",children:X.name}),p.jsx("span",{className:"text-xs text-[var(--color-muted)] truncate ml-auto",children:X.description})]},X.id))})]}),p.jsxs("div",{className:"text-xs text-[var(--color-muted)] space-y-1 pt-2 border-t border-[var(--color-border-subtle)]",children:[p.jsxs("p",{children:["ID: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.id})]}),p.jsxs("p",{children:["Module: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:t.module??"custom"})]}),p.jsxs("p",{children:["File: ",p.jsx("code",{className:"font-[var(--font-mono)] break-all",children:t.filePath})]})]}),N&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:N})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:Z,disabled:M,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(yh,{size:14}),M?"Saving...":"Save Changes"]})]})]})]})}function Pde(){const{id:t}=CA(),e=pa(),{notify:n}=hp(),{data:r,isLoading:i,error:s}=U4(t??""),[a,o]=C.useState(!1),[u,f]=C.useState(null),[h,m]=C.useState(!1),[O,x]=C.useState(!1),[v,S]=C.useState(!1),{data:k}=r5(),{data:w}=W4(),j=(w??[]).filter(T=>T.agentIds.includes(t??"")||T.agentIds.includes((r==null?void 0:r.name)??""));function Q(){const T=!a;if(o(T),T&&r&&u===null){m(!0);const N=r.filePath.indexOf("_bmad/"),_=N>=0?r.filePath.slice(N+6):r.filePath;fetch(`/api/files/${_}`).then(M=>{if(!M.ok)throw new Error("Not found");return M.json()}).then(M=>{f(M.content)}).catch(()=>f("Failed to load source file.")).finally(()=>m(!1))}}return i?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"h-8 w-48 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-40 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):s||!r?p.jsxs("div",{children:[p.jsxs(nr,{to:"/agents",className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[p.jsx(TO,{size:16})," Back to Agents"]}),p.jsx("p",{className:"text-[var(--color-error)]",children:s?`Failed to load agent: ${s.message}`:"Agent not found"})]}):p.jsxs("div",{className:"max-w-3xl",children:[p.jsxs(nr,{to:"/agents",className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[p.jsx(TO,{size:16})," Back to Agents"]}),p.jsxs("div",{className:"mb-8",children:[p.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[r.icon?p.jsx("span",{className:"text-3xl leading-none",role:"img",children:r.icon}):p.jsx("span",{className:"w-10 h-10 rounded-lg bg-[var(--color-accent)] text-white text-lg font-bold flex items-center justify-center shrink-0",children:r.name.charAt(0).toUpperCase()}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h1",{className:"text-2xl font-extrabold truncate",children:r.title||r.name}),r.title&&p.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["(",r.name,")"]})]})]}),p.jsx("p",{className:"text-[var(--color-muted)] text-sm mb-4",children:r.role}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("button",{onClick:()=>S(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:[p.jsx(Qu,{size:14}),"Edit Agent"]}),p.jsxs("button",{onClick:()=>e(`/agents/${t}/override`),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:[p.jsx(Qu,{size:14}),"Edit Override"]}),p.jsxs("a",{href:`vscode://file${r.filePath}`,className:"inline-flex items-center gap-1.5 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors underline underline-offset-2",children:[p.jsx(qw,{size:14}),"Open in IDE"]})]})]}),(r.identity||r.communicationStyle||r.principles)&&p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-3",children:"Persona"}),p.jsxs("div",{className:"rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] p-5 space-y-4",children:[r.identity&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Identity"}),p.jsx("p",{className:"text-sm text-[var(--color-text)]",children:r.identity})]}),r.communicationStyle&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Communication Style"}),p.jsxs("p",{className:"text-sm italic text-[var(--color-text)]",children:["“",r.communicationStyle,"”"]})]}),r.principles&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-muted)] mb-1",children:"Principles"}),p.jsx("div",{className:"text-sm text-[var(--color-text)] whitespace-pre-line",children:r.principles})]})]})]}),p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-3",children:"Details"}),p.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[p.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx("span",{className:"text-[var(--color-muted)]",children:"Module"}),p.jsx("p",{className:"font-bold",children:r.module??"Unknown"})]}),p.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx("span",{className:"text-[var(--color-muted)]",children:"Discussion Mode"}),p.jsx("p",{className:"font-bold",children:r.discussion?"Enabled":"Disabled"})]})]})]}),p.jsxs("section",{className:"mb-8",children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Skills (",r.skills.length,")"]}),p.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1 text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[p.jsx(hn,{size:14}),"Assign"]})]}),r.skills.length>0?p.jsx("div",{className:"flex flex-wrap gap-2",children:r.skills.map(T=>p.jsx("button",{onClick:()=>e("/skills"),className:"px-3 py-1 text-xs rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:text-[var(--color-accent)] transition-colors cursor-pointer",children:T},T))}):p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No skills assigned"})]}),O&&p.jsxs("div",{className:"fixed inset-0 z-40 flex",children:[p.jsx("div",{className:"flex-1 bg-black/40",onClick:()=>x(!1)}),p.jsx("div",{className:"w-[700px] bg-[var(--color-bg)] border-l border-[var(--color-border-subtle)] shadow-xl",children:p.jsx(_de,{agentName:r.name,currentSkills:r.skills,onSave:async T=>{try{(await fetch(`/api/agents/${t}/skills`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({skills:T})})).ok?(n("success",`Updated skills for ${r.name}`),x(!1)):n("error","Failed to update skills")}catch{n("error","Failed to update skills")}},onClose:()=>x(!1)})})]}),r.menu.length>0&&p.jsxs("section",{className:"mb-8",children:[p.jsxs("h2",{className:"text-lg font-bold mb-3",children:["Commands (",r.menu.length,")"]}),p.jsx("div",{className:"space-y-2",children:r.menu.map(T=>p.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsxs("div",{children:[p.jsx("span",{className:"font-bold text-sm font-[var(--font-mono)]",children:T.trigger}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:T.input})]}),T.route&&p.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:T.route})]},T.trigger))})]}),p.jsxs("section",{className:"mb-8",children:[p.jsxs("h2",{className:"text-lg font-bold mb-3",children:["Teams (",j.length,")"]}),j.length>0?p.jsx("div",{className:"space-y-2",children:j.map(T=>p.jsxs("button",{onClick:()=>e("/teams"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[T.icon?p.jsx("span",{className:"text-sm leading-none",children:T.icon}):p.jsx(di,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:T.name})]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[T.memberCount," members"]})]},T.id))}):p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"This agent is not part of any team"})]}),k&&k.length>0&&r&&p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-3",children:"Workflow Participation"}),(()=>{const T=r.name.toLowerCase(),N=r.id.toLowerCase(),_=k.filter(M=>{const I=M.name.toLowerCase();return I.includes(N)||I.includes(T)});return _.length===0?p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"This agent is not directly referenced in any workflow names. Agents may still be invoked via workflow steps."}):p.jsx("div",{className:"space-y-2",children:_.map(M=>p.jsxs("button",{onClick:()=>e("/workflows"),className:"w-full flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Mi,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm font-bold",children:M.name})]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[M.stepCount," steps"]})]},M.id))})})()]}),p.jsxs("section",{children:[p.jsxs("button",{onClick:Q,className:"flex items-center gap-2 text-lg font-bold mb-3 hover:text-[var(--color-accent)] transition-colors",children:[a?p.jsx(ea,{size:18}):p.jsx(ta,{size:18}),"Source"]}),a&&p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-96",children:h?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(pi,{content:u??"",filePath:r.filePath,onChange:()=>{},readOnly:!0})})]}),v&&r&&p.jsx(Nde,{agent:r,onClose:()=>S(!1),onSaved:()=>{S(!1)}})]})}function Ede(){const{id:t}=CA(),{data:e}=U4(t??""),{notify:n}=hp(),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState(!1),[f,h]=C.useState(!1),[m,O]=C.useState(!1);C.useEffect(()=>{if(e&&!f){const v=`_config/agents/${e.id}.customize.yaml`;fetch(`/api/files/${v}`).then(S=>{if(!S.ok)throw new Error("Not found");return S.json()}).then(S=>{const k=S;i(k.content),a(k.content)}).catch(()=>{const S=`# Override customizations for ${e.name}
496
+ # Add custom instructions, modify behavior, or extend capabilities
497
+
498
+ `;i(S),a("")}).finally(()=>h(!0))}},[e,f]);async function x(){if(e){O(!0);try{const v=`_config/agents/${e.id}.customize.yaml`;(await fetch(`/api/files/${v}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})})).ok?(a(r),u(!1),n("success",`Override saved for ${e.name}`)):n("error","Failed to save override")}catch{n("error","Failed to save override")}finally{O(!1)}}}return e?o?p.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[p.jsxs("h1",{className:"text-2xl font-extrabold mb-4",children:["Override Changes: ",e.name]}),m&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-2",children:"Saving..."}),p.jsx(mX,{original:s,modified:r,onConfirm:x,onCancel:()=>u(!1)})]}):p.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs(nr,{to:`/agents/${t}`,className:"flex items-center gap-1 text-sm text-[var(--color-muted)] hover:text-[var(--color-text)]",children:[p.jsx(TO,{size:16})," Back"]}),p.jsxs("h1",{className:"text-xl font-extrabold",children:["Override: ",e.name]})]}),p.jsx("button",{onClick:()=>u(!0),disabled:r===s,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Review Changes"})]}),p.jsx(pi,{content:r,filePath:`_bmad/_config/agents/${e.id}.customize.yaml`,onChange:i,onSave:()=>u(!0)})]}):p.jsxs("div",{children:[p.jsxs(nr,{to:`/agents/${t}`,className:"flex items-center gap-1 text-sm text-[var(--color-muted)] mb-4 hover:text-[var(--color-text)]",children:[p.jsx(TO,{size:16})," Back to Agent"]}),p.jsx("p",{className:"text-[var(--color-muted)]",children:"Loading agent..."})]})}function Ade(t){const e=t.split(`
499
+ `).filter(s=>s.trim());if(e.length===0)return{headers:[],rows:[]};const n=s=>{const a=[];let o="",u=!1;for(let f=0;f<s.length;f++){const h=s[f];h==='"'?u&&s[f+1]==='"'?(o+='"',f++):u=!u:h===","&&!u?(a.push(o.trim()),o=""):o+=h}return a.push(o.trim()),a},r=n(e[0]),i=e.slice(1).map(n);return{headers:r,rows:i}}function dQ({content:t}){const[e,n]=C.useState(null),[r,i]=C.useState(!0),{headers:s,rows:a}=C.useMemo(()=>Ade(t),[t]),o=C.useMemo(()=>e===null?a:[...a].sort((f,h)=>{const m=f[e]??"",O=h[e]??"";return r?m.localeCompare(O):O.localeCompare(m)}),[a,e,r]),u=f=>{e===f?i(!r):(n(f),i(!0))};return s.length===0?p.jsx("div",{className:"p-4 text-sm text-[var(--color-muted)]",children:"Empty or unparseable CSV content."}):p.jsxs("div",{className:"overflow-auto h-full",children:[p.jsxs("table",{className:"w-full text-sm border-collapse",children:[p.jsx("thead",{className:"sticky top-0 z-10",children:p.jsx("tr",{className:"bg-[var(--color-surface-raised)]",children:s.map((f,h)=>p.jsxs("th",{onClick:()=>u(h),className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider text-[var(--color-muted)] border-b border-[var(--color-border-subtle)] cursor-pointer hover:text-[var(--color-text)] select-none whitespace-nowrap",children:[f,e===h&&p.jsx("span",{className:"ml-1",children:r?"↑":"↓"})]},h))})}),p.jsx("tbody",{children:o.map((f,h)=>p.jsx("tr",{className:h%2===0?"bg-[var(--color-bg)]":"bg-[var(--color-surface-raised)]",children:s.map((m,O)=>p.jsx("td",{className:"px-3 py-2 border-b border-[var(--color-border-subtle)] whitespace-nowrap max-w-xs truncate",title:f[O]??"",children:f[O]??""},O))},h))})]}),p.jsxs("div",{className:"px-3 py-2 text-xs text-[var(--color-muted)] border-t border-[var(--color-border-subtle)]",children:[a.length," rows × ",s.length," columns"]})]})}function Mde({teamId:t,teamName:e,onClose:n,onDeleted:r}){const[i,s]=C.useState(""),[a,o]=C.useState(null),[u,f]=C.useState(!1),h=i===e,m=async()=>{var O;if(h){f(!0),o(null);try{const x=await fetch(`/api/teams/${t}`,{method:"DELETE"});if(!x.ok){const v=await x.json();throw new Error(((O=v.error)==null?void 0:O.message)??"Failed to delete team")}r()}catch(x){o(x instanceof Error?x.message:"Failed to delete team")}finally{f(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx(vh,{size:20,className:"text-[var(--color-error)]"}),p.jsx("h2",{className:"text-lg font-bold",children:"Delete Team"})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"text-sm",children:["This will permanently delete the ",p.jsx("strong",{children:e})," team YAML file. The party CSV will be preserved."]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm mb-1",children:["Type ",p.jsx("strong",{children:e})," to confirm:"]}),p.jsx("input",{type:"text",value:i,onChange:O=>s(O.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-error)] focus:outline-none"})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:m,disabled:!h||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-error)] text-white hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ef,{size:14}),u?"Deleting...":"Delete Team"]})]})]})]})}function Rde({teamId:t,onClose:e,onTeamUpdated:n}){const r=pa(),i=qo(),{notify:s}=hp(),{data:a,isLoading:o}=yce(t),{data:u}=vce(t),[f,h]=C.useState(!1),[m,O]=C.useState(!1),[x,v]=C.useState(!1),[S,k]=C.useState(""),[w,j]=C.useState(""),[Q,T]=C.useState(""),[N,_]=C.useState(new Set),[M,I]=C.useState(""),[U,F]=C.useState([]),[Z,X]=C.useState(!1),[H,E]=C.useState(!1),[q,R]=C.useState("");C.useEffect(()=>{x&&a&&(k(a.name),j(a.icon),T(a.description),_(new Set(a.agentIds)),fetch("/api/agents").then(P=>P.json()).then(P=>F(P)).catch(()=>{}))},[x,a]);const z=C.useMemo(()=>{if(!a)return[];const P=new Set(a.members.map(ee=>ee.agentId));return a.agentIds.filter(ee=>!P.has(ee))},[a]),B=U.filter(P=>{if(!M)return!0;const ee=M.toLowerCase();return P.name.toLowerCase().includes(ee)||P.title.toLowerCase().includes(ee)||P.role&&P.role.toLowerCase().includes(ee)}),W=P=>{_(ee=>{const ae=new Set(ee);return ae.has(P)?ae.delete(P):ae.add(P),ae})},A=async()=>{var P;if(a){X(!0);try{const ee=await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S.trim(),icon:w.trim(),description:Q.trim(),agentIds:Array.from(N)})});if(!ee.ok){const ae=await ee.json();throw new Error(((P=ae.error)==null?void 0:P.message)??"Failed to update team")}s("success",`Team "${S}" updated`),v(!1),await i.invalidateQueries({queryKey:["teams"]}),n==null||n()}catch(ee){s("error",ee instanceof Error?ee.message:"Failed to update team")}finally{X(!1)}}},D=async()=>{var P;if(a)try{const ee=await fetch(`/api/teams/${t}/party`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:q})});if(!ee.ok){const ae=await ee.json();throw new Error(((P=ae.error)==null?void 0:P.message)??"Failed to save party CSV")}s("success","Party CSV updated"),E(!1),await i.invalidateQueries({queryKey:["teams"]})}catch(ee){s("error",ee instanceof Error?ee.message:"Failed to save party CSV")}},Y=async()=>{O(!1),await i.invalidateQueries({queryKey:["teams"]}),n==null||n(),e()};return p.jsxs("div",{className:"slide-over-backdrop",onClick:P=>{P.target===P.currentTarget&&e()},children:[p.jsx("div",{className:"slide-over-bg",onClick:e}),p.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[(a==null?void 0:a.icon)&&p.jsx("span",{className:"text-xl leading-none",children:a.icon}),p.jsx("h2",{className:"text-lg font-bold truncate",children:(a==null?void 0:a.name)??"Loading..."})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[a&&!x&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>v(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Team",children:p.jsx(Qu,{size:16})}),p.jsx("button",{onClick:()=>O(!0),className:"text-[var(--color-muted)] hover:text-[var(--color-error)] transition-colors",title:"Delete Team",children:p.jsx(ef,{size:16})})]}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]})]}),o&&p.jsxs("div",{className:"p-6 space-y-3",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),a&&!x&&p.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:a.description}),a.module&&p.jsx("span",{className:"inline-block mt-2 text-xs px-2 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:a.module})]}),p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Members (",a.members.length,")"]}),p.jsx("div",{className:"space-y-2",children:a.members.map(P=>p.jsxs("button",{onClick:()=>r(`/agents/${P.agentId}`),className:"w-full flex items-start gap-3 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors cursor-pointer text-left",children:[p.jsx("span",{className:"text-lg leading-none mt-0.5",children:P.icon}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-sm font-bold",children:P.displayName}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:P.title})]}),P.communicationStyle&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1 line-clamp-2",children:P.communicationStyle})]})]},P.agentId))})]}),z.length>0&&p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-2 flex items-center gap-1.5",children:[p.jsx(vh,{size:14,className:"text-[var(--color-warning)]"}),"Unresolved Agents (",z.length,")"]}),p.jsx("div",{className:"space-y-1",children:z.map(P=>p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-warning)]/30",children:[p.jsx(vh,{size:12,className:"text-[var(--color-warning)]"}),p.jsx("span",{className:"text-sm font-[var(--font-mono)]",children:P}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"— not found in party CSV"})]},P))})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Party Mode"}),p.jsxs("div",{className:"p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(jo,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:a.partyFile||"No party CSV"})]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[a.members.length," personas"]})]}),a.partyFile&&p.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[p.jsxs("button",{onClick:()=>h(!f),className:"flex items-center gap-1.5 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[f?p.jsx(ea,{size:12}):p.jsx(ta,{size:12}),f?"Hide":"View"," Party Personas"]}),f&&(u==null?void 0:u.content)&&!H&&p.jsxs("button",{onClick:()=>{R(u.content),E(!0)},className:"flex items-center gap-1.5 text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:[p.jsx(Qu,{size:10}),"Edit Party Personas"]})]})]}),f&&(u==null?void 0:u.content)&&!H&&p.jsx("div",{className:"mt-2 rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-64",children:p.jsx(dQ,{content:u.content})}),f&&H&&p.jsxs("div",{className:"mt-2 space-y-2",children:[p.jsx("textarea",{value:q,onChange:P=>R(P.target.value),className:"w-full h-64 px-3 py-2 text-xs font-[var(--font-mono)] rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:D,className:"px-3 py-1.5 text-xs font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(yh,{size:12}),"Save Party CSV"]}),p.jsx("button",{onClick:()=>E(!1),className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{disabled:!0,className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] text-[var(--color-muted)] opacity-50 cursor-not-allowed",title:"Coming soon",children:"Generate from Agents"}),p.jsx("button",{disabled:!0,className:"px-3 py-1.5 text-xs rounded-md border border-[var(--color-border-subtle)] text-[var(--color-muted)] opacity-50 cursor-not-allowed",title:"Coming soon",children:"Sync"})]})]})]})]}),a&&x&&p.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:S,onChange:P=>k(P.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),p.jsx("input",{type:"text",value:w,onChange:P=>j(P.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:Q,onChange:P=>T(P.target.value),rows:3,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Agents (",N.size," selected)"]}),p.jsxs("div",{className:"relative mb-2",children:[p.jsx(Vo,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",value:M,onChange:P=>I(P.target.value),placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:B.length===0?p.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No agents found"}):B.map(P=>p.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:N.has(P.id),onChange:()=>W(P.id),className:"accent-[var(--color-accent)]"}),p.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[P.icon&&p.jsx("span",{className:"text-sm leading-none",children:P.icon}),p.jsx("span",{className:"truncate font-bold",children:P.title||P.name})]})]},P.id))})]}),p.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[p.jsxs("button",{onClick:A,disabled:Z||!S.trim(),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(yh,{size:14}),Z?"Saving...":"Save Changes"]}),p.jsx("button",{onClick:()=>v(!1),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"})]})]})]}),m&&a&&p.jsx(Mde,{teamId:t,teamName:a.name,onClose:()=>O(!1),onDeleted:Y})]})}function eA({onClose:t,onCreated:e}){const n=qo(),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState(""),[f,h]=C.useState(""),[m,O]=C.useState(new Set),[x,v]=C.useState(""),[S,k]=C.useState(null),[w,j]=C.useState(!1),[Q,T]=C.useState([]),[N,_]=C.useState([]);C.useEffect(()=>{fetch("/api/modules").then(Z=>Z.json()).then(Z=>{const X=Z;T(X.map(H=>({name:H.name}))),X.length===1&&h(X[0].name)}).catch(()=>{}),fetch("/api/agents").then(Z=>Z.json()).then(Z=>_(Z)).catch(()=>{})},[]);const M=N.filter(Z=>{if(!x)return!0;const X=x.toLowerCase();return Z.name.toLowerCase().includes(X)||Z.title.toLowerCase().includes(X)||Z.role&&Z.role.toLowerCase().includes(X)}),I=r.trim().length>0&&f.length>0,U=async()=>{var Z;if(I){j(!0),k(null);try{const X=await fetch("/api/teams",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),icon:s.trim(),description:o.trim(),agentIds:Array.from(m),module:f})});if(!X.ok){const H=await X.json();throw new Error(((Z=H.error)==null?void 0:Z.message)??"Failed to create team")}await n.invalidateQueries({queryKey:["teams"]}),e()}catch(X){k(X instanceof Error?X.message:"Failed to create team")}finally{j(!1)}}},F=Z=>{O(X=>{const H=new Set(X);return H.has(Z)?H.delete(Z):H.add(Z),H})};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"Create Team"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:r,onChange:Z=>i(Z.target.value),placeholder:"e.g. Frontend Squad",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Icon"}),p.jsx("input",{type:"text",value:s,onChange:Z=>a(Z.target.value),placeholder:"e.g. a single emoji",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:o,onChange:Z=>u(Z.target.value),placeholder:"What does this team do?",rows:3,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module"}),p.jsxs("select",{value:f,onChange:Z=>h(Z.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Select a module..."}),Q.map(Z=>p.jsx("option",{value:Z.name,children:Z.name},Z.name))]})]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:["Agents (",m.size," selected)"]}),p.jsxs("div",{className:"relative mb-2",children:[p.jsx(Vo,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",value:x,onChange:Z=>v(Z.target.value),placeholder:"Search agents...",className:"w-full pl-9 pr-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsx("div",{className:"max-h-48 overflow-y-auto border border-[var(--color-border-subtle)] rounded-md",children:M.length===0?p.jsx("p",{className:"text-xs text-[var(--color-muted)] p-3 text-center",children:"No agents found"}):M.map(Z=>p.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-[var(--color-surface-raised)] cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:m.has(Z.id),onChange:()=>F(Z.id),className:"accent-[var(--color-accent)]"}),p.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[Z.icon&&p.jsx("span",{className:"text-sm leading-none",children:Z.icon}),p.jsx("span",{className:"truncate font-bold",children:Z.title||Z.name}),Z.title&&p.jsxs("span",{className:"text-xs text-[var(--color-muted)] truncate",children:["(",Z.name,")"]})]})]},Z.id))})]}),S&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:S})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:U,disabled:!I||w,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),w?"Creating...":"Create Team"]})]})]})]})}function zde({team:t,isSelected:e,onClick:n}){return p.jsxs("button",{onClick:n,className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${e?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.icon&&p.jsx("span",{className:"text-lg leading-none",children:t.icon}),p.jsx("span",{className:"font-bold text-sm truncate",children:t.name}),t.module&&p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:t.module})]}),t.description&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] line-clamp-2 mb-2",children:t.description}),p.jsx("div",{className:"flex items-center justify-between",children:p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[p.jsx(di,{size:10,className:"inline mr-1"}),t.memberCount," members"]})})]})}function Dde(){const{data:t,isLoading:e,refetch:n}=W4(),[r,i]=cf("detail"),[s,a]=C.useState("all"),[o,u]=C.useState(""),[f,h]=C.useState(!1),m=C.useMemo(()=>{if(!t)return[];const v=new Set;for(const S of t)S.module&&v.add(S.module);return Array.from(v).sort()},[t]),O=C.useMemo(()=>{if(!t)return[];let v=t;if(s!=="all"&&(v=v.filter(S=>S.module===s)),o){const S=o.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(S)||k.description.toLowerCase().includes(S))}return v},[t,s,o]),x=C.useMemo(()=>{if(!t)return{};const v={};for(const S of t)S.module&&(v[S.module]=(v[S.module]??0)+1);return v},[t]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Teams"}),p.jsx(fy,{count:3})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Teams"}),p.jsx(Li,{icon:di,title:"No teams found",description:"Teams group agents for collaborative workflows and Party Mode. Create a team to get started.",actions:p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"Create Team"]})}),f&&p.jsx(eA,{onClose:()=>h(!1),onCreated:()=>{h(!1),n()}})]}):p.jsxs("div",{children:[p.jsx(uy,{title:"Teams",count:t.length,modules:m,moduleCounts:x,activeModule:s,onModuleChange:a,search:o,onSearchChange:u,actions:p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"Create Team"]})}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:O.map(v=>p.jsx(zde,{team:v,isSelected:r===v.id,onClick:()=>i(r===v.id?null:v.id)},v.id))}),O.length===0&&t.length>0&&p.jsx("p",{className:"text-sm text-[var(--color-muted)] text-center py-8",children:"No teams match your search."}),r&&p.jsx(Rde,{teamId:r,onClose:()=>i(null),onTeamUpdated:()=>n()}),f&&p.jsx(eA,{onClose:()=>h(!1),onCreated:()=>{h(!1),n()}})]})}function yy({open:t,onClose:e,title:n,actions:r,children:i,width:s}){const a=C.useRef(null);return C.useEffect(()=>{if(!t)return;function o(u){u.key==="Escape"&&e()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t,e]),C.useEffect(()=>{t&&a.current&&a.current.focus()},[t]),t?p.jsxs("div",{className:"slide-over-backdrop",children:[p.jsx("div",{className:"slide-over-bg",onClick:e}),p.jsxs("aside",{ref:a,tabIndex:-1,className:"slide-over-panel outline-none",style:{width:s??"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between shrink-0",children:[p.jsx("h2",{className:"text-lg font-bold truncate",children:n}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r,p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)] transition-colors",children:p.jsx(Yn,{size:18})})]})]}),p.jsx("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 65px)"},children:i})]})]}):null}function Lde({path:t,className:e,showIcon:n}){return p.jsxs("span",{className:`inline-flex items-center gap-2 text-xs ${e??""}`,children:[n&&p.jsx(qw,{size:12,className:"text-[var(--color-muted)] shrink-0"}),p.jsx(nr,{to:`/files?path=${encodeURIComponent(t)}`,className:"font-[var(--font-mono)] text-[var(--color-accent)] hover:underline break-all",children:t})]})}function Xde(t){const e=[],n=/(?:in|from|see|follow)\s+(?:the\s+(?:instructions\s+in\s+)?)?[`"']?(\.\/[\w./-]+)[`"']?/gi;let r;for(;(r=n.exec(t))!==null;)e.push(r[1]);const i=/\.\/([\w-]+\.(?:md|yaml|yml|txt))/g;for(;(r=i.exec(t))!==null;){const a=`./${r[1]}`;e.includes(a)||e.push(a)}const s=e.map(a=>a.replace(/\.+$/,""));return[...new Set(s)]}function Zde({reference:t,skillFilePath:e}){const[n,r]=C.useState(!1),[i,s]=C.useState(null),[a,o]=C.useState(!1),u=C.useCallback(async()=>{if(n){r(!1);return}if(r(!0),i===null){o(!0);try{const f=e.substring(0,e.lastIndexOf("/")),h=f.indexOf("_bmad/"),m=h>=0?f.slice(h+6):f,O=t.replace("./",""),x=m?`${m}/${O}`:O,v=await fetch(`/api/files/${x}`);if(v.ok){const S=await v.json();s(S.content)}else s("Could not load file.")}catch{s("Failed to load file.")}finally{o(!1)}}},[n,i,e,t]);return p.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[p.jsxs("button",{onClick:u,className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-[var(--color-surface-raised)] transition-colors",children:[n?p.jsx(ea,{size:14,className:"text-[var(--color-muted)]"}):p.jsx(ta,{size:14,className:"text-[var(--color-muted)]"}),p.jsx(jo,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-xs font-[var(--font-mono)]",children:t})]}),n&&p.jsx("div",{className:"border-t border-[var(--color-border-subtle)] h-48",children:a?p.jsx("div",{className:"h-full bg-[var(--color-surface-raised)] animate-pulse"}):p.jsx(pi,{content:i??"",filePath:t,onChange:()=>{},readOnly:!0})})]})}function Bde({skillId:t,onClose:e}){const{data:n,isLoading:r}=Cde(t),i=(n==null?void 0:n.content)??"",s=C.useMemo(()=>i?Xde(i):[],[i]);return p.jsxs(yy,{open:!0,title:(n==null?void 0:n.name)??"Loading...",onClose:e,children:[r&&p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"h-4 w-3/4 rounded bg-[var(--color-surface-raised)] animate-pulse"}),p.jsx("div",{className:"h-32 rounded bg-[var(--color-surface-raised)] animate-pulse"})]}),n&&p.jsxs(p.Fragment,{children:[p.jsx("div",{children:p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:n.description})}),n.bestFor&&n.bestFor.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Best for"}),p.jsx("div",{className:"flex flex-wrap gap-1",children:n.bestFor.map(a=>p.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:a},a))})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Content"}),p.jsx("div",{className:"h-64 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(pi,{content:n.content,filePath:n.filePath,onChange:()=>{},readOnly:!0})})]}),s.length>0&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Referenced Files"}),p.jsx("div",{className:"space-y-2",children:s.map(a=>p.jsx(Zde,{reference:a,skillFilePath:n.filePath},a))})]}),p.jsx(Lde,{path:n.filePath,showIcon:!0})]})]})}function qde(t,e,n,r){const i=["---",`name: ${t}`];if(e&&i.push(`description: "${e}"`),n.length>0){i.push("best_for:");for(const s of n)i.push(` - ${s.trim()}`)}return i.push("---","",r||`# Skill Instructions
500
+
501
+ <!-- Add skill instructions here -->`),i.join(`
502
+ `)}const tA=/^[a-z][a-z0-9-]*$/;function Vde({onClose:t,onCreated:e}){const n=qo(),[r,i]=C.useState("create"),[s,a]=C.useState(""),[o,u]=C.useState(""),[f,h]=C.useState(""),[m,O]=C.useState(""),[x,v]=C.useState(""),[S,k]=C.useState(!1),[w,j]=C.useState(""),[Q,T]=C.useState([]),[N,_]=C.useState(null),[M,I]=C.useState(!1);C.useEffect(()=>{fetch("/api/modules").then(E=>E.json()).then(E=>{const q=E;T(q.map(R=>({name:R.name}))),q.length===1&&O(q[0].name)}).catch(()=>{})},[]);const U=s.length===0||tA.test(s),F=f.split(",").map(E=>E.trim()).filter(Boolean),Z=s.trim().length>0&&tA.test(s)&&m.length>0,X=C.useCallback(E=>{var z;const q=(z=E.target.files)==null?void 0:z[0];if(!q)return;const R=new FileReader;R.onload=()=>{const B=R.result,W=B.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(W){const A=W[1],D=W[2],Y=A.match(/^name:\s*(.+)$/m),P=A.match(/^description:\s*"?(.+?)"?$/m),ee=A.match(/^best_for:\s*\n((?:\s+-\s+.+\n?)*)/m);if(Y&&a(Y[1].trim()),P&&u(P[1].trim()),ee){const ae=ee[1].split(`
503
+ `).map(ne=>ne.replace(/^\s+-\s+/,"").trim()).filter(Boolean);h(ae.join(", "))}v(D.trim())}else v(B);i("create")},R.readAsText(q)},[]),H=async()=>{var E;if(Z){I(!0),_(null);try{const q=qde(s.trim(),o.trim(),F,x),R=await fetch(`/api/modules/${encodeURIComponent(m)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"skill",name:s.trim(),content:q})});if(!R.ok){const z=await R.json();throw new Error(((E=z.error)==null?void 0:E.message)??"Failed to create skill")}await n.invalidateQueries({queryKey:["skills"]}),e()}catch(q){_(q instanceof Error?q.message:"Failed to create skill")}finally{I(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-2xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"New Skill"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"flex gap-1 mb-4 bg-[var(--color-surface-raised)] rounded-md p-0.5 self-start",children:[p.jsx("button",{onClick:()=>i("create"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${r==="create"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Create"}),p.jsx("button",{onClick:()=>i("import"),className:`px-3 py-1.5 text-sm rounded min-h-[32px] transition-colors ${r==="import"?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"Import"})]}),p.jsxs("div",{className:"space-y-4 overflow-y-auto flex-1 pr-1",children:[r==="import"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Upload .md file"}),p.jsxs("label",{className:"flex items-center justify-center gap-2 w-full px-4 py-6 border-2 border-dashed border-[var(--color-border-subtle)] rounded-lg cursor-pointer hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(NO,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm text-[var(--color-muted)]",children:"Click to upload or drag a .md file"}),p.jsx("input",{type:"file",accept:".md",onChange:X,className:"hidden"})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Or paste URL"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"text",value:w,onChange:E=>j(E.target.value),placeholder:"https://raw.githubusercontent.com/...",className:"flex-1 px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),p.jsx("button",{onClick:async()=>{if(w)try{const E=await fetch(w);if(E.ok){const q=await E.text(),R={target:{files:[new File([q],"import.md")]}};X(R)}}catch{_("Failed to fetch URL")}},disabled:!w,className:"px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:"Fetch"})]})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Uploading or fetching will parse the file and switch to the Create tab with fields pre-populated."})]}),r==="create"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:s,onChange:E=>a(E.target.value),onBlur:()=>k(!0),placeholder:"e.g. advanced-elicitation",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),S&&!U&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Name must be kebab-case (e.g., my-skill-name)"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:o,onChange:E=>u(E.target.value),placeholder:"What does this skill enable?",rows:2,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Best for (optional)"}),p.jsx("input",{type:"text",value:f,onChange:E=>h(E.target.value),placeholder:"e.g. pm, analyst, architect (comma-separated)",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Module"}),p.jsxs("select",{value:m,onChange:E=>O(E.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",children:[p.jsx("option",{value:"",children:"Select a module..."}),Q.map(E=>p.jsx("option",{value:E.name,children:E.name},E.name))]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Skill Content"}),p.jsx("div",{className:"h-48 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(pi,{content:x,filePath:"new-skill.md",onChange:v,defaultMode:"edit"})})]})]}),N&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:N})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:H,disabled:!Z||M,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),M?"Creating...":"Create Skill"]})]})]})]})}function Ide(){const{data:t,isLoading:e,refetch:n}=pX(),[r,i]=C.useState(""),[s,a]=cf("detail"),[o,u]=C.useState("all"),[f,h]=C.useState(!1),m=C.useMemo(()=>{if(!t)return[];const v=new Set;for(const S of t)S.module&&v.add(S.module);return Array.from(v).sort()},[t]),O=C.useMemo(()=>{if(!t)return[];let v=t;if(o!=="all"&&(v=v.filter(S=>S.module===o)),r){const S=r.toLowerCase();v=v.filter(k=>k.name.toLowerCase().includes(S)||k.description.toLowerCase().includes(S))}return v},[t,r,o]),x=C.useMemo(()=>{if(!t)return{};const v={};for(const S of t)S.module&&(v[S.module]=(v[S.module]??0)+1);return v},[t]);return e?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Skills"}),p.jsx(gce,{count:4})]}):!t||t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Skills"}),p.jsx(Li,{icon:na,title:"No skills found",description:"Install a module or import skills to get started."})]}):p.jsxs("div",{children:[p.jsxs("div",{children:[p.jsx(uy,{title:"Skills",count:t.length,modules:m,moduleCounts:x,activeModule:o,onModuleChange:u,search:r,onSearchChange:i,actions:p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"New Skill"]})}),p.jsx("div",{className:"space-y-3",children:O.map(v=>p.jsxs("button",{onClick:()=>a(v.id),className:`w-full text-left p-4 rounded-lg flex items-center justify-between transition-colors ${s===v.id?"bg-[var(--color-surface-raised)] border border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(na,{size:16,className:"text-[var(--color-accent)] shrink-0"}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:v.name}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] truncate max-w-md",children:v.description})]})]}),v.module&&p.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:v.module})]},v.id))})]}),s&&p.jsx(Bde,{skillId:s,onClose:()=>a(null)}),f&&p.jsx(Vde,{onClose:()=>h(!1),onCreated:()=>{h(!1),n()}})]})}function Yde(t){const e={};for(const n of t){if(n.name.startsWith("."))continue;const r=n.path.split("/"),i=r.length>1?r.slice(0,-1).join("/"):"root";e[i]||(e[i]=[]),e[i].push(n)}return e}function Ude({folder:t,files:e,selectedPath:n,onSelect:r}){const[i,s]=C.useState(!0),a=t==="root"?"Root":t.split("/").pop()??t;return p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>s(!i),className:"flex items-center gap-2 px-3 py-2 w-full text-left hover:bg-[var(--color-surface-raised)] rounded-md transition-colors",children:[i?p.jsx(ea,{size:14,className:"text-[var(--color-muted)]"}):p.jsx(ta,{size:14,className:"text-[var(--color-muted)]"}),p.jsx(FA,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:a}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",e.length,")"]})]}),i&&p.jsx("div",{className:"ml-4 space-y-0.5",children:e.map(o=>p.jsxs("button",{onClick:()=>r(o.path),className:`w-full flex items-center justify-between px-3 py-2 rounded-md transition-colors cursor-pointer text-left ${n===o.path?"bg-[var(--color-surface-raised)] text-[var(--color-accent)]":"hover:bg-[var(--color-surface-raised)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Mx,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"text-sm",children:o.name})]}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:new Date(o.modifiedAt).toLocaleDateString()})]},o.path))})]})}function Wde(){const[t,e]=C.useState([]),[n,r]=C.useState(!0),[i,s]=cf("path"),[a,o]=C.useState(""),[u,f]=C.useState(!1);C.useEffect(()=>{fetch("/api/outputs").then(x=>x.json()).then(x=>{e(x),r(!1)}).catch(()=>r(!1))},[]);const h=C.useMemo(()=>Yde(t),[t]),m=C.useMemo(()=>Object.values(h).reduce((x,v)=>x+v.length,0),[h]),O=C.useCallback(async x=>{if(i===x){s(null);return}s(x),f(!0);try{const v=await fetch(`/api/outputs/${x}`);if(v.ok){const S=await v.json();o(S.content)}}catch{o("Failed to load file content.")}finally{f(!1)}},[i]);return n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Outputs"}),p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):m===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Outputs"}),p.jsx(Li,{icon:Mx,title:"No outputs yet",description:"Run workflows to generate output files."})]}):p.jsxs("div",{children:[p.jsxs("h1",{className:"text-2xl font-extrabold mb-8",children:["Outputs (",m,")"]}),p.jsx("div",{className:"space-y-2",children:Object.entries(h).sort(([x],[v])=>x.localeCompare(v)).map(([x,v])=>p.jsx(Ude,{folder:x,files:v,selectedPath:i,onSelect:O},x))}),p.jsx(yy,{open:!!i,title:i??"",onClose:()=>s(null),children:u?p.jsx("div",{className:"h-64 rounded bg-[var(--color-surface-raised)] animate-pulse"}):i!=null&&i.endsWith(".csv")?p.jsx(dQ,{content:a}):p.jsx("div",{className:"h-96 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(pi,{content:a,filePath:i??"",onChange:()=>{},readOnly:!0})})})]})}const gX={jira:jo,confluence:P9,figma:y9,github:KA,custom:HA},QO={jira:"Jira",confluence:"Confluence",figma:"Figma",github:"GitHub",custom:"Custom"},Hde={jira:{cliTool:"jira-cli",parameters:{project:"",board:""},outputPath:"_bmad-output/data/jira/"},confluence:{cliTool:"confluence-cli",parameters:{space:"",label:""},outputPath:"_bmad-output/data/confluence/"},figma:{cliTool:"figma-export",parameters:{fileKey:"",nodeId:""},outputPath:"_bmad-output/data/figma/"},github:{cliTool:"gh",parameters:{repo:"",query:""},outputPath:"_bmad-output/data/github/"},custom:{cliTool:"",parameters:{},outputPath:"_bmad-output/data/"}},nA={configured:"var(--color-accent)",synced:"var(--color-success)",error:"var(--color-error)","not-configured":"var(--color-muted)"};function Gde({onClose:t,onCreated:e}){const[n,r]=C.useState("type"),[i,s]=C.useState(null),[a,o]=C.useState(""),[u,f]=C.useState(""),[h,m]=C.useState({}),[O,x]=C.useState(""),[v,S]=C.useState(null),[k,w]=C.useState(!1);function j(N){s(N);const _=Hde[N];f(_.cliTool),m({..._.parameters}),x(_.outputPath),r("form")}const Q=a.trim().length>0&&u.trim().length>0,T=async()=>{var N;if(!(!Q||!i)){w(!0),S(null);try{const _=await fetch("/api/datasources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a.trim(),type:i,cliTool:u.trim(),parameters:h,outputPath:O.trim()})});if(!_.ok){const M=await _.json();throw new Error(((N=M.error)==null?void 0:N.message)??"Failed to create data source")}e()}catch(_){S(_ instanceof Error?_.message:"Failed to create data source")}finally{w(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:n==="type"?"Add Data Source":`New ${QO[i]} Source`}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),n==="type"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-4",children:"Choose a data source type:"}),Object.keys(QO).map(N=>{const _=gX[N];return p.jsxs("button",{onClick:()=>j(N),className:"w-full flex items-center gap-3 p-3 rounded-lg border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:p.jsx(_,{size:16,className:"text-[var(--color-accent)]"})}),p.jsxs("div",{children:[p.jsx("span",{className:"font-bold text-sm",children:QO[N]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[N==="jira"&&"Import issues and boards from Jira",N==="confluence"&&"Import pages and spaces from Confluence",N==="figma"&&"Export designs from Figma",N==="github"&&"Pull data from GitHub repositories",N==="custom"&&"Configure a custom CLI tool"]})]})]},N)})]}),n==="form"&&i&&p.jsxs("div",{className:"space-y-4",children:[p.jsx("button",{onClick:()=>r("type"),className:"text-xs text-[var(--color-accent)] hover:underline",children:"← Change type"}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:a,onChange:N=>o(N.target.value),placeholder:"e.g. My Project Board",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"CLI Tool"}),p.jsx("input",{type:"text",value:u,onChange:N=>f(N.target.value),placeholder:"e.g. jira-cli",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),Object.entries(h).map(([N,_])=>p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1 capitalize",children:N}),p.jsx("input",{type:"text",value:_,onChange:M=>m({...h,[N]:M.target.value}),placeholder:`Enter ${N}...`,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]},N)),i==="custom"&&p.jsx("div",{children:p.jsx("button",{onClick:()=>{const N=prompt("Parameter name:");N&&N.trim()&&m({...h,[N.trim()]:""})},className:"text-xs text-[var(--color-accent)] hover:underline",children:"+ Add parameter"})}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Output Path"}),p.jsx("input",{type:"text",value:O,onChange:N=>x(N.target.value),placeholder:"_bmad-output/data/",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none font-[var(--font-mono)] text-xs"})]}),v&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:v}),p.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:T,disabled:!Q||k,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),k?"Creating...":"Create"]})]})]})]})]})}function Fde({command:t,sourceName:e,onClose:n}){const[r,i]=C.useState(!1);function s(){navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})}return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Sync: ",e]}),p.jsx("button",{onClick:n,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsx("p",{className:"text-sm text-[var(--color-muted)] mb-3",children:"Run this command in your terminal to sync data:"}),p.jsxs("div",{className:"relative",children:[p.jsx("pre",{className:"p-4 text-sm font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap border border-[var(--color-border-subtle)]",children:t}),p.jsx("button",{onClick:s,className:"absolute top-2 right-2 p-1.5 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",title:"Copy to clipboard",children:r?p.jsx(Bw,{size:14,className:"text-[var(--color-success)]"}):p.jsx(p9,{size:14,className:"text-[var(--color-muted)]"})})]}),p.jsx("div",{className:"flex justify-end mt-4",children:p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Close"})})]})]})}function Kde(){var X,H;const[t,e]=C.useState(null),[n,r]=C.useState(!0),[i,s]=C.useState(null),[a,o]=C.useState(null),[u,f]=C.useState(!1),[h,m]=C.useState([]),[O,x]=C.useState(!0),[v,S]=C.useState(!1),[k,w]=C.useState(null),[j,Q]=C.useState(null),[T,N]=C.useState(null),_=C.useCallback(async()=>{try{const q=await(await fetch("/api/datasources")).json();m(q)}catch{}finally{x(!1)}},[]);C.useEffect(()=>{fetch("/api/overview").then(E=>E.json()).then(E=>{e(E),r(!1)}).catch(()=>r(!1))},[]),C.useEffect(()=>{_()},[_]);async function M(E){if(i===E){s(null),o(null);return}s(E),f(!0);try{const q=await fetch(`/api/files/_config/ides/${E}.yaml`);if(q.ok){const R=await q.json();o(R.content)}else o(null)}catch{o(null)}finally{f(!1)}}async function I(E){Q(E.id);try{const q=await fetch(`/api/datasources/${encodeURIComponent(E.id)}/sync`,{method:"POST"});if(q.ok){const R=await q.json();w({command:R.command,name:E.name})}}catch{}finally{Q(null)}}async function U(E){if(confirm(`Delete data source "${E.name}"?`)){N(E.id);try{(await fetch(`/api/datasources/${encodeURIComponent(E.id)}`,{method:"DELETE"})).ok&&await _()}catch{}finally{N(null)}}}if(n&&O)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Connections"}),p.jsx(fy,{count:3})]});const F=((H=(X=t==null?void 0:t.sections)==null?void 0:X.ideConfigs)==null?void 0:H.ides)??[],Z=F.length+h.length;return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsxs("h1",{className:"text-2xl font-extrabold",children:["Connections (",Z,")"]}),p.jsxs("button",{onClick:()=>S(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"Add Data Source"]})]}),h.length>0&&p.jsxs("div",{className:"mb-8",children:[p.jsxs("h2",{className:"text-sm font-bold text-[var(--color-muted)] uppercase tracking-wider mb-4",children:["Data Sources (",h.length,")"]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map(E=>{const q=gX[E.type]??HA,R=nA[E.status]??nA["not-configured"];return p.jsxs("div",{className:"p-4 rounded-lg border bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-all",children:[p.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[p.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:p.jsx(q,{size:16,className:"text-[var(--color-accent)]"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("span",{className:"font-bold text-sm block truncate",children:E.name}),p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:QO[E.type]})]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[p.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:R}}),p.jsx("span",{className:"text-xs capitalize",style:{color:R},children:E.status}),E.lastSync&&p.jsxs("span",{className:"text-xs text-[var(--color-muted)] ml-auto",children:["Last sync: ",new Date(E.lastSync).toLocaleDateString()]})]}),p.jsxs("div",{className:"text-xs text-[var(--color-muted)] mb-3 space-y-1",children:[p.jsxs("p",{className:"font-[var(--font-mono)] truncate",title:E.cliTool,children:["Tool: ",E.cliTool||"(not set)"]}),p.jsxs("p",{className:"font-[var(--font-mono)] truncate",title:E.outputPath,children:["Output: ",E.outputPath]})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("button",{onClick:()=>I(E),disabled:j===E.id,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs rounded-md border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:[j===E.id?p.jsx(_O,{size:12,className:"animate-spin"}):p.jsx(rq,{size:12}),"Sync"]}),p.jsx("button",{onClick:()=>U(E),disabled:T===E.id,className:"flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs rounded-md border border-[var(--color-error)] text-[var(--color-error)] hover:bg-[var(--color-error)] hover:text-white transition-colors disabled:opacity-50",children:p.jsx(ef,{size:12})})]})]},E.id)})})]}),F.length>0&&p.jsxs("div",{className:"mb-8",children:[p.jsxs("h2",{className:"text-sm font-bold text-[var(--color-muted)] uppercase tracking-wider mb-4",children:["IDE Connections (",F.length,")"]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:F.map(E=>p.jsxs("button",{onClick:()=>M(E),className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${i===E?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[p.jsx("div",{className:"w-8 h-8 rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] flex items-center justify-center",children:p.jsx(F9,{size:16,className:"text-[var(--color-accent)]"})}),p.jsx("span",{className:"font-bold text-sm",children:E})]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"w-2 h-2 rounded-full bg-[var(--color-success)]"}),p.jsx("span",{className:"text-xs text-[var(--color-success)]",children:"Configured"})]})]},E))})]}),Z===0&&p.jsx(Li,{icon:Vw,title:"No connections configured",description:"Add data sources to sync external data, or configure IDE integrations in your BMAD project.",actions:p.jsxs("button",{onClick:()=>S(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"Add Data Source"]})}),i&&p.jsxs(yy,{open:!0,title:i,onClose:()=>{s(null),o(null)},children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Status"}),p.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx(Bw,{size:16,className:"text-[var(--color-success)]"}),p.jsx("span",{className:"text-sm",children:"Connected and active"})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Integration"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[var(--color-surface-raised)] text-sm",children:[p.jsx(Ud,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{children:"Agent commands"})]}),p.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[var(--color-surface-raised)] text-sm",children:[p.jsx(Ud,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{children:"Skill shortcuts"})]}),p.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[var(--color-surface-raised)] text-sm",children:[p.jsx(Ud,{size:14,className:"text-[var(--color-muted)]"}),p.jsx("span",{children:"Workflow triggers"})]})]})]}),u&&p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"}),a&&!u&&p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"Configuration"}),p.jsx("pre",{className:"p-3 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap max-h-64 overflow-y-auto",children:a})]}),p.jsx("div",{className:"text-xs text-[var(--color-muted)]",children:p.jsxs("p",{children:["Config file: ",p.jsxs("code",{className:"font-[var(--font-mono)]",children:["_bmad/_config/ides/",i,".yaml"]})]})})]}),v&&p.jsx(Gde,{onClose:()=>S(!1),onCreated:()=>{S(!1),_()}}),k&&p.jsx(Fde,{command:k.command,sourceName:k.name,onClose:()=>w(null)})]})}function Jde(t){const e=[],n=t.split(`
504
+ `);let r="",i=[];for(const s of n){const a=s.match(/^#{1,3}\s+(.+)/);a?((r||i.length>0)&&e.push({title:r||"Introduction",content:i.join(`
505
+ `).trim()}),r=a[1],i=[]):i.push(s)}return(r||i.length>0)&&e.push({title:r||"Content",content:i.join(`
506
+ `).trim()}),e}function ehe({section:t}){const[e,n]=C.useState(!0);return p.jsxs("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden",children:[p.jsxs("button",{onClick:()=>n(!e),className:"w-full flex items-center gap-2 px-4 py-3 bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] text-left transition-colors",children:[e?p.jsx(ea,{size:16,className:"text-[var(--color-muted)]"}):p.jsx(ta,{size:16,className:"text-[var(--color-muted)]"}),p.jsx("span",{className:"font-bold text-sm",children:t.title})]}),e&&t.content&&p.jsx("div",{className:"px-4 py-3 text-sm text-[var(--color-text)]",children:p.jsx("pre",{className:"whitespace-pre-wrap font-[var(--font-mono)] text-xs",children:t.content})})]})}function the(){const[t,e]=C.useState(null),[n,r]=C.useState(!0),[i,s]=C.useState(""),[a,o]=C.useState("structured"),[u,f]=C.useState(!1),[h,m]=C.useState(null),[O,x]=C.useState(""),{notify:v}=hp();C.useEffect(()=>{Promise.allSettled([fetch("/api/files/project-context.md").then(w=>{if(!w.ok)throw new Error("Not found");return w.json()}).then(w=>{const j=w;e(j.content),s(j.content)}),fetch("/api/files/core/config.yaml").then(w=>w.ok?w.json():fetch("/api/files/config.yaml").then(j=>{if(!j.ok)throw new Error("Not found");return j.json()})).then(w=>{const j=w;m(j.content),x(j.content)}).catch(()=>{})]).finally(()=>r(!1))},[]);async function S(){try{(await fetch("/api/files/project-context.md",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i})})).ok?(e(i),f(!1),v("success","Workspace context saved")):v("error","Failed to save workspace context")}catch{v("error","Failed to save workspace context")}}if(n)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workspace"}),p.jsx(d2,{className:"h-64"})]});if(t===null&&!u)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Workspace"}),p.jsx(Li,{icon:WA,title:"No workspace context found",description:"Create a project-context.md file in your _bmad/ directory to help agents understand your project.",actions:p.jsx("button",{onClick:()=>{const w=`# Project Context
507
+
508
+ ## Overview
509
+ Describe your project here.
510
+
511
+ ## Tech Stack
512
+ List your technologies.
513
+
514
+ ## Architecture
515
+ Describe your architecture.
516
+ `;e(""),s(w),f(!0)},className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Create Workspace Context"})})]});if(u)return p.jsxs("div",{className:"h-[calc(100vh-8rem)]",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h1",{className:"text-2xl font-extrabold",children:"Edit Workspace Context"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{onClick:()=>{f(!1),s(t??"")},className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] text-[var(--color-text)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:S,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Save"})]})]}),p.jsx(pi,{content:i,filePath:"_bmad/project-context.md",onChange:s,onSave:S})]});const k=Jde(t??"");return p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsx("h1",{className:"text-2xl font-extrabold",children:"Workspace"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"flex gap-1 bg-[var(--color-surface-raised)] rounded-md p-0.5",children:["structured","raw","preview","config"].map(w=>p.jsx("button",{onClick:()=>o(w),className:`px-3 py-1.5 text-sm rounded min-h-[36px] transition-colors ${a===w?"bg-[var(--color-bg)] text-[var(--color-text)] font-bold shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:w.charAt(0).toUpperCase()+w.slice(1)},w))}),p.jsx("button",{onClick:()=>f(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors",children:"Edit"})]})]}),a==="structured"&&p.jsxs("div",{className:"space-y-3",children:[k.map((w,j)=>p.jsx(ehe,{section:w},j)),k.length===0&&p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"No structured sections found in workspace context."})]}),a==="raw"&&p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:p.jsx("pre",{className:"p-4 text-sm font-[var(--font-mono)] overflow-x-auto whitespace-pre-wrap",children:t})}),a==="preview"&&p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] p-6",children:p.jsx("div",{className:"prose prose-sm max-w-none text-[var(--color-text)] prose-headings:text-[var(--color-text)] prose-headings:font-bold prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg prose-a:text-[var(--color-accent)] prose-strong:text-[var(--color-text)]",children:p.jsx(X5,{children:t??""})})}),a==="config"&&p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx(Ud,{size:16,className:"text-[var(--color-accent)]"}),p.jsx("h2",{className:"text-sm font-bold",children:"BMAD Configuration"}),p.jsx("span",{className:"text-xs text-[var(--color-muted)] font-[var(--font-mono)]",children:"_bmad/config.yaml"})]}),h!==null?p.jsx("div",{className:"rounded-lg border border-[var(--color-border-subtle)] overflow-hidden h-[500px]",children:p.jsx(pi,{content:O,filePath:"_bmad/config.yaml",onChange:x,onSave:async()=>{try{let w=await fetch("/api/files/core/config.yaml",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:O})});w.ok||(w=await fetch("/api/files/config.yaml",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:O})})),w.ok?(m(O),v("success","Configuration saved")):v("error","Failed to save configuration")}catch{v("error","Failed to save configuration")}}})}):p.jsx("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)] text-sm text-[var(--color-muted)]",children:"No config.yaml found in the _bmad/ directory."})]})]})}function nhe({moduleName:t,currentVersion:e,currentDescription:n,onClose:r,onSaved:i}){const[s,a]=C.useState(e||"1.0.0"),[o,u]=C.useState(n||""),[f,h]=C.useState(null),[m,O]=C.useState(!1),x=async()=>{var v;O(!0),h(null);try{const S=await fetch(`/api/modules/${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:s.trim(),description:o.trim()})});if(!S.ok){const k=await S.json();throw new Error(((v=k.error)==null?void 0:v.message)??"Failed to update module")}i()}catch(S){h(S instanceof Error?S.message:"Failed to update module")}finally{O(!1)}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Edit Module: ",t]}),p.jsx("button",{onClick:r,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:t,disabled:!0,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] opacity-50 cursor-not-allowed"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Module name cannot be changed"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),p.jsx("input",{type:"text",value:s,onChange:v=>a(v.target.value),placeholder:"e.g. 1.0.0",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description (optional)"}),p.jsx("textarea",{value:o,onChange:v=>u(v.target.value),rows:3,placeholder:"What does this module provide?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),f&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:f})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:x,disabled:m,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(yh,{size:14}),m?"Saving...":"Save Changes"]})]})]})]})}function rhe({onClose:t}){const[e,n]=C.useState("info"),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,u]=C.useState("1.0.0"),[f,h]=C.useState([]),[m,O]=C.useState([]),[x,v]=C.useState([]),[S,k]=C.useState(!1),[w,j]=C.useState(new Set),[Q,T]=C.useState(new Set),[N,_]=C.useState(new Set),[M,I]=C.useState(!1),[U,F]=C.useState(null),Z=r.trim().length>0;C.useEffect(()=>{e==="select"&&f.length===0&&m.length===0&&x.length===0&&(k(!0),Promise.all([fetch("/api/agents").then(A=>A.json()),fetch("/api/skills").then(A=>A.json()),fetch("/api/workflows").then(A=>A.json())]).then(([A,D,Y])=>{h(A),O(D),v(Y)}).catch(()=>F("Failed to load entities")).finally(()=>k(!1)))},[e,f.length,m.length,x.length]);const X=w.size+Q.size+N.size,H=C.useMemo(()=>s1(f),[f]),E=C.useMemo(()=>s1(m),[m]),q=C.useMemo(()=>s1(x),[x]);function R(A,D,Y){const P=new Set(A);P.has(Y)?P.delete(Y):P.add(Y),D(P)}function z(A,D){D(new Set(A.map(Y=>Y.id)))}function B(A){A(new Set)}async function W(){var A;I(!0),F(null);try{const D=await fetch("/api/packages/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r.trim(),description:s.trim(),version:o.trim(),agents:Array.from(w),skills:Array.from(Q),workflows:Array.from(N)})});if(!D.ok){const ae=await D.json();throw new Error(((A=ae.error)==null?void 0:A.message)??"Export failed")}const Y=await D.blob(),P=URL.createObjectURL(Y),ee=document.createElement("a");ee.href=P,ee.download=`${r.trim()}.tar.gz`,document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(P),t()}catch(D){F(D instanceof Error?D.message:"Export failed")}finally{I(!1)}}return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-3xl p-6 max-h-[85vh] flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between mb-6",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(xh,{size:20,className:"text-[var(--color-accent)]"}),p.jsx("h2",{className:"text-lg font-bold",children:"Export Package"})]}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[p.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${e==="info"?"text-[var(--color-accent)] font-bold":"text-[var(--color-muted)]"}`,children:[p.jsx("span",{className:"w-5 h-5 rounded-full border flex items-center justify-center text-xs border-current",children:e==="select"?p.jsx(c9,{size:12}):"1"}),"Package Info"]}),p.jsx("div",{className:"w-8 h-px bg-[var(--color-border-subtle)]"}),p.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${e==="select"?"text-[var(--color-accent)] font-bold":"text-[var(--color-muted)]"}`,children:[p.jsx("span",{className:"w-5 h-5 rounded-full border flex items-center justify-center text-xs border-current",children:"2"}),"Select Entities"]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[e==="info"&&p.jsxs("div",{className:"space-y-4 max-w-md",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Package Name *"}),p.jsx("input",{type:"text",value:r,onChange:A=>i(A.target.value),placeholder:"my-package",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none",autoFocus:!0})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Description"}),p.jsx("textarea",{value:s,onChange:A=>a(A.target.value),rows:3,placeholder:"What does this package contain?",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none resize-none"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),p.jsx("input",{type:"text",value:o,onChange:A=>u(A.target.value),placeholder:"1.0.0",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]})]}),e==="select"&&p.jsx(p.Fragment,{children:S?p.jsx("div",{className:"flex items-center justify-center py-12",children:p.jsx(_O,{size:24,className:"animate-spin text-[var(--color-muted)]"})}):p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(a1,{icon:di,label:"Agents",items:f,grouped:H,selected:w,onToggle:A=>R(w,j,A),onSelectAll:()=>z(f,j),onDeselectAll:()=>B(j),getLabel:A=>A.title||A.name}),p.jsx(a1,{icon:na,label:"Skills",items:m,grouped:E,selected:Q,onToggle:A=>R(Q,T,A),onSelectAll:()=>z(m,T),onDeselectAll:()=>B(T),getLabel:A=>A.name}),p.jsx(a1,{icon:Mi,label:"Workflows",items:x,grouped:q,selected:N,onToggle:A=>R(N,_,A),onSelectAll:()=>z(x,_),onDeselectAll:()=>B(_),getLabel:A=>A.name})]})})]}),U&&p.jsx("p",{className:"text-sm text-[var(--color-error)] mt-4",children:U}),p.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("div",{className:"text-sm text-[var(--color-muted)]",children:e==="select"&&`${X} entit${X===1?"y":"ies"} selected`}),p.jsxs("div",{className:"flex gap-3",children:[e==="info"&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsx("button",{onClick:()=>n("select"),disabled:!Z,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]}),e==="select"&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>n("info"),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Back"}),p.jsx("button",{onClick:W,disabled:X===0||M,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:M?p.jsxs(p.Fragment,{children:[p.jsx(_O,{size:14,className:"animate-spin"}),"Exporting..."]}):p.jsxs(p.Fragment,{children:[p.jsx($O,{size:14}),"Export Package"]})})]})]})]})]})]})}function s1(t){const e=new Map;for(const n of t){const r=n.module??"unknown";e.has(r)||e.set(r,[]),e.get(r).push(n)}return e}function a1({icon:t,label:e,items:n,grouped:r,selected:i,onToggle:s,onSelectAll:a,onDeselectAll:o,getLabel:u}){const f=n.length>0&&i.size===n.length;return p.jsxs("div",{className:"flex flex-col rounded-lg border border-[var(--color-border-subtle)] overflow-hidden",children:[p.jsx("div",{className:"px-3 py-2 bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(t,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:e}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",n.length,")"]})]}),p.jsx("button",{onClick:f?o:a,className:"text-xs text-[var(--color-accent)] hover:text-[var(--color-accent-hover)] transition-colors",children:f?"Deselect All":"Select All"})]})}),p.jsxs("div",{className:"flex-1 overflow-y-auto max-h-72 p-1",children:[n.length===0&&p.jsx("p",{className:"text-xs text-[var(--color-muted)] text-center py-4",children:"None available"}),Array.from(r.entries()).map(([h,m])=>p.jsxs("div",{children:[r.size>1&&p.jsx("p",{className:"text-[10px] uppercase font-bold text-[var(--color-muted)] px-2 pt-2 pb-1",children:h}),m.map(O=>p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-[var(--color-surface-raised)] cursor-pointer transition-colors",children:[p.jsx("input",{type:"checkbox",checked:i.has(O.id),onChange:()=>s(O.id),className:"rounded border-[var(--color-border-subtle)] text-[var(--color-accent)] focus:ring-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm truncate",children:u(O)}),r.size<=1&&O.module&&p.jsx("span",{className:"ml-auto text-[10px] px-1.5 py-0.5 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)] shrink-0",children:O.module})]},O.id))]},h))]})]})}function ihe({onClose:t,onInstalled:e}){const[n,r]=C.useState(""),[i,s]=C.useState(null),[a,o]=C.useState(!1),[u,f]=C.useState(null),h=n.trim().length>0,m=async()=>{if(h){o(!0),s(null),f(null);try{const x=await(await fetch("/api/modules/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:n.trim()})})).json();if(!x.ok)throw new Error(x.error??"Installation failed");f(x.modules??[]),setTimeout(()=>{e()},2e3)}catch(O){s(O instanceof Error?O.message:"Installation failed")}finally{o(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-lg font-bold",children:"Install Module from npm"}),p.jsx("button",{onClick:t,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"npm Package Name"}),p.jsx("input",{type:"text",value:n,onChange:O=>r(O.target.value),onKeyDown:O=>{O.key==="Enter"&&h&&!a&&m()},placeholder:"e.g. bmad-builder",disabled:a||u!==null,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-50"}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:["The package must contain a ",p.jsx("code",{className:"font-[var(--font-mono)]",children:"_bmad/"})," directory with module content."]})]}),a&&p.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsx(_O,{size:16,className:"text-[var(--color-accent)] animate-spin"}),p.jsx("span",{className:"text-sm",children:"Installing package..."})]}),u&&p.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-success)]",children:[p.jsx(Bw,{size:16,className:"text-[var(--color-success)]"}),p.jsxs("div",{className:"text-sm",children:[p.jsx("p",{className:"font-bold text-[var(--color-success)]",children:"Installed successfully"}),p.jsxs("p",{className:"text-[var(--color-muted)]",children:["Modules: ",u.join(", ")]})]})]}),i&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:i})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-4 border-t border-[var(--color-border-subtle)]",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:u?"Close":"Cancel"}),!u&&p.jsxs("button",{onClick:m,disabled:!h||a,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx($O,{size:14}),a?"Installing...":"Install"]})]})]})]})}function rA({onClose:t,onCreated:e}){const[n,r]=C.useState(""),[i,s]=C.useState("1.0.0"),[a,o]=C.useState(null),[u,f]=C.useState(!1),h=/^[a-z][a-z0-9-]*$/.test(n),m=async()=>{var O;if(h){f(!0),o(null);try{const x=await fetch("/api/modules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n,version:i})});if(!x.ok){const v=await x.json();throw new Error(((O=v.error)==null?void 0:O.message)??"Failed to create module")}e()}catch(x){o(x instanceof Error?x.message:"Failed to create module")}finally{f(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Create Module"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Name"}),p.jsx("input",{type:"text",value:n,onChange:O=>r(O.target.value),placeholder:"my-module",className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),n&&!h&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Lowercase alphanumeric and hyphens only, must start with a letter"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-bold mb-1",children:"Version"}),p.jsx("input",{type:"text",value:i,onChange:O=>s(O.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"})]}),n&&h&&p.jsxs("div",{className:"text-xs text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx("p",{className:"font-bold mb-1",children:"Will create:"}),p.jsx("pre",{className:"font-[var(--font-mono)]",children:`_bmad/${n}/
517
+ ├── config.yaml
518
+ ├── agents/
519
+ ├── skills/
520
+ └── workflows/`})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:m,disabled:!h||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),u?"Creating...":"Create"]})]})]})]})}function she({module:t,onClose:e,onRemoved:n}){const[r,i]=C.useState(""),[s,a]=C.useState(null),[o,u]=C.useState(!1),f=r===t.name,h=async()=>{var m;if(f){u(!0),a(null);try{const O=await fetch(`/api/modules/${encodeURIComponent(t.name)}`,{method:"DELETE"});if(!O.ok){const x=await O.json();throw new Error(((m=x.error)==null?void 0:m.message)??"Failed to remove module")}n()}catch(O){a(O instanceof Error?O.message:"Failed to remove module")}finally{u(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[p.jsx(vh,{size:20,className:"text-[var(--color-error)]"}),p.jsx("h2",{className:"text-lg font-bold",children:"Remove Module"})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"text-sm",children:["This will permanently delete the ",p.jsx("strong",{children:t.name})," module and all its contents:"]}),p.jsxs("div",{className:"text-sm text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)] space-y-1",children:[p.jsxs("p",{children:[t.agentCount," agent(s)"]}),p.jsxs("p",{children:[t.skillCount," skill(s)"]}),p.jsxs("p",{children:[t.workflowCount," workflow(s)"]})]}),t.source==="custom"&&p.jsxs("p",{className:"text-sm text-[var(--color-warning)] flex items-center gap-1.5",children:[p.jsx(vh,{size:14}),"Custom modules cannot be recovered unless tracked by git."]}),p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm mb-1",children:["Type ",p.jsx("strong",{children:t.name})," to confirm:"]}),p.jsx("input",{type:"text",value:r,onChange:m=>i(m.target.value),className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-error)] focus:outline-none"})]}),s&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:s})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:h,disabled:!f||o,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-error)] text-white hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(ef,{size:14}),o?"Removing...":"Remove Module"]})]})]})]})}function ahe({moduleName:t,entityType:e,onClose:n,onCreated:r}){const[i,s]=C.useState(""),[a,o]=C.useState(null),[u,f]=C.useState(!1),h=/^[a-z][a-z0-9-]*$/.test(i),m=e==="skill"?"Skill":"Workflow",O=async()=>{var x;if(h){f(!0),o(null);try{const v=await fetch(`/api/modules/${encodeURIComponent(t)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,name:i})});if(!v.ok){const S=await v.json();throw new Error(((x=S.error)==null?void 0:x.message)??`Failed to create ${e}`)}r()}catch(v){o(v instanceof Error?v.message:`Failed to create ${e}`)}finally{f(!1)}}};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:n}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-md p-6",children:[p.jsxs("h2",{className:"text-lg font-bold mb-4",children:["Create ",m]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsxs("label",{className:"block text-sm font-bold mb-1",children:[m," Name"]}),p.jsx("input",{type:"text",value:i,onChange:x=>s(x.target.value),placeholder:`my-${e}`,className:"w-full px-3 py-2 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] focus:border-[var(--color-accent)] focus:outline-none"}),i&&!h&&p.jsx("p",{className:"text-xs text-[var(--color-error)] mt-1",children:"Lowercase alphanumeric and hyphens only, must start with a letter"})]}),i&&h&&p.jsxs("div",{className:"text-xs text-[var(--color-muted)] p-3 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx("p",{className:"font-bold mb-1",children:"Will create:"}),p.jsx("code",{className:"font-[var(--font-mono)]",children:e==="skill"?`_bmad/${t}/skills/${i}/SKILL.md`:`_bmad/${t}/workflows/${i}/workflow.md`})]}),a&&p.jsx("p",{className:"text-sm text-[var(--color-error)]",children:a})]}),p.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[p.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Cancel"}),p.jsxs("button",{onClick:O,disabled:!h||u,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),u?"Creating...":`Create ${m}`]})]})]})]})}function lhe({manifest:t,onClose:e}){const n=["# Module Export Manifest",`module: ${t.module}`,`version: ${t.version}`,`source: ${t.source}`,`exportDate: ${t.exportDate}`,`totalEntities: ${t.totalEntities}`,"entities:"," agents:",` count: ${t.entities.agents.count}`," names:",...t.entities.agents.names.map(r=>` - ${r}`)," skills:",` count: ${t.entities.skills.count}`," names:",...t.entities.skills.names.map(r=>` - ${r}`)," workflows:",` count: ${t.entities.workflows.count}`," names:",...t.entities.workflows.names.map(r=>` - ${r}`),"",`# ${t.note}`].join(`
521
+ `);return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),p.jsxs("div",{className:"relative bg-[var(--color-bg)] border border-[var(--color-border-subtle)] rounded-lg shadow-xl w-full max-w-lg p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("h2",{className:"text-lg font-bold",children:["Export Manifest: ",t.module]}),p.jsx("button",{onClick:e,className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex gap-4 text-sm",children:[p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx(di,{size:14,className:"text-[var(--color-accent)]"}),p.jsxs("span",{children:[t.entities.agents.count," agents"]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx(na,{size:14,className:"text-[var(--color-accent)]"}),p.jsxs("span",{children:[t.entities.skills.count," skills"]})]}),p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-[var(--color-surface-raised)]",children:[p.jsx(Mi,{size:14,className:"text-[var(--color-accent)]"}),p.jsxs("span",{children:[t.entities.workflows.count," workflows"]})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-2",children:"module-manifest.yaml"}),p.jsx("pre",{className:"p-4 text-xs font-[var(--font-mono)] bg-[var(--color-surface-raised)] rounded-lg overflow-x-auto whitespace-pre-wrap max-h-72 overflow-y-auto border border-[var(--color-border-subtle)]",children:n})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Full file bundling and archive download is a future enhancement. This manifest provides a summary of module contents."})]}),p.jsx("div",{className:"flex justify-end gap-3 mt-6",children:p.jsx("button",{onClick:e,className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors",children:"Close"})})]})]})}function ohe(t){const e=t.name.toLowerCase();return e==="skill.md"||e.endsWith("-skill.md")||e.endsWith("_skill.md")?"skill":e==="workflow.md"?"workflow":"agent"}async function che(t){const n=(await t.text()).match(/^---\n([\s\S]*?)\n---/);if(n){const r=n[1].toLowerCase();if(r.includes("category:")&&(r.includes("skill")||r.includes("best_for:")))return"skill"}return ohe(t)}function l1({icon:t,label:e,items:n}){const[r,i]=C.useState(!1);return n.length===0?null:p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>i(!r),className:"flex items-center gap-2 w-full text-left py-2",children:[r?p.jsx(ea,{size:14,className:"text-[var(--color-muted)]"}):p.jsx(ta,{size:14,className:"text-[var(--color-muted)]"}),p.jsx(t,{size:14,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"text-sm font-bold",children:e}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:["(",n.length,")"]})]}),r&&p.jsx("div",{className:"ml-7 space-y-1 mb-2",children:n.map(s=>p.jsx(nr,{to:s.to,className:"block text-sm text-[var(--color-accent)] hover:underline py-0.5",children:s.name},s.id))})]})}function uhe(){const t=pa(),[e,n]=C.useState([]),[r,i]=C.useState(!0),[s,a]=cf("detail"),[o,u]=C.useState(!1),[f,h]=C.useState(!1),[m,O]=C.useState(!1),[x,v]=C.useState(null),[S,k]=C.useState(null),[w,j]=C.useState([]),[Q,T]=C.useState(null),[N,_]=C.useState(!1),[M,I]=C.useState(null),U=C.useRef(null),[F,Z]=C.useState(null),[X,H]=C.useState(!1),E=C.useCallback(async()=>{try{const W=await(await fetch("/api/modules")).json();n(W)}catch{}finally{i(!1)}},[]);C.useEffect(()=>{fetch("/api/teams").then(B=>B.json()).then(B=>j(B)).catch(()=>{})},[]),C.useEffect(()=>{E()},[E]);const q=C.useCallback(async(B,W)=>{I(null);let A=0,D=0;for(const Y of Array.from(B)){if(!Y.name.endsWith(".md")){D++;continue}try{const P=await Y.text(),ee=await che(Y),ae=Y.name.replace(/\.md$/i,"");(await fetch(`/api/modules/${encodeURIComponent(W)}/entities`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:ee,name:ae,content:P})})).ok?A++:D++}catch{D++}}A>0&&await E(),D>0?I(`Uploaded ${A} file(s), ${D} failed`):I(`Uploaded ${A} file(s) successfully`),setTimeout(()=>I(null),4e3)},[E]),R=C.useCallback(async B=>{H(!0);try{const W=await fetch(`/api/modules/${encodeURIComponent(B)}/export`,{method:"POST"});if(!W.ok)throw new Error("Export failed");const A=await W.json();Z(A)}catch{I("Export failed"),setTimeout(()=>I(null),3e3)}finally{H(!1)}},[]);if(r)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Modules"}),p.jsx(fy,{count:3})]});if(e.length===0)return p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Modules"}),p.jsx(Li,{icon:xh,title:"No modules installed",description:"Modules contain agents, skills, and workflows. Install a module or create a new one to get started.",actions:p.jsxs("button",{onClick:()=>u(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"Create Module"]})}),o&&p.jsx(rA,{onClose:()=>u(!1),onCreated:()=>{u(!1),E()}})]});const z=s?e.find(B=>B.name===s):null;return p.jsxs("div",{children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsxs("h1",{className:"text-2xl font-extrabold",children:["Modules (",e.length,")"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:()=>O(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors flex items-center gap-1.5",children:[p.jsx(NO,{size:14}),"Export Package"]}),p.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors flex items-center gap-1.5",children:[p.jsx($O,{size:14}),"Install Module"]}),p.jsxs("button",{onClick:()=>u(!0),className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors flex items-center gap-1.5",children:[p.jsx(hn,{size:14}),"Create Module"]})]})]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(B=>p.jsxs("button",{onClick:()=>a(s===B.name?null:B.name),className:`p-4 rounded-lg border text-left transition-all cursor-pointer hover:-translate-y-0.5 hover:shadow-md ${s===B.name?"bg-[var(--color-surface-raised)] border-[var(--color-accent)]":"bg-[var(--color-surface-raised)] border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx(xh,{size:18,className:"text-[var(--color-accent)]"}),p.jsx("span",{className:"font-bold text-sm",children:B.name}),p.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:B.source})]}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mb-2 ml-7",children:["v",B.version]}),p.jsxs("div",{className:"flex gap-4 text-xs text-[var(--color-muted)]",children:[p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(di,{size:10}),B.agentCount," agents"]}),p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(na,{size:10}),B.skillCount," skills"]}),p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(Mi,{size:10}),B.workflowCount," workflows"]})]})]},B.name))})]}),z&&p.jsxs("div",{className:"slide-over-backdrop",children:[p.jsx("div",{className:"slide-over-bg",onClick:()=>a(null)}),p.jsxs("aside",{className:"slide-over-panel",style:{width:"max(400px, 40vw)"},children:[p.jsxs("div",{className:"px-6 py-4 border-b border-[var(--color-border-subtle)] flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-bold",children:z.name}),p.jsxs("p",{className:"text-xs text-[var(--color-muted)]",children:[z.source," · v",z.version]})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[p.jsx("button",{onClick:()=>k(z.name),className:"text-[var(--color-muted)] hover:text-[var(--color-accent)] transition-colors",title:"Edit Module",children:p.jsx(Qu,{size:16})}),p.jsx("button",{onClick:()=>a(null),className:"text-[var(--color-muted)] hover:text-[var(--color-text)]",children:p.jsx(Yn,{size:18})})]})]}),p.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto",style:{maxHeight:"calc(100vh - 80px)"},children:[p.jsx(l1,{icon:di,label:"Agents",items:(z.agents??[]).map(B=>({id:B.id,name:B.title||B.name,to:`/agents/${B.id}`}))}),p.jsx(l1,{icon:na,label:"Skills",items:(z.skills??[]).map(B=>({id:B.id,name:B.name,to:`/skills?detail=${B.id}`}))}),p.jsx(l1,{icon:Mi,label:"Workflows",items:(z.workflows??[]).map(B=>({id:B.id,name:B.name,to:`/workflows?detail=${B.id}`}))}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Add Entities"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("button",{onClick:()=>t("/agents"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx(hn,{size:14,className:"text-[var(--color-accent)]"}),p.jsx(di,{size:14}),"Add Agent",p.jsx("span",{className:"ml-auto text-xs text-[var(--color-muted)]",children:"via Agents page"})]}),p.jsxs("button",{onClick:()=>T("skill"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx(hn,{size:14,className:"text-[var(--color-accent)]"}),p.jsx(na,{size:14}),"Add Skill"]}),p.jsxs("button",{onClick:()=>T("workflow"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] hover:bg-[var(--color-surface-raised)] transition-colors text-left",children:[p.jsx(hn,{size:14,className:"text-[var(--color-accent)]"}),p.jsx(Mi,{size:14}),"Add Workflow"]})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-bold mb-3",children:"Upload Entities"}),p.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${N?"border-[var(--color-accent)] bg-[var(--color-accent)]/10":"border-[var(--color-border-subtle)] hover:border-[var(--color-accent)]"}`,onDragOver:B=>{B.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:B=>{B.preventDefault(),_(!1),B.dataTransfer.files.length>0&&q(B.dataTransfer.files,z.name)},onClick:()=>{var B;return(B=U.current)==null?void 0:B.click()},children:[p.jsx("input",{ref:U,type:"file",accept:".md",multiple:!0,className:"hidden",onChange:B=>{B.target.files&&B.target.files.length>0&&(q(B.target.files,z.name),B.target.value="")}}),p.jsx(NO,{size:24,className:`mx-auto mb-2 ${N?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}`}),p.jsx("p",{className:"text-sm text-[var(--color-muted)]",children:"Drop .md files here or click to upload"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-1",children:"Auto-detects: SKILL.md → skills, workflow.md → workflows, others → agents"})]}),M&&p.jsxs("p",{className:"text-xs mt-2 text-[var(--color-accent)]",children:[p.jsx(jo,{size:12,className:"inline mr-1"}),M]})]}),(()=>{const B=w.filter(W=>W.module===z.name);return B.length===0?null:p.jsxs("div",{children:[p.jsxs("h3",{className:"text-sm font-bold mb-3",children:["Teams (",B.length,")"]}),p.jsx("div",{className:"space-y-2",children:B.map(W=>p.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("span",{className:"flex items-center gap-2 text-sm",children:[W.icon?p.jsx("span",{className:"text-sm leading-none",children:W.icon}):p.jsx(JA,{size:14,className:"text-[var(--color-accent)]"}),W.name]}),p.jsxs("span",{className:"text-xs text-[var(--color-muted)]",children:[W.memberCount," members"]})]},W.id))})]})})(),p.jsxs("div",{className:"text-xs text-[var(--color-muted)]",children:[p.jsxs("p",{children:["Module directory: ",p.jsxs("code",{className:"font-[var(--font-mono)]",children:["_bmad/",z.name,"/"]})]}),z.npmPackage&&p.jsxs("p",{className:"mt-1",children:["npm: ",p.jsx("code",{className:"font-[var(--font-mono)]",children:z.npmPackage})]})]}),p.jsxs("button",{onClick:()=>R(z.name),disabled:X,className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-accent)] text-[var(--color-accent)] hover:bg-[var(--color-accent)] hover:text-white transition-colors disabled:opacity-50",children:[p.jsx($O,{size:14}),X?"Exporting...":"Export Module"]}),z.source!=="built-in"&&p.jsxs("button",{onClick:()=>v(z),className:"w-full flex items-center justify-center gap-2 px-4 py-2 text-sm rounded-md border border-[var(--color-error)] text-[var(--color-error)] hover:bg-[var(--color-error)] hover:text-white transition-colors",children:[p.jsx(ef,{size:14}),"Remove Module"]})]})]})]}),o&&p.jsx(rA,{onClose:()=>u(!1),onCreated:()=>{u(!1),E()}}),x&&p.jsx(she,{module:x,onClose:()=>v(null),onRemoved:()=>{v(null),a(null),E()}}),Q&&z&&p.jsx(ahe,{moduleName:z.name,entityType:Q,onClose:()=>T(null),onCreated:()=>{T(null),E()}}),F&&p.jsx(lhe,{manifest:F,onClose:()=>Z(null)}),S&&z&&p.jsx(nhe,{moduleName:z.name,currentVersion:z.version,onClose:()=>k(null),onSaved:()=>{k(null),E()}}),f&&p.jsx(ihe,{onClose:()=>h(!1),onInstalled:()=>{h(!1),E()}}),m&&p.jsx(rhe,{onClose:()=>O(!1)})]})}function OX({node:t,depth:e=0,selectedPath:n,onSelect:r}){var u;const[i,s]=C.useState(e<2),a=()=>{t.type==="directory"?s(!i):r(t.path)},o=t.type==="file"&&n===t.path;return p.jsxs("div",{children:[p.jsxs("button",{onClick:a,className:`w-full text-left flex items-center gap-2 px-2 py-1.5 text-sm rounded transition-colors ${o?"bg-[var(--color-surface-raised)] text-[var(--color-accent)] font-bold":"hover:bg-[var(--color-surface-raised)]"} ${t.type==="directory"||t.type==="file"?"cursor-pointer":""}`,style:{paddingLeft:`${e*16+8}px`},children:[t.type==="directory"?p.jsx(FA,{size:14,className:i?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}):p.jsx(Q9,{size:14,className:o?"text-[var(--color-accent)]":"text-[var(--color-muted)]"}),p.jsx("span",{className:"truncate",children:t.name}),t.type==="file"&&t.size!==void 0&&p.jsx("span",{className:"ml-auto text-xs text-[var(--color-muted)] shrink-0",children:t.size>1024?`${(t.size/1024).toFixed(1)}K`:`${t.size}B`})]}),i&&((u=t.children)==null?void 0:u.map(f=>p.jsx(OX,{node:f,depth:e+1,selectedPath:n,onSelect:r},f.path)))]})}function fhe(){const[t,e]=C.useState([]),[n,r]=C.useState(!0),[i,s]=cf("path"),[a,o]=C.useState(""),[u,f]=C.useState(!1);C.useEffect(()=>{fetch("/api/files").then(m=>m.json()).then(m=>{e(m),r(!1)}).catch(()=>r(!1))},[]);const h=C.useCallback(async m=>{if(i===m){s(null);return}s(m),f(!0);const O=m.indexOf("_bmad/"),x=O>=0?m.slice(O+6):m;try{const v=await fetch(`/api/files/${x}`);if(v.ok){const S=await v.json();o(S.content)}else o("Failed to load file.")}catch{o("Failed to load file content.")}finally{f(!1)}},[i]);return n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),p.jsx("div",{className:"h-64 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),p.jsx(Li,{icon:GA,title:"No BMAD files",description:"No _bmad/ directory detected."})]}):p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Files"}),p.jsx("div",{className:"border border-[var(--color-border-subtle)] rounded-lg overflow-hidden overflow-y-auto",style:{maxHeight:"calc(100vh - 10rem)"},children:p.jsx("div",{className:"py-1",children:t.map(m=>p.jsx(OX,{node:m,selectedPath:i,onSelect:h},m.path))})}),p.jsx(yy,{open:!!i,title:i??"",onClose:()=>s(null),children:u?p.jsx("div",{className:"h-64 rounded bg-[var(--color-surface-raised)] animate-pulse"}):i!=null&&i.endsWith(".csv")?p.jsx(dQ,{content:a}):p.jsx("div",{className:"h-96 rounded-lg overflow-hidden border border-[var(--color-border-subtle)]",children:p.jsx(pi,{content:a,filePath:i??"",onChange:()=>{},readOnly:!0})})})]})}function dhe(){const t=bh(S=>S.theme),e=bh(S=>S.setTheme),{notify:n}=hp(),[,r]=C.useState({port:4040,theme:"dark"}),[i,s]=C.useState(!0),[a,o]=C.useState("4040"),[u,f]=C.useState(!1),[h,m]=C.useState(!1);C.useEffect(()=>{fetch("/api/settings").then(S=>S.json()).then(S=>{const k=S;r(k),o(String(k.port??4040)),s(!1)}).catch(()=>s(!1))},[]);function O(){const S=n5();e(S),f(!0)}function x(S){o(S),f(!0)}async function v(){m(!0);const S=parseInt(a,10);if(isNaN(S)||S<1024||S>65535){n("error","Port must be between 1024 and 65535"),m(!1);return}try{(await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:S,theme:t})})).ok?(r({port:S,theme:t}),f(!1),n("success","Settings saved")):n("error","Failed to save settings")}catch{n("error","Failed to save settings")}finally{m(!1)}}return i?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Settings"}),p.jsx("div",{className:"h-32 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"})]}):p.jsxs("div",{className:"max-w-2xl",children:[p.jsxs("div",{className:"flex items-center justify-between mb-8",children:[p.jsx("h1",{className:"text-2xl font-extrabold",children:"Settings"}),p.jsx("button",{onClick:v,disabled:!u||h,className:"px-4 py-2 text-sm font-bold rounded-md bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:h?"Saving...":"Save"})]}),p.jsxs("section",{className:"mb-8",children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Studio"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Theme"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Toggle between dark and light mode"})]}),p.jsx("button",{onClick:O,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--color-border-subtle)] hover:bg-[var(--color-bg)] transition-colors",children:t==="dark"?"Switch to Light":"Switch to Dark"})]}),p.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[var(--color-surface-raised)]",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-bold",children:"Port"}),p.jsx("p",{className:"text-xs text-[var(--color-muted)]",children:"Server port (requires restart)"})]}),p.jsx("input",{type:"number",value:a,onChange:S=>x(S.target.value),min:1024,max:65535,className:"w-24 px-3 py-1.5 text-sm text-right rounded-md bg-[var(--color-bg)] border border-[var(--color-border-subtle)] text-[var(--color-text)] font-[var(--font-mono)] outline-none focus:border-[var(--color-accent)]"})]})]})]}),p.jsxs("section",{children:[p.jsx("h2",{className:"text-lg font-bold mb-4",children:"Project"}),p.jsx("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)]",children:p.jsxs("p",{className:"text-sm text-[var(--color-muted)]",children:["Project settings are configured via ",p.jsx("code",{className:"font-[var(--font-mono)]",children:"_bmad/config.yaml"})]})})]})]})}const hhe="0.1.0";function Gg({href:t,icon:e,title:n,description:r}){return p.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-3 p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] hover:border-[var(--color-accent)] transition-colors",children:[p.jsx(e,{size:18,className:"text-[var(--color-accent)] shrink-0 mt-0.5"}),p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"text-sm font-bold",children:n}),p.jsx(qw,{size:10,className:"text-[var(--color-muted)]"})]}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] mt-0.5",children:r})]})]})}const phe=[{q:"What is BMAD?",a:"BMAD (Build Manage Architect Deploy) is an agentic engineering framework that defines AI agents, skills, and workflows as structured markdown files. It provides a method for orchestrating AI agents in software delivery workflows."},{q:"What does BMAD Studio do?",a:"Studio is the configuration and visibility layer for BMAD projects. It reads and writes the same markdown and YAML files that BMAD uses — no database, no hidden state. You can browse agents, visualize workflows, manage skills, and configure your project through a web interface."},{q:"Does Studio execute agents or workflows?",a:"No. Studio configures and visualizes. Your IDE (Claude Code, Cursor, Windsurf, etc.) remains the execution environment. Studio helps you understand and manage the setup; the IDE runs the agents."},{q:"What BMAD version is supported?",a:"Studio targets BMAD v6+. It reads the BMAD version from your project config and warns if the version is unsupported."},{q:"How do I install Studio?",a:"Run `npx bmad-studio` from your BMAD project root. It starts a local server and opens in your browser. No global install required."},{q:"Where does Studio store its data?",a:"Studio reads directly from your _bmad/ directory. Studio-only runtime data (drafts, sync config) lives in .bmad-studio/ which can be deleted at any time with zero impact on your project."},{q:"Can I use Studio without a BMAD project?",a:"Studio will start in setup mode and guide you through initializing a BMAD structure. However, most features require an existing BMAD project to be useful."},{q:"Is my data sent anywhere?",a:"No. Studio runs entirely locally. There are no analytics, no telemetry, and no external network requests. All data stays on your machine."}];function mhe(){return p.jsxs("div",{className:"max-w-2xl",children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-2",children:"About BMAD Studio"}),p.jsxs("p",{className:"text-sm text-[var(--color-muted)] mb-8",children:["Version ",hhe]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("p",{className:"text-sm leading-relaxed",children:"BMAD Studio is a browser-based admin interface for the BMAD agentic engineering framework. It helps you visualize, configure, and manage your BMAD project — agents, skills, workflows, teams, and modules — all through an intuitive web UI."}),p.jsx("p",{className:"text-sm leading-relaxed mt-3 text-[var(--color-muted)]",children:"Studio is the configuration and visibility layer. It reads and writes BMAD's existing markdown and YAML files directly, with no database and no hidden state. The IDE remains the execution environment."})]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h2",{className:"text-sm font-bold mb-3",children:"Links"}),p.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[p.jsx(Gg,{href:"https://github.com/jwhiteside/bmad-studio",icon:KA,title:"GitHub Repository",description:"Source code, issues, and releases"}),p.jsx(Gg,{href:"https://github.com/bmadcode/BMAD-METHOD",icon:Zw,title:"BMAD Method",description:"The agentic engineering framework"}),p.jsx(Gg,{href:"https://github.com/jwhiteside/bmad-studio/blob/main/CONTRIBUTING.md",icon:R9,title:"Contributing",description:"How to report bugs and submit PRs"}),p.jsx(Gg,{href:"https://github.com/jwhiteside/bmad-studio/blob/main/LICENSE",icon:uq,title:"MIT License",description:"Free and open-source software"})]})]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h2",{className:"text-sm font-bold mb-3",children:"Frequently Asked Questions"}),p.jsx("div",{className:"space-y-4",children:phe.map((t,e)=>p.jsxs("div",{className:"p-4 rounded-lg bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)]",children:[p.jsx("p",{className:"text-sm font-bold mb-1.5",children:t.q}),p.jsx("p",{className:"text-xs text-[var(--color-muted)] leading-relaxed",children:t.a})]},e))})]}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h2",{className:"text-sm font-bold mb-3",children:"Built With"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:["React 19","Fastify 5","TypeScript","Tailwind CSS 4","Vite 6","CodeMirror 6","React Flow"].map(t=>p.jsx("span",{className:"text-xs px-2.5 py-1 rounded-full bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:t},t))})]}),p.jsx("div",{className:"text-xs text-[var(--color-muted)] border-t border-[var(--color-border-subtle)] pt-4",children:p.jsxs("p",{children:["Made by ",p.jsx("a",{href:"https://github.com/jwhiteside",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-accent)] hover:underline",children:"Jonathan Whiteside"}),". Licensed under the MIT License."]})})]})}const ghe=[{key:"all",label:"All"},{key:"1-analysis",label:"Analysis"},{key:"2-planning",label:"Planning"},{key:"3-solutioning",label:"Solutioning"},{key:"4-implementation",label:"Implementation"},{key:"anytime",label:"Anytime"}];function Ohe(t){if(t==="anytime")return"Anytime";if(t==="0-learning")return"Learning";const e=t.replace(/^\d+-/,"");return e.charAt(0).toUpperCase()+e.slice(1)}function xhe(){const[t,e]=C.useState([]),[n,r]=C.useState(!0),[i,s]=C.useState("all"),[a,o]=C.useState("all"),[u,f]=C.useState("");C.useEffect(()=>{fetch("/api/commands").then(O=>O.json()).then(O=>{e(O),r(!1)}).catch(()=>r(!1))},[]);const h=C.useMemo(()=>{const O=new Set;for(const x of t)x.module&&O.add(x.module);return Array.from(O).sort()},[t]),m=C.useMemo(()=>{let O=t;if(i!=="all"&&(O=O.filter(x=>x.phase===i)),a!=="all"&&(O=O.filter(x=>x.module===a)),u){const x=u.toLowerCase();O=O.filter(v=>v.name.toLowerCase().includes(x)||v.code.toLowerCase().includes(x)||v.description.toLowerCase().includes(x)||v.agentDisplayName.toLowerCase().includes(x))}return O},[t,i,a,u]);return n?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Commands"}),p.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(O=>p.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-surface-raised)] animate-pulse"},O))})]}):t.length===0?p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-extrabold mb-8",children:"Commands"}),p.jsx(Li,{icon:Zw,title:"No commands found",description:"No bmad-help.csv found or it contains no commands."})]}):p.jsxs("div",{children:[p.jsxs("div",{className:"mb-6",children:[p.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[p.jsxs("h1",{className:"text-2xl font-extrabold shrink-0",children:["Commands (",t.length,")"]}),h.length>0&&p.jsxs("div",{className:"flex gap-1 flex-wrap",children:[p.jsx("button",{onClick:()=>o("all"),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${a==="all"?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:"All"}),h.map(O=>p.jsx("button",{onClick:()=>o(O),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${a===O?"bg-[var(--color-surface-raised)] text-[var(--color-text)] font-bold":"text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:O},O))]}),p.jsx("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:p.jsxs("div",{className:"relative",children:[p.jsx(Vo,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-muted)]"}),p.jsx("input",{type:"text",placeholder:"Search commands...",value:u,onChange:O=>f(O.target.value),className:"pl-9 pr-3 py-1.5 text-sm rounded-md bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-text)] placeholder:text-[var(--color-muted)] outline-none focus:border-[var(--color-accent)] w-64"})]})})]}),p.jsx("div",{className:"flex gap-1 flex-wrap mt-4",children:ghe.map(O=>p.jsx("button",{onClick:()=>s(O.key),className:`px-3 py-1.5 text-sm rounded-md min-h-[36px] transition-colors ${i===O.key?"bg-[var(--color-accent)] text-white font-bold":"bg-[var(--color-surface-raised)] text-[var(--color-muted)] hover:text-[var(--color-text)]"}`,children:O.label},O.key))}),m.length!==t.length&&p.jsxs("p",{className:"text-xs text-[var(--color-muted)] mt-3",children:["Showing ",m.length," of ",t.length," commands"]})]}),p.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--color-border-subtle)]",children:p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"bg-[var(--color-surface-raised)] border-b border-[var(--color-border-subtle)]",children:[p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Code"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Name"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Phase"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Agent"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Required"}),p.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold uppercase tracking-wider text-[var(--color-muted)]",children:"Description"})]})}),p.jsx("tbody",{children:m.map(O=>{var v,S;const x=((S=(v=O.agentTitle)==null?void 0:v.match(new RegExp("\\p{Emoji_Presentation}","u")))==null?void 0:S[0])??"";return p.jsxs("tr",{className:`border-b border-[var(--color-border-subtle)] hover:bg-[var(--color-surface-raised)] transition-colors ${O.required?"bg-[var(--color-accent)]/3":""}`,children:[p.jsx("td",{className:"px-4 py-3",children:p.jsx("span",{className:`font-[var(--font-mono)] font-bold ${O.required?"text-[var(--color-accent)]":""}`,children:O.code})}),p.jsx("td",{className:"px-4 py-3 font-bold",children:O.name}),p.jsx("td",{className:"px-4 py-3",children:p.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs bg-[var(--color-surface-raised)] border border-[var(--color-border-subtle)] text-[var(--color-muted)]",children:Ohe(O.phase)})}),p.jsx("td",{className:"px-4 py-3",children:O.agentDisplayName&&p.jsxs("span",{className:"flex items-center gap-1.5",children:[x&&p.jsx("span",{className:"text-sm leading-none",role:"img",children:x}),p.jsx("span",{className:"text-[var(--color-text)]",children:O.agentDisplayName})]})}),p.jsx("td",{className:"px-4 py-3",children:O.required?p.jsx("span",{className:"text-xs font-bold text-[var(--color-accent)]",children:"Required"}):p.jsx("span",{className:"text-xs text-[var(--color-muted)]",children:"Optional"})}),p.jsx("td",{className:"px-4 py-3 text-[var(--color-muted)] max-w-md",children:p.jsx("span",{className:"line-clamp-2",children:O.description})})]},`${O.code}-${O.module}`)})})]})}),m.length===0&&p.jsx("div",{className:"text-center py-12 text-[var(--color-muted)]",children:p.jsx("p",{className:"text-sm",children:"No commands match your filters."})})]})}const yhe=new zB({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function vhe(){return p.jsx(DB,{client:yhe,children:p.jsx(FB,{children:p.jsx(nB,{children:p.jsx(N8,{children:p.jsxs(Pn,{element:p.jsx(zq,{}),children:[p.jsx(Pn,{index:!0,element:p.jsx(dce,{})}),p.jsx(Pn,{path:"agents",element:p.jsx(Oce,{})}),p.jsx(Pn,{path:"agents/:id",element:p.jsx(Pde,{})}),p.jsx(Pn,{path:"agents/:id/override",element:p.jsx(Ede,{})}),p.jsx(Pn,{path:"teams",element:p.jsx(Dde,{})}),p.jsx(Pn,{path:"skills",element:p.jsx(Ide,{})}),p.jsx(Pn,{path:"workflows",element:p.jsx(oce,{})}),p.jsx(Pn,{path:"outputs",element:p.jsx(Wde,{})}),p.jsx(Pn,{path:"connections",element:p.jsx(Kde,{})}),p.jsx(Pn,{path:"workspace",element:p.jsx(the,{})}),p.jsx(Pn,{path:"modules",element:p.jsx(uhe,{})}),p.jsx(Pn,{path:"files",element:p.jsx(fhe,{})}),p.jsx(Pn,{path:"commands",element:p.jsx(xhe,{})}),p.jsx(Pn,{path:"settings",element:p.jsx(dhe,{})}),p.jsx(Pn,{path:"about",element:p.jsx(mhe,{})})]})})})})})}t5(Sq());N6.createRoot(document.getElementById("root")).render(p.jsx(C.StrictMode,{children:p.jsx(vhe,{})}));