@agentscope-ai/chat 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +88 -0
  2. package/dist/_util/hooks/use-proxy-imperative-handle.d.ts +4 -0
  3. package/dist/_util/hooks/use-proxy-imperative-handle.js +18 -0
  4. package/dist/_util/type.d.ts +1 -0
  5. package/dist/_util/type.js +1 -0
  6. package/dist/_util/warning.d.ts +30 -0
  7. package/dist/_util/warning.js +63 -0
  8. package/dist/accordion/Accordion.d.ts +22 -0
  9. package/dist/accordion/Accordion.js +93 -0
  10. package/dist/accordion/BodyContent.d.ts +8 -0
  11. package/dist/accordion/BodyContent.js +18 -0
  12. package/dist/accordion/DeepThink.d.ts +7 -0
  13. package/dist/accordion/DeepThink.js +35 -0
  14. package/dist/accordion/index.d.ts +2 -0
  15. package/dist/accordion/index.js +1 -0
  16. package/dist/accordion/index.less +170 -0
  17. package/dist/attachments/DropArea.d.ts +8 -0
  18. package/dist/attachments/DropArea.js +87 -0
  19. package/dist/attachments/FileList/AudioIcon.d.ts +2 -0
  20. package/dist/attachments/FileList/AudioIcon.js +19 -0
  21. package/dist/attachments/FileList/FileListCard.d.ts +12 -0
  22. package/dist/attachments/FileList/FileListCard.js +229 -0
  23. package/dist/attachments/FileList/Progress.d.ts +6 -0
  24. package/dist/attachments/FileList/Progress.js +21 -0
  25. package/dist/attachments/FileList/VideoIcon.d.ts +2 -0
  26. package/dist/attachments/FileList/VideoIcon.js +19 -0
  27. package/dist/attachments/FileList/index.d.ts +16 -0
  28. package/dist/attachments/FileList/index.js +132 -0
  29. package/dist/attachments/PlaceholderUploader.d.ts +17 -0
  30. package/dist/attachments/PlaceholderUploader.js +79 -0
  31. package/dist/attachments/SilentUploader.d.ts +9 -0
  32. package/dist/attachments/SilentUploader.js +23 -0
  33. package/dist/attachments/context.d.ts +5 -0
  34. package/dist/attachments/context.js +2 -0
  35. package/dist/attachments/index.d.ts +33 -0
  36. package/dist/attachments/index.js +166 -0
  37. package/dist/attachments/style/fileCard.d.ts +4 -0
  38. package/dist/attachments/style/fileCard.js +124 -0
  39. package/dist/attachments/style/index.d.ts +10 -0
  40. package/dist/attachments/style/index.js +211 -0
  41. package/dist/attachments/util.d.ts +2 -0
  42. package/dist/attachments/util.js +53 -0
  43. package/dist/bubble/Avatar.d.ts +10 -0
  44. package/dist/bubble/Avatar.js +22 -0
  45. package/dist/bubble/Bubble.d.ts +11 -0
  46. package/dist/bubble/Bubble.js +102 -0
  47. package/dist/bubble/BubbleList.d.ts +15 -0
  48. package/dist/bubble/BubbleList.js +44 -0
  49. package/dist/bubble/Cards.d.ts +21 -0
  50. package/dist/bubble/Cards.js +47 -0
  51. package/dist/bubble/ScrollToBottom.d.ts +7 -0
  52. package/dist/bubble/ScrollToBottom.js +45 -0
  53. package/dist/bubble/Spin.d.ts +2 -0
  54. package/dist/bubble/Spin.js +18 -0
  55. package/dist/bubble/hooks/useDisplayData.d.ts +0 -0
  56. package/dist/bubble/hooks/useDisplayData.js +0 -0
  57. package/dist/bubble/hooks/useListData.d.ts +0 -0
  58. package/dist/bubble/hooks/useListData.js +0 -0
  59. package/dist/bubble/index.d.ts +8 -0
  60. package/dist/bubble/index.js +4 -0
  61. package/dist/bubble/interface.d.ts +26 -0
  62. package/dist/bubble/interface.js +1 -0
  63. package/dist/bubble/loading.d.ts +6 -0
  64. package/dist/bubble/loading.js +17 -0
  65. package/dist/bubble/style/avatar.less +40 -0
  66. package/dist/bubble/style/content.d.ts +4 -0
  67. package/dist/bubble/style/content.js +43 -0
  68. package/dist/bubble/style/index.d.ts +9 -0
  69. package/dist/bubble/style/index.js +53 -0
  70. package/dist/bubble/style/list.less +15 -0
  71. package/dist/bubble/style/scrollToBottom.less +174 -0
  72. package/dist/chat-anywhere/Chat/Ref.d.ts +3 -0
  73. package/dist/chat-anywhere/Chat/Ref.js +19 -0
  74. package/dist/chat-anywhere/Chat/index.d.ts +4 -0
  75. package/dist/chat-anywhere/Chat/index.js +65 -0
  76. package/dist/chat-anywhere/Chat/index.less +54 -0
  77. package/dist/chat-anywhere/Header/index.d.ts +3 -0
  78. package/dist/chat-anywhere/Header/index.js +32 -0
  79. package/dist/chat-anywhere/Header/index.less +24 -0
  80. package/dist/chat-anywhere/Input/index.d.ts +3 -0
  81. package/dist/chat-anywhere/Input/index.js +170 -0
  82. package/dist/chat-anywhere/Input/index.less +12 -0
  83. package/dist/chat-anywhere/Layout/index.d.ts +10 -0
  84. package/dist/chat-anywhere/Layout/index.js +73 -0
  85. package/dist/chat-anywhere/Layout/index.less +61 -0
  86. package/dist/chat-anywhere/SessionList/index.d.ts +5 -0
  87. package/dist/chat-anywhere/SessionList/index.js +115 -0
  88. package/dist/chat-anywhere/SessionList/index.less +52 -0
  89. package/dist/chat-anywhere/hooks/ChatAnywhereProvider.d.ts +43 -0
  90. package/dist/chat-anywhere/hooks/ChatAnywhereProvider.js +90 -0
  91. package/dist/chat-anywhere/hooks/types.d.ts +57 -0
  92. package/dist/chat-anywhere/hooks/types.js +1 -0
  93. package/dist/chat-anywhere/hooks/useInput.d.ts +7 -0
  94. package/dist/chat-anywhere/hooks/useInput.js +21 -0
  95. package/dist/chat-anywhere/hooks/useMessages.d.ts +11 -0
  96. package/dist/chat-anywhere/hooks/useMessages.js +56 -0
  97. package/dist/chat-anywhere/hooks/useSessionList.d.ts +24 -0
  98. package/dist/chat-anywhere/hooks/useSessionList.js +120 -0
  99. package/dist/chat-anywhere/index.d.ts +9 -0
  100. package/dist/chat-anywhere/index.js +58 -0
  101. package/dist/conversations/GroupTitle.d.ts +10 -0
  102. package/dist/conversations/GroupTitle.js +15 -0
  103. package/dist/conversations/Item.d.ts +14 -0
  104. package/dist/conversations/Item.js +96 -0
  105. package/dist/conversations/hooks/useGroupable.d.ts +9 -0
  106. package/dist/conversations/hooks/useGroupable.js +72 -0
  107. package/dist/conversations/index.d.ts +62 -0
  108. package/dist/conversations/index.js +124 -0
  109. package/dist/conversations/interface.d.ts +60 -0
  110. package/dist/conversations/interface.js +1 -0
  111. package/dist/conversations/style/index.d.ts +9 -0
  112. package/dist/conversations/style/index.js +80 -0
  113. package/dist/default-cards/Count/index.d.ts +3 -0
  114. package/dist/default-cards/Count/index.js +16 -0
  115. package/dist/default-cards/Count/index.less +19 -0
  116. package/dist/default-cards/DeepThink/index.d.ts +11 -0
  117. package/dist/default-cards/DeepThink/index.js +11 -0
  118. package/dist/default-cards/DeepThink/index.less +0 -0
  119. package/dist/default-cards/Files/index.d.ts +2 -0
  120. package/dist/default-cards/Files/index.js +18 -0
  121. package/dist/default-cards/Footer/index.d.ts +19 -0
  122. package/dist/default-cards/Footer/index.js +50 -0
  123. package/dist/default-cards/Footer/index.less +41 -0
  124. package/dist/default-cards/Images/index.d.ts +3 -0
  125. package/dist/default-cards/Images/index.js +33 -0
  126. package/dist/default-cards/Images/index.less +17 -0
  127. package/dist/default-cards/Interrupted/index.d.ts +11 -0
  128. package/dist/default-cards/Interrupted/index.js +40 -0
  129. package/dist/default-cards/Interrupted/index.less +57 -0
  130. package/dist/default-cards/Text/index.d.ts +2 -0
  131. package/dist/default-cards/Text/index.js +12 -0
  132. package/dist/default-cards/index.d.ts +6 -0
  133. package/dist/default-cards/index.js +6 -0
  134. package/dist/disclaimer/index.d.ts +11 -0
  135. package/dist/disclaimer/index.js +26 -0
  136. package/dist/docs/1896.async.js +457 -0
  137. package/dist/docs/2710.async.js +62 -0
  138. package/dist/docs/2863.async.js +400 -0
  139. package/dist/docs/3057.async.js +46 -0
  140. package/dist/docs/3364.async.js +25 -0
  141. package/dist/docs/404.html +15 -0
  142. package/dist/docs/4820.async.js +1381 -0
  143. package/dist/docs/5623.async.js +60 -0
  144. package/dist/docs/5757.async.js +1 -0
  145. package/dist/docs/5804.async.js +271 -0
  146. package/dist/docs/6198.async.js +18 -0
  147. package/dist/docs/6671.async.js +137 -0
  148. package/dist/docs/7195.async.js +1 -0
  149. package/dist/docs/7485.async.js +29 -0
  150. package/dist/docs/7931.async.js +19 -0
  151. package/dist/docs/7997.async.js +5 -0
  152. package/dist/docs/8156.async.js +110 -0
  153. package/dist/docs/8368.async.js +2 -0
  154. package/dist/docs/8480.async.js +1449 -0
  155. package/dist/docs/8618.async.js +246 -0
  156. package/dist/docs/9016.async.js +32 -0
  157. package/dist/docs/9016.chunk.css +1 -0
  158. package/dist/docs/9335.async.js +11 -0
  159. package/dist/docs/accordion__demos.async.js +9 -0
  160. package/dist/docs/attachments__demos.async.js +1 -0
  161. package/dist/docs/bubble__demos.async.js +50 -0
  162. package/dist/docs/components/accordion/index.html +15 -0
  163. package/dist/docs/components/accordion-cn/index.html +15 -0
  164. package/dist/docs/components/attachments/index.html +15 -0
  165. package/dist/docs/components/attachments-cn/index.html +15 -0
  166. package/dist/docs/components/bubble/index.html +15 -0
  167. package/dist/docs/components/bubble-cn/index.html +15 -0
  168. package/dist/docs/components/bubble-list/index.html +15 -0
  169. package/dist/docs/components/bubble-list-cn/index.html +15 -0
  170. package/dist/docs/components/conversations/index.html +15 -0
  171. package/dist/docs/components/conversations-cn/index.html +15 -0
  172. package/dist/docs/components/disclaimer/index.html +15 -0
  173. package/dist/docs/components/disclaimer-cn/index.html +15 -0
  174. package/dist/docs/components/footer/index.html +15 -0
  175. package/dist/docs/components/footer-cn/index.html +15 -0
  176. package/dist/docs/components/markdown/index.html +15 -0
  177. package/dist/docs/components/markdown-cn/index.html +15 -0
  178. package/dist/docs/components/sender/index.html +15 -0
  179. package/dist/docs/components/sender-cn/index.html +15 -0
  180. package/dist/docs/components/status/index.html +15 -0
  181. package/dist/docs/components/status-cn/index.html +15 -0
  182. package/dist/docs/components/welcome/index.html +15 -0
  183. package/dist/docs/components/welcome-cn/index.html +15 -0
  184. package/dist/docs/components__accordion__index.en-US.md.async.js +6 -0
  185. package/dist/docs/components__accordion__index.en-US.md.chunk.css +1 -0
  186. package/dist/docs/components__accordion__index.zh-CN.md.async.js +6 -0
  187. package/dist/docs/components__accordion__index.zh-CN.md.chunk.css +1 -0
  188. package/dist/docs/components__attachments__index.en-US.md.async.js +1 -0
  189. package/dist/docs/components__attachments__index.en-US.md.chunk.css +1 -0
  190. package/dist/docs/components__attachments__index.zh-CN.md.async.js +1 -0
  191. package/dist/docs/components__attachments__index.zh-CN.md.chunk.css +1 -0
  192. package/dist/docs/components__bubble-list__index.en-US.md.async.js +2 -0
  193. package/dist/docs/components__bubble-list__index.en-US.md.chunk.css +1 -0
  194. package/dist/docs/components__bubble-list__index.zh-CN.md.async.js +2 -0
  195. package/dist/docs/components__bubble-list__index.zh-CN.md.chunk.css +1 -0
  196. package/dist/docs/components__bubble__index.en-US.md.async.js +1 -0
  197. package/dist/docs/components__bubble__index.en-US.md.chunk.css +1 -0
  198. package/dist/docs/components__bubble__index.zh-CN.md.async.js +1 -0
  199. package/dist/docs/components__bubble__index.zh-CN.md.chunk.css +1 -0
  200. package/dist/docs/components__conversations__index.en-US.md.async.js +2 -0
  201. package/dist/docs/components__conversations__index.en-US.md.chunk.css +1 -0
  202. package/dist/docs/components__conversations__index.zh-CN.md.async.js +1 -0
  203. package/dist/docs/components__conversations__index.zh-CN.md.chunk.css +1 -0
  204. package/dist/docs/components__disclaimer__index.en-US.md.async.js +1 -0
  205. package/dist/docs/components__disclaimer__index.en-US.md.chunk.css +1 -0
  206. package/dist/docs/components__disclaimer__index.zh-CN.md.async.js +1 -0
  207. package/dist/docs/components__disclaimer__index.zh-CN.md.chunk.css +1 -0
  208. package/dist/docs/components__footer__index.en-US.md.async.js +1 -0
  209. package/dist/docs/components__footer__index.en-US.md.chunk.css +1 -0
  210. package/dist/docs/components__footer__index.zh-CN.md.async.js +2 -0
  211. package/dist/docs/components__footer__index.zh-CN.md.chunk.css +1 -0
  212. package/dist/docs/components__markdown__index.en-US.md.async.js +1 -0
  213. package/dist/docs/components__markdown__index.en-US.md.chunk.css +1 -0
  214. package/dist/docs/components__markdown__index.zh-CN.md.async.js +1 -0
  215. package/dist/docs/components__markdown__index.zh-CN.md.chunk.css +1 -0
  216. package/dist/docs/components__sender__index.en-US.md.async.js +1 -0
  217. package/dist/docs/components__sender__index.en-US.md.chunk.css +1 -0
  218. package/dist/docs/components__sender__index.zh-CN.md.async.js +1 -0
  219. package/dist/docs/components__sender__index.zh-CN.md.chunk.css +1 -0
  220. package/dist/docs/components__status__index.en-US.md.async.js +1 -0
  221. package/dist/docs/components__status__index.en-US.md.chunk.css +1 -0
  222. package/dist/docs/components__status__index.zh-CN.md.async.js +2 -0
  223. package/dist/docs/components__status__index.zh-CN.md.chunk.css +1 -0
  224. package/dist/docs/components__welcome__index.en-US.md.async.js +2 -0
  225. package/dist/docs/components__welcome__index.en-US.md.chunk.css +1 -0
  226. package/dist/docs/components__welcome__index.zh-CN.md.async.js +2 -0
  227. package/dist/docs/components__welcome__index.zh-CN.md.chunk.css +1 -0
  228. package/dist/docs/conversations__demos.async.js +1 -0
  229. package/dist/docs/demos.async.js +47 -0
  230. package/dist/docs/demos.chunk.css +1 -0
  231. package/dist/docs/disclaimer__demos.async.js +1 -0
  232. package/dist/docs/docs/development/ag-ui/index.html +15 -0
  233. package/dist/docs/docs/development/ag-ui-cn/index.html +15 -0
  234. package/dist/docs/docs/development/backend/index.html +15 -0
  235. package/dist/docs/docs/development/backend-cn/index.html +15 -0
  236. package/dist/docs/docs/development/cards/index.html +15 -0
  237. package/dist/docs/docs/development/cards-cn/index.html +15 -0
  238. package/dist/docs/docs/development/chatanywhere/index.html +15 -0
  239. package/dist/docs/docs/development/chatanywhere-api/index.html +15 -0
  240. package/dist/docs/docs/development/chatanywhere-api-cn/index.html +15 -0
  241. package/dist/docs/docs/development/chatanywhere-cn/index.html +15 -0
  242. package/dist/docs/docs/development/custom/index.html +15 -0
  243. package/dist/docs/docs/development/custom-cn/index.html +15 -0
  244. package/dist/docs/docs/development/overview/index.html +15 -0
  245. package/dist/docs/docs/development/overview-cn/index.html +15 -0
  246. package/dist/docs/docs/development/qwen/index.html +15 -0
  247. package/dist/docs/docs/development/qwen-cn/index.html +15 -0
  248. package/dist/docs/docs/templates/copilot/index.html +15 -0
  249. package/dist/docs/docs/templates/copilot-cn/index.html +15 -0
  250. package/dist/docs/docs/templates/native/index.html +15 -0
  251. package/dist/docs/docs/templates/native-cn/index.html +15 -0
  252. package/dist/docs/docs/templates/voice/index.html +15 -0
  253. package/dist/docs/docs/templates/voice-cn/index.html +15 -0
  254. package/dist/docs/docs__development__ag-ui.en-US.md.async.js +210 -0
  255. package/dist/docs/docs__development__ag-ui.en-US.md.chunk.css +1 -0
  256. package/dist/docs/docs__development__ag-ui.zh-CN.md.async.js +210 -0
  257. package/dist/docs/docs__development__ag-ui.zh-CN.md.chunk.css +1 -0
  258. package/dist/docs/docs__development__backend.en-US.md.async.js +12 -0
  259. package/dist/docs/docs__development__backend.en-US.md.chunk.css +1 -0
  260. package/dist/docs/docs__development__backend.zh-CN.md.async.js +12 -0
  261. package/dist/docs/docs__development__backend.zh-CN.md.chunk.css +1 -0
  262. package/dist/docs/docs__development__cards.en-US.md.async.js +27 -0
  263. package/dist/docs/docs__development__cards.en-US.md.chunk.css +1 -0
  264. package/dist/docs/docs__development__cards.zh-CN.md.async.js +27 -0
  265. package/dist/docs/docs__development__cards.zh-CN.md.chunk.css +1 -0
  266. package/dist/docs/docs__development__chatanywhere-api.en-US.md.async.js +69 -0
  267. package/dist/docs/docs__development__chatanywhere-api.en-US.md.chunk.css +1 -0
  268. package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.async.js +69 -0
  269. package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.chunk.css +1 -0
  270. package/dist/docs/docs__development__chatanywhere.en-US.md.async.js +77 -0
  271. package/dist/docs/docs__development__chatanywhere.en-US.md.chunk.css +1 -0
  272. package/dist/docs/docs__development__chatanywhere.zh-CN.md.async.js +77 -0
  273. package/dist/docs/docs__development__chatanywhere.zh-CN.md.chunk.css +1 -0
  274. package/dist/docs/docs__development__custom.en-US.md.async.js +22 -0
  275. package/dist/docs/docs__development__custom.en-US.md.chunk.css +1 -0
  276. package/dist/docs/docs__development__custom.zh-CN.md.async.js +22 -0
  277. package/dist/docs/docs__development__custom.zh-CN.md.chunk.css +1 -0
  278. package/dist/docs/docs__development__overview.en-US.md.async.js +21 -0
  279. package/dist/docs/docs__development__overview.en-US.md.chunk.css +1 -0
  280. package/dist/docs/docs__development__overview.zh-CN.md.async.js +21 -0
  281. package/dist/docs/docs__development__overview.zh-CN.md.chunk.css +1 -0
  282. package/dist/docs/docs__development__qwen.en-US.md.async.js +25 -0
  283. package/dist/docs/docs__development__qwen.en-US.md.chunk.css +1 -0
  284. package/dist/docs/docs__development__qwen.zh-CN.md.async.js +25 -0
  285. package/dist/docs/docs__development__qwen.zh-CN.md.chunk.css +1 -0
  286. package/dist/docs/docs__templates__copilot.en-US.md.async.js +1 -0
  287. package/dist/docs/docs__templates__copilot.en-US.md.chunk.css +1 -0
  288. package/dist/docs/docs__templates__copilot.zh-CN.md.async.js +1 -0
  289. package/dist/docs/docs__templates__copilot.zh-CN.md.chunk.css +1 -0
  290. package/dist/docs/docs__templates__native.en-US.md.async.js +1 -0
  291. package/dist/docs/docs__templates__native.en-US.md.chunk.css +1 -0
  292. package/dist/docs/docs__templates__native.zh-CN.md.async.js +1 -0
  293. package/dist/docs/docs__templates__native.zh-CN.md.chunk.css +1 -0
  294. package/dist/docs/docs__templates__voice.en-US.md.async.js +20 -0
  295. package/dist/docs/docs__templates__voice.en-US.md.chunk.css +1 -0
  296. package/dist/docs/docs__templates__voice.zh-CN.md.async.js +1 -0
  297. package/dist/docs/docs__templates__voice.zh-CN.md.chunk.css +1 -0
  298. package/dist/docs/dumi__pages__index__index.en-US.async.js +1 -0
  299. package/dist/docs/dumi__pages__index__index.en-US.chunk.css +1 -0
  300. package/dist/docs/dumi__pages__index__index.zh-CN.async.js +1 -0
  301. package/dist/docs/dumi__pages__index__index.zh-CN.chunk.css +1 -0
  302. package/dist/docs/dumi__theme__layouts__DocLayout__index.async.js +1 -0
  303. package/dist/docs/dumi__theme__layouts__DocLayout__index.chunk.css +1 -0
  304. package/dist/docs/dumi__theme__layouts__GlobalLayout__index.async.js +18 -0
  305. package/dist/docs/dumi__theme__layouts__GlobalLayout__index.chunk.css +1 -0
  306. package/dist/docs/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +1 -0
  307. package/dist/docs/index/index.html +15 -0
  308. package/dist/docs/index-cn/index.html +15 -0
  309. package/dist/docs/markdown__demos.async.js +164 -0
  310. package/dist/docs/meta__components__en-US.async.js +9 -0
  311. package/dist/docs/meta__components__zh-CN.async.js +10 -0
  312. package/dist/docs/meta__docs__en-US.async.js +475 -0
  313. package/dist/docs/meta__docs__en-US.chunk.css +1 -0
  314. package/dist/docs/meta__docs__zh-CN.async.js +456 -0
  315. package/dist/docs/meta__docs__zh-CN.chunk.css +1 -0
  316. package/dist/docs/nm__dumi__dist__client__pages__404.async.js +1 -0
  317. package/dist/docs/nm__dumi__dist__client__pages__Demo__index.async.js +1 -0
  318. package/dist/docs/nm__dumi__dist__client__pages__Demo__index.chunk.css +1 -0
  319. package/dist/docs/preload_helper.js +1 -0
  320. package/dist/docs/sender__demos.async.js +1 -0
  321. package/dist/docs/umi.css +1 -0
  322. package/dist/docs/umi.js +107 -0
  323. package/dist/docs/welcome__demos.async.js +1 -0
  324. package/dist/docs/~demos/:id/index.html +15 -0
  325. package/dist/docs/~demos/accordion-demo-inline/index.html +15 -0
  326. package/dist/docs/~demos/accordion-demo-mutisteps/index.html +15 -0
  327. package/dist/docs/~demos/accordion-demo-thinking/index.html +15 -0
  328. package/dist/docs/~demos/attachments-demo-files/index.html +15 -0
  329. package/dist/docs/~demos/bubble-demo-basic/index.html +15 -0
  330. package/dist/docs/~demos/bubble-demo-havestopped/index.html +15 -0
  331. package/dist/docs/~demos/bubble-demo-userwithfile/index.html +15 -0
  332. package/dist/docs/~demos/bubble-demo-userwithimage/index.html +15 -0
  333. package/dist/docs/~demos/bubble-demo-userwithnormal/index.html +15 -0
  334. package/dist/docs/~demos/bubble-demo-withavatar/index.html +15 -0
  335. package/dist/docs/~demos/bubble-demo-withcode/index.html +15 -0
  336. package/dist/docs/~demos/bubble-demo-witherror/index.html +15 -0
  337. package/dist/docs/~demos/bubble-demo-witherrordetail/index.html +15 -0
  338. package/dist/docs/~demos/bubble-demo-withimage/index.html +15 -0
  339. package/dist/docs/~demos/bubble-demo-withusage/index.html +15 -0
  340. package/dist/docs/~demos/bubble-demo-withwaitingmessage/index.html +15 -0
  341. package/dist/docs/~demos/components-bubble-list-demo-basic/index.html +15 -0
  342. package/dist/docs/~demos/components-footer-demo-basic/index.html +15 -0
  343. package/dist/docs/~demos/components-footer-demo-withusage/index.html +15 -0
  344. package/dist/docs/~demos/components-status-demo-basic/index.html +15 -0
  345. package/dist/docs/~demos/conversations-demo-basic/index.html +15 -0
  346. package/dist/docs/~demos/disclaimer-demo-demo/index.html +15 -0
  347. package/dist/docs/~demos/disclaimer-demo-withlink/index.html +15 -0
  348. package/dist/docs/~demos/docs-development-ag-ui-demo-with-copilotkit/index.html +15 -0
  349. package/dist/docs/~demos/docs-development-cards-demo-file/index.html +15 -0
  350. package/dist/docs/~demos/docs-development-cards-demo-footer/index.html +15 -0
  351. package/dist/docs/~demos/docs-development-cards-demo-image/index.html +15 -0
  352. package/dist/docs/~demos/docs-development-cards-demo-text/index.html +15 -0
  353. package/dist/docs/~demos/docs-development-custom-demo-custom/index.html +15 -0
  354. package/dist/docs/~demos/docs-templates-copilot-demo-copilot/index.html +15 -0
  355. package/dist/docs/~demos/docs-templates-native-demo-basic/index.html +15 -0
  356. package/dist/docs/~demos/docs-templates-voice-demo-demo/index.html +15 -0
  357. package/dist/docs/~demos/markdown-demo-citations/index.html +15 -0
  358. package/dist/docs/~demos/markdown-demo-cursor/index.html +15 -0
  359. package/dist/docs/~demos/markdown-demo-mathjax/index.html +15 -0
  360. package/dist/docs/~demos/markdown-demo-md/index.html +15 -0
  361. package/dist/docs/~demos/sender-demo-basic/index.html +15 -0
  362. package/dist/docs/~demos/sender-demo-disabled/index.html +15 -0
  363. package/dist/docs/~demos/sender-demo-loading/index.html +15 -0
  364. package/dist/docs/~demos/sender-demo-moreprefixaction/index.html +15 -0
  365. package/dist/docs/~demos/sender-demo-withfile/index.html +15 -0
  366. package/dist/docs/~demos/welcome-demo-demo0/index.html +15 -0
  367. package/dist/docs/~demos/welcome-demo-demo1/index.html +15 -0
  368. package/dist/docs/~demos/welcome-demo-demo2/index.html +15 -0
  369. package/dist/index.d.ts +26 -0
  370. package/dist/index.js +20 -0
  371. package/dist/index.less +1 -0
  372. package/dist/markdown/Citation.d.ts +16 -0
  373. package/dist/markdown/Citation.js +55 -0
  374. package/dist/markdown/CodeBlock.d.ts +6 -0
  375. package/dist/markdown/CodeBlock.js +88 -0
  376. package/dist/markdown/ImageOrVideo.d.ts +2 -0
  377. package/dist/markdown/ImageOrVideo.js +81 -0
  378. package/dist/markdown/Link.d.ts +3 -0
  379. package/dist/markdown/Link.js +28 -0
  380. package/dist/markdown/Markdown.d.ts +4 -0
  381. package/dist/markdown/Markdown.js +121 -0
  382. package/dist/markdown/cursor/Blur.d.ts +3 -0
  383. package/dist/markdown/cursor/Blur.js +7 -0
  384. package/dist/markdown/cursor/Dot.d.ts +3 -0
  385. package/dist/markdown/cursor/Dot.js +16 -0
  386. package/dist/markdown/cursor/Underline.d.ts +3 -0
  387. package/dist/markdown/cursor/Underline.js +7 -0
  388. package/dist/markdown/cursor/index.less +124 -0
  389. package/dist/markdown/hooks/index.d.ts +1 -0
  390. package/dist/markdown/hooks/index.js +49 -0
  391. package/dist/markdown/hooks/useTypedEffect.d.ts +6 -0
  392. package/dist/markdown/hooks/useTypedEffect.js +56 -0
  393. package/dist/markdown/index.d.ts +16 -0
  394. package/dist/markdown/index.js +37 -0
  395. package/dist/markdown/index.less +204 -0
  396. package/dist/markdown/plugins/footnote.d.ts +2 -0
  397. package/dist/markdown/plugins/footnote.js +89 -0
  398. package/dist/markdown/plugins/katexDir.d.ts +1 -0
  399. package/dist/markdown/plugins/katexDir.js +15 -0
  400. package/dist/markdown/rehype/fadeIn.d.ts +2 -0
  401. package/dist/markdown/rehype/fadeIn.js +43 -0
  402. package/dist/markdown/type.d.ts +46 -0
  403. package/dist/markdown/type.js +1 -0
  404. package/dist/markdown/utils.d.ts +22 -0
  405. package/dist/markdown/utils.js +125 -0
  406. package/dist/provider/CustomCardsProvider.d.ts +15 -0
  407. package/dist/provider/CustomCardsProvider.js +18 -0
  408. package/dist/provider/GlobalProvider.d.ts +5 -0
  409. package/dist/provider/GlobalProvider.js +11 -0
  410. package/dist/provider/index.d.ts +8 -0
  411. package/dist/provider/index.js +20 -0
  412. package/dist/provider/types.d.ts +8 -0
  413. package/dist/provider/types.js +1 -0
  414. package/dist/sender/SenderHeader.d.ts +19 -0
  415. package/dist/sender/SenderHeader.js +79 -0
  416. package/dist/sender/StopLoading.d.ts +5 -0
  417. package/dist/sender/StopLoading.js +20 -0
  418. package/dist/sender/components/ActionButton.d.ts +22 -0
  419. package/dist/sender/components/ActionButton.js +39 -0
  420. package/dist/sender/components/ClearButton.d.ts +4 -0
  421. package/dist/sender/components/ClearButton.js +13 -0
  422. package/dist/sender/components/LoadingButton.d.ts +4 -0
  423. package/dist/sender/components/LoadingButton.js +22 -0
  424. package/dist/sender/components/SendButton.d.ts +4 -0
  425. package/dist/sender/components/SendButton.js +14 -0
  426. package/dist/sender/components/SpeechButton/RecordingIcon.d.ts +5 -0
  427. package/dist/sender/components/SpeechButton/RecordingIcon.js +49 -0
  428. package/dist/sender/components/SpeechButton/index.d.ts +4 -0
  429. package/dist/sender/components/SpeechButton/index.js +30 -0
  430. package/dist/sender/index.d.ts +61 -0
  431. package/dist/sender/index.js +307 -0
  432. package/dist/sender/style/header.d.ts +4 -0
  433. package/dist/sender/style/header.js +46 -0
  434. package/dist/sender/style/index.d.ts +10 -0
  435. package/dist/sender/style/index.js +123 -0
  436. package/dist/sender/useSpeech.d.ts +6 -0
  437. package/dist/sender/useSpeech.js +114 -0
  438. package/dist/stream/index.d.ts +34 -0
  439. package/dist/stream/index.en-US.md.bk +50 -0
  440. package/dist/stream/index.js +197 -0
  441. package/dist/stream/index.zh-CN.md.bk +51 -0
  442. package/dist/theme/components.d.ts +10 -0
  443. package/dist/theme/components.js +1 -0
  444. package/dist/theme/cssinjs-utils.d.ts +14 -0
  445. package/dist/theme/cssinjs-utils.js +1 -0
  446. package/dist/theme/genStyleUtils.d.ts +28 -0
  447. package/dist/theme/genStyleUtils.js +49 -0
  448. package/dist/theme/useToken.d.ts +18 -0
  449. package/dist/theme/useToken.js +110 -0
  450. package/dist/version/index.d.ts +2 -0
  451. package/dist/version/index.js +2 -0
  452. package/dist/voice-chat/Recorder/index.d.ts +26 -0
  453. package/dist/voice-chat/Recorder/index.js +168 -0
  454. package/dist/voice-chat/VoiceChatProvider/context.d.ts +22 -0
  455. package/dist/voice-chat/VoiceChatProvider/context.js +3 -0
  456. package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.d.ts +1 -0
  457. package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.js +5 -0
  458. package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.d.ts +8 -0
  459. package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.js +31 -0
  460. package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.d.ts +5 -0
  461. package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.js +48 -0
  462. package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.d.ts +4 -0
  463. package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.js +10 -0
  464. package/dist/voice-chat/VoiceChatProvider/index.d.ts +9 -0
  465. package/dist/voice-chat/VoiceChatProvider/index.js +55 -0
  466. package/dist/voice-chat/VoiceChatService/index.d.ts +34 -0
  467. package/dist/voice-chat/VoiceChatService/index.js +209 -0
  468. package/dist/voice-chat/index.d.ts +2 -0
  469. package/dist/voice-chat/index.js +2 -0
  470. package/dist/voice-chat/types/index.d.ts +12 -0
  471. package/dist/voice-chat/types/index.js +4 -0
  472. package/dist/welcome/icon.d.ts +2 -0
  473. package/dist/welcome/icon.js +38 -0
  474. package/dist/welcome/index.d.ts +9 -0
  475. package/dist/welcome/index.js +57 -0
  476. package/package.json +117 -0
@@ -0,0 +1,271 @@
1
+ !(function(){var Ls=Object.defineProperty,js=Object.defineProperties;var Us=Object.getOwnPropertyDescriptors;var ua=Object.getOwnPropertySymbols;var Bs=Object.prototype.hasOwnProperty,zs=Object.prototype.propertyIsEnumerable;var Oi=(lt,Ue)=>(Ue=Symbol[lt])?Ue:Symbol.for("Symbol."+lt);var ca=Math.pow,la=(lt,Ue,G)=>Ue in lt?Ls(lt,Ue,{enumerable:!0,configurable:!0,writable:!0,value:G}):lt[Ue]=G,J=(lt,Ue)=>{for(var G in Ue||(Ue={}))Bs.call(Ue,G)&&la(lt,G,Ue[G]);if(ua)for(var G of ua(Ue))zs.call(Ue,G)&&la(lt,G,Ue[G]);return lt},it=(lt,Ue)=>js(lt,Us(Ue));var Bn=(lt,Ue,G)=>new Promise((ee,Ce)=>{var te=ce=>{try{B(G.next(ce))}catch(ke){Ce(ke)}},Te=ce=>{try{B(G.throw(ce))}catch(ke){Ce(ke)}},B=ce=>ce.done?ee(ce.value):Promise.resolve(ce.value).then(te,Te);B((G=G.apply(lt,Ue)).next())}),Fn=function(lt,Ue){this[0]=lt,this[1]=Ue},_r=(lt,Ue,G)=>{var ee=(Te,B,ce,ke)=>{try{var Oe=G[Te](B),ft=(B=Oe.value)instanceof Fn,ye=Oe.done;Promise.resolve(ft?B[0]:B).then(M=>ft?ee(Te==="return"?Te:"next",B[1]?{done:M.done,value:M.value}:M,ce,ke):ce({value:M,done:ye})).catch(M=>ee("throw",M,ce,ke))}catch(M){ke(M)}},Ce=Te=>te[Te]=B=>new Promise((ce,ke)=>ee(Te,B,ce,ke)),te={};return G=G.apply(lt,Ue),te[Oi("asyncIterator")]=()=>te,Ce("next"),Ce("throw"),Ce("return"),te};var jr=(lt,Ue,G)=>(Ue=lt[Oi("asyncIterator")])?Ue.call(lt):(lt=lt[Oi("iterator")](),Ue={},G=(ee,Ce)=>(Ce=lt[ee])&&(Ue[ee]=te=>new Promise((Te,B,ce)=>(te=Ce.call(lt,te),ce=te.done,Promise.resolve(te.value).then(ke=>Te({value:ke,done:ce}),B)))),G("next"),G("return"),Ue);(self.webpackChunk_agentscope_ai_chat=self.webpackChunk_agentscope_ai_chat||[]).push([[5804],{76712:function(lt,Ue,G){"use strict";G.d(Ue,{Z:function(){return mt}});var ee=G(41747),Ce=G(45757),te=G(92310),Te=G.n(te),B=G(91942),ce=["css"];function ke(Y){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(fe){return typeof fe}:function(fe){return fe&&typeof Symbol=="function"&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe},ke(Y)}function Oe(Y,fe){if(Y==null)return{};var xe=ft(Y,fe),Ie,nt;if(Object.getOwnPropertySymbols){var Se=Object.getOwnPropertySymbols(Y);for(nt=0;nt<Se.length;nt++)Ie=Se[nt],!(fe.indexOf(Ie)>=0)&&Object.prototype.propertyIsEnumerable.call(Y,Ie)&&(xe[Ie]=Y[Ie])}return xe}function ft(Y,fe){if(Y==null)return{};var xe={},Ie=Object.keys(Y),nt,Se;for(Se=0;Se<Ie.length;Se++)nt=Ie[Se],!(fe.indexOf(nt)>=0)&&(xe[nt]=Y[nt]);return xe}function ye(Y,fe,xe){return fe=M(fe),fe in Y?Object.defineProperty(Y,fe,{value:xe,enumerable:!0,configurable:!0,writable:!0}):Y[fe]=xe,Y}function M(Y){var fe=W(Y,"string");return ke(fe)=="symbol"?fe:String(fe)}function W(Y,fe){if(ke(Y)!="object"||!Y)return Y;var xe=Y[Symbol.toPrimitive];if(xe!==void 0){var Ie=xe.call(Y,fe||"default");if(ke(Ie)!="object")return Ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return(fe==="string"?String:Number)(Y)}function he(Y){var fe=Y.sparkPrefix,xe=Y.antPrefix;return ye({},".".concat(fe,"-drawer"),ye(ye(ye({},".".concat(xe,"-drawer-header"),ye({padding:"18px 20px",borderColor:"var(--".concat(xe,"-color-border-secondary)")},".".concat(xe,"-drawer-header-title"),ye({display:"flex",flexDirection:"row-reverse"},".".concat(xe,"-drawer-title"),{fontSize:16,fontWeight:"500",lineHeight:"28px",color:"var(--".concat(xe,"-color-text)")}))),".".concat(xe,"-drawer-footer"),{padding:"16px 20px",borderColor:"var(--".concat(xe,"-color-border-secondary)"),display:"flex",alignItems:"center"}),".".concat(xe,"-drawer-close"),{margin:0}))}var je=(0,B.Z)(function(Y){var fe=Y.css,xe=Oe(Y,ce),Ie=fe(he(xe));return Ie}),H=je,de=G(27174);function ge(Y){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(fe){return typeof fe}:function(fe){return fe&&typeof Symbol=="function"&&fe.constructor===Symbol&&fe!==Symbol.prototype?"symbol":typeof fe},ge(Y)}var Ae=["children","className","style"];function We(Y,fe){var xe=Object.keys(Y);if(Object.getOwnPropertySymbols){var Ie=Object.getOwnPropertySymbols(Y);fe&&(Ie=Ie.filter(function(nt){return Object.getOwnPropertyDescriptor(Y,nt).enumerable})),xe.push.apply(xe,Ie)}return xe}function yt(Y){for(var fe=1;fe<arguments.length;fe++){var xe=arguments[fe]!=null?arguments[fe]:{};fe%2?We(Object(xe),!0).forEach(function(Ie){st(Y,Ie,xe[Ie])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(xe)):We(Object(xe)).forEach(function(Ie){Object.defineProperty(Y,Ie,Object.getOwnPropertyDescriptor(xe,Ie))})}return Y}function st(Y,fe,xe){return fe=Nt(fe),fe in Y?Object.defineProperty(Y,fe,{value:xe,enumerable:!0,configurable:!0,writable:!0}):Y[fe]=xe,Y}function Nt(Y){var fe=tt(Y,"string");return ge(fe)=="symbol"?fe:String(fe)}function tt(Y,fe){if(ge(Y)!="object"||!Y)return Y;var xe=Y[Symbol.toPrimitive];if(xe!==void 0){var Ie=xe.call(Y,fe||"default");if(ge(Ie)!="object")return Ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return(fe==="string"?String:Number)(Y)}function Ee(Y,fe){if(Y==null)return{};var xe=De(Y,fe),Ie,nt;if(Object.getOwnPropertySymbols){var Se=Object.getOwnPropertySymbols(Y);for(nt=0;nt<Se.length;nt++)Ie=Se[nt],!(fe.indexOf(Ie)>=0)&&Object.prototype.propertyIsEnumerable.call(Y,Ie)&&(xe[Ie]=Y[Ie])}return xe}function De(Y,fe){if(Y==null)return{};var xe={},Ie=Object.keys(Y),nt,Se;for(Se=0;Se<Ie.length;Se++)nt=Ie[Se],!(fe.indexOf(nt)>=0)&&(xe[nt]=Y[nt]);return xe}var mt=function(Y){var fe=Y.children,xe=Y.className,Ie=Y.style,nt=Ee(Y,Ae);H();var Se=(0,ee.sA)(),Le=Se.sparkPrefix,ne=Se.variables;return(0,de.jsx)(Ce.Z,yt(yt({className:Te()("".concat(Le,"-drawer"),xe),style:yt(yt({},Ie),ne)},nt),{},{children:fe}))}},98703:function(lt,Ue,G){"use strict";G.d(Ue,{Z:function(){return Le}});var ee=G(41747),Ce=G(5465),te=G(62901),Te=G(23188),B=G(92310),ce=G.n(B),ke=G(21739),Oe=G(91942),ft=["css"];function ye(ne){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_e){return typeof _e}:function(_e){return _e&&typeof Symbol=="function"&&_e.constructor===Symbol&&_e!==Symbol.prototype?"symbol":typeof _e},ye(ne)}function M(ne,_e){if(ne==null)return{};var Pe=W(ne,_e),Je,re;if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(ne);for(re=0;re<se.length;re++)Je=se[re],!(_e.indexOf(Je)>=0)&&Object.prototype.propertyIsEnumerable.call(ne,Je)&&(Pe[Je]=ne[Je])}return Pe}function W(ne,_e){if(ne==null)return{};var Pe={},Je=Object.keys(ne),re,se;for(se=0;se<Je.length;se++)re=Je[se],!(_e.indexOf(re)>=0)&&(Pe[re]=ne[re]);return Pe}function he(ne,_e,Pe){return _e=je(_e),_e in ne?Object.defineProperty(ne,_e,{value:Pe,enumerable:!0,configurable:!0,writable:!0}):ne[_e]=Pe,ne}function je(ne){var _e=H(ne,"string");return ye(_e)=="symbol"?_e:String(_e)}function H(ne,_e){if(ye(ne)!="object"||!ne)return ne;var Pe=ne[Symbol.toPrimitive];if(Pe!==void 0){var Je=Pe.call(ne,_e||"default");if(ye(Je)!="object")return Je;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_e==="string"?String:Number)(ne)}function de(ne){var _e=ne.sparkPrefix,Pe=ne.antPrefix;return he(he(he({},".".concat(_e,"-form"),he(he({},".".concat(_e,"-required-mark"),{color:"var(--".concat(Pe,"-color-error)"),marginLeft:"4px",lineHeight:1,marginTop:"6px"}),".".concat(Pe,"-form-item .").concat(Pe,"-form-item-label"),{textAlign:"left"})),".".concat(_e,"-form-label-margin-small"),he({},".".concat(Pe,"-form-item-label > label"),{marginRight:"8px"})),".".concat(Pe,"-col"),{minHeight:"unset"})}var ge=(0,Oe.Z)(function(ne){var _e=ne.css,Pe=M(ne,ft),Je=_e(de(Pe));return Je}),Ae=ge,We=G(27174),yt=["tooltip"];function st(ne){"@babel/helpers - typeof";return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_e){return typeof _e}:function(_e){return _e&&typeof Symbol=="function"&&_e.constructor===Symbol&&_e!==Symbol.prototype?"symbol":typeof _e},st(ne)}function Nt(ne,_e){if(ne==null)return{};var Pe=tt(ne,_e),Je,re;if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(ne);for(re=0;re<se.length;re++)Je=se[re],!(_e.indexOf(Je)>=0)&&Object.prototype.propertyIsEnumerable.call(ne,Je)&&(Pe[Je]=ne[Je])}return Pe}function tt(ne,_e){if(ne==null)return{};var Pe={},Je=Object.keys(ne),re,se;for(se=0;se<Je.length;se++)re=Je[se],!(_e.indexOf(re)>=0)&&(Pe[re]=ne[re]);return Pe}function Ee(ne,_e){var Pe=Object.keys(ne);if(Object.getOwnPropertySymbols){var Je=Object.getOwnPropertySymbols(ne);_e&&(Je=Je.filter(function(re){return Object.getOwnPropertyDescriptor(ne,re).enumerable})),Pe.push.apply(Pe,Je)}return Pe}function De(ne){for(var _e=1;_e<arguments.length;_e++){var Pe=arguments[_e]!=null?arguments[_e]:{};_e%2?Ee(Object(Pe),!0).forEach(function(Je){mt(ne,Je,Pe[Je])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ne,Object.getOwnPropertyDescriptors(Pe)):Ee(Object(Pe)).forEach(function(Je){Object.defineProperty(ne,Je,Object.getOwnPropertyDescriptor(Pe,Je))})}return ne}function mt(ne,_e,Pe){return _e=Y(_e),_e in ne?Object.defineProperty(ne,_e,{value:Pe,enumerable:!0,configurable:!0,writable:!0}):ne[_e]=Pe,ne}function Y(ne){var _e=fe(ne,"string");return st(_e)=="symbol"?_e:String(_e)}function fe(ne,_e){if(st(ne)!="object"||!ne)return ne;var Pe=ne[Symbol.toPrimitive];if(Pe!==void 0){var Je=Pe.call(ne,_e||"default");if(st(Je)!="object")return Je;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_e==="string"?String:Number)(ne)}var xe=(0,ke.forwardRef)(function(ne,_e){var Pe=ne.labelMarginRight,Je=Pe===void 0?void 0:Pe,re=(0,ke.useRef)(null),se=(0,ee.sA)(),Re=se.sparkPrefix;return Ae(),(0,ke.useImperativeHandle)(_e,function(){return re.current}),(0,We.jsx)(te.Z,De(De({},ne),{},{className:ce()(ne.className,"".concat(Re,"-form"),Je==="small"&&"".concat(Re,"-form-label-margin-small")),ref:re,requiredMark:function(Ze,Lt){return(0,We.jsxs)(We.Fragment,{children:[Ze,Lt.required&&(0,We.jsx)("span",{className:"".concat(Re,"-required-mark"),children:"*"})]})}}))}),Ie=function(_e){var Pe=_e.tooltip,Je=Nt(_e,yt),re=(0,We.jsx)(Ce.QuestionCircleOutlined,{});function se(){if(Pe){var Re=st(Pe)==="object"&&!ke.isValidElement(Pe)?De(De({},Pe),{},{icon:Pe.icon||re}):{title:Pe,icon:re};return Re}}return(0,We.jsx)(te.Z.Item,De(De({},Je),{},{tooltip:se(),labelCol:_e.labelCol||(_e.layout==="vertical"?{flex:"unset"}:void 0)}))},nt=Ie;nt.useStatus=Te.Z.useStatus;var Se=xe;Se.Item=nt,Se.List=te.Z.List,Se.ErrorList=te.Z.ErrorList,Se.Provider=te.Z.Provider,Se.useForm=te.Z.useForm,Se.useFormInstance=te.Z.useFormInstance,Se.useWatch=te.Z.useWatch;var Le=Se},54123:function(lt,Ue,G){"use strict";var ee=G(23306),Ce=G(41747),te=G(15266),Te=G(21739),B=G(27174);function ce(H){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(de){return typeof de}:function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},ce(H)}var ke=["bordered"];function Oe(H,de){var ge=Object.keys(H);if(Object.getOwnPropertySymbols){var Ae=Object.getOwnPropertySymbols(H);de&&(Ae=Ae.filter(function(We){return Object.getOwnPropertyDescriptor(H,We).enumerable})),ge.push.apply(ge,Ae)}return ge}function ft(H){for(var de=1;de<arguments.length;de++){var ge=arguments[de]!=null?arguments[de]:{};de%2?Oe(Object(ge),!0).forEach(function(Ae){ye(H,Ae,ge[Ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(ge)):Oe(Object(ge)).forEach(function(Ae){Object.defineProperty(H,Ae,Object.getOwnPropertyDescriptor(ge,Ae))})}return H}function ye(H,de,ge){return de=M(de),de in H?Object.defineProperty(H,de,{value:ge,enumerable:!0,configurable:!0,writable:!0}):H[de]=ge,H}function M(H){var de=W(H,"string");return ce(de)=="symbol"?de:String(de)}function W(H,de){if(ce(H)!="object"||!H)return H;var ge=H[Symbol.toPrimitive];if(ge!==void 0){var Ae=ge.call(H,de||"default");if(ce(Ae)!="object")return Ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return(de==="string"?String:Number)(H)}function he(H,de){if(H==null)return{};var ge=je(H,de),Ae,We;if(Object.getOwnPropertySymbols){var yt=Object.getOwnPropertySymbols(H);for(We=0;We<yt.length;We++)Ae=yt[We],!(de.indexOf(Ae)>=0)&&Object.prototype.propertyIsEnumerable.call(H,Ae)&&(ge[Ae]=H[Ae])}return ge}function je(H,de){if(H==null)return{};var ge={},Ae=Object.keys(H),We,yt;for(yt=0;yt<Ae.length;yt++)We=Ae[yt],!(de.indexOf(We)>=0)&&(ge[We]=H[We]);return ge}Ue.Z=function(H){var de=H.bordered,ge=de===void 0?!0:de,Ae=he(H,ke),We=(0,Ce.sA)(),yt=We.iconfont,st=(0,Te.useMemo)(function(){return typeof H.icon=="string"?(0,B.jsx)(ee.Z,{type:H.icon,size:H.size}):H.icon},[H.icon,yt]);return(0,B.jsx)(te.Z,ft(ft({style:{lineHeight:1},type:ge?"default":"text"},Ae),{},{icon:st}))}},20477:function(lt,Ue,G){"use strict";var ee=G(21739),Ce=G(23064),te=G(89360),Te=function(B){te.Z&&((0,Ce.mf)(B)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof B,'".'))),(0,ee.useEffect)(function(){B==null||B()},[])};Ue.Z=Te},78092:function(lt){var Ue=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,G=/\n/g,ee=/^\s*/,Ce=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,te=/^:\s*/,Te=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B=/^[;\s]*/,ce=/^\s+|\s+$/g,ke=`
2
+ `,Oe="/",ft="*",ye="",M="comment",W="declaration";lt.exports=function(je,H){if(typeof je!="string")throw new TypeError("First argument must be a string");if(!je)return[];H=H||{};var de=1,ge=1;function Ae(xe){var Ie=xe.match(G);Ie&&(de+=Ie.length);var nt=xe.lastIndexOf(ke);ge=~nt?xe.length-nt:ge+xe.length}function We(){var xe={line:de,column:ge};return function(Ie){return Ie.position=new yt(xe),Ee(),Ie}}function yt(xe){this.start=xe,this.end={line:de,column:ge},this.source=H.source}yt.prototype.content=je;var st=[];function Nt(xe){var Ie=new Error(H.source+":"+de+":"+ge+": "+xe);if(Ie.reason=xe,Ie.filename=H.source,Ie.line=de,Ie.column=ge,Ie.source=je,H.silent)st.push(Ie);else throw Ie}function tt(xe){var Ie=xe.exec(je);if(Ie){var nt=Ie[0];return Ae(nt),je=je.slice(nt.length),Ie}}function Ee(){tt(ee)}function De(xe){var Ie;for(xe=xe||[];Ie=mt();)Ie!==!1&&xe.push(Ie);return xe}function mt(){var xe=We();if(!(Oe!=je.charAt(0)||ft!=je.charAt(1))){for(var Ie=2;ye!=je.charAt(Ie)&&(ft!=je.charAt(Ie)||Oe!=je.charAt(Ie+1));)++Ie;if(Ie+=2,ye===je.charAt(Ie-1))return Nt("End of comment missing");var nt=je.slice(2,Ie-2);return ge+=2,Ae(nt),je=je.slice(Ie),ge+=2,xe({type:M,comment:nt})}}function Y(){var xe=We(),Ie=tt(Ce);if(Ie){if(mt(),!tt(te))return Nt("property missing ':'");var nt=tt(Te),Se=xe({type:W,property:he(Ie[0].replace(Ue,ye)),value:nt?he(nt[0].replace(Ue,ye)):ye});return tt(B),Se}}function fe(){var xe=[];De(xe);for(var Ie;Ie=Y();)Ie!==!1&&(xe.push(Ie),De(xe));return xe}return Ee(),fe()};function he(je){return je?je.replace(ce,ye):ye}},1288:function(lt){lt.exports=function(G){return G!=null&&G.constructor!=null&&typeof G.constructor.isBuffer=="function"&&G.constructor.isBuffer(G)}},10867:function(lt){function Ue(G){for(var ee=-1,Ce=G==null?0:G.length,te=0,Te=[];++ee<Ce;){var B=G[ee];B&&(Te[te++]=B)}return Te}lt.exports=Ue},35906:function(lt,Ue,G){var ee=G(78092);function Ce(te,Te){var B=null;if(!te||typeof te!="string")return B;for(var ce,ke=ee(te),Oe=typeof Te=="function",ft,ye,M=0,W=ke.length;M<W;M++)ce=ke[M],ft=ce.property,ye=ce.value,Oe?Te(ft,ye,ce):ye&&(B||(B={}),B[ft]=ye);return B}lt.exports=Ce,lt.exports.default=Ce},94473:function(lt){function Ue(ee){var Ce,te,Te,B=2;for(typeof Symbol!="undefined"&&(te=Symbol.asyncIterator,Te=Symbol.iterator);B--;){if(te&&(Ce=ee[te])!=null)return Ce.call(ee);if(Te&&(Ce=ee[Te])!=null)return new G(Ce.call(ee));te="@@asyncIterator",Te="@@iterator"}throw new TypeError("Object is not async iterable")}function G(ee){function Ce(te){if(Object(te)!==te)return Promise.reject(new TypeError(te+" is not an object."));var Te=te.done;return Promise.resolve(te.value).then(function(B){return{value:B,done:Te}})}return G=function(Te){this.s=Te,this.n=Te.next},G.prototype={s:null,n:null,next:function(){return Ce(this.n.apply(this.s,arguments))},return:function(Te){var B=this.s.return;return B===void 0?Promise.resolve({value:Te,done:!0}):Ce(B.apply(this.s,arguments))},throw:function(Te){var B=this.s.return;return B===void 0?Promise.reject(Te):Ce(B.apply(this.s,arguments))}},new G(ee)}lt.exports=Ue,lt.exports.__esModule=!0,lt.exports.default=lt.exports},52092:function(lt,Ue,G){"use strict";G.d(Ue,{VW:function(){return Cs},UK:function(){return As},cM:function(){return na},pm:function(){return ea}});var ee={};G.r(ee),G.d(ee,{attentionMarkers:function(){return en},contentInitial:function(){return pt},disable:function(){return Fe},document:function(){return He},flow:function(){return gt},flowInitial:function(){return ct},insideSpan:function(){return an},string:function(){return St},text:function(){return Qt}});var Ce=G(27174),te=({className:i,style:u})=>(0,Ce.jsxs)("svg",{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",className:`lucide lucide-circle-alert ${i||""}`,style:u,children:[(0,Ce.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ce.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,Ce.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]}),Te=G(35549),B=G(21739),ce=G(1288);function ke(i){return!i||typeof i!="object"?"":"position"in i||"type"in i?ft(i.position):"start"in i||"end"in i?ft(i):"line"in i||"column"in i?Oe(i):""}function Oe(i){return ye(i&&i.line)+":"+ye(i&&i.column)}function ft(i){return Oe(i&&i.start)+"-"+Oe(i&&i.end)}function ye(i){return i&&typeof i=="number"?i:1}class M extends Error{constructor(u,d,p){const v=[null,null];let y={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof d=="string"&&(p=d,d=void 0),typeof p=="string"){const C=p.indexOf(":");C===-1?v[1]=p:(v[0]=p.slice(0,C),v[1]=p.slice(C+1))}d&&("type"in d||"position"in d?d.position&&(y=d.position):"start"in d||"end"in d?y=d:("line"in d||"column"in d)&&(y.start=d)),this.name=ke(d)||"1:1",this.message=typeof u=="object"?u.message:u,this.stack="",typeof u=="object"&&u.stack&&(this.stack=u.stack),this.reason=this.message,this.fatal,this.line=y.start.line,this.column=y.start.column,this.position=y,this.source=v[0],this.ruleId=v[1],this.file,this.actual,this.expected,this.url,this.note}}M.prototype.file="",M.prototype.name="",M.prototype.reason="",M.prototype.message="",M.prototype.stack="",M.prototype.fatal=null,M.prototype.column=null,M.prototype.line=null,M.prototype.source=null,M.prototype.ruleId=null,M.prototype.position=null;const W={basename:he,dirname:je,extname:H,join:de,sep:"/"};function he(i,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');We(i);let d=0,p=-1,v=i.length,y;if(u===void 0||u.length===0||u.length>i.length){for(;v--;)if(i.charCodeAt(v)===47){if(y){d=v+1;break}}else p<0&&(y=!0,p=v+1);return p<0?"":i.slice(d,p)}if(u===i)return"";let C=-1,T=u.length-1;for(;v--;)if(i.charCodeAt(v)===47){if(y){d=v+1;break}}else C<0&&(y=!0,C=v+1),T>-1&&(i.charCodeAt(v)===u.charCodeAt(T--)?T<0&&(p=v):(T=-1,p=C));return d===p?p=C:p<0&&(p=i.length),i.slice(d,p)}function je(i){if(We(i),i.length===0)return".";let u=-1,d=i.length,p;for(;--d;)if(i.charCodeAt(d)===47){if(p){u=d;break}}else p||(p=!0);return u<0?i.charCodeAt(0)===47?"/":".":u===1&&i.charCodeAt(0)===47?"//":i.slice(0,u)}function H(i){We(i);let u=i.length,d=-1,p=0,v=-1,y=0,C;for(;u--;){const T=i.charCodeAt(u);if(T===47){if(C){p=u+1;break}continue}d<0&&(C=!0,d=u+1),T===46?v<0?v=u:y!==1&&(y=1):v>-1&&(y=-1)}return v<0||d<0||y===0||y===1&&v===d-1&&v===p+1?"":i.slice(v,d)}function de(...i){let u=-1,d;for(;++u<i.length;)We(i[u]),i[u]&&(d=d===void 0?i[u]:d+"/"+i[u]);return d===void 0?".":ge(d)}function ge(i){We(i);const u=i.charCodeAt(0)===47;let d=Ae(i,!u);return d.length===0&&!u&&(d="."),d.length>0&&i.charCodeAt(i.length-1)===47&&(d+="/"),u?"/"+d:d}function Ae(i,u){let d="",p=0,v=-1,y=0,C=-1,T,U;for(;++C<=i.length;){if(C<i.length)T=i.charCodeAt(C);else{if(T===47)break;T=47}if(T===47){if(!(v===C-1||y===1))if(v!==C-1&&y===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){if(U=d.lastIndexOf("/"),U!==d.length-1){U<0?(d="",p=0):(d=d.slice(0,U),p=d.length-1-d.lastIndexOf("/")),v=C,y=0;continue}}else if(d.length>0){d="",p=0,v=C,y=0;continue}}u&&(d=d.length>0?d+"/..":"..",p=2)}else d.length>0?d+="/"+i.slice(v+1,C):d=i.slice(v+1,C),p=C-v-1;v=C,y=0}else T===46&&y>-1?y++:y=-1}return d}function We(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}const yt={cwd:st};function st(){return"/"}function Nt(i){return i!==null&&typeof i=="object"&&i.href&&i.origin}function tt(i){if(typeof i=="string")i=new URL(i);else if(!Nt(i)){const u=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+i+"`");throw u.code="ERR_INVALID_ARG_TYPE",u}if(i.protocol!=="file:"){const u=new TypeError("The URL must be of scheme file");throw u.code="ERR_INVALID_URL_SCHEME",u}return Ee(i)}function Ee(i){if(i.hostname!==""){const p=new TypeError('File URL host must be "localhost" or empty on darwin');throw p.code="ERR_INVALID_FILE_URL_HOST",p}const u=i.pathname;let d=-1;for(;++d<u.length;)if(u.charCodeAt(d)===37&&u.charCodeAt(d+1)===50){const p=u.charCodeAt(d+2);if(p===70||p===102){const v=new TypeError("File URL path must not include encoded / characters");throw v.code="ERR_INVALID_FILE_URL_PATH",v}}return decodeURIComponent(u)}const De=["history","path","basename","stem","extname","dirname"];class mt{constructor(u){let d;u?typeof u=="string"||Ie(u)?d={value:u}:Nt(u)?d={path:u}:d=u:d={},this.data={},this.messages=[],this.history=[],this.cwd=yt.cwd(),this.value,this.stored,this.result,this.map;let p=-1;for(;++p<De.length;){const y=De[p];y in d&&d[y]!==void 0&&d[y]!==null&&(this[y]=y==="history"?[...d[y]]:d[y])}let v;for(v in d)De.includes(v)||(this[v]=d[v])}get path(){return this.history[this.history.length-1]}set path(u){Nt(u)&&(u=tt(u)),fe(u,"path"),this.path!==u&&this.history.push(u)}get dirname(){return typeof this.path=="string"?W.dirname(this.path):void 0}set dirname(u){xe(this.basename,"dirname"),this.path=W.join(u||"",this.basename)}get basename(){return typeof this.path=="string"?W.basename(this.path):void 0}set basename(u){fe(u,"basename"),Y(u,"basename"),this.path=W.join(this.dirname||"",u)}get extname(){return typeof this.path=="string"?W.extname(this.path):void 0}set extname(u){if(Y(u,"extname"),xe(this.dirname,"extname"),u){if(u.charCodeAt(0)!==46)throw new Error("`extname` must start with `.`");if(u.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=W.join(this.dirname,this.stem+(u||""))}get stem(){return typeof this.path=="string"?W.basename(this.path,this.extname):void 0}set stem(u){fe(u,"stem"),Y(u,"stem"),this.path=W.join(this.dirname||"",u+(this.extname||""))}toString(u){return(this.value||"").toString(u||void 0)}message(u,d,p){const v=new M(u,d,p);return this.path&&(v.name=this.path+":"+v.name,v.file=this.path),v.fatal=!1,this.messages.push(v),v}info(u,d,p){const v=this.message(u,d,p);return v.fatal=null,v}fail(u,d,p){const v=this.message(u,d,p);throw v.fatal=!0,v}}function Y(i,u){if(i&&i.includes(W.sep))throw new Error("`"+u+"` cannot be a path: did not expect `"+W.sep+"`")}function fe(i,u){if(!i)throw new Error("`"+u+"` cannot be empty")}function xe(i,u){if(!i)throw new Error("Setting `"+u+"` requires `path` to be set too")}function Ie(i){return ce(i)}var nt=G(67504),Se=G(51512),Le=G(93880),ne=G(28036);const _e=Je().freeze(),Pe={}.hasOwnProperty;function Je(){const i=(0,ne.r)(),u=[];let d={},p,v=-1;return y.data=C,y.Parser=void 0,y.Compiler=void 0,y.freeze=T,y.attachers=u,y.use=U,y.parse=K,y.stringify=j,y.run=Q,y.runSync=X,y.process=$,y.processSync=ht,y;function y(){const Ke=Je();let dt=-1;for(;++dt<u.length;)Ke.use(...u[dt]);return Ke.data(Se(!0,{},d)),Ke}function C(Ke,dt){return typeof Ke=="string"?arguments.length===2?(Ze("data",p),d[Ke]=dt,y):Pe.call(d,Ke)&&d[Ke]||null:Ke?(Ze("data",p),d=Ke,y):d}function T(){if(p)return y;for(;++v<u.length;){const[Ke,...dt]=u[v];if(dt[0]===!1)continue;dt[0]===!0&&(dt[0]=void 0);const Ne=Ke.call(y,...dt);typeof Ne=="function"&&i.use(Ne)}return p=!0,v=Number.POSITIVE_INFINITY,y}function U(Ke,...dt){let Ne;if(Ze("use",p),Ke!=null)if(typeof Ke=="function")qt(Ke,...dt);else if(typeof Ke=="object")Array.isArray(Ke)?Jt(Ke):et(Ke);else throw new TypeError("Expected usable value, not `"+Ke+"`");return Ne&&(d.settings=Object.assign(d.settings||{},Ne)),y;function zt(ve){if(typeof ve=="function")qt(ve);else if(typeof ve=="object")if(Array.isArray(ve)){const[Et,...Ht]=ve;qt(Et,...Ht)}else et(ve);else throw new TypeError("Expected usable value, not `"+ve+"`")}function et(ve){Jt(ve.plugins),ve.settings&&(Ne=Object.assign(Ne||{},ve.settings))}function Jt(ve){let Et=-1;if(ve!=null)if(Array.isArray(ve))for(;++Et<ve.length;){const Ht=ve[Et];zt(Ht)}else throw new TypeError("Expected a list of plugins, not `"+ve+"`")}function qt(ve,Et){let Ht=-1,nn;for(;++Ht<u.length;)if(u[Ht][0]===ve){nn=u[Ht];break}nn?((0,Le.Z)(nn[1])&&(0,Le.Z)(Et)&&(Et=Se(!0,nn[1],Et)),nn[1]=Et):u.push([...arguments])}}function K(Ke){y.freeze();const dt=Xt(Ke),Ne=y.Parser;return Re("parse",Ne),re(Ne,"parse")?new Ne(String(dt),dt).parse():Ne(String(dt),dt)}function j(Ke,dt){y.freeze();const Ne=Xt(dt),zt=y.Compiler;return qe("stringify",zt),Lt(Ke),re(zt,"compile")?new zt(Ke,Ne).compile():zt(Ke,Ne)}function Q(Ke,dt,Ne){if(Lt(Ke),y.freeze(),!Ne&&typeof dt=="function"&&(Ne=dt,dt=void 0),!Ne)return new Promise(zt);zt(null,Ne);function zt(et,Jt){i.run(Ke,Xt(dt),qt);function qt(ve,Et,Ht){Et=Et||Ke,ve?Jt(ve):et?et(Et):Ne(null,Et,Ht)}}}function X(Ke,dt){let Ne,zt;return y.run(Ke,dt,et),Bt("runSync","run",zt),Ne;function et(Jt,qt){(0,nt.N)(Jt),Ne=qt,zt=!0}}function $(Ke,dt){if(y.freeze(),Re("process",y.Parser),qe("process",y.Compiler),!dt)return new Promise(Ne);Ne(null,dt);function Ne(zt,et){const Jt=Xt(Ke);y.run(y.parse(Jt),Jt,(ve,Et,Ht)=>{if(ve||!Et||!Ht)qt(ve);else{const nn=y.stringify(Et,Ht);nn==null||(ae(nn)?Ht.value=nn:Ht.result=nn),qt(ve,Ht)}});function qt(ve,Et){ve||!Et?et(ve):zt?zt(Et):dt(null,Et)}}}function ht(Ke){let dt;y.freeze(),Re("processSync",y.Parser),qe("processSync",y.Compiler);const Ne=Xt(Ke);return y.process(Ne,zt),Bt("processSync","process",dt),Ne;function zt(et){dt=!0,(0,nt.N)(et)}}}function re(i,u){return typeof i=="function"&&i.prototype&&(se(i.prototype)||u in i.prototype)}function se(i){let u;for(u in i)if(Pe.call(i,u))return!0;return!1}function Re(i,u){if(typeof u!="function")throw new TypeError("Cannot `"+i+"` without `Parser`")}function qe(i,u){if(typeof u!="function")throw new TypeError("Cannot `"+i+"` without `Compiler`")}function Ze(i,u){if(u)throw new Error("Cannot call `"+i+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Lt(i){if(!(0,Le.Z)(i)||typeof i.type!="string")throw new TypeError("Expected node, got `"+i+"`")}function Bt(i,u,d){if(!d)throw new Error("`"+i+"` finished async. Use `"+u+"` instead")}function Xt(i){return jt(i)?i:new mt(i)}function jt(i){return!!(i&&typeof i=="object"&&"message"in i&&"messages"in i)}function ae(i){return typeof i=="string"||ce(i)}const pe={};function Me(i,u){const d=u||pe,p=typeof d.includeImageAlt=="boolean"?d.includeImageAlt:!0,v=typeof d.includeHtml=="boolean"?d.includeHtml:!0;return me(i,p,v)}function me(i,u,d){if($e(i)){if("value"in i)return i.type==="html"&&!d?"":i.value;if(u&&"alt"in i&&i.alt)return i.alt;if("children"in i)return Ye(i.children,u,d)}return Array.isArray(i)?Ye(i,u,d):""}function Ye(i,u,d){const p=[];let v=-1;for(;++v<i.length;)p[v]=me(i[v],u,d);return p.join("")}function $e(i){return!!(i&&typeof i=="object")}function Ge(i,u,d,p){const v=i.length;let y=0,C;if(u<0?u=-u>v?0:v+u:u=u>v?v:u,d=d>0?d:0,p.length<1e4)C=Array.from(p),C.unshift(u,d),i.splice(...C);else for(d&&i.splice(u,d);y<p.length;)C=p.slice(y,y+1e4),C.unshift(u,0),i.splice(...C),y+=1e4,u+=1e4}function ot(i,u){return i.length>0?(Ge(i,i.length,0,u),i):u}const Ft={}.hasOwnProperty;function tn(i){const u={};let d=-1;for(;++d<i.length;)xt(u,i[d]);return u}function xt(i,u){let d;for(d in u){const v=(Ft.call(i,d)?i[d]:void 0)||(i[d]={}),y=u[d];let C;if(y)for(C in y){Ft.call(v,C)||(v[C]=[]);const T=y[C];rn(v[C],Array.isArray(T)?T:T?[T]:[])}}}function rn(i,u){let d=-1;const p=[];for(;++d<u.length;)(u[d].add==="after"?i:p).push(u[d]);Ge(i,0,0,p)}function En(i){const u={};let d=-1;for(;++d<i.length;)bn(u,i[d]);return u}function bn(i,u){let d;for(d in u){const v=(Ft.call(i,d)?i[d]:void 0)||(i[d]={}),y=u[d];let C;if(y)for(C in y)v[C]=y[C]}}const _n=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,bt=cn(/[A-Za-z]/),Ct=cn(/[\dA-Za-z]/),It=cn(/[#-'*+\--9=?A-Z^-~]/);function on(i){return i!==null&&(i<32||i===127)}const mn=cn(/\d/),gn=cn(/[\dA-Fa-f]/),Wt=cn(/[!-/:-@[-`{-~]/);function Xe(i){return i!==null&&i<-2}function Kt(i){return i!==null&&(i<0||i===32)}function _t(i){return i===-2||i===-1||i===32}const Tn=cn(_n),Mn=cn(/\s/);function cn(i){return u;function u(d){return d!==null&&i.test(String.fromCharCode(d))}}function Mt(i,u,d,p){const v=p?p-1:Number.POSITIVE_INFINITY;let y=0;return C;function C(U){return _t(U)?(i.enter(d),T(U)):u(U)}function T(U){return _t(U)&&y++<v?(i.consume(U),T):(i.exit(d),u(U))}}const zn={tokenize:Gt};function Gt(i){const u=i.attempt(this.parser.constructs.contentInitial,p,v);let d;return u;function p(T){if(T===null){i.consume(T);return}return i.enter("lineEnding"),i.consume(T),i.exit("lineEnding"),Mt(i,u,"linePrefix")}function v(T){return i.enter("paragraph"),y(T)}function y(T){const U=i.enter("chunkText",{contentType:"text",previous:d});return d&&(d.next=U),d=U,C(T)}function C(T){if(T===null){i.exit("chunkText"),i.exit("paragraph"),i.consume(T);return}return Xe(T)?(i.consume(T),i.exit("chunkText"),y):(i.consume(T),C)}}const dn={tokenize:Vn},fn={tokenize:Wn};function Vn(i){const u=this,d=[];let p=0,v,y,C;return T;function T(et){if(p<d.length){const Jt=d[p];return u.containerState=Jt[1],i.attempt(Jt[0].continuation,U,K)(et)}return K(et)}function U(et){if(p++,u.containerState._closeFlow){u.containerState._closeFlow=void 0,v&&zt();const Jt=u.events.length;let qt=Jt,ve;for(;qt--;)if(u.events[qt][0]==="exit"&&u.events[qt][1].type==="chunkFlow"){ve=u.events[qt][1].end;break}Ne(p);let Et=Jt;for(;Et<u.events.length;)u.events[Et][1].end=Object.assign({},ve),Et++;return Ge(u.events,qt+1,0,u.events.slice(Jt)),u.events.length=Et,K(et)}return T(et)}function K(et){if(p===d.length){if(!v)return X(et);if(v.currentConstruct&&v.currentConstruct.concrete)return ht(et);u.interrupt=!!(v.currentConstruct&&!v._gfmTableDynamicInterruptHack)}return u.containerState={},i.check(fn,j,Q)(et)}function j(et){return v&&zt(),Ne(p),X(et)}function Q(et){return u.parser.lazy[u.now().line]=p!==d.length,C=u.now().offset,ht(et)}function X(et){return u.containerState={},i.attempt(fn,$,ht)(et)}function $(et){return p++,d.push([u.currentConstruct,u.containerState]),X(et)}function ht(et){if(et===null){v&&zt(),Ne(0),i.consume(et);return}return v=v||u.parser.flow(u.now()),i.enter("chunkFlow",{contentType:"flow",previous:y,_tokenizer:v}),Ke(et)}function Ke(et){if(et===null){dt(i.exit("chunkFlow"),!0),Ne(0),i.consume(et);return}return Xe(et)?(i.consume(et),dt(i.exit("chunkFlow")),p=0,u.interrupt=void 0,T):(i.consume(et),Ke)}function dt(et,Jt){const qt=u.sliceStream(et);if(Jt&&qt.push(null),et.previous=y,y&&(y.next=et),y=et,v.defineSkip(et.start),v.write(qt),u.parser.lazy[et.start.line]){let ve=v.events.length;for(;ve--;)if(v.events[ve][1].start.offset<C&&(!v.events[ve][1].end||v.events[ve][1].end.offset>C))return;const Et=u.events.length;let Ht=Et,nn,Ln;for(;Ht--;)if(u.events[Ht][0]==="exit"&&u.events[Ht][1].type==="chunkFlow"){if(nn){Ln=u.events[Ht][1].end;break}nn=!0}for(Ne(p),ve=Et;ve<u.events.length;)u.events[ve][1].end=Object.assign({},Ln),ve++;Ge(u.events,Ht+1,0,u.events.slice(Et)),u.events.length=ve}}function Ne(et){let Jt=d.length;for(;Jt-- >et;){const qt=d[Jt];u.containerState=qt[1],qt[0].exit.call(u,i)}d.length=et}function zt(){v.write([null]),y=void 0,v=void 0,u.containerState._closeFlow=void 0}}function Wn(i,u,d){return Mt(i,i.attempt(this.parser.constructs.document,u,d),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const vn={tokenize:yn,partial:!0};function yn(i,u,d){return p;function p(y){return _t(y)?Mt(i,v,"linePrefix")(y):v(y)}function v(y){return y===null||Xe(y)?u(y):d(y)}}function kn(i){const u={};let d=-1,p,v,y,C,T,U,K;for(;++d<i.length;){for(;d in u;)d=u[d];if(p=i[d],d&&p[1].type==="chunkFlow"&&i[d-1][1].type==="listItemPrefix"&&(U=p[1]._tokenizer.events,y=0,y<U.length&&U[y][1].type==="lineEndingBlank"&&(y+=2),y<U.length&&U[y][1].type==="content"))for(;++y<U.length&&U[y][1].type!=="content";)U[y][1].type==="chunkText"&&(U[y][1]._isInFirstContentOfListItem=!0,y++);if(p[0]==="enter")p[1].contentType&&(Object.assign(u,An(i,d)),d=u[d],K=!0);else if(p[1]._container){for(y=d,v=void 0;y--&&(C=i[y],C[1].type==="lineEnding"||C[1].type==="lineEndingBlank");)C[0]==="enter"&&(v&&(i[v][1].type="lineEndingBlank"),C[1].type="lineEnding",v=y);v&&(p[1].end=Object.assign({},i[v][1].start),T=i.slice(v,d),T.unshift(p),Ge(i,v,d-v+1,T))}}return!K}function An(i,u){const d=i[u][1],p=i[u][2];let v=u-1;const y=[],C=d._tokenizer||p.parser[d.contentType](d.start),T=C.events,U=[],K={};let j,Q,X=-1,$=d,ht=0,Ke=0;const dt=[Ke];for(;$;){for(;i[++v][1]!==$;);y.push(v),$._tokenizer||(j=p.sliceStream($),$.next||j.push(null),Q&&C.defineSkip($.start),$._isInFirstContentOfListItem&&(C._gfmTasklistFirstContentOfListItem=!0),C.write(j),$._isInFirstContentOfListItem&&(C._gfmTasklistFirstContentOfListItem=void 0)),Q=$,$=$.next}for($=d;++X<T.length;)T[X][0]==="exit"&&T[X-1][0]==="enter"&&T[X][1].type===T[X-1][1].type&&T[X][1].start.line!==T[X][1].end.line&&(Ke=X+1,dt.push(Ke),$._tokenizer=void 0,$.previous=void 0,$=$.next);for(C.events=[],$?($._tokenizer=void 0,$.previous=void 0):dt.pop(),X=dt.length;X--;){const Ne=T.slice(dt[X],dt[X+1]),zt=y.pop();U.unshift([zt,zt+Ne.length-1]),Ge(i,zt,2,Ne)}for(X=-1;++X<U.length;)K[ht+U[X][0]]=ht+U[X][1],ht+=U[X][1]-U[X][0]-1;return K}const Nn={tokenize:Qn,resolve:Gn},$n={tokenize:Zn,partial:!0};function Gn(i){return kn(i),i}function Qn(i,u){let d;return p;function p(T){return i.enter("content"),d=i.enter("chunkContent",{contentType:"content"}),v(T)}function v(T){return T===null?y(T):Xe(T)?i.check($n,C,y)(T):(i.consume(T),v)}function y(T){return i.exit("chunkContent"),i.exit("content"),u(T)}function C(T){return i.consume(T),i.exit("chunkContent"),d.next=i.enter("chunkContent",{contentType:"content",previous:d}),d=d.next,v}}function Zn(i,u,d){const p=this;return v;function v(C){return i.exit("chunkContent"),i.enter("lineEnding"),i.consume(C),i.exit("lineEnding"),Mt(i,y,"linePrefix")}function y(C){if(C===null||Xe(C))return d(C);const T=p.events[p.events.length-1];return!p.parser.constructs.disable.null.includes("codeIndented")&&T&&T[1].type==="linePrefix"&&T[2].sliceSerialize(T[1],!0).length>=4?u(C):i.interrupt(p.parser.constructs.flow,d,u)(C)}}const mr={tokenize:jn};function jn(i){const u=this,d=i.attempt(vn,p,i.attempt(this.parser.constructs.flowInitial,v,Mt(i,i.attempt(this.parser.constructs.flow,v,i.attempt(Nn,v)),"linePrefix")));return d;function p(y){if(y===null){i.consume(y);return}return i.enter("lineEndingBlank"),i.consume(y),i.exit("lineEndingBlank"),u.currentConstruct=void 0,d}function v(y){if(y===null){i.consume(y);return}return i.enter("lineEnding"),i.consume(y),i.exit("lineEnding"),u.currentConstruct=void 0,d}}const un={resolveAll:pn()},Rn=Vt("string"),xn=Vt("text");function Vt(i){return{tokenize:u,resolveAll:pn(i==="text"?at:void 0)};function u(d){const p=this,v=this.parser.constructs[i],y=d.attempt(v,C,T);return C;function C(j){return K(j)?y(j):T(j)}function T(j){if(j===null){d.consume(j);return}return d.enter("data"),d.consume(j),U}function U(j){return K(j)?(d.exit("data"),y(j)):(d.consume(j),U)}function K(j){if(j===null)return!0;const Q=v[j];let X=-1;if(Q)for(;++X<Q.length;){const $=Q[X];if(!$.previous||$.previous.call(p,p.previous))return!0}return!1}}}function pn(i){return u;function u(d,p){let v=-1,y;for(;++v<=d.length;)y===void 0?d[v]&&d[v][1].type==="data"&&(y=v,v++):(!d[v]||d[v][1].type!=="data")&&(v!==y+2&&(d[y][1].end=d[v-1][1].end,d.splice(y+2,v-y-2),v=y+2),y=void 0);return i?i(d,p):d}}function at(i,u){let d=0;for(;++d<=i.length;)if((d===i.length||i[d][1].type==="lineEnding")&&i[d-1][1].type==="data"){const p=i[d-1][1],v=u.sliceStream(p);let y=v.length,C=-1,T=0,U;for(;y--;){const K=v[y];if(typeof K=="string"){for(C=K.length;K.charCodeAt(C-1)===32;)T++,C--;if(C)break;C=-1}else if(K===-2)U=!0,T++;else if(K!==-1){y++;break}}if(T){const K={type:d===i.length||U||T<2?"lineSuffix":"hardBreakTrailing",start:{line:p.end.line,column:p.end.column-T,offset:p.end.offset-T,_index:p.start._index+y,_bufferIndex:y?C:p.start._bufferIndex+C},end:Object.assign({},p.end)};p.end=Object.assign({},K.start),p.start.offset===p.end.offset?Object.assign(p,K):(i.splice(d,0,["enter",K,u],["exit",K,u]),d+=2)}d++}return i}function Dt(i,u,d){const p=[];let v=-1;for(;++v<i.length;){const y=i[v].resolveAll;y&&!p.includes(y)&&(u=y(u,d),p.push(y))}return u}function Ut(i,u,d){let p=Object.assign(d?Object.assign({},d):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const v={},y=[];let C=[],T=[],U=!0;const K={consume:Jt,enter:qt,exit:ve,attempt:nn(Et),check:nn(Ht),interrupt:nn(Ht,{interrupt:!0})},j={previous:null,code:null,containerState:{},events:[],parser:i,sliceStream:Ke,sliceSerialize:ht,now:dt,defineSkip:Ne,write:$};let Q=u.tokenize.call(j,K),X;return u.resolveAll&&y.push(u),j;function $(vt){return C=ot(C,vt),zt(),C[C.length-1]!==null?[]:(Ln(u,0),j.events=Dt(y,j.events,j),j.events)}function ht(vt,Zt){return Xn(Ke(vt),Zt)}function Ke(vt){return Un(C,vt)}function dt(){const{line:vt,column:Zt,offset:$t,_index:Sn,_bufferIndex:On}=p;return{line:vt,column:Zt,offset:$t,_index:Sn,_bufferIndex:On}}function Ne(vt){v[vt.line]=vt.column,Yt()}function zt(){let vt;for(;p._index<C.length;){const Zt=C[p._index];if(typeof Zt=="string")for(vt=p._index,p._bufferIndex<0&&(p._bufferIndex=0);p._index===vt&&p._bufferIndex<Zt.length;)et(Zt.charCodeAt(p._bufferIndex));else et(Zt)}}function et(vt){U=void 0,X=vt,Q=Q(vt)}function Jt(vt){Xe(vt)?(p.line++,p.column=1,p.offset+=vt===-3?2:1,Yt()):vt!==-1&&(p.column++,p.offset++),p._bufferIndex<0?p._index++:(p._bufferIndex++,p._bufferIndex===C[p._index].length&&(p._bufferIndex=-1,p._index++)),j.previous=vt,U=!0}function qt(vt,Zt){const $t=Zt||{};return $t.type=vt,$t.start=dt(),j.events.push(["enter",$t,j]),T.push($t),$t}function ve(vt){const Zt=T.pop();return Zt.end=dt(),j.events.push(["exit",Zt,j]),Zt}function Et(vt,Zt){Ln(vt,Zt.from)}function Ht(vt,Zt){Zt.restore()}function nn(vt,Zt){return $t;function $t(Sn,On,nr){let sr,V,Yn,dr;return Array.isArray(Sn)?Hn(Sn):"tokenize"in Sn?Hn([Sn]):Z(Sn);function Z(Pn){return Qr;function Qr(fr){const Lr=fr!==null&&Pn[fr],Or=fr!==null&&Pn.null,Ii=[...Array.isArray(Lr)?Lr:Lr?[Lr]:[],...Array.isArray(Or)?Or:Or?[Or]:[]];return Hn(Ii)(fr)}}function Hn(Pn){return sr=Pn,V=0,Pn.length===0?nr:Dr(Pn[V])}function Dr(Pn){return Qr;function Qr(fr){return dr=Cn(),Yn=Pn,Pn.partial||(j.currentConstruct=Pn),Pn.name&&j.parser.constructs.disable.null.includes(Pn.name)?Hr(fr):Pn.tokenize.call(Zt?Object.assign(Object.create(j),Zt):j,K,Ci,Hr)(fr)}}function Ci(Pn){return U=!0,vt(Yn,dr),On}function Hr(Pn){return U=!0,dr.restore(),++V<sr.length?Dr(sr[V]):nr}}}function Ln(vt,Zt){vt.resolveAll&&!y.includes(vt)&&y.push(vt),vt.resolve&&Ge(j.events,Zt,j.events.length-Zt,vt.resolve(j.events.slice(Zt),j)),vt.resolveTo&&(j.events=vt.resolveTo(j.events,j))}function Cn(){const vt=dt(),Zt=j.previous,$t=j.currentConstruct,Sn=j.events.length,On=Array.from(T);return{restore:nr,from:Sn};function nr(){p=vt,j.previous=Zt,j.currentConstruct=$t,j.events.length=Sn,T=On,Yt()}}function Yt(){p.line in v&&p.column<2&&(p.column=v[p.line],p.offset+=v[p.line]-1)}}function Un(i,u){const d=u.start._index,p=u.start._bufferIndex,v=u.end._index,y=u.end._bufferIndex;let C;if(d===v)C=[i[d].slice(p,y)];else{if(C=i.slice(d,v),p>-1){const T=C[0];typeof T=="string"?C[0]=T.slice(p):C.shift()}y>0&&C.push(i[v].slice(0,y))}return C}function Xn(i,u){let d=-1;const p=[];let v;for(;++d<i.length;){const y=i[d];let C;if(typeof y=="string")C=y;else switch(y){case-5:{C="\r";break}case-4:{C=`
3
+ `;break}case-3:{C=`\r
4
+ `;break}case-2:{C=u?" ":" ";break}case-1:{if(!u&&v)continue;C=" ";break}default:C=String.fromCharCode(y)}v=y===-2,p.push(C)}return p.join("")}const er={name:"thematicBreak",tokenize:wr};function wr(i,u,d){let p=0,v;return y;function y(K){return i.enter("thematicBreak"),C(K)}function C(K){return v=K,T(K)}function T(K){return K===v?(i.enter("thematicBreakSequence"),U(K)):p>=3&&(K===null||Xe(K))?(i.exit("thematicBreak"),u(K)):d(K)}function U(K){return K===v?(i.consume(K),p++,U):(i.exit("thematicBreakSequence"),_t(K)?Mt(i,T,"whitespace")(K):T(K))}}const hn={name:"list",tokenize:or,continuation:{tokenize:Jn},exit:tr},Nr={tokenize:kt,partial:!0},gr={tokenize:vr,partial:!0};function or(i,u,d){const p=this,v=p.events[p.events.length-1];let y=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,C=0;return T;function T($){const ht=p.containerState.type||($===42||$===43||$===45?"listUnordered":"listOrdered");if(ht==="listUnordered"?!p.containerState.marker||$===p.containerState.marker:mn($)){if(p.containerState.type||(p.containerState.type=ht,i.enter(ht,{_container:!0})),ht==="listUnordered")return i.enter("listItemPrefix"),$===42||$===45?i.check(er,d,K)($):K($);if(!p.interrupt||$===49)return i.enter("listItemPrefix"),i.enter("listItemValue"),U($)}return d($)}function U($){return mn($)&&++C<10?(i.consume($),U):(!p.interrupt||C<2)&&(p.containerState.marker?$===p.containerState.marker:$===41||$===46)?(i.exit("listItemValue"),K($)):d($)}function K($){return i.enter("listItemMarker"),i.consume($),i.exit("listItemMarker"),p.containerState.marker=p.containerState.marker||$,i.check(vn,p.interrupt?d:j,i.attempt(Nr,X,Q))}function j($){return p.containerState.initialBlankLine=!0,y++,X($)}function Q($){return _t($)?(i.enter("listItemPrefixWhitespace"),i.consume($),i.exit("listItemPrefixWhitespace"),X):d($)}function X($){return p.containerState.size=y+p.sliceSerialize(i.exit("listItemPrefix"),!0).length,u($)}}function Jn(i,u,d){const p=this;return p.containerState._closeFlow=void 0,i.check(vn,v,y);function v(T){return p.containerState.furtherBlankLines=p.containerState.furtherBlankLines||p.containerState.initialBlankLine,Mt(i,u,"listItemIndent",p.containerState.size+1)(T)}function y(T){return p.containerState.furtherBlankLines||!_t(T)?(p.containerState.furtherBlankLines=void 0,p.containerState.initialBlankLine=void 0,C(T)):(p.containerState.furtherBlankLines=void 0,p.containerState.initialBlankLine=void 0,i.attempt(gr,u,C)(T))}function C(T){return p.containerState._closeFlow=!0,p.interrupt=void 0,Mt(i,i.attempt(hn,u,d),"linePrefix",p.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T)}}function vr(i,u,d){const p=this;return Mt(i,v,"listItemIndent",p.containerState.size+1);function v(y){const C=p.events[p.events.length-1];return C&&C[1].type==="listItemIndent"&&C[2].sliceSerialize(C[1],!0).length===p.containerState.size?u(y):d(y)}}function tr(i){i.exit(this.containerState.type)}function kt(i,u,d){const p=this;return Mt(i,v,"listItemPrefixWhitespace",p.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function v(y){const C=p.events[p.events.length-1];return!_t(y)&&C&&C[1].type==="listItemPrefixWhitespace"?u(y):d(y)}}const Rt={name:"blockQuote",tokenize:Pt,continuation:{tokenize:qn},exit:Dn};function Pt(i,u,d){const p=this;return v;function v(C){if(C===62){const T=p.containerState;return T.open||(i.enter("blockQuote",{_container:!0}),T.open=!0),i.enter("blockQuotePrefix"),i.enter("blockQuoteMarker"),i.consume(C),i.exit("blockQuoteMarker"),y}return d(C)}function y(C){return _t(C)?(i.enter("blockQuotePrefixWhitespace"),i.consume(C),i.exit("blockQuotePrefixWhitespace"),i.exit("blockQuotePrefix"),u):(i.exit("blockQuotePrefix"),u(C))}}function qn(i,u,d){const p=this;return v;function v(C){return _t(C)?Mt(i,y,"linePrefix",p.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):y(C)}function y(C){return i.attempt(Rt,u,d)(C)}}function Dn(i){i.exit("blockQuote")}function Sr(i,u,d,p,v,y,C,T,U){const K=U||Number.POSITIVE_INFINITY;let j=0;return Q;function Q(Ne){return Ne===60?(i.enter(p),i.enter(v),i.enter(y),i.consume(Ne),i.exit(y),X):Ne===null||Ne===32||Ne===41||on(Ne)?d(Ne):(i.enter(p),i.enter(C),i.enter(T),i.enter("chunkString",{contentType:"string"}),Ke(Ne))}function X(Ne){return Ne===62?(i.enter(y),i.consume(Ne),i.exit(y),i.exit(v),i.exit(p),u):(i.enter(T),i.enter("chunkString",{contentType:"string"}),$(Ne))}function $(Ne){return Ne===62?(i.exit("chunkString"),i.exit(T),X(Ne)):Ne===null||Ne===60||Xe(Ne)?d(Ne):(i.consume(Ne),Ne===92?ht:$)}function ht(Ne){return Ne===60||Ne===62||Ne===92?(i.consume(Ne),$):$(Ne)}function Ke(Ne){return!j&&(Ne===null||Ne===41||Kt(Ne))?(i.exit("chunkString"),i.exit(T),i.exit(C),i.exit(p),u(Ne)):j<K&&Ne===40?(i.consume(Ne),j++,Ke):Ne===41?(i.consume(Ne),j--,Ke):Ne===null||Ne===32||Ne===40||on(Ne)?d(Ne):(i.consume(Ne),Ne===92?dt:Ke)}function dt(Ne){return Ne===40||Ne===41||Ne===92?(i.consume(Ne),Ke):Ke(Ne)}}function Ur(i,u,d,p,v,y){const C=this;let T=0,U;return K;function K($){return i.enter(p),i.enter(v),i.consume($),i.exit(v),i.enter(y),j}function j($){return T>999||$===null||$===91||$===93&&!U||$===94&&!T&&"_hiddenFootnoteSupport"in C.parser.constructs?d($):$===93?(i.exit(y),i.enter(v),i.consume($),i.exit(v),i.exit(p),u):Xe($)?(i.enter("lineEnding"),i.consume($),i.exit("lineEnding"),j):(i.enter("chunkString",{contentType:"string"}),Q($))}function Q($){return $===null||$===91||$===93||Xe($)||T++>999?(i.exit("chunkString"),j($)):(i.consume($),U||(U=!_t($)),$===92?X:Q)}function X($){return $===91||$===92||$===93?(i.consume($),T++,Q):Q($)}}function Br(i,u,d,p,v,y){let C;return T;function T(X){return X===34||X===39||X===40?(i.enter(p),i.enter(v),i.consume(X),i.exit(v),C=X===40?41:X,U):d(X)}function U(X){return X===C?(i.enter(v),i.consume(X),i.exit(v),i.exit(p),u):(i.enter(y),K(X))}function K(X){return X===C?(i.exit(y),U(C)):X===null?d(X):Xe(X)?(i.enter("lineEnding"),i.consume(X),i.exit("lineEnding"),Mt(i,K,"linePrefix")):(i.enter("chunkString",{contentType:"string"}),j(X))}function j(X){return X===C||X===null||Xe(X)?(i.exit("chunkString"),K(X)):(i.consume(X),X===92?Q:j)}function Q(X){return X===C||X===92?(i.consume(X),j):j(X)}}function ur(i,u){let d;return p;function p(v){return Xe(v)?(i.enter("lineEnding"),i.consume(v),i.exit("lineEnding"),d=!0,p):_t(v)?Mt(i,p,d?"linePrefix":"lineSuffix")(v):u(v)}}function ir(i){return i.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Er={name:"definition",tokenize:zr},Tr={tokenize:Vr,partial:!0};function zr(i,u,d){const p=this;let v;return y;function y($){return i.enter("definition"),C($)}function C($){return Ur.call(p,i,T,d,"definitionLabel","definitionLabelMarker","definitionLabelString")($)}function T($){return v=ir(p.sliceSerialize(p.events[p.events.length-1][1]).slice(1,-1)),$===58?(i.enter("definitionMarker"),i.consume($),i.exit("definitionMarker"),U):d($)}function U($){return Kt($)?ur(i,K)($):K($)}function K($){return Sr(i,j,d,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")($)}function j($){return i.attempt(Tr,Q,Q)($)}function Q($){return _t($)?Mt(i,X,"whitespace")($):X($)}function X($){return $===null||Xe($)?(i.exit("definition"),p.parser.defined.push(v),u($)):d($)}}function Vr(i,u,d){return p;function p(T){return Kt(T)?ur(i,v)(T):d(T)}function v(T){return Br(i,y,d,"definitionTitle","definitionTitleMarker","definitionTitleString")(T)}function y(T){return _t(T)?Mt(i,C,"whitespace")(T):C(T)}function C(T){return T===null||Xe(T)?u(T):d(T)}}const yr={name:"codeIndented",tokenize:fi},$r={tokenize:Rr,partial:!0};function fi(i,u,d){const p=this;return v;function v(K){return i.enter("codeIndented"),Mt(i,y,"linePrefix",5)(K)}function y(K){const j=p.events[p.events.length-1];return j&&j[1].type==="linePrefix"&&j[2].sliceSerialize(j[1],!0).length>=4?C(K):d(K)}function C(K){return K===null?U(K):Xe(K)?i.attempt($r,C,U)(K):(i.enter("codeFlowValue"),T(K))}function T(K){return K===null||Xe(K)?(i.exit("codeFlowValue"),C(K)):(i.consume(K),T)}function U(K){return i.exit("codeIndented"),u(K)}}function Rr(i,u,d){const p=this;return v;function v(C){return p.parser.lazy[p.now().line]?d(C):Xe(C)?(i.enter("lineEnding"),i.consume(C),i.exit("lineEnding"),v):Mt(i,y,"linePrefix",5)(C)}function y(C){const T=p.events[p.events.length-1];return T&&T[1].type==="linePrefix"&&T[2].sliceSerialize(T[1],!0).length>=4?u(C):Xe(C)?v(C):d(C)}}const Cr={name:"headingAtx",tokenize:Xr,resolve:Yr};function Yr(i,u){let d=i.length-2,p=3,v,y;return i[p][1].type==="whitespace"&&(p+=2),d-2>p&&i[d][1].type==="whitespace"&&(d-=2),i[d][1].type==="atxHeadingSequence"&&(p===d-1||d-4>p&&i[d-2][1].type==="whitespace")&&(d-=p+1===d?2:4),d>p&&(v={type:"atxHeadingText",start:i[p][1].start,end:i[d][1].end},y={type:"chunkText",start:i[p][1].start,end:i[d][1].end,contentType:"text"},Ge(i,p,d-p+1,[["enter",v,u],["enter",y,u],["exit",y,u],["exit",v,u]])),i}function Xr(i,u,d){let p=0;return v;function v(j){return i.enter("atxHeading"),y(j)}function y(j){return i.enter("atxHeadingSequence"),C(j)}function C(j){return j===35&&p++<6?(i.consume(j),C):j===null||Kt(j)?(i.exit("atxHeadingSequence"),T(j)):d(j)}function T(j){return j===35?(i.enter("atxHeadingSequence"),U(j)):j===null||Xe(j)?(i.exit("atxHeading"),u(j)):_t(j)?Mt(i,T,"whitespace")(j):(i.enter("atxHeadingText"),K(j))}function U(j){return j===35?(i.consume(j),U):(i.exit("atxHeadingSequence"),T(j))}function K(j){return j===null||j===35||Kt(j)?(i.exit("atxHeadingText"),T(j)):(i.consume(j),K)}}const Zr={name:"setextUnderline",tokenize:ti,resolveTo:ei};function ei(i,u){let d=i.length,p,v,y;for(;d--;)if(i[d][0]==="enter"){if(i[d][1].type==="content"){p=d;break}i[d][1].type==="paragraph"&&(v=d)}else i[d][1].type==="content"&&i.splice(d,1),!y&&i[d][1].type==="definition"&&(y=d);const C={type:"setextHeading",start:Object.assign({},i[v][1].start),end:Object.assign({},i[i.length-1][1].end)};return i[v][1].type="setextHeadingText",y?(i.splice(v,0,["enter",C,u]),i.splice(y+1,0,["exit",i[p][1],u]),i[p][1].end=Object.assign({},i[y][1].end)):i[p][1]=C,i.push(["exit",C,u]),i}function ti(i,u,d){const p=this;let v;return y;function y(K){let j=p.events.length,Q;for(;j--;)if(p.events[j][1].type!=="lineEnding"&&p.events[j][1].type!=="linePrefix"&&p.events[j][1].type!=="content"){Q=p.events[j][1].type==="paragraph";break}return!p.parser.lazy[p.now().line]&&(p.interrupt||Q)?(i.enter("setextHeadingLine"),v=K,C(K)):d(K)}function C(K){return i.enter("setextHeadingLineSequence"),T(K)}function T(K){return K===v?(i.consume(K),T):(i.exit("setextHeadingLineSequence"),_t(K)?Mt(i,U,"lineSuffix")(K):U(K))}function U(K){return K===null||Xe(K)?(i.exit("setextHeadingLine"),u(K)):d(K)}}const ni=["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"],Kr=["pre","script","style","textarea"],ri={name:"htmlFlow",tokenize:Pr,resolveTo:Wr,concrete:!0},ii={tokenize:Fr,partial:!0},ai={tokenize:Ir,partial:!0};function Wr(i){let u=i.length;for(;u--&&!(i[u][0]==="enter"&&i[u][1].type==="htmlFlow"););return u>1&&i[u-2][1].type==="linePrefix"&&(i[u][1].start=i[u-2][1].start,i[u+1][1].start=i[u-2][1].start,i.splice(u-2,2)),i}function Pr(i,u,d){const p=this;let v,y,C,T,U;return K;function K(Z){return j(Z)}function j(Z){return i.enter("htmlFlow"),i.enter("htmlFlowData"),i.consume(Z),Q}function Q(Z){return Z===33?(i.consume(Z),X):Z===47?(i.consume(Z),y=!0,Ke):Z===63?(i.consume(Z),v=3,p.interrupt?u:V):bt(Z)?(i.consume(Z),C=String.fromCharCode(Z),dt):d(Z)}function X(Z){return Z===45?(i.consume(Z),v=2,$):Z===91?(i.consume(Z),v=5,T=0,ht):bt(Z)?(i.consume(Z),v=4,p.interrupt?u:V):d(Z)}function $(Z){return Z===45?(i.consume(Z),p.interrupt?u:V):d(Z)}function ht(Z){const Hn="CDATA[";return Z===Hn.charCodeAt(T++)?(i.consume(Z),T===Hn.length?p.interrupt?u:Yt:ht):d(Z)}function Ke(Z){return bt(Z)?(i.consume(Z),C=String.fromCharCode(Z),dt):d(Z)}function dt(Z){if(Z===null||Z===47||Z===62||Kt(Z)){const Hn=Z===47,Dr=C.toLowerCase();return!Hn&&!y&&Kr.includes(Dr)?(v=1,p.interrupt?u(Z):Yt(Z)):ni.includes(C.toLowerCase())?(v=6,Hn?(i.consume(Z),Ne):p.interrupt?u(Z):Yt(Z)):(v=7,p.interrupt&&!p.parser.lazy[p.now().line]?d(Z):y?zt(Z):et(Z))}return Z===45||Ct(Z)?(i.consume(Z),C+=String.fromCharCode(Z),dt):d(Z)}function Ne(Z){return Z===62?(i.consume(Z),p.interrupt?u:Yt):d(Z)}function zt(Z){return _t(Z)?(i.consume(Z),zt):Ln(Z)}function et(Z){return Z===47?(i.consume(Z),Ln):Z===58||Z===95||bt(Z)?(i.consume(Z),Jt):_t(Z)?(i.consume(Z),et):Ln(Z)}function Jt(Z){return Z===45||Z===46||Z===58||Z===95||Ct(Z)?(i.consume(Z),Jt):qt(Z)}function qt(Z){return Z===61?(i.consume(Z),ve):_t(Z)?(i.consume(Z),qt):et(Z)}function ve(Z){return Z===null||Z===60||Z===61||Z===62||Z===96?d(Z):Z===34||Z===39?(i.consume(Z),U=Z,Et):_t(Z)?(i.consume(Z),ve):Ht(Z)}function Et(Z){return Z===U?(i.consume(Z),U=null,nn):Z===null||Xe(Z)?d(Z):(i.consume(Z),Et)}function Ht(Z){return Z===null||Z===34||Z===39||Z===47||Z===60||Z===61||Z===62||Z===96||Kt(Z)?qt(Z):(i.consume(Z),Ht)}function nn(Z){return Z===47||Z===62||_t(Z)?et(Z):d(Z)}function Ln(Z){return Z===62?(i.consume(Z),Cn):d(Z)}function Cn(Z){return Z===null||Xe(Z)?Yt(Z):_t(Z)?(i.consume(Z),Cn):d(Z)}function Yt(Z){return Z===45&&v===2?(i.consume(Z),Sn):Z===60&&v===1?(i.consume(Z),On):Z===62&&v===4?(i.consume(Z),Yn):Z===63&&v===3?(i.consume(Z),V):Z===93&&v===5?(i.consume(Z),sr):Xe(Z)&&(v===6||v===7)?(i.exit("htmlFlowData"),i.check(ii,dr,vt)(Z)):Z===null||Xe(Z)?(i.exit("htmlFlowData"),vt(Z)):(i.consume(Z),Yt)}function vt(Z){return i.check(ai,Zt,dr)(Z)}function Zt(Z){return i.enter("lineEnding"),i.consume(Z),i.exit("lineEnding"),$t}function $t(Z){return Z===null||Xe(Z)?vt(Z):(i.enter("htmlFlowData"),Yt(Z))}function Sn(Z){return Z===45?(i.consume(Z),V):Yt(Z)}function On(Z){return Z===47?(i.consume(Z),C="",nr):Yt(Z)}function nr(Z){if(Z===62){const Hn=C.toLowerCase();return Kr.includes(Hn)?(i.consume(Z),Yn):Yt(Z)}return bt(Z)&&C.length<8?(i.consume(Z),C+=String.fromCharCode(Z),nr):Yt(Z)}function sr(Z){return Z===93?(i.consume(Z),V):Yt(Z)}function V(Z){return Z===62?(i.consume(Z),Yn):Z===45&&v===2?(i.consume(Z),V):Yt(Z)}function Yn(Z){return Z===null||Xe(Z)?(i.exit("htmlFlowData"),dr(Z)):(i.consume(Z),Yn)}function dr(Z){return i.exit("htmlFlow"),u(Z)}}function Ir(i,u,d){const p=this;return v;function v(C){return Xe(C)?(i.enter("lineEnding"),i.consume(C),i.exit("lineEnding"),y):d(C)}function y(C){return p.parser.lazy[p.now().line]?d(C):u(C)}}function Fr(i,u,d){return p;function p(v){return i.enter("lineEnding"),i.consume(v),i.exit("lineEnding"),i.attempt(vn,u,d)}}const S={tokenize:A,partial:!0},l={name:"codeFenced",tokenize:h,concrete:!0};function h(i,u,d){const p=this,v={tokenize:qt,partial:!0};let y=0,C=0,T;return U;function U(ve){return K(ve)}function K(ve){const Et=p.events[p.events.length-1];return y=Et&&Et[1].type==="linePrefix"?Et[2].sliceSerialize(Et[1],!0).length:0,T=ve,i.enter("codeFenced"),i.enter("codeFencedFence"),i.enter("codeFencedFenceSequence"),j(ve)}function j(ve){return ve===T?(C++,i.consume(ve),j):C<3?d(ve):(i.exit("codeFencedFenceSequence"),_t(ve)?Mt(i,Q,"whitespace")(ve):Q(ve))}function Q(ve){return ve===null||Xe(ve)?(i.exit("codeFencedFence"),p.interrupt?u(ve):i.check(S,Ke,Jt)(ve)):(i.enter("codeFencedFenceInfo"),i.enter("chunkString",{contentType:"string"}),X(ve))}function X(ve){return ve===null||Xe(ve)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),Q(ve)):_t(ve)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),Mt(i,$,"whitespace")(ve)):ve===96&&ve===T?d(ve):(i.consume(ve),X)}function $(ve){return ve===null||Xe(ve)?Q(ve):(i.enter("codeFencedFenceMeta"),i.enter("chunkString",{contentType:"string"}),ht(ve))}function ht(ve){return ve===null||Xe(ve)?(i.exit("chunkString"),i.exit("codeFencedFenceMeta"),Q(ve)):ve===96&&ve===T?d(ve):(i.consume(ve),ht)}function Ke(ve){return i.attempt(v,Jt,dt)(ve)}function dt(ve){return i.enter("lineEnding"),i.consume(ve),i.exit("lineEnding"),Ne}function Ne(ve){return y>0&&_t(ve)?Mt(i,zt,"linePrefix",y+1)(ve):zt(ve)}function zt(ve){return ve===null||Xe(ve)?i.check(S,Ke,Jt)(ve):(i.enter("codeFlowValue"),et(ve))}function et(ve){return ve===null||Xe(ve)?(i.exit("codeFlowValue"),zt(ve)):(i.consume(ve),et)}function Jt(ve){return i.exit("codeFenced"),u(ve)}function qt(ve,Et,Ht){let nn=0;return Ln;function Ln($t){return ve.enter("lineEnding"),ve.consume($t),ve.exit("lineEnding"),Cn}function Cn($t){return ve.enter("codeFencedFence"),_t($t)?Mt(ve,Yt,"linePrefix",p.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($t):Yt($t)}function Yt($t){return $t===T?(ve.enter("codeFencedFenceSequence"),vt($t)):Ht($t)}function vt($t){return $t===T?(nn++,ve.consume($t),vt):nn>=C?(ve.exit("codeFencedFenceSequence"),_t($t)?Mt(ve,Zt,"whitespace")($t):Zt($t)):Ht($t)}function Zt($t){return $t===null||Xe($t)?(ve.exit("codeFencedFence"),Et($t)):Ht($t)}}}function A(i,u,d){const p=this;return v;function v(C){return C===null?d(C):(i.enter("lineEnding"),i.consume(C),i.exit("lineEnding"),y)}function y(C){return p.parser.lazy[p.now().line]?d(C):u(C)}}var R=G(19713);const P={name:"characterReference",tokenize:oe};function oe(i,u,d){const p=this;let v=0,y,C;return T;function T(Q){return i.enter("characterReference"),i.enter("characterReferenceMarker"),i.consume(Q),i.exit("characterReferenceMarker"),U}function U(Q){return Q===35?(i.enter("characterReferenceMarkerNumeric"),i.consume(Q),i.exit("characterReferenceMarkerNumeric"),K):(i.enter("characterReferenceValue"),y=31,C=Ct,j(Q))}function K(Q){return Q===88||Q===120?(i.enter("characterReferenceMarkerHexadecimal"),i.consume(Q),i.exit("characterReferenceMarkerHexadecimal"),i.enter("characterReferenceValue"),y=6,C=gn,j):(i.enter("characterReferenceValue"),y=7,C=mn,j(Q))}function j(Q){if(Q===59&&v){const X=i.exit("characterReferenceValue");return C===Ct&&!(0,R.T)(p.sliceSerialize(X))?d(Q):(i.enter("characterReferenceMarker"),i.consume(Q),i.exit("characterReferenceMarker"),i.exit("characterReference"),u)}return C(Q)&&v++<y?(i.consume(Q),j):d(Q)}}const le={name:"characterEscape",tokenize:Be};function Be(i,u,d){return p;function p(y){return i.enter("characterEscape"),i.enter("escapeMarker"),i.consume(y),i.exit("escapeMarker"),v}function v(y){return Wt(y)?(i.enter("characterEscapeValue"),i.consume(y),i.exit("characterEscapeValue"),i.exit("characterEscape"),u):d(y)}}const Ve={name:"lineEnding",tokenize:wt};function wt(i,u){return d;function d(p){return i.enter("lineEnding"),i.consume(p),i.exit("lineEnding"),Mt(i,u,"linePrefix")}}const wn={name:"labelEnd",tokenize:Ri,resolveTo:Ti,resolveAll:Ni},kr={tokenize:pi},lr={tokenize:hi},si={tokenize:Pi};function Ni(i){let u=-1;for(;++u<i.length;){const d=i[u][1];(d.type==="labelImage"||d.type==="labelLink"||d.type==="labelEnd")&&(i.splice(u+1,d.type==="labelImage"?4:2),d.type="data",u++)}return i}function Ti(i,u){let d=i.length,p=0,v,y,C,T;for(;d--;)if(v=i[d][1],y){if(v.type==="link"||v.type==="labelLink"&&v._inactive)break;i[d][0]==="enter"&&v.type==="labelLink"&&(v._inactive=!0)}else if(C){if(i[d][0]==="enter"&&(v.type==="labelImage"||v.type==="labelLink")&&!v._balanced&&(y=d,v.type!=="labelLink")){p=2;break}}else v.type==="labelEnd"&&(C=d);const U={type:i[y][1].type==="labelLink"?"link":"image",start:Object.assign({},i[y][1].start),end:Object.assign({},i[i.length-1][1].end)},K={type:"label",start:Object.assign({},i[y][1].start),end:Object.assign({},i[C][1].end)},j={type:"labelText",start:Object.assign({},i[y+p+2][1].end),end:Object.assign({},i[C-2][1].start)};return T=[["enter",U,u],["enter",K,u]],T=ot(T,i.slice(y+1,y+p+3)),T=ot(T,[["enter",j,u]]),T=ot(T,Dt(u.parser.constructs.insideSpan.null,i.slice(y+p+4,C-3),u)),T=ot(T,[["exit",j,u],i[C-2],i[C-1],["exit",K,u]]),T=ot(T,i.slice(C+1)),T=ot(T,[["exit",U,u]]),Ge(i,y,i.length,T),i}function Ri(i,u,d){const p=this;let v=p.events.length,y,C;for(;v--;)if((p.events[v][1].type==="labelImage"||p.events[v][1].type==="labelLink")&&!p.events[v][1]._balanced){y=p.events[v][1];break}return T;function T(X){return y?y._inactive?Q(X):(C=p.parser.defined.includes(ir(p.sliceSerialize({start:y.end,end:p.now()}))),i.enter("labelEnd"),i.enter("labelMarker"),i.consume(X),i.exit("labelMarker"),i.exit("labelEnd"),U):d(X)}function U(X){return X===40?i.attempt(kr,j,C?j:Q)(X):X===91?i.attempt(lr,j,C?K:Q)(X):C?j(X):Q(X)}function K(X){return i.attempt(si,j,Q)(X)}function j(X){return u(X)}function Q(X){return y._balanced=!0,d(X)}}function pi(i,u,d){return p;function p(Q){return i.enter("resource"),i.enter("resourceMarker"),i.consume(Q),i.exit("resourceMarker"),v}function v(Q){return Kt(Q)?ur(i,y)(Q):y(Q)}function y(Q){return Q===41?j(Q):Sr(i,C,T,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(Q)}function C(Q){return Kt(Q)?ur(i,U)(Q):j(Q)}function T(Q){return d(Q)}function U(Q){return Q===34||Q===39||Q===40?Br(i,K,d,"resourceTitle","resourceTitleMarker","resourceTitleString")(Q):j(Q)}function K(Q){return Kt(Q)?ur(i,j)(Q):j(Q)}function j(Q){return Q===41?(i.enter("resourceMarker"),i.consume(Q),i.exit("resourceMarker"),i.exit("resource"),u):d(Q)}}function hi(i,u,d){const p=this;return v;function v(T){return Ur.call(p,i,y,C,"reference","referenceMarker","referenceString")(T)}function y(T){return p.parser.defined.includes(ir(p.sliceSerialize(p.events[p.events.length-1][1]).slice(1,-1)))?u(T):d(T)}function C(T){return d(T)}}function Pi(i,u,d){return p;function p(y){return i.enter("reference"),i.enter("referenceMarker"),i.consume(y),i.exit("referenceMarker"),v}function v(y){return y===93?(i.enter("referenceMarker"),i.consume(y),i.exit("referenceMarker"),i.exit("reference"),u):d(y)}}const mi={name:"labelStartImage",tokenize:gi,resolveAll:wn.resolveAll};function gi(i,u,d){const p=this;return v;function v(T){return i.enter("labelImage"),i.enter("labelImageMarker"),i.consume(T),i.exit("labelImageMarker"),y}function y(T){return T===91?(i.enter("labelMarker"),i.consume(T),i.exit("labelMarker"),i.exit("labelImage"),C):d(T)}function C(T){return T===94&&"_hiddenFootnoteSupport"in p.parser.constructs?d(T):u(T)}}function vi(i){if(i===null||Kt(i)||Mn(i))return 1;if(Tn(i))return 2}const cr={name:"attention",tokenize:Gr,resolveAll:oi};function oi(i,u){let d=-1,p,v,y,C,T,U,K,j;for(;++d<i.length;)if(i[d][0]==="enter"&&i[d][1].type==="attentionSequence"&&i[d][1]._close){for(p=d;p--;)if(i[p][0]==="exit"&&i[p][1].type==="attentionSequence"&&i[p][1]._open&&u.sliceSerialize(i[p][1]).charCodeAt(0)===u.sliceSerialize(i[d][1]).charCodeAt(0)){if((i[p][1]._close||i[d][1]._open)&&(i[d][1].end.offset-i[d][1].start.offset)%3&&!((i[p][1].end.offset-i[p][1].start.offset+i[d][1].end.offset-i[d][1].start.offset)%3))continue;U=i[p][1].end.offset-i[p][1].start.offset>1&&i[d][1].end.offset-i[d][1].start.offset>1?2:1;const Q=Object.assign({},i[p][1].end),X=Object.assign({},i[d][1].start);Mr(Q,-U),Mr(X,U),C={type:U>1?"strongSequence":"emphasisSequence",start:Q,end:Object.assign({},i[p][1].end)},T={type:U>1?"strongSequence":"emphasisSequence",start:Object.assign({},i[d][1].start),end:X},y={type:U>1?"strongText":"emphasisText",start:Object.assign({},i[p][1].end),end:Object.assign({},i[d][1].start)},v={type:U>1?"strong":"emphasis",start:Object.assign({},C.start),end:Object.assign({},T.end)},i[p][1].end=Object.assign({},C.start),i[d][1].start=Object.assign({},T.end),K=[],i[p][1].end.offset-i[p][1].start.offset&&(K=ot(K,[["enter",i[p][1],u],["exit",i[p][1],u]])),K=ot(K,[["enter",v,u],["enter",C,u],["exit",C,u],["enter",y,u]]),K=ot(K,Dt(u.parser.constructs.insideSpan.null,i.slice(p+1,d),u)),K=ot(K,[["exit",y,u],["enter",T,u],["exit",T,u],["exit",v,u]]),i[d][1].end.offset-i[d][1].start.offset?(j=2,K=ot(K,[["enter",i[d][1],u],["exit",i[d][1],u]])):j=0,Ge(i,p-1,d-p+3,K),d=p+K.length-j-2;break}}for(d=-1;++d<i.length;)i[d][1].type==="attentionSequence"&&(i[d][1].type="data");return i}function Gr(i,u){const d=this.parser.constructs.attentionMarkers.null,p=this.previous,v=vi(p);let y;return C;function C(U){return y=U,i.enter("attentionSequence"),T(U)}function T(U){if(U===y)return i.consume(U),T;const K=i.exit("attentionSequence"),j=vi(U),Q=!j||j===2&&v||d.includes(U),X=!v||v===2&&j||d.includes(p);return K._open=!!(y===42?Q:Q&&(v||!X)),K._close=!!(y===42?X:X&&(j||!Q)),u(U)}}function Mr(i,u){i.column+=u,i.offset+=u,i._bufferIndex+=u}const f={name:"autolink",tokenize:b};function b(i,u,d){let p=0;return v;function v($){return i.enter("autolink"),i.enter("autolinkMarker"),i.consume($),i.exit("autolinkMarker"),i.enter("autolinkProtocol"),y}function y($){return bt($)?(i.consume($),C):K($)}function C($){return $===43||$===45||$===46||Ct($)?(p=1,T($)):K($)}function T($){return $===58?(i.consume($),p=0,U):($===43||$===45||$===46||Ct($))&&p++<32?(i.consume($),T):(p=0,K($))}function U($){return $===62?(i.exit("autolinkProtocol"),i.enter("autolinkMarker"),i.consume($),i.exit("autolinkMarker"),i.exit("autolink"),u):$===null||$===32||$===60||on($)?d($):(i.consume($),U)}function K($){return $===64?(i.consume($),j):It($)?(i.consume($),K):d($)}function j($){return Ct($)?Q($):d($)}function Q($){return $===46?(i.consume($),p=0,j):$===62?(i.exit("autolinkProtocol").type="autolinkEmail",i.enter("autolinkMarker"),i.consume($),i.exit("autolinkMarker"),i.exit("autolink"),u):X($)}function X($){if(($===45||Ct($))&&p++<63){const ht=$===45?X:Q;return i.consume($),ht}return d($)}}const I={name:"htmlText",tokenize:N};function N(i,u,d){const p=this;let v,y,C;return T;function T(V){return i.enter("htmlText"),i.enter("htmlTextData"),i.consume(V),U}function U(V){return V===33?(i.consume(V),K):V===47?(i.consume(V),qt):V===63?(i.consume(V),et):bt(V)?(i.consume(V),Ht):d(V)}function K(V){return V===45?(i.consume(V),j):V===91?(i.consume(V),y=0,ht):bt(V)?(i.consume(V),zt):d(V)}function j(V){return V===45?(i.consume(V),$):d(V)}function Q(V){return V===null?d(V):V===45?(i.consume(V),X):Xe(V)?(C=Q,On(V)):(i.consume(V),Q)}function X(V){return V===45?(i.consume(V),$):Q(V)}function $(V){return V===62?Sn(V):V===45?X(V):Q(V)}function ht(V){const Yn="CDATA[";return V===Yn.charCodeAt(y++)?(i.consume(V),y===Yn.length?Ke:ht):d(V)}function Ke(V){return V===null?d(V):V===93?(i.consume(V),dt):Xe(V)?(C=Ke,On(V)):(i.consume(V),Ke)}function dt(V){return V===93?(i.consume(V),Ne):Ke(V)}function Ne(V){return V===62?Sn(V):V===93?(i.consume(V),Ne):Ke(V)}function zt(V){return V===null||V===62?Sn(V):Xe(V)?(C=zt,On(V)):(i.consume(V),zt)}function et(V){return V===null?d(V):V===63?(i.consume(V),Jt):Xe(V)?(C=et,On(V)):(i.consume(V),et)}function Jt(V){return V===62?Sn(V):et(V)}function qt(V){return bt(V)?(i.consume(V),ve):d(V)}function ve(V){return V===45||Ct(V)?(i.consume(V),ve):Et(V)}function Et(V){return Xe(V)?(C=Et,On(V)):_t(V)?(i.consume(V),Et):Sn(V)}function Ht(V){return V===45||Ct(V)?(i.consume(V),Ht):V===47||V===62||Kt(V)?nn(V):d(V)}function nn(V){return V===47?(i.consume(V),Sn):V===58||V===95||bt(V)?(i.consume(V),Ln):Xe(V)?(C=nn,On(V)):_t(V)?(i.consume(V),nn):Sn(V)}function Ln(V){return V===45||V===46||V===58||V===95||Ct(V)?(i.consume(V),Ln):Cn(V)}function Cn(V){return V===61?(i.consume(V),Yt):Xe(V)?(C=Cn,On(V)):_t(V)?(i.consume(V),Cn):nn(V)}function Yt(V){return V===null||V===60||V===61||V===62||V===96?d(V):V===34||V===39?(i.consume(V),v=V,vt):Xe(V)?(C=Yt,On(V)):_t(V)?(i.consume(V),Yt):(i.consume(V),Zt)}function vt(V){return V===v?(i.consume(V),v=void 0,$t):V===null?d(V):Xe(V)?(C=vt,On(V)):(i.consume(V),vt)}function Zt(V){return V===null||V===34||V===39||V===60||V===61||V===96?d(V):V===47||V===62||Kt(V)?nn(V):(i.consume(V),Zt)}function $t(V){return V===47||V===62||Kt(V)?nn(V):d(V)}function Sn(V){return V===62?(i.consume(V),i.exit("htmlTextData"),i.exit("htmlText"),u):d(V)}function On(V){return i.exit("htmlTextData"),i.enter("lineEnding"),i.consume(V),i.exit("lineEnding"),nr}function nr(V){return _t(V)?Mt(i,sr,"linePrefix",p.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):sr(V)}function sr(V){return i.enter("htmlTextData"),C(V)}}const F={name:"labelStartLink",tokenize:D,resolveAll:wn.resolveAll};function D(i,u,d){const p=this;return v;function v(C){return i.enter("labelLink"),i.enter("labelMarker"),i.consume(C),i.exit("labelMarker"),i.exit("labelLink"),y}function y(C){return C===94&&"_hiddenFootnoteSupport"in p.parser.constructs?d(C):u(C)}}const L={name:"hardBreakEscape",tokenize:ie};function ie(i,u,d){return p;function p(y){return i.enter("hardBreakEscape"),i.consume(y),v}function v(y){return Xe(y)?(i.exit("hardBreakEscape"),u(y)):d(y)}}const ue={name:"codeText",tokenize:Qe,resolve:be,previous:ut};function be(i){let u=i.length-4,d=3,p,v;if((i[d][1].type==="lineEnding"||i[d][1].type==="space")&&(i[u][1].type==="lineEnding"||i[u][1].type==="space")){for(p=d;++p<u;)if(i[p][1].type==="codeTextData"){i[d][1].type="codeTextPadding",i[u][1].type="codeTextPadding",d+=2,u-=2;break}}for(p=d-1,u++;++p<=u;)v===void 0?p!==u&&i[p][1].type!=="lineEnding"&&(v=p):(p===u||i[p][1].type==="lineEnding")&&(i[v][1].type="codeTextData",p!==v+2&&(i[v][1].end=i[p-1][1].end,i.splice(v+2,p-v-2),u-=p-v-2,p=v+2),v=void 0);return i}function ut(i){return i!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qe(i,u,d){const p=this;let v=0,y,C;return T;function T(X){return i.enter("codeText"),i.enter("codeTextSequence"),U(X)}function U(X){return X===96?(i.consume(X),v++,U):(i.exit("codeTextSequence"),K(X))}function K(X){return X===null?d(X):X===32?(i.enter("space"),i.consume(X),i.exit("space"),K):X===96?(C=i.enter("codeTextSequence"),y=0,Q(X)):Xe(X)?(i.enter("lineEnding"),i.consume(X),i.exit("lineEnding"),K):(i.enter("codeTextData"),j(X))}function j(X){return X===null||X===32||X===96||Xe(X)?(i.exit("codeTextData"),K(X)):(i.consume(X),j)}function Q(X){return X===96?(i.consume(X),y++,Q):y===v?(i.exit("codeTextSequence"),i.exit("codeText"),u(X)):(C.type="codeTextData",j(X))}}const He={42:hn,43:hn,45:hn,48:hn,49:hn,50:hn,51:hn,52:hn,53:hn,54:hn,55:hn,56:hn,57:hn,62:Rt},pt={91:Er},ct={[-2]:yr,[-1]:yr,32:yr},gt={35:Cr,42:er,45:[Zr,er],60:ri,61:Zr,95:er,96:l,126:l},St={38:P,92:le},Qt={[-5]:Ve,[-4]:Ve,[-3]:Ve,33:mi,38:P,42:cr,60:[f,I],91:F,92:[L,le],93:wn,95:cr,96:ue},an={null:[cr,un]},en={null:[42,95]},Fe={null:[]};function At(i){const d=tn([ee,...(i||{}).extensions||[]]),p={defined:[],lazy:{},constructs:d,content:v(zn),document:v(dn),flow:v(mr),string:v(Rn),text:v(xn)};return p;function v(y){return C;function C(T){return Ut(p,y,T)}}}const rt=/[\0\t\n\r]/g;function Kn(){let i=1,u="",d=!0,p;return v;function v(y,C,T){const U=[];let K,j,Q,X,$;for(y=u+y.toString(C),Q=0,u="",d&&(y.charCodeAt(0)===65279&&Q++,d=void 0);Q<y.length;){if(rt.lastIndex=Q,K=rt.exec(y),X=K&&K.index!==void 0?K.index:y.length,$=y.charCodeAt(X),!K){u=y.slice(Q);break}if($===10&&Q===X&&p)U.push(-3),p=void 0;else switch(p&&(U.push(-5),p=void 0),Q<X&&(U.push(y.slice(Q,X)),i+=X-Q),$){case 0:{U.push(65533),i++;break}case 9:{for(j=Math.ceil(i/4)*4,U.push(-2);i++<j;)U.push(-1);break}case 10:{U.push(-4),i=1;break}default:p=!0,i=1}Q=X+1}return T&&(p&&U.push(-5),u&&U.push(u),U.push(null)),U}}function ar(i){for(;!kn(i););return i}function Fi(i,u){const d=Number.parseInt(i,u);return d<9||d===11||d>13&&d<32||d>126&&d<160||d>55295&&d<57344||d>64975&&d<65008||(d&65535)===65535||(d&65535)===65534||d>1114111?"\uFFFD":String.fromCharCode(d)}const da=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yi(i){return i.replace(da,fa)}function fa(i,u,d){if(u)return u;if(d.charCodeAt(0)===35){const v=d.charCodeAt(1),y=v===120||v===88;return Fi(d.slice(y?2:1),y?16:10)}return(0,R.T)(d)||i}const Mi={}.hasOwnProperty,pa=function(i,u,d){return typeof u!="string"&&(d=u,u=void 0),ha(d)(ar(At(d).document().write(Kn()(i,u,!0))))};function ha(i){const u={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:T(sa),autolinkProtocol:Cn,autolinkEmail:Cn,atxHeading:T(ra),blockQuote:T(Lr),characterEscape:Cn,characterReference:Cn,codeFenced:T(Or),codeFencedFenceInfo:U,codeFencedFenceMeta:U,codeIndented:T(Or,U),codeText:T(Ii,U),codeTextData:Cn,data:Cn,codeFlowValue:Cn,definition:T(Os),definitionDestinationString:U,definitionLabelString:U,definitionTitleString:U,emphasis:T(Ns),hardBreakEscape:T(ia),hardBreakTrailing:T(ia),htmlFlow:T(aa,U),htmlFlowData:Cn,htmlText:T(aa,U),htmlTextData:Cn,image:T(Ts),label:U,link:T(sa),listItem:T(Rs),listItemValue:ht,listOrdered:T(oa,$),listUnordered:T(oa),paragraph:T(Ps),reference:Dr,referenceString:U,resourceDestinationString:U,resourceTitleString:U,setextHeading:T(ra),strong:T(Fs),thematicBreak:T(Ds)},exit:{atxHeading:j(),atxHeadingSequence:Et,autolink:j(),autolinkEmail:fr,autolinkProtocol:Qr,blockQuote:j(),characterEscapeValue:Yt,characterReferenceMarkerHexadecimal:Hr,characterReferenceMarkerNumeric:Hr,characterReferenceValue:Pn,codeFenced:j(zt),codeFencedFence:Ne,codeFencedFenceInfo:Ke,codeFencedFenceMeta:dt,codeFlowValue:Yt,codeIndented:j(et),codeText:j(On),codeTextData:Yt,data:Yt,definition:j(),definitionDestinationString:ve,definitionLabelString:Jt,definitionTitleString:qt,emphasis:j(),hardBreakEscape:j(Zt),hardBreakTrailing:j(Zt),htmlFlow:j($t),htmlFlowData:Yt,htmlText:j(Sn),htmlTextData:Yt,image:j(sr),label:Yn,labelText:V,lineEnding:vt,link:j(nr),listItem:j(),listOrdered:j(),listUnordered:j(),paragraph:j(),referenceString:Ci,resourceDestinationString:dr,resourceTitleString:Z,resource:Hn,setextHeading:j(Ln),setextHeadingLineSequence:nn,setextHeadingText:Ht,strong:j(),thematicBreak:j()}};Di(u,(i||{}).mdastExtensions||[]);const d={};return p;function p(we){let ze={type:"root",children:[]};const Ot={stack:[ze],tokenStack:[],config:u,enter:K,exit:Q,buffer:U,resume:X,setData:y,getData:C},sn=[];let ln=-1;for(;++ln<we.length;)if(we[ln][1].type==="listOrdered"||we[ln][1].type==="listUnordered")if(we[ln][0]==="enter")sn.push(ln);else{const rr=sn.pop();ln=v(we,rr,ln)}for(ln=-1;++ln<we.length;){const rr=u[we[ln][0]];Mi.call(rr,we[ln][1].type)&&rr[we[ln][1].type].call(Object.assign({sliceSerialize:we[ln][2].sliceSerialize},Ot),we[ln][1])}if(Ot.tokenStack.length>0){const rr=Ot.tokenStack[Ot.tokenStack.length-1];(rr[1]||Li).call(Ot,void 0,rr[0])}for(ze.position={start:xr(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:xr(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},ln=-1;++ln<u.transforms.length;)ze=u.transforms[ln](ze)||ze;return ze}function v(we,ze,Ot){let sn=ze-1,ln=-1,rr=!1,br,pr,Jr,qr;for(;++sn<=Ot;){const In=we[sn];if(In[1].type==="listUnordered"||In[1].type==="listOrdered"||In[1].type==="blockQuote"?(In[0]==="enter"?ln++:ln--,qr=void 0):In[1].type==="lineEndingBlank"?In[0]==="enter"&&(br&&!qr&&!ln&&!Jr&&(Jr=sn),qr=void 0):In[1].type==="linePrefix"||In[1].type==="listItemValue"||In[1].type==="listItemMarker"||In[1].type==="listItemPrefix"||In[1].type==="listItemPrefixWhitespace"||(qr=void 0),!ln&&In[0]==="enter"&&In[1].type==="listItemPrefix"||ln===-1&&In[0]==="exit"&&(In[1].type==="listUnordered"||In[1].type==="listOrdered")){if(br){let Ai=sn;for(pr=void 0;Ai--;){const hr=we[Ai];if(hr[1].type==="lineEnding"||hr[1].type==="lineEndingBlank"){if(hr[0]==="exit")continue;pr&&(we[pr][1].type="lineEndingBlank",rr=!0),hr[1].type="lineEnding",pr=Ai}else if(!(hr[1].type==="linePrefix"||hr[1].type==="blockQuotePrefix"||hr[1].type==="blockQuotePrefixWhitespace"||hr[1].type==="blockQuoteMarker"||hr[1].type==="listItemIndent"))break}Jr&&(!pr||Jr<pr)&&(br._spread=!0),br.end=Object.assign({},pr?we[pr][1].start:In[1].end),we.splice(pr||sn,0,["exit",br,In[2]]),sn++,Ot++}In[1].type==="listItemPrefix"&&(br={type:"listItem",_spread:!1,start:Object.assign({},In[1].start),end:void 0},we.splice(sn,0,["enter",br,In[2]]),sn++,Ot++,Jr=void 0,qr=!0)}}return we[ze][1]._spread=rr,Ot}function y(we,ze){d[we]=ze}function C(we){return d[we]}function T(we,ze){return Ot;function Ot(sn){K.call(this,we(sn),sn),ze&&ze.call(this,sn)}}function U(){this.stack.push({type:"fragment",children:[]})}function K(we,ze,Ot){return this.stack[this.stack.length-1].children.push(we),this.stack.push(we),this.tokenStack.push([ze,Ot]),we.position={start:xr(ze.start)},we}function j(we){return ze;function ze(Ot){we&&we.call(this,Ot),Q.call(this,Ot)}}function Q(we,ze){const Ot=this.stack.pop(),sn=this.tokenStack.pop();if(sn)sn[0].type!==we.type&&(ze?ze.call(this,we,sn[0]):(sn[1]||Li).call(this,we,sn[0]));else throw new Error("Cannot close `"+we.type+"` ("+ke({start:we.start,end:we.end})+"): it\u2019s not open");return Ot.position.end=xr(we.end),Ot}function X(){return Me(this.stack.pop())}function $(){y("expectingFirstListItemValue",!0)}function ht(we){if(C("expectingFirstListItemValue")){const ze=this.stack[this.stack.length-2];ze.start=Number.parseInt(this.sliceSerialize(we),10),y("expectingFirstListItemValue")}}function Ke(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.lang=we}function dt(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.meta=we}function Ne(){C("flowCodeInside")||(this.buffer(),y("flowCodeInside",!0))}function zt(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.value=we.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),y("flowCodeInside")}function et(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.value=we.replace(/(\r?\n|\r)$/g,"")}function Jt(we){const ze=this.resume(),Ot=this.stack[this.stack.length-1];Ot.label=ze,Ot.identifier=ir(this.sliceSerialize(we)).toLowerCase()}function qt(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.title=we}function ve(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.url=we}function Et(we){const ze=this.stack[this.stack.length-1];if(!ze.depth){const Ot=this.sliceSerialize(we).length;ze.depth=Ot}}function Ht(){y("setextHeadingSlurpLineEnding",!0)}function nn(we){const ze=this.stack[this.stack.length-1];ze.depth=this.sliceSerialize(we).charCodeAt(0)===61?1:2}function Ln(){y("setextHeadingSlurpLineEnding")}function Cn(we){const ze=this.stack[this.stack.length-1];let Ot=ze.children[ze.children.length-1];(!Ot||Ot.type!=="text")&&(Ot=Ms(),Ot.position={start:xr(we.start)},ze.children.push(Ot)),this.stack.push(Ot)}function Yt(we){const ze=this.stack.pop();ze.value+=this.sliceSerialize(we),ze.position.end=xr(we.end)}function vt(we){const ze=this.stack[this.stack.length-1];if(C("atHardBreak")){const Ot=ze.children[ze.children.length-1];Ot.position.end=xr(we.end),y("atHardBreak");return}!C("setextHeadingSlurpLineEnding")&&u.canContainEols.includes(ze.type)&&(Cn.call(this,we),Yt.call(this,we))}function Zt(){y("atHardBreak",!0)}function $t(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.value=we}function Sn(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.value=we}function On(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.value=we}function nr(){const we=this.stack[this.stack.length-1];if(C("inReference")){const ze=C("referenceType")||"shortcut";we.type+="Reference",we.referenceType=ze,delete we.url,delete we.title}else delete we.identifier,delete we.label;y("referenceType")}function sr(){const we=this.stack[this.stack.length-1];if(C("inReference")){const ze=C("referenceType")||"shortcut";we.type+="Reference",we.referenceType=ze,delete we.url,delete we.title}else delete we.identifier,delete we.label;y("referenceType")}function V(we){const ze=this.sliceSerialize(we),Ot=this.stack[this.stack.length-2];Ot.label=yi(ze),Ot.identifier=ir(ze).toLowerCase()}function Yn(){const we=this.stack[this.stack.length-1],ze=this.resume(),Ot=this.stack[this.stack.length-1];if(y("inReference",!0),Ot.type==="link"){const sn=we.children;Ot.children=sn}else Ot.alt=ze}function dr(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.url=we}function Z(){const we=this.resume(),ze=this.stack[this.stack.length-1];ze.title=we}function Hn(){y("inReference")}function Dr(){y("referenceType","collapsed")}function Ci(we){const ze=this.resume(),Ot=this.stack[this.stack.length-1];Ot.label=ze,Ot.identifier=ir(this.sliceSerialize(we)).toLowerCase(),y("referenceType","full")}function Hr(we){y("characterReferenceType",we.type)}function Pn(we){const ze=this.sliceSerialize(we),Ot=C("characterReferenceType");let sn;Ot?(sn=Fi(ze,Ot==="characterReferenceMarkerNumeric"?10:16),y("characterReferenceType")):sn=(0,R.T)(ze);const ln=this.stack.pop();ln.value+=sn,ln.position.end=xr(we.end)}function Qr(we){Yt.call(this,we);const ze=this.stack[this.stack.length-1];ze.url=this.sliceSerialize(we)}function fr(we){Yt.call(this,we);const ze=this.stack[this.stack.length-1];ze.url="mailto:"+this.sliceSerialize(we)}function Lr(){return{type:"blockquote",children:[]}}function Or(){return{type:"code",lang:null,meta:null,value:""}}function Ii(){return{type:"inlineCode",value:""}}function Os(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ns(){return{type:"emphasis",children:[]}}function ra(){return{type:"heading",depth:void 0,children:[]}}function ia(){return{type:"break"}}function aa(){return{type:"html",value:""}}function Ts(){return{type:"image",title:null,url:"",alt:null}}function sa(){return{type:"link",title:null,url:"",children:[]}}function oa(we){return{type:"list",ordered:we.type==="listOrdered",start:null,spread:we._spread,children:[]}}function Rs(we){return{type:"listItem",spread:we._spread,checked:null,children:[]}}function Ps(){return{type:"paragraph",children:[]}}function Fs(){return{type:"strong",children:[]}}function Ms(){return{type:"text",value:""}}function Ds(){return{type:"thematicBreak"}}}function xr(i){return{line:i.line,column:i.column,offset:i.offset}}function Di(i,u){let d=-1;for(;++d<u.length;){const p=u[d];Array.isArray(p)?Di(i,p):ma(i,p)}}function ma(i,u){let d;for(d in u)if(Mi.call(u,d)){if(d==="canContainEols"){const p=u[d];p&&i[d].push(...p)}else if(d==="transforms"){const p=u[d];p&&i[d].push(...p)}else if(d==="enter"||d==="exit"){const p=u[d];p&&Object.assign(i[d],p)}}}function Li(i,u){throw i?new Error("Cannot close `"+i.type+"` ("+ke({start:i.start,end:i.end})+"): a different token (`"+u.type+"`, "+ke({start:u.start,end:u.end})+") is open"):new Error("Cannot close document, a token (`"+u.type+"`, "+ke({start:u.start,end:u.end})+") is still open")}function ga(i){Object.assign(this,{Parser:d=>{const p=this.data("settings");return pa(d,Object.assign({},p,i,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Vs(i,u){const d=encode(Ar(i||""));if(!u)return d;const p=d.indexOf(":"),v=d.indexOf("?"),y=d.indexOf("#"),C=d.indexOf("/");return p<0||C>-1&&p>C||v>-1&&p>v||y>-1&&p>y||u.test(d.slice(0,p))?d:""}function Ar(i){const u=[];let d=-1,p=0,v=0;for(;++d<i.length;){const y=i.charCodeAt(d);let C="";if(y===37&&Ct(i.charCodeAt(d+1))&&Ct(i.charCodeAt(d+2)))v=2;else if(y<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(y))||(C=String.fromCharCode(y));else if(y>55295&&y<57344){const T=i.charCodeAt(d+1);y<56320&&T>56319&&T<57344?(C=String.fromCharCode(y,T),v=1):C="\uFFFD"}else C=String.fromCharCode(y);C&&(u.push(i.slice(p,d),encodeURIComponent(C)),p=d+v+1,C=""),v&&(d+=v,v=0)}return u.join("")+i.slice(p)}function va(i){const u=[];let d=-1;for(;++d<i.footnoteOrder.length;){const p=i.footnoteById[i.footnoteOrder[d]];if(!p)continue;const v=i.all(p),y=String(p.identifier).toUpperCase(),C=Ar(y.toLowerCase());let T=0;const U=[];for(;++T<=i.footnoteCounts[y];){const Q={type:"element",tagName:"a",properties:{href:"#"+i.clobberPrefix+"fnref-"+C+(T>1?"-"+T:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:i.footnoteBackLabel},children:[{type:"text",value:"\u21A9"}]};T>1&&Q.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(T)}]}),U.length>0&&U.push({type:"text",value:" "}),U.push(Q)}const K=v[v.length-1];if(K&&K.type==="element"&&K.tagName==="p"){const Q=K.children[K.children.length-1];Q&&Q.type==="text"?Q.value+=" ":K.children.push({type:"text",value:" "}),K.children.push(...U)}else v.push(...U);const j={type:"element",tagName:"li",properties:{id:i.clobberPrefix+"fn-"+C},children:i.wrap(v,!0)};i.patch(p,j),u.push(j)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i.footnoteLabelTagName,properties:it(J({},JSON.parse(JSON.stringify(i.footnoteLabelProperties))),{id:"footnote-label"}),children:[{type:"text",value:i.footnoteLabel}]},{type:"text",value:`
5
+ `},{type:"element",tagName:"ol",properties:{},children:i.wrap(u,!0)},{type:"text",value:`
6
+ `}]}}const $s=function i(u,d,p,v,y){const C=ki(d);if(p!=null&&(typeof p!="number"||p<0||p===Number.POSITIVE_INFINITY))throw new Error("Expected positive finite index");if(v!=null&&(!i(v)||!v.children))throw new Error("Expected parent node");if(v==null!=(p==null))throw new Error("Expected both parent and index");return u&&u.type&&typeof u.type=="string"?!!C.call(y,u,p,v):!1},ki=function(i){if(i==null)return ba;if(typeof i=="string")return xa(i);if(typeof i=="object")return Array.isArray(i)?ya(i):ka(i);if(typeof i=="function")return ui(i);throw new Error("Expected function, string, or object as test")};function ya(i){const u=[];let d=-1;for(;++d<i.length;)u[d]=ki(i[d]);return ui(p);function p(...v){let y=-1;for(;++y<u.length;)if(u[y].call(this,...v))return!0;return!1}}function ka(i){return ui(u);function u(d){let p;for(p in i)if(d[p]!==i[p])return!1;return!0}}function xa(i){return ui(u);function u(d){return d&&d.type===i}}function ui(i){return u;function u(d,...p){return!!(d&&typeof d=="object"&&"type"in d&&i.call(this,d,...p))}}function ba(){return!0}function Zs(i){return i}const _a=!0,ji=!1,wa="skip",Sa=function(i,u,d,p){typeof u=="function"&&typeof d!="function"&&(p=d,d=u,u=null);const v=ki(u),y=p?-1:1;C(i,void 0,[])();function C(T,U,K){const j=T&&typeof T=="object"?T:{};if(typeof j.type=="string"){const X=typeof j.tagName=="string"?j.tagName:typeof j.name=="string"?j.name:void 0;Object.defineProperty(Q,"name",{value:"node ("+(T.type+(X?"<"+X+">":""))+")"})}return Q;function Q(){let X=[],$,ht,Ke;if((!u||v(T,U,K[K.length-1]||null))&&(X=Ea(d(T,K)),X[0]===ji))return X;if(T.children&&X[0]!==wa)for(ht=(p?T.children.length:-1)+y,Ke=K.concat(T);ht>-1&&ht<T.children.length;){if($=C(T.children[ht],ht,Ke)(),$[0]===ji)return $;ht=typeof $[1]=="number"?$[1]:ht+y}return X}}};function Ea(i){return Array.isArray(i)?i:typeof i=="number"?[_a,i]:[i]}const xi=function(i,u,d,p){typeof u=="function"&&typeof d!="function"&&(p=d,d=u,u=null),Sa(i,u,v,p);function v(y,C){const T=C[C.length-1];return d(y,T?T.children.indexOf(y):null,T)}},bi=Ui("start"),_i=Ui("end");function Ca(i){return{start:bi(i),end:_i(i)}}function Ui(i){return u;function u(d){const p=d&&d.position&&d.position[i]||{};return{line:p.line||null,column:p.column||null,offset:p.offset>-1?p.offset:null}}}function Ia(i){return!i||!i.position||!i.position.start||!i.position.start.line||!i.position.start.column||!i.position.end||!i.position.end.line||!i.position.end.column}const Bi={}.hasOwnProperty;function Aa(i){const u=Object.create(null);if(!i||!i.type)throw new Error("mdast-util-definitions expected node");return xi(i,"definition",p=>{const v=zi(p.identifier);v&&!Bi.call(u,v)&&(u[v]=p)}),d;function d(p){const v=zi(p);return v&&Bi.call(u,v)?u[v]:null}}function zi(i){return String(i||"").toUpperCase()}function Oa(i,u){const d={type:"element",tagName:"blockquote",properties:{},children:i.wrap(i.all(u),!0)};return i.patch(u,d),i.applyData(u,d)}function Na(i,u){const d={type:"element",tagName:"br",properties:{},children:[]};return i.patch(u,d),[i.applyData(u,d),{type:"text",value:`
7
+ `}]}function Ta(i,u){const d=u.value?u.value+`
8
+ `:"",p=u.lang?u.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,v={};p&&(v.className=["language-"+p]);let y={type:"element",tagName:"code",properties:v,children:[{type:"text",value:d}]};return u.meta&&(y.data={meta:u.meta}),i.patch(u,y),y=i.applyData(u,y),y={type:"element",tagName:"pre",properties:{},children:[y]},i.patch(u,y),y}function Ra(i,u){const d={type:"element",tagName:"del",properties:{},children:i.all(u)};return i.patch(u,d),i.applyData(u,d)}function Pa(i,u){const d={type:"element",tagName:"em",properties:{},children:i.all(u)};return i.patch(u,d),i.applyData(u,d)}function Vi(i,u){const d=String(u.identifier).toUpperCase(),p=Ar(d.toLowerCase()),v=i.footnoteOrder.indexOf(d);let y;v===-1?(i.footnoteOrder.push(d),i.footnoteCounts[d]=1,y=i.footnoteOrder.length):(i.footnoteCounts[d]++,y=v+1);const C=i.footnoteCounts[d],T={type:"element",tagName:"a",properties:{href:"#"+i.clobberPrefix+"fn-"+p,id:i.clobberPrefix+"fnref-"+p+(C>1?"-"+C:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(y)}]};i.patch(u,T);const U={type:"element",tagName:"sup",properties:{},children:[T]};return i.patch(u,U),i.applyData(u,U)}function Fa(i,u){const d=i.footnoteById;let p=1;for(;p in d;)p++;const v=String(p);return d[v]={type:"footnoteDefinition",identifier:v,children:[{type:"paragraph",children:u.children}],position:u.position},Vi(i,{type:"footnoteReference",identifier:v,position:u.position})}function Ma(i,u){const d={type:"element",tagName:"h"+u.depth,properties:{},children:i.all(u)};return i.patch(u,d),i.applyData(u,d)}function Da(i,u){if(i.dangerous){const d={type:"raw",value:u.value};return i.patch(u,d),i.applyData(u,d)}return null}function $i(i,u){const d=u.referenceType;let p="]";if(d==="collapsed"?p+="[]":d==="full"&&(p+="["+(u.label||u.identifier)+"]"),u.type==="imageReference")return{type:"text",value:"!["+u.alt+p};const v=i.all(u),y=v[0];y&&y.type==="text"?y.value="["+y.value:v.unshift({type:"text",value:"["});const C=v[v.length-1];return C&&C.type==="text"?C.value+=p:v.push({type:"text",value:p}),v}function La(i,u){const d=i.definition(u.identifier);if(!d)return $i(i,u);const p={src:Ar(d.url||""),alt:u.alt};d.title!==null&&d.title!==void 0&&(p.title=d.title);const v={type:"element",tagName:"img",properties:p,children:[]};return i.patch(u,v),i.applyData(u,v)}function ja(i,u){const d={src:Ar(u.url)};u.alt!==null&&u.alt!==void 0&&(d.alt=u.alt),u.title!==null&&u.title!==void 0&&(d.title=u.title);const p={type:"element",tagName:"img",properties:d,children:[]};return i.patch(u,p),i.applyData(u,p)}function Ua(i,u){const d={type:"text",value:u.value.replace(/\r?\n|\r/g," ")};i.patch(u,d);const p={type:"element",tagName:"code",properties:{},children:[d]};return i.patch(u,p),i.applyData(u,p)}function Ba(i,u){const d=i.definition(u.identifier);if(!d)return $i(i,u);const p={href:Ar(d.url||"")};d.title!==null&&d.title!==void 0&&(p.title=d.title);const v={type:"element",tagName:"a",properties:p,children:i.all(u)};return i.patch(u,v),i.applyData(u,v)}function za(i,u){const d={href:Ar(u.url)};u.title!==null&&u.title!==void 0&&(d.title=u.title);const p={type:"element",tagName:"a",properties:d,children:i.all(u)};return i.patch(u,p),i.applyData(u,p)}function Va(i,u,d){const p=i.all(u),v=d?$a(d):Zi(u),y={},C=[];if(typeof u.checked=="boolean"){const j=p[0];let Q;j&&j.type==="element"&&j.tagName==="p"?Q=j:(Q={type:"element",tagName:"p",properties:{},children:[]},p.unshift(Q)),Q.children.length>0&&Q.children.unshift({type:"text",value:" "}),Q.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:u.checked,disabled:!0},children:[]}),y.className=["task-list-item"]}let T=-1;for(;++T<p.length;){const j=p[T];(v||T!==0||j.type!=="element"||j.tagName!=="p")&&C.push({type:"text",value:`
9
+ `}),j.type==="element"&&j.tagName==="p"&&!v?C.push(...j.children):C.push(j)}const U=p[p.length-1];U&&(v||U.type!=="element"||U.tagName!=="p")&&C.push({type:"text",value:`
10
+ `});const K={type:"element",tagName:"li",properties:y,children:C};return i.patch(u,K),i.applyData(u,K)}function $a(i){let u=!1;if(i.type==="list"){u=i.spread||!1;const d=i.children;let p=-1;for(;!u&&++p<d.length;)u=Zi(d[p])}return u}function Zi(i){const u=i.spread;return u==null?i.children.length>1:u}function Za(i,u){const d={},p=i.all(u);let v=-1;for(typeof u.start=="number"&&u.start!==1&&(d.start=u.start);++v<p.length;){const C=p[v];if(C.type==="element"&&C.tagName==="li"&&C.properties&&Array.isArray(C.properties.className)&&C.properties.className.includes("task-list-item")){d.className=["contains-task-list"];break}}const y={type:"element",tagName:u.ordered?"ol":"ul",properties:d,children:i.wrap(p,!0)};return i.patch(u,y),i.applyData(u,y)}function Ka(i,u){const d={type:"element",tagName:"p",properties:{},children:i.all(u)};return i.patch(u,d),i.applyData(u,d)}function Wa(i,u){const d={type:"root",children:i.wrap(i.all(u))};return i.patch(u,d),i.applyData(u,d)}function Ga(i,u){const d={type:"element",tagName:"strong",properties:{},children:i.all(u)};return i.patch(u,d),i.applyData(u,d)}function Ha(i,u){const d=i.all(u),p=d.shift(),v=[];if(p){const C={type:"element",tagName:"thead",properties:{},children:i.wrap([p],!0)};i.patch(u.children[0],C),v.push(C)}if(d.length>0){const C={type:"element",tagName:"tbody",properties:{},children:i.wrap(d,!0)},T=bi(u.children[1]),U=_i(u.children[u.children.length-1]);T.line&&U.line&&(C.position={start:T,end:U}),v.push(C)}const y={type:"element",tagName:"table",properties:{},children:i.wrap(v,!0)};return i.patch(u,y),i.applyData(u,y)}function Qa(i,u,d){const p=d?d.children:void 0,y=(p?p.indexOf(u):1)===0?"th":"td",C=d&&d.type==="table"?d.align:void 0,T=C?C.length:u.children.length;let U=-1;const K=[];for(;++U<T;){const Q=u.children[U],X={},$=C?C[U]:void 0;$&&(X.align=$);let ht={type:"element",tagName:y,properties:X,children:[]};Q&&(ht.children=i.all(Q),i.patch(Q,ht),ht=i.applyData(u,ht)),K.push(ht)}const j={type:"element",tagName:"tr",properties:{},children:i.wrap(K,!0)};return i.patch(u,j),i.applyData(u,j)}function Ja(i,u){const d={type:"element",tagName:"td",properties:{},children:i.all(u)};return i.patch(u,d),i.applyData(u,d)}var qa=G(22679);function Ya(i,u){const d={type:"text",value:(0,qa.j)(String(u.value))};return i.patch(u,d),i.applyData(u,d)}function Xa(i,u){const d={type:"element",tagName:"hr",properties:{},children:[]};return i.patch(u,d),i.applyData(u,d)}const es={blockquote:Oa,break:Na,code:Ta,delete:Ra,emphasis:Pa,footnoteReference:Vi,footnote:Fa,heading:Ma,html:Da,imageReference:La,image:ja,inlineCode:Ua,linkReference:Ba,link:za,listItem:Va,list:Za,paragraph:Ka,root:Wa,strong:Ga,table:Ha,tableCell:Ja,tableRow:Qa,text:Ya,thematicBreak:Xa,toml:li,yaml:li,definition:li,footnoteDefinition:li};function li(){return null}const ci={}.hasOwnProperty;function ts(i,u){const d=u||{},p=d.allowDangerousHtml||!1,v={};return C.dangerous=p,C.clobberPrefix=d.clobberPrefix===void 0||d.clobberPrefix===null?"user-content-":d.clobberPrefix,C.footnoteLabel=d.footnoteLabel||"Footnotes",C.footnoteLabelTagName=d.footnoteLabelTagName||"h2",C.footnoteLabelProperties=d.footnoteLabelProperties||{className:["sr-only"]},C.footnoteBackLabel=d.footnoteBackLabel||"Back to content",C.unknownHandler=d.unknownHandler,C.passThrough=d.passThrough,C.handlers=J(J({},es),d.handlers),C.definition=Aa(i),C.footnoteById=v,C.footnoteOrder=[],C.footnoteCounts={},C.patch=ns,C.applyData=rs,C.one=T,C.all=U,C.wrap=as,C.augment=y,xi(i,"footnoteDefinition",K=>{const j=String(K.identifier).toUpperCase();ci.call(v,j)||(v[j]=K)}),C;function y(K,j){if(K&&"data"in K&&K.data){const Q=K.data;Q.hName&&(j.type!=="element"&&(j={type:"element",tagName:"",properties:{},children:[]}),j.tagName=Q.hName),j.type==="element"&&Q.hProperties&&(j.properties=J(J({},j.properties),Q.hProperties)),"children"in j&&j.children&&Q.hChildren&&(j.children=Q.hChildren)}if(K){const Q="type"in K?K:{position:K};Ia(Q)||(j.position={start:bi(Q),end:_i(Q)})}return j}function C(K,j,Q,X){return Array.isArray(Q)&&(X=Q,Q={}),y(K,{type:"element",tagName:j,properties:Q||{},children:X||[]})}function T(K,j){return Ki(C,K,j)}function U(K){return wi(C,K)}}function ns(i,u){i.position&&(u.position=Ca(i))}function rs(i,u){let d=u;if(i&&i.data){const p=i.data.hName,v=i.data.hChildren,y=i.data.hProperties;typeof p=="string"&&(d.type==="element"?d.tagName=p:d={type:"element",tagName:p,properties:{},children:[]}),d.type==="element"&&y&&(d.properties=J(J({},d.properties),y)),"children"in d&&d.children&&v!==null&&v!==void 0&&(d.children=v)}return d}function Ki(i,u,d){const p=u&&u.type;if(!p)throw new Error("Expected node, got `"+u+"`");return ci.call(i.handlers,p)?i.handlers[p](i,u,d):i.passThrough&&i.passThrough.includes(p)?"children"in u?it(J({},u),{children:wi(i,u)}):u:i.unknownHandler?i.unknownHandler(i,u,d):is(i,u)}function wi(i,u){const d=[];if("children"in u){const p=u.children;let v=-1;for(;++v<p.length;){const y=Ki(i,p[v],u);if(y){if(v&&p[v-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=y.value.replace(/^\s+/,"")),!Array.isArray(y)&&y.type==="element")){const C=y.children[0];C&&C.type==="text"&&(C.value=C.value.replace(/^\s+/,""))}Array.isArray(y)?d.push(...y):d.push(y)}}}return d}function is(i,u){const d=u.data||{},p="value"in u&&!(ci.call(d,"hProperties")||ci.call(d,"hChildren"))?{type:"text",value:u.value}:{type:"element",tagName:"div",properties:{},children:wi(i,u)};return i.patch(u,p),i.applyData(u,p)}function as(i,u){const d=[];let p=-1;for(u&&d.push({type:"text",value:`
11
+ `});++p<i.length;)p&&d.push({type:"text",value:`
12
+ `}),d.push(i[p]);return u&&i.length>0&&d.push({type:"text",value:`
13
+ `}),d}function Wi(i,u){const d=ts(i,u),p=d.one(i,null),v=va(d);return v&&p.children.push({type:"text",value:`
14
+ `},v),Array.isArray(p)?{type:"root",children:p}:p}var ss=function(i,u){return i&&"run"in i?os(i,u):us(i||u)};function os(i,u){return(d,p,v)=>{i.run(Wi(d,u),p,y=>{v(y)})}}function us(i){return u=>Wi(u,i)}var Tt=G(12708),Gi=G(54099);function ls(i){if(i.allowedElements&&i.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(i.allowedElements||i.disallowedElements||i.allowElement)return u=>{xi(u,"element",(d,p,v)=>{const y=v;let C;if(i.allowedElements?C=!i.allowedElements.includes(d.tagName):i.disallowedElements&&(C=i.disallowedElements.includes(d.tagName)),!C&&i.allowElement&&typeof p=="number"&&(C=!i.allowElement(d,p,y)),C&&typeof p=="number")return i.unwrapDisallowed&&d.children?y.children.splice(p,1,...d.children):y.children.splice(p,1),p})}}var cs=G(23265);function ds(i){const u=i&&typeof i=="object"&&i.type==="text"?i.value||"":i;return typeof u=="string"&&u.replace(/[ \t\n\f\r]/g,"")===""}var fs=G(91022);const Hi={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"};var ps=G(71523),hs=G(11630),ms=G(35906),gs=ms;const Qi=["http","https","mailto","tel"];function vs(i){const u=(i||"").trim(),d=u.charAt(0);if(d==="#"||d==="/")return u;const p=u.indexOf(":");if(p===-1)return u;let v=-1;for(;++v<Qi.length;){const y=Qi[v];if(p===y.length&&u.slice(0,y.length).toLowerCase()===y)return u}return v=u.indexOf("?"),v!==-1&&p>v||(v=u.indexOf("#"),v!==-1&&p>v)?u:"javascript:void(0)"}const Si={}.hasOwnProperty,ys=new Set(["table","thead","tbody","tfoot","tr"]);function Ji(i,u){const d=[];let p=-1,v;for(;++p<u.children.length;)v=u.children[p],v.type==="element"?d.push(ks(i,v,p,u)):v.type==="text"?(u.type!=="element"||!ys.has(u.tagName)||!ds(v))&&d.push(v.value):v.type==="raw"&&!i.options.skipHtml&&d.push(v.value);return d}function ks(i,u,d,p){const v=i.options,y=v.transformLinkUri===void 0?vs:v.transformLinkUri,C=i.schema,T=u.tagName,U={};let K=C,j;if(C.space==="html"&&T==="svg"&&(K=Gi.YP,i.schema=K),u.properties)for(j in u.properties)Si.call(u.properties,j)&&bs(U,j,u.properties[j],i);(T==="ol"||T==="ul")&&i.listDepth++;const Q=Ji(i,u);(T==="ol"||T==="ul")&&i.listDepth--,i.schema=C;const X=u.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},$=v.components&&Si.call(v.components,T)?v.components[T]:T,ht=typeof $=="string"||$===B.Fragment;if(!cs.isValidElementType($))throw new TypeError(`Component for name \`${T}\` not defined or is not renderable`);if(U.key=d,T==="a"&&v.linkTarget&&(U.target=typeof v.linkTarget=="function"?v.linkTarget(String(U.href||""),u.children,typeof U.title=="string"?U.title:null):v.linkTarget),T==="a"&&y&&(U.href=y(String(U.href||""),u.children,typeof U.title=="string"?U.title:null)),!ht&&T==="code"&&p.type==="element"&&p.tagName!=="pre"&&(U.inline=!0),!ht&&(T==="h1"||T==="h2"||T==="h3"||T==="h4"||T==="h5"||T==="h6")&&(U.level=Number.parseInt(T.charAt(1),10)),T==="img"&&v.transformImageUri&&(U.src=v.transformImageUri(String(U.src||""),String(U.alt||""),typeof U.title=="string"?U.title:null)),!ht&&T==="li"&&p.type==="element"){const Ke=xs(u);U.checked=Ke&&Ke.properties?!!Ke.properties.checked:null,U.index=Ei(p,u),U.ordered=p.tagName==="ol"}return!ht&&(T==="ol"||T==="ul")&&(U.ordered=T==="ol",U.depth=i.listDepth),(T==="td"||T==="th")&&(U.align&&(U.style||(U.style={}),U.style.textAlign=U.align,delete U.align),ht||(U.isHeader=T==="th")),!ht&&T==="tr"&&p.type==="element"&&(U.isHeader=p.tagName==="thead"),v.sourcePos&&(U["data-sourcepos"]=Ss(X)),!ht&&v.rawSourcePos&&(U.sourcePosition=u.position),!ht&&v.includeElementIndex&&(U.index=Ei(p,u),U.siblingCount=Ei(p)),ht||(U.node=u),Q.length>0?B.createElement($,U,Q):B.createElement($,U)}function xs(i){let u=-1;for(;++u<i.children.length;){const d=i.children[u];if(d.type==="element"&&d.tagName==="input")return d}return null}function Ei(i,u){let d=-1,p=0;for(;++d<i.children.length&&i.children[d]!==u;)i.children[d].type==="element"&&p++;return p}function bs(i,u,d,p){const v=(0,fs.s)(p.schema,u);let y=d;y==null||y!==y||(Array.isArray(y)&&(y=v.commaSeparated?(0,hs.P)(y):(0,ps.P)(y)),v.property==="style"&&typeof y=="string"&&(y=_s(y)),v.space&&v.property?i[Si.call(Hi,v.property)?Hi[v.property]:v.property]=y:v.attribute&&(i[v.attribute]=y))}function _s(i){const u={};try{gs(i,d)}catch(p){}return u;function d(p,v){const y=p.slice(0,4)==="-ms-"?`ms-${p.slice(4)}`:p;u[y.replace(/-([a-z])/g,ws)]=v}}function ws(i,u){return u.toUpperCase()}function Ss(i){return[i.start.line,":",i.start.column,"-",i.end.line,":",i.end.column].map(String).join("")}const qi={}.hasOwnProperty,Es="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",di={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function Yi(i){for(const y in di)if(qi.call(di,y)&&qi.call(i,y)){const C=di[y];console.warn(`[react-markdown] Warning: please ${C.to?`use \`${C.to}\` instead of`:"remove"} \`${y}\` (see <${Es}#${C.id}> for more info)`),delete di[y]}const u=_e().use(ga).use(i.remarkPlugins||[]).use(ss,it(J({},i.remarkRehypeOptions),{allowDangerousHtml:!0})).use(i.rehypePlugins||[]).use(ls,i),d=new mt;typeof i.children=="string"?d.value=i.children:i.children!==void 0&&i.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${i.children}\`)`);const p=u.runSync(u.parse(d),d);if(p.type!=="root")throw new TypeError("Expected a `root` node");let v=B.createElement(B.Fragment,{},Ji({options:i,schema:Gi.dy,listDepth:0},p));return i.className&&(v=B.createElement("div",{className:i.className},v)),v}Yi.propTypes={children:Tt.string,className:Tt.string,allowElement:Tt.func,allowedElements:Tt.arrayOf(Tt.string),disallowedElements:Tt.arrayOf(Tt.string),unwrapDisallowed:Tt.bool,remarkPlugins:Tt.arrayOf(Tt.oneOfType([Tt.object,Tt.func,Tt.arrayOf(Tt.oneOfType([Tt.bool,Tt.string,Tt.object,Tt.func,Tt.arrayOf(Tt.any)]))])),rehypePlugins:Tt.arrayOf(Tt.oneOfType([Tt.object,Tt.func,Tt.arrayOf(Tt.oneOfType([Tt.bool,Tt.string,Tt.object,Tt.func,Tt.arrayOf(Tt.any)]))])),sourcePos:Tt.bool,rawSourcePos:Tt.bool,skipHtml:Tt.bool,includeElementIndex:Tt.bool,transformLinkUri:Tt.oneOfType([Tt.func,Tt.bool]),linkTarget:Tt.oneOfType([Tt.func,Tt.string]),transformImageUri:Tt.func,components:Tt.object};var Xi=(0,B.createContext)(void 0);function ea(){const i=(0,B.useContext)(Xi);if(!i)throw new Error("useToast must be used within a ToastProvider");return i}function Cs({enabled:i,children:u}){const[d,p]=(0,B.useState)([]),v=(0,B.useCallback)(U=>{var K;if(!i)return;const j=(K=U.id)!=null?K:Math.random().toString(36).substring(2,9);p(Q=>Q.find(X=>X.id===j)?Q:[...Q,(0,Te.EZ)((0,Te.ih)({},U),{id:j})]),U.duration&&setTimeout(()=>{C(j)},U.duration)},[i]),y=(0,B.useCallback)(U=>{v({type:"error",message:(0,Ce.jsx)(ta,{errors:U})})},[]),C=(0,B.useCallback)(U=>{p(K=>K.filter(j=>j.id!==U))},[]),T={toasts:d,addToast:v,addGraphQLErrorsToast:y,removeToast:C,enabled:i};return(0,Ce.jsxs)(Xi.Provider,{value:T,children:[(0,Ce.jsxs)("div",{style:{position:"fixed",bottom:"1rem",left:"50%",transform:"translateX(-50%)",zIndex:50,display:"flex",flexDirection:"column",gap:"0.5rem"},children:[d.length>1&&(0,Ce.jsx)("div",{style:{textAlign:"right"},children:(0,Ce.jsx)("button",{onClick:()=>p([]),style:{padding:"4px 8px",fontSize:"12px",cursor:"pointer",background:"white",border:"1px solid rgba(0,0,0,0.2)",borderRadius:"4px"},children:"Close All"})}),d.map(U=>(0,Ce.jsx)(Is,{message:U.message,type:U.type,onClose:()=>C(U.id)},U.id))]}),u]})}function Is({message:i,type:u="info",onClose:d}){const p={info:"#3b82f6",success:"#22c55e",warning:"#eab308",error:"#ef4444"};return(0,Ce.jsxs)("div",{style:{backgroundColor:p[u],color:"white",padding:"0.5rem 1.5rem",borderRadius:"0.25rem",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative",minWidth:"200px"},children:[(0,Ce.jsx)("div",{children:i}),(0,Ce.jsx)("button",{onClick:d,style:{position:"absolute",top:"0",right:"0",background:"none",border:"none",color:"white",cursor:"pointer",padding:"0.5rem",fontSize:"1rem"},children:"\u2715"})]})}function ta({errors:i}){const u=i.map((d,p)=>{var v,y,C;const T="extensions"in d?(v=d.extensions)==null?void 0:v.originalError:{},U=(y=T==null?void 0:T.message)!=null?y:d.message,K="extensions"in d?(C=d.extensions)==null?void 0:C.code:null;return(0,Ce.jsxs)("div",{style:{marginTop:p===0?0:10,marginBottom:14},children:[(0,Ce.jsx)(te,{style:{marginBottom:4}}),K&&(0,Ce.jsxs)("div",{style:{fontWeight:"600",marginBottom:4},children:["Copilot Cloud Error:"," ",(0,Ce.jsx)("span",{style:{fontFamily:"monospace",fontWeight:"normal"},children:K})]}),(0,Ce.jsx)(Yi,{children:U})]},p)});return(0,Ce.jsxs)("div",{style:{fontSize:"13px",maxWidth:"600px"},children:[u,(0,Ce.jsx)("div",{style:{fontSize:"11px",opacity:.75},children:"NOTE: This error only displays during local development."})]})}function na(){const{addToast:i}=ea();return(0,B.useCallback)(u=>{const d=u.map(p=>{var v,y;const C="extensions"in p&&((y=(v=p.extensions)==null?void 0:v.originalError)==null?void 0:y.message)||p.message,T=p.stack||"";return btoa(C+T).slice(0,32)}).join("|");i({type:"error",id:d,message:(0,Ce.jsx)(ta,{errors:u})})},[i])}function As(i,u){const d=na();return(0,B.useCallback)((...p)=>(0,Te.Cr)(this,null,function*(){try{return yield i(...p)}catch(v){throw console.error("Error in async callback:",v),d([v]),v}}),u)}},49323:function(lt,Ue,G){"use strict";G.d(Ue,{W:function(){return Te}});var ee=G(22646),Ce=G(21739);function te(B,ce){return`${B}: ${typeof ce=="string"?ce:JSON.stringify(ce)}`}function Te({description:B,value:ce,parentId:ke,categories:Oe,convert:ft,available:ye="enabled"},M){const{addContext:W,removeContext:he}=(0,ee.I)(),je=(0,Ce.useRef)();ft=ft||te;const H=ft(B,ce);return(0,Ce.useEffect)(()=>{if(ye==="disabled")return;const de=W(H,ke,Oe);return je.current=de,()=>{he(de)}},[ye,H,ke,W,he,...M||[]]),je.current}},41904:function(lt,Ue,G){"use strict";G.d(Ue,{E:function(){return te}});var ee=G(78828),Ce=G(20106);function te(Te){return Te.filter(ce=>ce.available!==ee.GR.Disabled&&ce.disabled!==!0&&ce.name!=="*"&&ce.available!="frontend"&&!ce.pairedAction).map(ce=>{let ke=ee.GR.Enabled;return ce.disabled||ce.available==="disabled"?ke=ee.GR.Disabled:ce.available==="remote"&&(ke=ee.GR.Remote),{name:ce.name,description:ce.description||"",jsonSchema:JSON.stringify((0,Ce.H)(ce.parameters||[])),available:ke}})}},22646:function(lt,Ue,G){"use strict";G.d(Ue,{C:function(){return Te},I:function(){return B}});var ee=G(35549),Ce=G(21739),te={actions:{},setAction:()=>{},removeAction:()=>{},coAgentStateRenders:{},setCoAgentStateRender:()=>{},removeCoAgentStateRender:()=>{},chatComponentsCache:{current:{actions:{},coAgentStateRenders:{}}},getContextString:(ke,Oe)=>ce(""),addContext:()=>"",removeContext:()=>{},getFunctionCallHandler:()=>ce(()=>(0,ee.Cr)(void 0,null,function*(){})),isLoading:!1,setIsLoading:()=>ce(!1),chatInstructions:"",setChatInstructions:()=>ce(""),additionalInstructions:[],setAdditionalInstructions:()=>ce([]),getDocumentsContext:ke=>ce([]),addDocumentContext:()=>ce(""),removeDocumentContext:()=>{},runtimeClient:{},copilotApiConfig:new class{get chatApiEndpoint(){throw new Error("Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!")}get headers(){return{}}get body(){return{}}},chatSuggestionConfiguration:{},addChatSuggestionConfiguration:()=>{},removeChatSuggestionConfiguration:()=>{},showDevConsole:"auto",coagentStates:{},setCoagentStates:()=>{},coagentStatesRef:{current:{}},setCoagentStatesWithRef:()=>{},agentSession:null,setAgentSession:()=>{},forwardedParameters:{},agentLock:null,threadId:"",setThreadId:()=>{},runId:null,setRunId:()=>{},chatAbortControllerRef:{current:null},availableAgents:[],extensions:{},setExtensions:()=>{},langGraphInterruptAction:null,setLangGraphInterruptAction:()=>null,removeLangGraphInterruptAction:()=>null},Te=Ce.createContext(te);function B(){const ke=Ce.useContext(Te);if(ke===te)throw new Error("Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!");return ke}function ce(ke){throw new Error("Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!")}},24325:function(lt,Ue,G){"use strict";G.d(Ue,{p:function(){return B}});var ee=G(52092),Ce=G(35549),te=G(44098),Te=G(21739),B=ce=>{const{addGraphQLErrorsToast:ke}=(0,ee.pm)(),Oe=(0,ee.cM)(),{addToast:ft}=(0,ee.pm)();return(0,Te.useMemo)(()=>new te.t((0,Ce.EZ)((0,Ce.ih)({},ce),{handleGQLErrors:M=>{M.graphQLErrors.length?ke(M.graphQLErrors):Oe([M])},handleGQLWarning:M=>{console.warn(M),ft({type:"warning",message:M})}})),[ce,ke,ft])}},98818:function(lt,Ue,G){"use strict";G.d(Ue,{p:function(){return Te},w:function(){return te}});var ee=G(21739),Ce={messages:[],setMessages:()=>[]},te=ee.createContext(Ce);function Te(){const B=ee.useContext(te);if(B===Ce)throw new Error("A messages consuming component was not wrapped with `<CopilotMessages> {...} </CopilotMessages>`");return B}},67313:function(lt,Ue,G){"use strict";G.d(Ue,{h:function(){return ce}});var ee=G(22646),Ce=G(52092),te=G(35549),Te=G(25590),B=G(21739);function ce(Oe,ft){const{setAction:ye,removeAction:M,actions:W,chatComponentsCache:he}=(0,ee.I)(),je=(0,B.useRef)((0,Te.kb)()),H=(0,B.useRef)(null),{addToast:de}=(0,Ce.pm)();if(Oe=(0,te.ih)({},Oe),ke(Oe)&&(Oe.renderAndWait||Oe.renderAndWaitForResponse)){const ge=Oe.renderAndWait||Oe.renderAndWaitForResponse;Oe.renderAndWait=void 0,Oe.renderAndWaitForResponse=void 0,Oe.handler=(0,Ce.UK)(()=>(0,te.Cr)(this,null,function*(){let Ae,We;const yt=new Promise((st,Nt)=>{Ae=st,We=Nt});return H.current={promise:yt,resolve:Ae,reject:We},yield yt}),[]),Oe.render=Ae=>{let We=Ae.status;Ae.status==="executing"&&!H.current&&(We="inProgress");const yt={status:We,args:Ae.args,result:Ae.result,handler:We==="executing"?H.current.resolve:void 0,respond:We==="executing"?H.current.resolve:void 0},st=Nt=>{var tt;return((tt=Oe.parameters)==null?void 0:tt.length)===0};return ge?(st(ge),ge(yt)):(0,B.createElement)(B.Fragment)}}ft===void 0&&W[je.current]&&(ke(Oe)&&(W[je.current].handler=Oe.handler),typeof Oe.render=="function"&&he.current!==null&&(he.current.actions[Oe.name]=Oe.render)),(0,B.useEffect)(()=>{Object.values(W).some(Ae=>Ae.name===Oe.name&&Ae!==W[je.current])&&de({type:"warning",message:`Found an already registered action with name ${Oe.name}.`,id:`dup-action-${Oe.name}`})},[W]),(0,B.useEffect)(()=>(ye(je.current,Oe),he.current!==null&&Oe.render!==void 0&&(he.current.actions[Oe.name]=Oe.render),()=>{M(je.current)}),[ye,M,ke(Oe)?Oe.description:void 0,Oe.name,ke(Oe)?Oe.disabled:void 0,ke(Oe)?Oe.available:void 0,JSON.stringify(ke(Oe)?Oe.parameters:[]),typeof Oe.render=="string"?Oe.render:void 0,...ft||[]])}function ke(Oe){return Oe.name!=="*"}},69376:function(lt,Ue,G){"use strict";G.d(Ue,{O:function(){return ee}});function ee(te){return typeof te=="boolean"?te:Ce()==="localhost"||Ce()==="127.0.0.1"||Ce()==="0.0.0.0"||Ce()==="::1"}function Ce(){return typeof window!="undefined"&&window.location?window.location.hostname:""}},47667:function(lt,Ue,G){"use strict";G.d(Ue,{Qt:function(){return re},rv:function(){return Re},Kl:function(){return Bt}});var ee=G(35549),Ce=G(35538),te=1e3*60*5,Te=class{constructor(){this.activeKey=null,this.intervalId=null,this.instanceCount=0,this.lastResponse=null}start(ae,pe){return(0,ee.Cr)(this,null,function*(){if(this.instanceCount++,this.activeKey===ae)return;this.intervalId&&clearInterval(this.intervalId);const Me=()=>(0,ee.Cr)(this,null,function*(){try{const Ye=yield fetch(`${Ce.Vq}/ciu`,{method:"GET",headers:{[Ce.w8]:ae}}).then($e=>$e.json());return this.lastResponse=Ye,pe==null||pe(Ye),Ye}catch(Ye){return null}}),me=yield Me();return this.intervalId=setInterval(Me,te),this.activeKey=ae,me})}getLastResponse(){return this.lastResponse}stop(){this.instanceCount--,this.instanceCount===0&&this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null,this.activeKey=null,this.lastResponse=null)}},B=G(86349),ce=G(27174),ke={[B.zb.Error]:(0,ce.jsxs)("svg",{viewBox:"0 0 24 24",width:"20",height:"20",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ce.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ce.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,ce.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})};function Oe({severity:ae=B.zb.Error,message:pe="",icon:Me,actions:me}){if(!pe||!ae)return null;const Ye=Me||ke[ae],$e={info:"#dbeafe",warning:"#fef3c7",error:"#fee2e2"}[ae],Ge={info:"#1e40af",warning:"#854d0e",error:"#991b1b"}[ae],ot={info:"#3b82f6",warning:"#eab308",error:"#ef4444"}[ae],Ft={info:"#3b82f6",warning:"#eab308",error:"#ef4444"}[ae],tn={info:"#2563eb",warning:"#ca8a04",error:"#dc2626"}[ae];return(0,ce.jsx)("div",{style:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90%",zIndex:9999},children:(0,ce.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px",borderRadius:"9999px",border:"1px solid #e5e7eb",backgroundColor:$e,padding:"8px 16px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},children:[(0,ce.jsx)("div",{style:{color:ot},children:Ye}),(0,ce.jsx)("span",{style:{flex:1,fontSize:"14px",fontWeight:500,color:Ge,whiteSpace:"normal",wordBreak:"break-word"},children:pe}),(0,ce.jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[(me==null?void 0:me.secondary)&&(0,ce.jsx)("button",{onClick:me.secondary.onClick,style:{borderRadius:"9999px",padding:"4px 12px",fontSize:"14px",fontWeight:500,color:Ge,backgroundColor:"transparent",border:"none",cursor:"pointer",transition:"background-color 0.2s"},onMouseOver:xt=>xt.currentTarget.style.backgroundColor="rgba(255,255,255,0.5)",onMouseOut:xt=>xt.currentTarget.style.backgroundColor="transparent",children:me.secondary.label}),(me==null?void 0:me.primary)&&(0,ce.jsx)("button",{onClick:me.primary.onClick,style:{borderRadius:"9999px",padding:"4px 12px",fontSize:"14px",fontWeight:500,color:"#fff",backgroundColor:Ft,border:"none",cursor:"pointer",transition:"background-color 0.2s"},onMouseOver:xt=>xt.currentTarget.style.backgroundColor=tn,onMouseOut:xt=>xt.currentTarget.style.backgroundColor=Ft,children:me.primary.label})]})]})})}function ft(ae){switch(ae.name){case B.gR.CONFIGURATION_ERROR:return(0,ce.jsx)(Oe,{severity:ae.severity,message:ae.message});case B.gR.MISSING_PUBLIC_API_KEY_ERROR:return(0,ce.jsx)(Oe,{severity:ae.severity,message:ae.message,actions:{primary:{label:"Sign In",onClick:()=>{window.location.href="https://cloud.copilotkit.ai"}}}});case B.gR.UPGRADE_REQUIRED_ERROR:return(0,ce.jsx)(Oe,{severity:ae.severity,message:ae.message,actions:{primary:{label:"Upgrade",onClick:()=>{window.location.href="https://copilotkit.ai/"}}}})}}var ye=G(52092),M=G(21739),W=new Te,he=class extends M.Component{constructor(ae){super(ae),this.state={hasError:!1}}static getDerivedStateFromError(ae){return{hasError:!0,error:ae}}componentDidMount(){this.props.publicApiKey&&W.start(this.props.publicApiKey,ae=>{this.setState(pe=>{var Me;return(ae==null?void 0:ae.severity)!==((Me=pe.status)==null?void 0:Me.severity)?{status:ae!=null?ae:void 0}:null})})}componentWillUnmount(){W.stop()}componentDidCatch(ae,pe){console.error("CopilotKit Error:",ae,pe)}render(){var ae,pe;if(this.state.hasError){if(this.state.error instanceof B.KP)return B.qP.includes(this.state.error.name)?(0,ce.jsx)(je,{error:this.state.error,children:ft(this.state.error)}):(0,ce.jsxs)(ce.Fragment,{children:[this.props.children,this.props.showUsageBanner&&(0,ce.jsx)(Oe,{severity:(ae=this.state.status)==null?void 0:ae.severity,message:(pe=this.state.status)==null?void 0:pe.message})]});throw this.state.error}return this.props.children}};function je({error:ae,children:pe}){const Me=(0,ye.cM)();if((0,M.useEffect)(()=>{ae&&Me([ae])},[ae,Me]),!ae)throw ae;return pe}var H=G(69376),de=G(22646),ge=G(98818),Ae=G(95327);function We({children:ae}){const[pe,Me]=(0,M.useState)([]),me=(0,M.useRef)(),Ye=(0,M.useRef)(),$e=(0,M.useRef)(),{threadId:Ge,agentSession:ot,runtimeClient:Ft}=(0,de.I)();return(0,M.useEffect)(()=>{if(!Ge||Ge===me.current||Ge===me.current&&(ot==null?void 0:ot.agentName)===Ye.current)return;(0,ee.Cr)(this,null,function*(){var xt,rn,En,bn;if(!(ot!=null&&ot.agentName))return;const _n=yield Ft.loadAgentState({threadId:Ge,agentName:ot==null?void 0:ot.agentName}),bt=(rn=(xt=_n.data)==null?void 0:xt.loadAgentState)==null?void 0:rn.messages;if(bt!==$e.current&&(bn=(En=_n.data)==null?void 0:En.loadAgentState)!=null&&bn.threadExists){$e.current=bt,me.current=Ge,Ye.current=ot==null?void 0:ot.agentName;const Ct=(0,Ae.FU)(JSON.parse(bt||"[]"));Me(Ct)}})},[Ge,ot==null?void 0:ot.agentName]),(0,ce.jsx)(ge.w.Provider,{value:{messages:pe,setMessages:Me},children:ae})}var yt=G(25590),st=()=>{const[ae,pe]=(0,M.useReducer)(tt,new Map),Me=(0,M.useCallback)(($e,Ge)=>{const ot=(0,yt.kb)();return pe({type:"ADD_ELEMENT",value:$e,id:ot,categories:Ge}),ot},[]),me=(0,M.useCallback)($e=>{pe({type:"REMOVE_ELEMENT",id:$e})},[]),Ye=(0,M.useCallback)($e=>{const Ge=new Set($e),ot=[];return ae.forEach(Ft=>{Ee(Ge,Ft.categories)&&ot.push(Ft.value)}),ot},[ae]);return{addElement:Me,removeElement:me,allElements:Ye}},Nt=st;function tt(ae,pe){switch(pe.type){case"ADD_ELEMENT":{const{value:Me,id:me,categories:Ye}=pe,$e={id:me,value:Me,categories:new Set(Ye)},Ge=new Map(ae);return Ge.set(me,$e),Ge}case"REMOVE_ELEMENT":{const Me=new Map(ae);return Me.delete(pe.id),Me}default:return ae}}function Ee(ae,pe){const[Me,me]=ae.size<=pe.size?[ae,pe]:[pe,ae];for(let Ye of Me)if(me.has(Ye))return!0;return!1}var De=(ae,pe)=>ae.reduce((Me,me)=>{if(me.id!==pe){const Ye=(0,ee.EZ)((0,ee.ih)({},me),{children:De(me.children,pe)});Me.push(Ye)}return Me},[]),mt=(ae,pe,Me)=>Me?ae.map(me=>me.id===Me?(0,ee.EZ)((0,ee.ih)({},me),{children:[...me.children,pe]}):me.children.length?(0,ee.EZ)((0,ee.ih)({},me),{children:mt(me.children,pe,Me)}):me):[...ae,pe],Y=(ae,pe)=>pe===0?(ae+1).toString():pe===1?String.fromCharCode(65+ae):pe===2?String.fromCharCode(97+ae):"-",fe=(ae,pe="",Me=0)=>{const me=" ".repeat(3).repeat(Me),Ye=pe.length+me.length,$e=" ".repeat(Ye),Ge=ae.value.split(`
15
+ `),ot=`${me}${pe}${Ge[0]}`,Ft=Ge.slice(1).map(rn=>`${$e}${rn}`).join(`
16
+ `);let tn=`${ot}
17
+ `;Ft&&(tn+=`${Ft}
18
+ `);const xt=" ".repeat(pe.length);return ae.children.forEach((rn,En)=>tn+=fe(rn,`${xt}${Y(En,Me+1)}. `,Me+1)),tn};function xe(ae,pe){switch(pe.type){case"ADD_NODE":{const{value:Me,parentId:me,id:Ye}=pe,$e={id:Ye,value:Me,children:[],categories:new Set(pe.categories)};try{return mt(ae,$e,me)}catch(Ge){return console.error(`Error while adding node with id ${Ye}: ${Ge}`),ae}}case"REMOVE_NODE":return De(ae,pe.id);default:return ae}}var Ie=()=>{const[ae,pe]=(0,M.useReducer)(xe,[]),Me=(0,M.useCallback)(($e,Ge,ot)=>{const Ft=(0,yt.kb)();return pe({type:"ADD_NODE",value:$e,parentId:ot,id:Ft,categories:Ge}),Ft},[]),me=(0,M.useCallback)($e=>{pe({type:"REMOVE_NODE",id:$e})},[]),Ye=(0,M.useCallback)($e=>{const Ge=new Set($e);let ot="";return ae.forEach((Ft,tn)=>{Se(Ge,Ft.categories)&&(tn!==0&&(ot+=`
19
+ `),ot+=fe(Ft,`${Y(tn,0)}. `))}),ot},[ae]);return{tree:ae,addElement:Me,printTree:Ye,removeElement:me}},nt=Ie;function Se(ae,pe){const[Me,me]=ae.size<=pe.size?[ae,pe]:[pe,ae];for(let Ye of Me)if(me.has(Ye))return!0;return!1}var Le=G(24325),ne=G(20106),_e=G(78828),Pe=G(46522),Je=G(67820);function re(ae){var pe=ae,{children:Me}=pe,me=(0,ee.S0)(pe,["children"]);const Ye=me.showDevConsole===void 0?"auto":me.showDevConsole,$e=(0,H.O)(Ye);return(0,ce.jsx)(ye.VW,{enabled:$e,children:(0,ce.jsx)(he,{publicApiKey:me.publicApiKey,showUsageBanner:$e,children:(0,ce.jsx)(se,(0,ee.EZ)((0,ee.ih)({},me),{children:Me}))})})}function se(ae){const pe=ae,{children:Me}=pe,me=(0,ee.S0)(pe,["children"]);Lt(ae);const Ye=me.runtimeUrl||Ce.xt,[$e,Ge]=(0,M.useState)({}),[ot,Ft]=(0,M.useState)({}),tn=(0,M.useRef)({actions:{},coAgentStateRenders:{}}),{addElement:xt,removeElement:rn,printTree:En}=nt(),[bn,_n]=(0,M.useState)(!1),[bt,Ct]=(0,M.useState)(""),[It,on]=(0,M.useState)({}),[mn,gn]=(0,M.useState)({}),[Wt,Xe]=(0,M.useState)([]),{addElement:Kt,removeElement:_t,allElements:Tn}=Nt(),Mn=(0,M.useCallback)((kt,Rt)=>{Ge(Pt=>(0,ee.EZ)((0,ee.ih)({},Pt),{[kt]:Rt}))},[]),cn=(0,M.useCallback)(kt=>{Ge(Rt=>{const Pt=(0,ee.ih)({},Rt);return delete Pt[kt],Pt})},[]),Mt=(0,M.useCallback)((kt,Rt)=>{Ft(Pt=>(0,ee.EZ)((0,ee.ih)({},Pt),{[kt]:Rt}))},[]),zn=(0,M.useCallback)(kt=>{Ft(Rt=>{const Pt=(0,ee.ih)({},Rt);return delete Pt[kt],Pt})},[]),Gt=(0,M.useCallback)((kt,Rt)=>{const Pt=kt.map(Dn=>`${Dn.name} (${Dn.sourceApplication}):
20
+ ${Dn.getContents()}`).join(`
21
+
22
+ `),qn=En(Rt);return`${Pt}
23
+
24
+ ${qn}`},[En]),dn=(0,M.useCallback)((kt,Rt,Pt=Re)=>xt(kt,Pt,Rt),[xt]),fn=(0,M.useCallback)(kt=>{rn(kt)},[rn]),Vn=(0,M.useCallback)(kt=>qe(Object.values(kt||$e)),[$e]),Wn=(0,M.useCallback)(kt=>Tn(kt),[Tn]),vn=(0,M.useCallback)((kt,Rt=Re)=>Kt(kt,Rt),[Kt]),yn=(0,M.useCallback)(kt=>{_t(kt)},[_t]),kn=(0,M.useMemo)(()=>{var kt,Rt;let Pt;return me.publicApiKey&&(Pt={guardrails:{input:{restrictToTopic:{enabled:!!me.guardrails_c,validTopics:((kt=me.guardrails_c)==null?void 0:kt.validTopics)||[],invalidTopics:((Rt=me.guardrails_c)==null?void 0:Rt.invalidTopics)||[]}}}}),(0,ee.EZ)((0,ee.ih)({publicApiKey:me.publicApiKey},Pt?{cloud:Pt}:{}),{chatApiEndpoint:Ye,headers:me.headers||{},properties:me.properties||{},transcribeAudioUrl:me.transcribeAudioUrl,textToSpeechUrl:me.textToSpeechUrl,credentials:me.credentials})},[me.publicApiKey,me.headers,me.properties,me.transcribeAudioUrl,me.textToSpeechUrl,me.credentials,me.cloudRestrictToTopic,me.guardrails_c]),An=(0,M.useMemo)(()=>{const kt=Object.values(It||{}).reduce((Rt,Pt)=>Pt.status==="authenticated"&&Pt.authHeaders?(0,ee.ih)((0,ee.ih)({},Rt),Object.entries(Pt.authHeaders).reduce((qn,[Dn,Sr])=>(0,ee.EZ)((0,ee.ih)({},qn),{[Dn.startsWith("X-Custom-")?Dn:`X-Custom-${Dn}`]:Sr}),{})):Rt,{});return(0,ee.ih)((0,ee.ih)((0,ee.ih)({},kn.headers||{}),kn.publicApiKey?{[Ce.w8]:kn.publicApiKey}:{}),kt)},[kn.headers,kn.publicApiKey,It]),Nn=(0,Le.p)({url:kn.chatApiEndpoint,publicApiKey:kn.publicApiKey,headers:An,credentials:kn.credentials}),[$n,Gn]=(0,M.useState)({}),Qn=(kt,Rt)=>{Gn(Pt=>(0,ee.EZ)((0,ee.ih)({},Pt),{[kt]:Rt}))},Zn=kt=>{Gn(Rt=>{const Pt=Rt,{[kt]:qn}=Pt;return(0,ee.S0)(Pt,[(0,ee.FL)(kt)])})},[mr,jn]=(0,M.useState)([]),[un,Rn]=(0,M.useState)({}),xn=(0,M.useRef)({}),Vt=(0,M.useCallback)(kt=>{const Rt=typeof kt=="function"?kt(xn.current):kt;xn.current=Rt,Rn(Pt=>Rt)},[]),pn=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(pn.current)return;(0,ee.Cr)(this,null,function*(){var Rt;const Pt=yield Nn.availableAgents();(Rt=Pt.data)!=null&&Rt.availableAgents&&jn(Pt.data.availableAgents.agents),pn.current=!0})},[]);let at=null;me.agent&&(at={agentName:me.agent});const[Dt,Ut]=(0,M.useState)(at);(0,M.useEffect)(()=>{me.agent?Ut({agentName:me.agent}):Ut(null)},[me.agent]);const[Un,Xn]=(0,M.useState)(me.threadId||(0,yt.HP)()),er=(0,M.useCallback)(kt=>{if(me.threadId)throw new Error("Cannot call setThreadId() when threadId is provided via props.");Xn(kt)},[me.threadId]);(0,M.useEffect)(()=>{me.threadId!==void 0&&Xn(me.threadId)},[me.threadId]);const[wr,hn]=(0,M.useState)(null),Nr=(0,M.useRef)(null),gr=me.showDevConsole===void 0?"auto":me.showDevConsole,[or,Jn]=(0,M.useState)(null),vr=(0,M.useCallback)(kt=>{Jn(Rt=>{if(Rt==null)return kt;if(kt==null)return null;let Pt=Rt.event;return kt.event&&(Pt=(0,ee.ih)((0,ee.ih)({},Rt.event),kt.event)),(0,ee.EZ)((0,ee.ih)((0,ee.ih)({},Rt),kt),{event:Pt})})},[]),tr=(0,M.useCallback)(()=>{vr(null)},[]);return(0,ce.jsx)(de.C.Provider,{value:{actions:$e,chatComponentsCache:tn,getFunctionCallHandler:Vn,setAction:Mn,removeAction:cn,coAgentStateRenders:ot,setCoAgentStateRender:Mt,removeCoAgentStateRender:zn,getContextString:Gt,addContext:dn,removeContext:fn,getDocumentsContext:Wn,addDocumentContext:vn,removeDocumentContext:yn,copilotApiConfig:kn,isLoading:bn,setIsLoading:_n,chatSuggestionConfiguration:$n,addChatSuggestionConfiguration:Qn,removeChatSuggestionConfiguration:Zn,chatInstructions:bt,setChatInstructions:Ct,additionalInstructions:Wt,setAdditionalInstructions:Xe,showDevConsole:gr,coagentStates:un,setCoagentStates:Rn,coagentStatesRef:xn,setCoagentStatesWithRef:Vt,agentSession:Dt,setAgentSession:Ut,runtimeClient:Nn,forwardedParameters:me.forwardedParameters||{},agentLock:me.agent||null,threadId:Un,setThreadId:er,runId:wr,setRunId:hn,chatAbortControllerRef:Nr,availableAgents:mr,authConfig_c:me.authConfig_c,authStates_c:It,setAuthStates_c:on,extensions:mn,setExtensions:gn,langGraphInterruptAction:or,setLangGraphInterruptAction:vr,removeLangGraphInterruptAction:tr},children:(0,ce.jsx)(We,{children:Me})})}var Re=["global"];function qe(ae){return pe=>(0,ee.Cr)(this,[pe],function*({name:Me,args:me}){let Ye={};for(let ot of ae)Ye[ot.name]=ot;const $e=Ye[Me];let Ge;return $e&&(yield new Promise((ot,Ft)=>{(0,Je.flushSync)(()=>(0,ee.Cr)(this,null,function*(){var tn;try{Ge=yield(tn=$e.handler)==null?void 0:tn.call($e,me),ot()}catch(xt){Ft(xt)}}))}),yield new Promise(ot=>setTimeout(ot,20))),Ge})}function Ze(ae){return ae.replace(/_c$/,"").split("_").map(pe=>pe.charAt(0).toUpperCase()+pe.slice(1).toLowerCase()).join(" ")}function Lt(ae){const pe=Object.keys(ae).filter(Me=>Me.endsWith("_c"));if(!ae.runtimeUrl&&!ae.publicApiKey)throw new B.UY("Missing required prop: 'runtimeUrl' or 'publicApiKey'");if(pe.length>0&&!ae.publicApiKey)throw new B.nl(`Missing required prop: 'publicApiKey' to use cloud features: ${pe.map(Ze).join(", ")}`)}function Bt(ae){return(0,ee.Cr)(this,arguments,function*({context:pe,instructions:Me,parameters:me,include:Ye,data:$e,abortSignal:Ge,stream:ot,requestType:Ft=_e.J3.Task,forwardedParameters:tn}){var xt,rn;const{messages:En}=pe,bn={name:"extract",description:Me,parameters:me,handler:Kt=>{}},_n=(xt=Ye==null?void 0:Ye.readable)!=null?xt:!1,bt=(rn=Ye==null?void 0:Ye.messages)!=null?rn:!1;let Ct="";$e&&(Ct=(typeof $e=="string"?$e:JSON.stringify($e))+`
25
+
26
+ `),_n&&(Ct+=pe.getContextString([],Re));const It=new Pe.cv({content:jt(Ct,Me),role:Pe.uU.System}),on=new Pe.cv({content:Xt(Me),role:Pe.uU.User}),gn=pe.runtimeClient.asStream(pe.runtimeClient.generateCopilotResponse({data:{frontend:{actions:[{name:bn.name,description:bn.description||"",jsonSchema:JSON.stringify((0,ne.H)(bn.parameters||[]))}],url:window.location.href},messages:(0,Ae.rc)(bt?[It,on,...(0,Ae.kG)(En)]:[It,on]),metadata:{requestType:Ft},forwardedParameters:(0,ee.EZ)((0,ee.ih)({},tn!=null?tn:{}),{toolChoice:"function",toolChoiceFunctionName:bn.name})},properties:pe.copilotApiConfig.properties,signal:Ge})).getReader();let Wt=!0,Xe;for(;;){const{done:Kt,value:_t}=yield gn.read();if(Kt)break;if(Ge!=null&&Ge.aborted)throw new Error("Aborted");Xe=(0,Ae.nR)(_t.generateCopilotResponse.messages).find(Tn=>Tn.isActionExecutionMessage()),Xe&&(ot==null||ot({status:Wt?"initial":"inProgress",args:Xe.arguments}),Wt=!1)}if(!Xe)throw new Error("extract() failed: No function call occurred");return ot==null||ot({status:"complete",args:Xe.arguments}),Xe.arguments})}function Xt(ae){return`
27
+ The user has given you the following task to complete:
28
+
29
+ \`\`\`
30
+ ${ae}
31
+ \`\`\`
32
+
33
+ Any additional messages provided are for providing context only and should not be used to ask questions or engage in conversation.
34
+ `}function jt(ae,pe){return`
35
+ Please act as an efficient, competent, conscientious, and industrious professional assistant.
36
+
37
+ Help the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.
38
+ Always be polite and respectful, and prefer brevity over verbosity.
39
+
40
+ The user has provided you with the following context:
41
+ \`\`\`
42
+ ${ae}
43
+ \`\`\`
44
+
45
+ They have also provided you with a function called extract you MUST call to initiate actions on their behalf.
46
+
47
+ Please assist them as best you can.
48
+
49
+ This is not a conversation, so please do not ask questions. Just call the function without saying anything else.
50
+ `}},35549:function(lt,Ue,G){"use strict";G.d(Ue,{Cr:function(){return W},EZ:function(){return ft},FL:function(){return ye},S0:function(){return M},ih:function(){return Oe}});var ee=Object.defineProperty,Ce=Object.defineProperties,te=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,ke=(he,je,H)=>je in he?ee(he,je,{enumerable:!0,configurable:!0,writable:!0,value:H}):he[je]=H,Oe=(he,je)=>{for(var H in je||(je={}))B.call(je,H)&&ke(he,H,je[H]);if(Te)for(var H of Te(je))ce.call(je,H)&&ke(he,H,je[H]);return he},ft=(he,je)=>Ce(he,te(je)),ye=he=>typeof he=="symbol"?he:he+"",M=(he,je)=>{var H={};for(var de in he)B.call(he,de)&&je.indexOf(de)<0&&(H[de]=he[de]);if(he!=null&&Te)for(var de of Te(he))je.indexOf(de)<0&&ce.call(he,de)&&(H[de]=he[de]);return H},W=(he,je,H)=>new Promise((de,ge)=>{var Ae=st=>{try{yt(H.next(st))}catch(Nt){ge(Nt)}},We=st=>{try{yt(H.throw(st))}catch(Nt){ge(Nt)}},yt=st=>st.done?de(st.value):Promise.resolve(st.value).then(Ae,We);yt((H=H.apply(he,je)).next())})},58176:function(lt,Ue,G){"use strict";G.d(Ue,{C:function(){return yt}});var ee=G(47667),Ce=G(22646),te=G(98818),Te=G(41904),B=G(24325),ce=G(52092),ke=G(35549),Oe=G(21739),ft=G(35538),ye=G(86349),M=G(25590),W=G(78828),he=G(46522),je=G(95327),H=G(44098);function de(tt){const{messages:Ee,setMessages:De,makeSystemMessageCallback:mt,copilotConfig:Y,setIsLoading:fe,initialMessages:xe,isLoading:Ie,actions:nt,onFunctionCall:Se,onCoAgentStateRender:Le,setCoagentStatesWithRef:ne,coagentStatesRef:_e,agentSession:Pe,setAgentSession:Je,threadId:re,setThreadId:se,runId:Re,setRunId:qe,chatAbortControllerRef:Ze,agentLock:Lt,extensions:Bt,setExtensions:Xt,langGraphInterruptAction:jt,setLangGraphInterruptAction:ae}=tt,pe=(0,Oe.useRef)(),Me=(0,ce.cM)(),me=(0,Oe.useRef)(Pe);me.current=Pe;const Ye=(0,Oe.useRef)(Re);Ye.current=Re;const $e=(0,Oe.useRef)(Bt);$e.current=Bt;const Ge=Y.publicApiKey,ot=(0,ke.ih)((0,ke.ih)({},Y.headers||{}),Ge?{[ft.w8]:Ge}:{}),Ft=(0,B.p)({url:Y.chatApiEndpoint,publicApiKey:Y.publicApiKey,headers:ot,credentials:Y.credentials}),tn=(0,ce.UK)(bt=>(0,ke.Cr)(this,null,function*(){var Ct,It,on,mn,gn,Wt,Xe,Kt,_t,Tn,Mn,cn,Mt,zn,Gt;fe(!0);const dn=jt==null?void 0:jt.event;(dn==null?void 0:dn.name)===W.gY.LangGraphInterruptEvent&&(dn!=null&&dn.value)&&!(dn!=null&&dn.response)&&me.current&&Me([new Error("A message was sent while interrupt is active. This will cause failure on the agent side")]);let fn=[new he.cv({content:"",role:he.uU.Assistant})];Ze.current=new AbortController,De([...bt,...fn]);const Wn=[mt(),...xe||[],...bt],vn=(0,ke.ih)({},Y.properties||{});let yn=null;Y.mcpServers&&Array.isArray(Y.mcpServers)&&Y.mcpServers.length>0?yn=Y.mcpServers:(Ct=Y.properties)!=null&&Ct.mcpServers&&Array.isArray(Y.properties.mcpServers)&&Y.properties.mcpServers.length>0&&(yn=Y.properties.mcpServers),yn&&(vn.mcpServers=yn,Y.mcpServers=yn);const kn=me.current!==null,An=Ft.asStream(Ft.generateCopilotResponse({data:(0,ke.EZ)((0,ke.ih)((0,ke.EZ)((0,ke.ih)({frontend:{actions:(0,Te.E)(nt),url:window.location.href},threadId:re,runId:Ye.current,extensions:$e.current,metaEvents:rn([jt==null?void 0:jt.event]),messages:(0,je.rc)((0,je.kG)(Wn))},Y.cloud?{cloud:(0,ke.ih)({},(mn=(on=(It=Y.cloud.guardrails)==null?void 0:It.input)==null?void 0:on.restrictToTopic)!=null&&mn.enabled?{guardrails:{inputValidationRules:{allowList:Y.cloud.guardrails.input.restrictToTopic.validTopics,denyList:Y.cloud.guardrails.input.restrictToTopic.invalidTopics}}}:{})}:{}),{metadata:{requestType:W.J3.Chat}}),me.current?{agentSession:me.current}:{}),{agentStates:Object.values(_e.current).map(un=>{var Rn;return{agentName:un.name,state:JSON.stringify(un.state),config:JSON.stringify((Rn=un.config)!=null?Rn:{})}}),forwardedParameters:tt.forwardedParameters||{}}),properties:vn,signal:(gn=Ze.current)==null?void 0:gn.signal})),Nn=((Kt=(Xe=(Wt=Y.cloud)==null?void 0:Wt.guardrails)==null?void 0:Xe.input)==null?void 0:Kt.restrictToTopic.enabled)||!1,$n=An.getReader();let Gn=[],Qn,Zn=[],mr=[],jn=[];try{for(;;){let xn,Vt;try{const Dt=yield $n.read();xn=Dt.done,Vt=Dt.value}catch(Dt){break}if(xn){if(Ze.current.signal.aborted)return[];break}if(!(Vt!=null&&Vt.generateCopilotResponse))continue;Ye.current=Vt.generateCopilotResponse.runId||null,$e.current=H.t.removeGraphQLTypename(Vt.generateCopilotResponse.extensions||{}),qe(Ye.current),Xt($e.current);let pn=Vt.generateCopilotResponse.messages;const at=(Tn=(_t=Vt.generateCopilotResponse)==null?void 0:_t.metaEvents)!=null?Tn:[];if((at!=null?at:[]).forEach(Dt=>{if(Dt.name===W.gY.LangGraphInterruptEvent){let Ut=(0,he.Tp)(Dt).value;Ut=(0,ye.Mo)(Ut,Ut),ae({event:(0,ke.EZ)((0,ke.ih)({},(0,he.Tp)(Dt)),{value:Ut})})}if(Dt.name===W.gY.CopilotKitLangGraphInterruptEvent){const Ut=Dt.data;pn=[...pn,...Ut.messages],jn=(0,je.nR)((0,je.cl)(Ut.messages))}}),Zn=(0,je.nR)((0,je.cl)(pn)),Zn.length!==0){if(fn=[],((Mn=Vt.generateCopilotResponse.status)==null?void 0:Mn.__typename)==="FailedResponseStatus"&&Vt.generateCopilotResponse.status.reason==="GUARDRAILS_VALIDATION_FAILED"){fn=[new he.cv({role:W.lB.Assistant,content:((cn=Vt.generateCopilotResponse.status.details)==null?void 0:cn.guardrailsReason)||""})],De([...bt,...fn]);break}else{fn=[...Zn];for(const Ut of Zn)if(Ut.isAgentStateMessage()&&!Ut.active&&!Gn.includes(Ut.id)&&Le){if(Nn&&Vt.generateCopilotResponse.status===void 0)break;yield Le({name:Ut.agentName,nodeName:Ut.nodeName,state:Ut.state}),Gn.push(Ut.id)}const Dt=[...Zn].reverse().find(Ut=>Ut.isAgentStateMessage());Dt&&(Dt.state.messages&&Dt.state.messages.length>0&&(mr=(0,je.FU)(Dt.state.messages)),ne(Ut=>(0,ke.EZ)((0,ke.ih)({},Ut),{[Dt.agentName]:{name:Dt.agentName,state:Dt.state,running:Dt.running,active:Dt.active,threadId:Dt.threadId,nodeName:Dt.nodeName,runId:Dt.runId}})),Dt.running?Je({threadId:Dt.threadId,agentName:Dt.agentName,nodeName:Dt.nodeName}):Je(Lt?{threadId:(0,M.kb)(),agentName:Lt,nodeName:void 0}:null))}fn.length>0&&De([...bt,...fn])}}let un=ge([...mr,...jn],bt,fn),Rn=!1;if(Se){const xn=[];for(let Vt=un.length-1;Vt>=0;Vt--){const pn=un[Vt];if((pn.isActionExecutionMessage()||pn.isResultMessage())&&pn.status.code!==W.Bu.Pending)xn.unshift(pn);else break}for(const Vt of xn){De(un);const pn=nt.find(Ut=>Ut.name===Vt.name),at=Vt.isResultMessage()?We(nt,Vt):null,Dt=(Ut,Un)=>(0,ke.Cr)(this,null,function*(){const Xn=jn.find(hn=>hn.id===Un.id);Qn=(Ut==null?void 0:Ut.followUp)||!Xn;const er=yield Ae({onFunctionCall:Se,previousMessages:bt,message:Un,chatAbortControllerRef:Ze,onError:hn=>{Me([hn]),console.error(`Failed to execute action ${Un.name}: ${hn}`)}});Rn=!0;const wr=un.findIndex(hn=>hn.id===Un.id);return un.splice(wr+1,0,er),er});if(pn&&Vt.isActionExecutionMessage()){const Ut=yield Dt(pn,Vt),Un=We(nt,Ut);if(Un){const Xn=new he.NB({name:Un.name,arguments:(0,ye.Mo)(Ut.result,Ut.result),status:Vt.status,createdAt:Vt.createdAt,parentMessageId:Vt.parentMessageId});yield Dt(Un,Xn)}}else if(Vt.isResultMessage()&&at){const Ut=new he.NB({name:at.name,arguments:(0,ye.Mo)(Vt.result,Vt.result),status:Vt.status,createdAt:Vt.createdAt});un.push(Ut),yield Dt(at,Ut)}}De(un)}if(Qn!==!1&&(Rn||!kn&&un.length&&un[un.length-1].isResultMessage())&&!((Mt=Ze.current)!=null&&Mt.signal.aborted))return yield new Promise(xn=>setTimeout(xn,10)),yield pe.current(un);if((zn=Ze.current)!=null&&zn.signal.aborted){const xn=un.filter((pn,at)=>pn.isActionExecutionMessage()?un.find((Dt,Ut)=>Dt.isResultMessage()&&Dt.actionExecutionId===pn.id&&Ut===at+1):!0),Vt=xn.map(pn=>pn.id);return De(xn),(Gt=me.current)!=null&&Gt.nodeName&&Je({threadId:me.current.threadId,agentName:me.current.agentName,nodeName:"__end__"}),fn.filter(pn=>Vt.includes(pn.id))}else return fn.slice()}finally{fe(!1)}}),[Ee,De,mt,Y,fe,xe,Ie,nt,Se,Le,ne,_e,Pe,Je]);pe.current=tn;const xt=(0,ce.UK)(bt=>(0,ke.Cr)(this,null,function*(){yield pe.current(bt)}),[Ee]),rn=(0,Oe.useCallback)(bt=>bt.reduce((Ct,It)=>{if(!It)return Ct;switch(It.name){case W.gY.LangGraphInterruptEvent:if(It.response){ae(null);const on=It.value;return[...Ct,{name:It.name,value:typeof on=="string"?on:JSON.stringify(on),response:typeof It.response=="string"?It.response:JSON.stringify(It.response)}]}return Ct;default:return Ct}},[]),[ae]),En=(0,ce.UK)((bt,Ct)=>(0,ke.Cr)(this,null,function*(){var It;if(Ie)return;const on=[...Ee,bt];if(De(on),(It=Ct==null?void 0:Ct.followUp)!=null?It:!0)return xt(on)}),[Ie,Ee,De,xt]),bn=(0,ce.UK)(bt=>(0,ke.Cr)(this,null,function*(){if(Ie||Ee.length===0)return;const Ct=Ee.findIndex(on=>on.id===bt);if(Ct===-1){console.warn(`Message with id ${bt} not found`);return}let It=Ee.slice(0,Ct);return It.length>0&&It[It.length-1].isAgentStateMessage()&&(It=It.slice(0,It.length-1)),De(It),xt(It)}),[Ie,Ee,De,xt]);return{append:En,reload:bn,stop:()=>{var bt;(bt=Ze.current)==null||bt.abort("Stop was called")},runChatCompletion:()=>pe.current(Ee)}}function ge(tt,Ee,De){const mt=tt.length>0?[...tt]:[...Ee,...De];if(tt.length>0){const Y=[...Ee,...De];let fe;for(const xe of Y){if(xe.isAgentStateMessage()){const Ie=mt.findIndex(nt=>nt.id===fe);Ie!==-1&&mt.splice(Ie+1,0,xe)}fe=xe.id}}return mt}function Ae(tt){return(0,ke.Cr)(this,arguments,function*({onFunctionCall:Ee,previousMessages:De,message:mt,chatAbortControllerRef:Y,onError:fe}){let xe,Ie=null;try{xe=yield Promise.race([Ee({messages:De,name:mt.name,args:mt.arguments}),new Promise(nt=>{var Se;return(Se=Y.current)==null?void 0:Se.signal.addEventListener("abort",()=>nt("Operation was aborted by the user"))}),new Promise(nt=>{var Se;(Se=Y.current)!=null&&Se.signal.aborted&&nt("Operation was aborted by the user")})])}catch(nt){fe(nt)}return new he.W7({id:"result-"+mt.id,result:he.W7.encodeResult(Ie?{content:xe,error:JSON.parse(JSON.stringify(Ie,Object.getOwnPropertyNames(Ie)))}:xe),actionExecutionId:mt.id,actionName:mt.name})})}function We(tt,Ee){let De=null;return Ee.isActionExecutionMessage()?De=Ee.name:Ee.isResultMessage()&&(De=Ee.actionName),tt.find(mt=>mt.name===De&&mt.available==="frontend"||mt.pairedAction===De)}function yt(tt={}){var Ee=tt,{makeSystemMessage:De}=Ee,mt=(0,ke.S0)(Ee,["makeSystemMessage"]);const{getContextString:Y,getFunctionCallHandler:fe,copilotApiConfig:xe,isLoading:Ie,setIsLoading:nt,chatInstructions:Se,actions:Le,coagentStatesRef:ne,setCoagentStatesWithRef:_e,coAgentStateRenders:Pe,agentSession:Je,setAgentSession:re,forwardedParameters:se,agentLock:Re,threadId:qe,setThreadId:Ze,runId:Lt,setRunId:Bt,chatAbortControllerRef:Xt,extensions:jt,setExtensions:ae,langGraphInterruptAction:pe,setLangGraphInterruptAction:Me}=(0,Ce.I)(),{messages:me,setMessages:Ye}=(0,te.p)(),[$e,Ge]=(0,Oe.useState)([]);(0,Oe.useEffect)(()=>{if($e.length>0){const Gt=[...$e];xe.mcpServers=Gt,xe.properties||(xe.properties={}),xe.properties.mcpServers=Gt}},[$e,xe]);const ot=(0,Oe.useCallback)(Gt=>{Ge(Gt)},[]),Ft=(0,ce.UK)(Gt=>(0,ke.Cr)(this,null,function*(){var dn;const{name:fn,nodeName:Vn,state:Wn}=Gt;let vn=Object.values(Pe).find(yn=>yn.name===fn&&yn.nodeName===Vn);vn||(vn=Object.values(Pe).find(yn=>yn.name===fn&&!yn.nodeName)),vn&&(yield(dn=vn.handler)==null?void 0:dn.call(vn,{state:Wn,nodeName:Vn}))}),[Pe]),tn=(0,Oe.useCallback)(()=>{const Gt=De||Nt,dn=Y([],ee.rv);return new he.cv({content:Gt(dn,Se),role:he.uU.System})},[Y,De,Se]),xt=(0,Oe.useCallback)(Gt=>{Ye(dn=>dn.filter(fn=>fn.id!==Gt))},[Ye]),{append:rn,reload:En,stop:bn,runChatCompletion:_n}=de((0,ke.EZ)((0,ke.ih)({},mt),{actions:Object.values(Le),copilotConfig:xe,initialMessages:mt.initialMessages||[],onFunctionCall:fe(),onCoAgentStateRender:Ft,messages:me,setMessages:Ye,makeSystemMessageCallback:tn,isLoading:Ie,setIsLoading:nt,coagentStatesRef:ne,setCoagentStatesWithRef:_e,agentSession:Je,setAgentSession:re,forwardedParameters:se,threadId:qe,setThreadId:Ze,runId:Lt,setRunId:Bt,chatAbortControllerRef:Xt,agentLock:Re,extensions:jt,setExtensions:ae,langGraphInterruptAction:pe,setLangGraphInterruptAction:Me})),bt=st(rn),Ct=(0,ce.UK)((Gt,dn)=>(0,ke.Cr)(this,null,function*(){return yield bt.current(Gt,dn)}),[bt]),It=st(En),on=(0,ce.UK)(Gt=>(0,ke.Cr)(this,null,function*(){return yield It.current(Gt)}),[It]),mn=st(bn),gn=(0,Oe.useCallback)(()=>mn.current(),[mn]),Wt=st(xt),Xe=(0,Oe.useCallback)(Gt=>Wt.current(Gt),[Wt]),Kt=st(Ye),_t=(0,Oe.useCallback)(Gt=>Kt.current(Gt),[Kt]),Tn=st(_n),Mn=(0,ce.UK)(()=>(0,ke.Cr)(this,null,function*(){return yield Tn.current()}),[Tn]),cn=(0,Oe.useCallback)(()=>{gn(),Ye([]),Bt(null),_e({});let Gt=null;Re&&(Gt={agentName:Re}),re(Gt)},[gn,Ye,Ze,_e,re,Re]),Mt=st(cn),zn=(0,Oe.useCallback)(()=>Mt.current(),[Mt]);return{visibleMessages:me,appendMessage:Ct,setMessages:_t,reloadMessages:on,stopGeneration:gn,reset:zn,deleteMessage:Xe,runChatCompletion:Mn,isLoading:Ie,mcpServers:$e,setMcpServers:ot}}function st(tt){const Ee=(0,Oe.useRef)(tt);return(0,Oe.useEffect)(()=>{Ee.current=tt},[tt]),Ee}function Nt(tt,Ee){return`
51
+ Please act as an efficient, competent, conscientious, and industrious professional assistant.
52
+
53
+ Help the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.
54
+ Always be polite and respectful, and prefer brevity over verbosity.
55
+
56
+ The user has provided you with the following context:
57
+ \`\`\`
58
+ ${tt}
59
+ \`\`\`
60
+
61
+ They have also provided you with functions you can call to initiate actions on their behalf, or functions you can call to receive more information.
62
+
63
+ Please assist them as best you can.
64
+
65
+ You can ask them for clarifying questions if needed, but don't be annoying about it. If you can reasonably 'fill in the blanks' yourself, do so.
66
+
67
+ If you would like to call a function, call it without saying anything else.
68
+ In case of a function error:
69
+ - If this error stems from incorrect function parameters or syntax, you may retry with corrected arguments.
70
+ - If the error's source is unclear or seems unrelated to your input, do not attempt further retries.
71
+ `+(Ee?`
72
+
73
+ ${Ee}`:"")}},95327:function(lt,Ue,G){"use strict";G.d(Ue,{nR:function(){return Oe},rc:function(){return ce},cl:function(){return ke},kG:function(){return B},FU:function(){return ft}});var ee=G(46522);function Ce(M){return` \r
74
+ `.indexOf(M)>=0}function te(M){for(var W=["topLevel"],he=0,je,H,de,ge=function(xe){return W.push(xe)},Ae=function(xe){return W[W.length-1]=xe},We=function(xe){je==null&&(je=he,H=W.length,de=xe)},yt=function(xe){xe===de&&(je=void 0,H=void 0,de=void 0)},st=function(){return W.pop()},Nt=function(){return he--},tt=function(xe){if("0"<=xe&&xe<="9"){ge("number");return}switch(xe){case'"':ge("string");return;case"-":ge("numberNeedsDigit");return;case"t":ge("true");return;case"f":ge("false");return;case"n":ge("null");return;case"[":ge("arrayNeedsValue");return;case"{":ge("objectNeedsKey");return}},Ee=M.length;he<Ee;he++){var De=M[he];switch(W[W.length-1]){case"topLevel":tt(De);break;case"string":switch(De){case'"':st();break;case"\\":We("stringEscape"),ge("stringEscaped");break}break;case"stringEscaped":De==="u"?ge("stringUnicode"):(yt("stringEscape"),st());break;case"stringUnicode":he-M.lastIndexOf("u",he)===4&&(yt("stringEscape"),st());break;case"number":De==="."?Ae("numberNeedsDigit"):De==="e"||De==="E"?Ae("numberNeedsExponent"):(De<"0"||De>"9")&&(Nt(),st());break;case"numberNeedsDigit":Ae("number");break;case"numberNeedsExponent":Ae(De==="+"||De==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(De<"a"||De>"z")&&(Nt(),st());break;case"arrayNeedsValue":De==="]"?st():Ce(De)||(yt("collectionItem"),Ae("arrayNeedsComma"),tt(De));break;case"arrayNeedsComma":De==="]"?st():De===","&&(We("collectionItem"),Ae("arrayNeedsValue"));break;case"objectNeedsKey":De==="}"?st():De==='"'&&(We("collectionItem"),Ae("objectNeedsColon"),ge("string"));break;case"objectNeedsColon":De===":"&&Ae("objectNeedsValue");break;case"objectNeedsValue":Ce(De)||(yt("collectionItem"),Ae("objectNeedsComma"),tt(De));break;case"objectNeedsComma":De==="}"?st():De===","&&(We("collectionItem"),Ae("objectNeedsKey"));break}}H!=null&&(W.length=H);for(var mt=[je!=null?M.slice(0,je):M],Y=function(xe){return mt.push(xe.slice(M.length-M.lastIndexOf(xe[0])))},fe=W.length-1;fe>=0;fe--)switch(W[fe]){case"string":mt.push('"');break;case"numberNeedsDigit":case"numberNeedsExponent":mt.push("0");break;case"true":Y("true");break;case"false":Y("false");break;case"null":Y("null");break;case"arrayNeedsValue":case"arrayNeedsComma":mt.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":mt.push("}");break}return mt.join("")}var Te=G(86349);function B(M){return M.filter(W=>!W.isAgentStateMessage())}function ce(M){return M.map(W=>{if(W.isTextMessage())return{id:W.id,createdAt:W.createdAt,textMessage:{content:W.content,role:W.role,parentMessageId:W.parentMessageId}};if(W.isActionExecutionMessage())return{id:W.id,createdAt:W.createdAt,actionExecutionMessage:{name:W.name,arguments:JSON.stringify(W.arguments),parentMessageId:W.parentMessageId}};if(W.isResultMessage())return{id:W.id,createdAt:W.createdAt,resultMessage:{result:W.result,actionExecutionId:W.actionExecutionId,actionName:W.actionName}};if(W.isAgentStateMessage())return{id:W.id,createdAt:W.createdAt,agentStateMessage:{threadId:W.threadId,role:W.role,agentName:W.agentName,nodeName:W.nodeName,runId:W.runId,active:W.active,running:W.running,state:JSON.stringify(W.state)}};if(W.isImageMessage())return{id:W.id,createdAt:W.createdAt,imageMessage:{format:W.format,bytes:W.bytes,role:W.role,parentMessageId:W.parentMessageId}};throw new Error("Unknown message type")})}function ke(M){const W=[];return M.forEach((he,je)=>{if(he.__typename!=="AgentStateMessageOutput")W.push(he);else{const H=W.findIndex(de=>de.__typename==="AgentStateMessageOutput"&&de.agentName===he.agentName);H===-1?W.push(he):W[H]=he}}),W}function Oe(M){return M.map(W=>{if(W.__typename==="TextMessageOutput")return new ee.cv({id:W.id,role:W.role,content:W.content.join(""),parentMessageId:W.parentMessageId,createdAt:new Date,status:W.status||{code:"Pending"}});if(W.__typename==="ActionExecutionMessageOutput")return new ee.NB({id:W.id,name:W.name,arguments:ye(W.arguments),parentMessageId:W.parentMessageId,createdAt:new Date,status:W.status||{code:"Pending"}});if(W.__typename==="ResultMessageOutput")return new ee.W7({id:W.id,result:W.result,actionExecutionId:W.actionExecutionId,actionName:W.actionName,createdAt:new Date,status:W.status||{code:"Pending"}});if(W.__typename==="AgentStateMessageOutput")return new ee.z7({id:W.id,threadId:W.threadId,role:W.role,agentName:W.agentName,nodeName:W.nodeName,runId:W.runId,active:W.active,running:W.running,state:(0,Te.Mo)(W.state,{}),createdAt:new Date});if(W.__typename==="ImageMessageOutput")return new ee.z6({id:W.id,format:W.format,bytes:W.bytes,role:W.role,parentMessageId:W.parentMessageId,createdAt:new Date,status:W.status||{code:"Pending"}});throw new Error("Unknown message type")})}function ft(M){const W=[];for(const he of M)"content"in he?W.push(new ee.cv({id:he.id,role:he.role,content:he.content,parentMessageId:he.parentMessageId,createdAt:he.createdAt||new Date,status:he.status||{code:"Success"}})):"arguments"in he?W.push(new ee.NB({id:he.id,name:he.name,arguments:he.arguments,parentMessageId:he.parentMessageId,createdAt:he.createdAt||new Date,status:he.status||{code:"Success"}})):"result"in he?W.push(new ee.W7({id:he.id,result:he.result,actionExecutionId:he.actionExecutionId,actionName:he.actionName,createdAt:he.createdAt||new Date,status:he.status||{code:"Success"}})):"state"in he?W.push(new ee.z7({id:he.id,threadId:he.threadId,role:he.role,agentName:he.agentName,nodeName:he.nodeName,runId:he.runId,active:he.active,running:he.running,state:he.state,createdAt:he.createdAt||new Date})):"format"in he&&"bytes"in he&&W.push(new ee.z6({id:he.id,format:he.format,bytes:he.bytes,role:he.role,parentMessageId:he.parentMessageId,createdAt:he.createdAt||new Date,status:he.status||{code:"Success"}}));return W}function ye(M){try{return M.length?JSON.parse(te(M.join(""))):{}}catch(W){return{}}}},46522:function(lt,Ue,G){"use strict";G.d(Ue,{NB:function(){return ke},Tp:function(){return M},W7:function(){return Oe},cv:function(){return ce},uU:function(){return B},v0:function(){return Te},z6:function(){return ye},z7:function(){return ft}});var ee=G(78828),Ce=G(25590),te=G(86349),Te=class{constructor(W){var he,je,H;(he=W.id)!=null||(W.id=(0,Ce.kb)()),(je=W.status)!=null||(W.status={code:"Success"}),(H=W.createdAt)!=null||(W.createdAt=new Date),Object.assign(this,W)}isTextMessage(){return this.type==="TextMessage"}isActionExecutionMessage(){return this.type==="ActionExecutionMessage"}isResultMessage(){return this.type==="ResultMessage"}isAgentStateMessage(){return this.type==="AgentStateMessage"}isImageMessage(){return this.type==="ImageMessage"}},B=ee.lB,ce=class extends Te{constructor(W){super(W),this.type="TextMessage"}},ke=class extends Te{constructor(W){super(W),this.type="ActionExecutionMessage"}},Oe=class extends Te{constructor(W){super(W),this.type="ResultMessage"}static decodeResult(W){return(0,te.Mo)(W,W)}static encodeResult(W){return W===void 0?"":typeof W=="string"?W:JSON.stringify(W)}},ft=class extends Te{constructor(W){super(W),this.type="AgentStateMessage"}},ye=class extends Te{constructor(W){super(W),this.type="ImageMessage"}};function M(W){return it(J({},W),{name:"LangGraphInterruptEvent",type:"MetaEvent"})}},44098:function(lt,Ue,G){"use strict";G.d(Ue,{t:function(){return Mr}});var ee=G(78828),Ce={"\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\n generateCopilotResponse(data: $data, properties: $properties) {\n threadId\n runId\n extensions {\n openaiAssistantAPI {\n runId\n threadId\n }\n }\n ... on CopilotResponse @defer {\n status {\n ... on BaseResponseStatus {\n code\n }\n ... on FailedResponseStatus {\n reason\n details\n }\n }\n }\n messages @stream {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content @stream\n role\n parentMessageId\n }\n ... on ImageMessageOutput {\n format\n bytes\n role\n parentMessageId\n }\n ... on ActionExecutionMessageOutput {\n name\n arguments @stream\n parentMessageId\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n ... on AgentStateMessageOutput {\n threadId\n state\n running\n agentName\n nodeName\n runId\n active\n role\n }\n }\n metaEvents @stream {\n ... on LangGraphInterruptEvent {\n type\n name\n value\n }\n\n ... on CopilotKitLangGraphInterruptEvent {\n type\n name\n data {\n messages {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content\n role\n parentMessageId\n }\n ... on ActionExecutionMessageOutput {\n name\n arguments\n parentMessageId\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n }\n value\n }\n }\n }\n }\n }\n":ee.eb,"\n query availableAgents {\n availableAgents {\n agents {\n name\n id\n description\n }\n }\n }\n":ee.jJ,"\n query loadAgentState($data: LoadAgentStateInput!) {\n loadAgentState(data: $data) {\n threadId\n threadExists\n state\n messages\n }\n }\n":ee.Jc};function te(f){var b;return(b=Ce[f])!=null?b:{}}var Te=te(`
75
+ mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {
76
+ generateCopilotResponse(data: $data, properties: $properties) {
77
+ threadId
78
+ runId
79
+ extensions {
80
+ openaiAssistantAPI {
81
+ runId
82
+ threadId
83
+ }
84
+ }
85
+ ... on CopilotResponse @defer {
86
+ status {
87
+ ... on BaseResponseStatus {
88
+ code
89
+ }
90
+ ... on FailedResponseStatus {
91
+ reason
92
+ details
93
+ }
94
+ }
95
+ }
96
+ messages @stream {
97
+ __typename
98
+ ... on BaseMessageOutput {
99
+ id
100
+ createdAt
101
+ }
102
+ ... on BaseMessageOutput @defer {
103
+ status {
104
+ ... on SuccessMessageStatus {
105
+ code
106
+ }
107
+ ... on FailedMessageStatus {
108
+ code
109
+ reason
110
+ }
111
+ ... on PendingMessageStatus {
112
+ code
113
+ }
114
+ }
115
+ }
116
+ ... on TextMessageOutput {
117
+ content @stream
118
+ role
119
+ parentMessageId
120
+ }
121
+ ... on ImageMessageOutput {
122
+ format
123
+ bytes
124
+ role
125
+ parentMessageId
126
+ }
127
+ ... on ActionExecutionMessageOutput {
128
+ name
129
+ arguments @stream
130
+ parentMessageId
131
+ }
132
+ ... on ResultMessageOutput {
133
+ result
134
+ actionExecutionId
135
+ actionName
136
+ }
137
+ ... on AgentStateMessageOutput {
138
+ threadId
139
+ state
140
+ running
141
+ agentName
142
+ nodeName
143
+ runId
144
+ active
145
+ role
146
+ }
147
+ }
148
+ metaEvents @stream {
149
+ ... on LangGraphInterruptEvent {
150
+ type
151
+ name
152
+ value
153
+ }
154
+
155
+ ... on CopilotKitLangGraphInterruptEvent {
156
+ type
157
+ name
158
+ data {
159
+ messages {
160
+ __typename
161
+ ... on BaseMessageOutput {
162
+ id
163
+ createdAt
164
+ }
165
+ ... on BaseMessageOutput @defer {
166
+ status {
167
+ ... on SuccessMessageStatus {
168
+ code
169
+ }
170
+ ... on FailedMessageStatus {
171
+ code
172
+ reason
173
+ }
174
+ ... on PendingMessageStatus {
175
+ code
176
+ }
177
+ }
178
+ }
179
+ ... on TextMessageOutput {
180
+ content
181
+ role
182
+ parentMessageId
183
+ }
184
+ ... on ActionExecutionMessageOutput {
185
+ name
186
+ arguments
187
+ parentMessageId
188
+ }
189
+ ... on ResultMessageOutput {
190
+ result
191
+ actionExecutionId
192
+ actionName
193
+ }
194
+ }
195
+ value
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ `),B=te(`
202
+ query availableAgents {
203
+ availableAgents {
204
+ agents {
205
+ name
206
+ id
207
+ description
208
+ }
209
+ }
210
+ }
211
+ `),ce=te(`
212
+ query loadAgentState($data: LoadAgentStateInput!) {
213
+ loadAgentState(data: $data) {
214
+ threadId
215
+ threadExists
216
+ state
217
+ messages
218
+ }
219
+ }
220
+ `),ke={NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType"},Oe={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};class ft extends Error{constructor(b,I,N,F,D,L,ie){super(b),this.name="GraphQLError",this.message=b,D&&(this.path=D),I&&(this.nodes=Array.isArray(I)?I:[I]),N&&(this.source=N),F&&(this.positions=F),L&&(this.originalError=L);var ue=ie;if(!ue&&L){var be=L.extensions;be&&typeof be=="object"&&(ue=be)}this.extensions=ue||{}}toJSON(){return it(J({},this),{message:this.message})}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var ye,M;function W(f){return new ft(`Syntax Error: Unexpected token at ${M} in ${f}`)}function he(f){if(f.lastIndex=M,f.test(ye))return ye.slice(M,M=f.lastIndex)}var je=/ +(?=[^\s])/y;function H(f){for(var b=f.split(`
221
+ `),I="",N=0,F=0,D=b.length-1,L=0;L<b.length;L++)je.lastIndex=0,je.test(b[L])&&(L&&(!N||je.lastIndex<N)&&(N=je.lastIndex),F=F||L,D=L);for(var ie=F;ie<=D;ie++)ie!==F&&(I+=`
222
+ `),I+=b[ie].slice(N).replace(/\\"""/g,'"""');return I}function de(){for(var f=0|ye.charCodeAt(M++);f===9||f===10||f===13||f===32||f===35||f===44||f===65279;f=0|ye.charCodeAt(M++))if(f===35)for(;(f=ye.charCodeAt(M++))!==10&&f!==13;);M--}function ge(){for(var f=M,b=0|ye.charCodeAt(M++);b>=48&&b<=57||b>=65&&b<=90||b===95||b>=97&&b<=122;b=0|ye.charCodeAt(M++));if(f===M-1)throw W("Name");var I=ye.slice(f,--M);return de(),I}function Ae(){return{kind:"Name",value:ge()}}var We=/(?:"""|(?:[\s\S]*?[^\\])""")/y,yt=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function st(f){var b;switch(ye.charCodeAt(M)){case 91:M++,de();for(var I=[];ye.charCodeAt(M)!==93;)I.push(st(f));return M++,de(),{kind:"ListValue",values:I};case 123:M++,de();for(var N=[];ye.charCodeAt(M)!==125;){var F=Ae();if(ye.charCodeAt(M++)!==58)throw W("ObjectField");de(),N.push({kind:"ObjectField",name:F,value:st(f)})}return M++,de(),{kind:"ObjectValue",fields:N};case 36:if(f)throw W("Variable");return M++,{kind:"Variable",name:Ae()};case 34:if(ye.charCodeAt(M+1)===34&&ye.charCodeAt(M+2)===34){if(M+=3,(b=he(We))==null)throw W("StringValue");return de(),{kind:"StringValue",value:H(b.slice(0,-3)),block:!0}}else{var D=M,L;M++;var ie=!1;for(L=0|ye.charCodeAt(M++);L===92&&(M++,ie=!0)||L!==10&&L!==13&&L!==34&&L;L=0|ye.charCodeAt(M++));if(L!==34)throw W("StringValue");return b=ye.slice(D,M),de(),{kind:"StringValue",value:ie?JSON.parse(b):b.slice(1,-1),block:!1}}case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var ue=M++,be;(be=0|ye.charCodeAt(M++))>=48&&be<=57;);var ut=ye.slice(ue,--M);if((be=ye.charCodeAt(M))===46||be===69||be===101){if((b=he(yt))==null)throw W("FloatValue");return de(),{kind:"FloatValue",value:ut+b}}else return de(),{kind:"IntValue",value:ut};case 110:if(ye.charCodeAt(M+1)===117&&ye.charCodeAt(M+2)===108&&ye.charCodeAt(M+3)===108)return M+=4,de(),{kind:"NullValue"};break;case 116:if(ye.charCodeAt(M+1)===114&&ye.charCodeAt(M+2)===117&&ye.charCodeAt(M+3)===101)return M+=4,de(),{kind:"BooleanValue",value:!0};break;case 102:if(ye.charCodeAt(M+1)===97&&ye.charCodeAt(M+2)===108&&ye.charCodeAt(M+3)===115&&ye.charCodeAt(M+4)===101)return M+=5,de(),{kind:"BooleanValue",value:!1};break}return{kind:"EnumValue",value:ge()}}function Nt(f){if(ye.charCodeAt(M)===40){var b=[];M++,de();do{var I=Ae();if(ye.charCodeAt(M++)!==58)throw W("Argument");de(),b.push({kind:"Argument",name:I,value:st(f)})}while(ye.charCodeAt(M)!==41);return M++,de(),b}}function tt(f){if(ye.charCodeAt(M)===64){var b=[];do M++,b.push({kind:"Directive",name:Ae(),arguments:Nt(f)});while(ye.charCodeAt(M)===64);return b}}function Ee(){for(var f=0;ye.charCodeAt(M)===91;)f++,M++,de();var b={kind:"NamedType",name:Ae()};do if(ye.charCodeAt(M)===33&&(M++,de(),b={kind:"NonNullType",type:b}),f){if(ye.charCodeAt(M++)!==93)throw W("NamedType");de(),b={kind:"ListType",type:b}}while(f--);return b}function De(){if(ye.charCodeAt(M++)!==123)throw W("SelectionSet");return de(),mt()}function mt(){var f=[];do if(ye.charCodeAt(M)===46){if(ye.charCodeAt(++M)!==46||ye.charCodeAt(++M)!==46)throw W("SelectionSet");switch(M++,de(),ye.charCodeAt(M)){case 64:f.push({kind:"InlineFragment",typeCondition:void 0,directives:tt(!1),selectionSet:De()});break;case 111:ye.charCodeAt(M+1)===110?(M+=2,de(),f.push({kind:"InlineFragment",typeCondition:{kind:"NamedType",name:Ae()},directives:tt(!1),selectionSet:De()})):f.push({kind:"FragmentSpread",name:Ae(),directives:tt(!1)});break;case 123:M++,de(),f.push({kind:"InlineFragment",typeCondition:void 0,directives:void 0,selectionSet:mt()});break;default:f.push({kind:"FragmentSpread",name:Ae(),directives:tt(!1)})}}else{var b=Ae(),I=void 0;ye.charCodeAt(M)===58&&(M++,de(),I=b,b=Ae());var N=Nt(!1),F=tt(!1),D=void 0;ye.charCodeAt(M)===123&&(M++,de(),D=mt()),f.push({kind:"Field",alias:I,name:b,arguments:N,directives:F,selectionSet:D})}while(ye.charCodeAt(M)!==125);return M++,de(),{kind:"SelectionSet",selections:f}}function Y(){if(de(),ye.charCodeAt(M)===40){var f=[];M++,de();do{if(ye.charCodeAt(M++)!==36)throw W("Variable");var b=Ae();if(ye.charCodeAt(M++)!==58)throw W("VariableDefinition");de();var I=Ee(),N=void 0;ye.charCodeAt(M)===61&&(M++,de(),N=st(!0)),de(),f.push({kind:"VariableDefinition",variable:{kind:"Variable",name:b},type:I,defaultValue:N,directives:tt(!0)})}while(ye.charCodeAt(M)!==41);return M++,de(),f}}function fe(){var f=Ae();if(ye.charCodeAt(M++)!==111||ye.charCodeAt(M++)!==110)throw W("FragmentDefinition");return de(),{kind:"FragmentDefinition",name:f,typeCondition:{kind:"NamedType",name:Ae()},directives:tt(!1),selectionSet:De()}}function xe(){var f=[];do if(ye.charCodeAt(M)===123)M++,de(),f.push({kind:"OperationDefinition",operation:"query",name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:mt()});else{var b=ge();switch(b){case"fragment":f.push(fe());break;case"query":case"mutation":case"subscription":var I,N=void 0;(I=ye.charCodeAt(M))!==40&&I!==64&&I!==123&&(N=Ae()),f.push({kind:"OperationDefinition",operation:b,name:N,variableDefinitions:Y(),directives:tt(!1),selectionSet:De()});break;default:throw W("Document")}}while(M<ye.length);return f}function Ie(f,b){return ye=f.body?f.body:f,M=0,de(),b&&b.noLocation?{kind:"Document",definitions:xe()}:{kind:"Document",definitions:xe(),loc:{start:0,end:ye.length,startToken:void 0,endToken:void 0,source:{body:ye,name:"graphql.web",locationOffset:{line:1,column:1}}}}}function nt(f,b){return ye=f.body?f.body:f,M=0,de(),st(!1)}function Se(f,b){return ye=f.body?f.body:f,M=0,Ee()}var Le={};function ne(f,b){var I=[],N=[];try{var F=function D(L,ie,ue){var be=!1,ut=b[L.kind]&&b[L.kind].enter||b[L.kind]||b.enter,Qe=ut&&ut.call(b,L,ie,ue,N,I);if(Qe===!1)return L;if(Qe===null)return null;if(Qe===Le)throw Le;Qe&&typeof Qe.kind=="string"&&(be=Qe!==L,L=Qe),ue&&I.push(ue);var He,pt=J({},L);for(var ct in L){N.push(ct);var gt=L[ct];if(Array.isArray(gt)){for(var St=[],Qt=0;Qt<gt.length;Qt++)gt[Qt]!=null&&typeof gt[Qt].kind=="string"&&(I.push(L),N.push(Qt),He=D(gt[Qt],Qt,gt),N.pop(),I.pop(),He==null?be=!0:(be=be||He!==gt[Qt],St.push(He)));gt=St}else gt!=null&&typeof gt.kind=="string"&&(He=D(gt,ct,L))!==void 0&&(be=be||gt!==He,gt=He);N.pop(),be&&(pt[ct]=gt)}ue&&I.pop();var an=b[L.kind]&&b[L.kind].leave||b.leave,en=an&&an.call(b,L,ie,ue,N,I);if(en===Le)throw Le;return en!==void 0?en:Qe!==void 0?be?pt:Qe:be?pt:L}(f);return F!==void 0&&F!==!1?F:f}catch(D){if(D!==Le)throw D;return f}}function _e(f,b,I){for(var N="",F=0;F<f.length;F++)F&&(N+=b),N+=I(f[F]);return N}function Pe(f){return JSON.stringify(f)}function Je(f){return`"""
223
+ `+f.replace(/"""/g,'\\"""')+`
224
+ """`}var re=`
225
+ `,se={OperationDefinition(f){var b=f.operation;return f.name&&(b+=" "+f.name.value),f.variableDefinitions&&f.variableDefinitions.length&&(f.name||(b+=" "),b+="("+_e(f.variableDefinitions,", ",se.VariableDefinition)+")"),f.directives&&f.directives.length&&(b+=" "+_e(f.directives," ",se.Directive)),b!=="query"?b+" "+se.SelectionSet(f.selectionSet):se.SelectionSet(f.selectionSet)},VariableDefinition(f){var b=se.Variable(f.variable)+": "+Re(f.type);return f.defaultValue&&(b+=" = "+Re(f.defaultValue)),f.directives&&f.directives.length&&(b+=" "+_e(f.directives," ",se.Directive)),b},Field(f){var b=f.alias?f.alias.value+": "+f.name.value:f.name.value;if(f.arguments&&f.arguments.length){var I=_e(f.arguments,", ",se.Argument);b.length+I.length+2>80?b+="("+(re+=" ")+_e(f.arguments,re,se.Argument)+(re=re.slice(0,-2))+")":b+="("+I+")"}return f.directives&&f.directives.length&&(b+=" "+_e(f.directives," ",se.Directive)),f.selectionSet&&f.selectionSet.selections.length&&(b+=" "+se.SelectionSet(f.selectionSet)),b},StringValue(f){return f.block?Je(f.value).replace(/\n/g,re):Pe(f.value)},BooleanValue:f=>""+f.value,NullValue:f=>"null",IntValue:f=>f.value,FloatValue:f=>f.value,EnumValue:f=>f.value,Name:f=>f.value,Variable:f=>"$"+f.name.value,ListValue:f=>"["+_e(f.values,", ",Re)+"]",ObjectValue:f=>"{"+_e(f.fields,", ",se.ObjectField)+"}",ObjectField:f=>f.name.value+": "+Re(f.value),Document(f){return!f.definitions||!f.definitions.length?"":_e(f.definitions,`
226
+
227
+ `,Re)},SelectionSet:f=>"{"+(re+=" ")+_e(f.selections,re,Re)+(re=re.slice(0,-2))+"}",Argument:f=>f.name.value+": "+Re(f.value),FragmentSpread(f){var b="..."+f.name.value;return f.directives&&f.directives.length&&(b+=" "+_e(f.directives," ",se.Directive)),b},InlineFragment(f){var b="...";return f.typeCondition&&(b+=" on "+f.typeCondition.name.value),f.directives&&f.directives.length&&(b+=" "+_e(f.directives," ",se.Directive)),b+=" "+se.SelectionSet(f.selectionSet)},FragmentDefinition(f){var b="fragment "+f.name.value;return b+=" on "+f.typeCondition.name.value,f.directives&&f.directives.length&&(b+=" "+_e(f.directives," ",se.Directive)),b+" "+se.SelectionSet(f.selectionSet)},Directive(f){var b="@"+f.name.value;return f.arguments&&f.arguments.length&&(b+="("+_e(f.arguments,", ",se.Argument)+")"),b},NamedType:f=>f.name.value,ListType:f=>"["+Re(f.type)+"]",NonNullType:f=>Re(f.type)+"!"},Re=f=>se[f.kind](f);function qe(f){return re=`
228
+ `,se[f.kind]?se[f.kind](f):""}function Ze(f,b){switch(f.kind){case"NullValue":return null;case"IntValue":return parseInt(f.value,10);case"FloatValue":return parseFloat(f.value);case"StringValue":case"EnumValue":case"BooleanValue":return f.value;case"ListValue":for(var I=[],N=0,F=f.values.length;N<F;N++)I.push(Ze(f.values[N],b));return I;case"ObjectValue":for(var D=Object.create(null),L=0,ie=f.fields.length;L<ie;L++){var ue=f.fields[L];D[ue.name.value]=Ze(ue.value,b)}return D;case"Variable":return b&&b[f.name.value]}}function Lt(f,b,I){if(f.kind==="Variable")return I?Lt(I[f.name.value],b,I):void 0;if(b.kind==="NonNullType")return f.kind!=="NullValue"?Lt(f,b,I):void 0;if(f.kind==="NullValue")return null;if(b.kind==="ListType"){if(f.kind==="ListValue"){for(var N=[],F=0,D=f.values.length;F<D;F++){var L=Lt(f.values[F],b.type,I);if(L===void 0)return;N.push(L)}return N}}else if(b.kind==="NamedType")switch(b.name.value){case"Int":case"Float":case"String":case"Bool":return b.name.value+"Value"===f.kind?Ze(f,I):void 0;default:return Ze(f,I)}}function Bt(f){return f.kind==="Field"||f.kind==="FragmentSpread"||f.kind==="InlineFragment"}function Xt(f,b,I){return{body:f,name:b,locationOffset:I||{line:1,column:1}}}var jt=()=>{},ae=jt;function pe(f){return{tag:0,0:f}}function Me(f){return{tag:1,0:f}}var me=()=>typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator",Ye=()=>typeof Symbol=="function"&&Symbol.observable||"@@observable",$e=f=>f;function Ge(f){return b=>I=>{var N=[],F=ae,D=ae,L=!1,ie=!1;b(ue=>{ie||(ue===0?(ie=!0,D(1),N.length&&I(Me(N)),I(0)):ue.tag===0?(F=ue[0],f(be=>{if(!ie){if(be===0)ie=!0,F(1),N.length&&I(Me(N)),I(0);else if(be.tag===0)D=be[0];else if(N.length){var ut=Me(N);N=[],I(ut)}}})):(N.push(ue[0]),L?L=!1:(L=!0,F(0),D(0))))}),I(pe(ue=>{ue===1&&!ie?(ie=!0,F(1),D(1)):!ie&&!L&&(L=!0,F(0),D(0))}))}}function ot(f){return b=>I=>{var N=[],F=ae,D=ae,L=!1,ie=!1,ue=!1,be=!1;function ut(Qe){ue=!0,Qe(He=>{He===0?ue&&(ue=!1,N.length?ut(f(N.shift())):be?I(0):L||(L=!0,F(0))):He.tag===0?(ie=!1,(D=He[0])(0)):ue&&(I(He),ie?ie=!1:D(0))})}b(Qe=>{be||(Qe===0?(be=!0,!ue&&!N.length&&I(0)):Qe.tag===0?F=Qe[0]:(L=!1,ue?N.push(Qe[0]):ut(f(Qe[0]))))}),I(pe(Qe=>{Qe===1?(be||(be=!0,F(1)),ue&&(ue=!1,D(1))):(!be&&!L&&(L=!0,F(0)),ue&&!ie&&(ie=!0,D(0)))}))}}function Ft(f){return ot($e)(f)}function tn(f){return Ft(yn(f))}function xt(f){return b=>I=>{var N=ae;b(F=>{F===0?I(0):F.tag===0?(N=F[0],I(F)):f(F[0])?I(F):N(0)})}}function rn(f){return b=>I=>b(N=>{N===0||N.tag===0?I(N):I(Me(f(N[0])))})}function En(f){return b=>I=>{var N=[],F=ae,D=!1,L=!1;b(ie=>{L||(ie===0?(L=!0,N.length||I(0)):ie.tag===0?F=ie[0]:(D=!1,function(be){var ut=ae;be(Qe=>{if(Qe===0){if(N.length){var He=N.indexOf(ut);He>-1&&(N=N.slice()).splice(He,1),N.length||(L?I(0):D||(D=!0,F(0)))}}else Qe.tag===0?(N.push(ut=Qe[0]),ut(0)):N.length&&(I(Qe),ut(0))})}(f(ie[0])),D||(D=!0,F(0))))}),I(pe(ie=>{if(ie===1){L||(L=!0,F(1));for(var ue=0,be=N,ut=N.length;ue<ut;ue++)be[ue](1);N.length=0}else{!L&&!D?(D=!0,F(0)):D=!1;for(var Qe=0,He=N,pt=N.length;Qe<pt;Qe++)He[Qe](0)}}))}}function bn(f){return En($e)(f)}function _n(f){return bn(yn(f))}function bt(f){return b=>I=>{var N=!1;b(F=>{if(!N)if(F===0)N=!0,I(0),f();else if(F.tag===0){var D=F[0];I(pe(L=>{L===1?(N=!0,D(1),f()):D(L)}))}else I(F)})}}function Ct(f){return b=>I=>{var N=!1;b(F=>{if(!N)if(F===0)N=!0,I(0);else if(F.tag===0){var D=F[0];I(pe(L=>{L===1&&(N=!0),D(L)}))}else f(F[0]),I(F)})}}function It(f){return b=>I=>b(N=>{N===0?I(0):N.tag===0?(I(N),f()):I(N)})}function on(f){return b=>I=>{var N=ae,F=ae,D,L=!1,ie=!1;b(ue=>{ie||(ue===0?(ie=!0,F(1),I(0)):ue.tag===0?N=ue[0]:(D=ue[0],L?L=!1:(L=!0,F(0),N(0))))}),f(ue=>{if(!ie){if(ue===0)ie=!0,N(1),I(0);else if(ue.tag===0)F=ue[0];else if(D!==void 0){var be=Me(D);D=void 0,I(be)}}}),I(pe(ue=>{ue===1&&!ie?(ie=!0,N(1),F(1)):!ie&&!L&&(L=!0,N(0),F(0))}))}}function mn(f,b){return I=>N=>{var F=b;I(D=>{D===0?N(0):D.tag===0?N(D):N(Me(F=f(F,D[0])))})}}function gn(f){var b=[],I=ae,N=!1;return F=>{b.push(F),b.length===1&&f(D=>{if(D===0){for(var L=0,ie=b,ue=b.length;L<ue;L++)ie[L](0);b.length=0}else if(D.tag===0)I=D[0];else{N=!1;for(var be=0,ut=b,Qe=b.length;be<Qe;be++)ut[be](D)}}),F(pe(D=>{if(D===1){var L=b.indexOf(F);L>-1&&(b=b.slice()).splice(L,1),b.length||I(1)}else N||(N=!0,I(0))}))}}function Wt(f){return b=>I=>{var N=ae,F=f;b(D=>{D===0?I(0):D.tag===0?(N=D[0],I(D)):F-- >0?N(0):I(D)})}}function Xe(f){return b=>I=>{var N=ae,F=ae,D=!0,L=!1,ie=!1;b(ue=>{ie||(ue===0?(ie=!0,D&&F(1),I(0)):ue.tag===0?(N=ue[0],f(be=>{be===0?D&&(ie=!0,N(1)):be.tag===0?(F=be[0])(0):(D=!1,F(1))})):D?L?L=!1:(L=!0,N(0),F(0)):(L=!1,I(ue)))}),I(pe(ue=>{ue===1&&!ie?(ie=!0,N(1),D&&F(1)):!ie&&!L&&(L=!0,D&&F(0),N(0))}))}}function Kt(f){return b=>I=>{var N=ae,F=!0;b(D=>{D===0?I(0):D.tag===0?(N=D[0],I(D)):F?f(D[0])?N(0):(F=!1,I(D)):I(D)})}}function _t(f){return b=>I=>{var N=ae,F=ae,D=!1,L=!1,ie=!1,ue=!1;b(be=>{ue||(be===0?(ue=!0,ie||I(0)):be.tag===0?N=be[0]:(ie&&(F(1),F=ae),D?D=!1:(D=!0,N(0)),function(Qe){ie=!0,Qe(He=>{ie&&(He===0?(ie=!1,ue?I(0):D||(D=!0,N(0))):He.tag===0?(L=!1,(F=He[0])(0)):(I(He),L?L=!1:F(0)))})}(f(be[0]))))}),I(pe(be=>{be===1?(ue||(ue=!0,N(1)),ie&&(ie=!1,F(1))):(!ue&&!D&&(D=!0,N(0)),ie&&!L&&(L=!0,F(0)))}))}}function Tn(f){return _t($e)(f)}function Mn(f){return b=>I=>{var N=ae,F=!1,D=0;b(L=>{F||(L===0?(F=!0,I(0)):L.tag===0?f<=0?(F=!0,I(0),L[0](1)):N=L[0]:D++<f?(I(L),!F&&D>=f&&(F=!0,I(0),N(1))):I(L))}),I(pe(L=>{L===1&&!F?(F=!0,N(1)):L===0&&!F&&D<f&&N(0)}))}}function cn(f){return b=>I=>{var N=[],F=ae;b(D=>{D===0?yn(N)(I):D.tag===0?f<=0?(D[0](1),yn(N)(I)):(F=D[0])(0):(N.length>=f&&f&&N.shift(),N.push(D[0]),F(0))})}}function Mt(f){return b=>I=>{var N=ae,F=ae,D=!1;b(L=>{D||(L===0?(D=!0,F(1),I(0)):L.tag===0?(N=L[0],f(ie=>{ie===0||(ie.tag===0?(F=ie[0])(0):(D=!0,F(1),N(1),I(0)))})):I(L))}),I(pe(L=>{L===1&&!D?(D=!0,N(1),F(1)):D||N(0)}))}}function zn(f,b){return I=>N=>{var F=ae,D=!1;I(L=>{D||(L===0?(D=!0,N(0)):L.tag===0?(F=L[0],N(L)):f(L[0])?N(L):(D=!0,b&&N(L),N(0),F(1)))})}}function Gt(f){return b=>I=>{var N,F=!1,D=!1;b(L=>{if(!D)if(L===0)D=!0,N?F=!0:I(0);else if(L.tag===0){var ie=L[0];I(pe(ue=>{ue===1&&!D?(D=!0,F=!1,N&&clearTimeout(N),ie(1)):D||ie(0)}))}else N&&clearTimeout(N),N=setTimeout(()=>{N=void 0,I(L),F&&I(0)},f(L[0]))})}}function dn(f){return b=>I=>{var N=0;b(F=>{F!==0&&F.tag===0?I(F):(N++,setTimeout(()=>{N&&(N--,I(F))},f))})}}function fn(f){return b=>I=>{var N=!1,F;b(D=>{if(D===0)F&&clearTimeout(F),I(0);else if(D.tag===0){var L=D[0];I(pe(ie=>{ie===1?(F&&clearTimeout(F),L(1)):L(0)}))}else N||(N=!0,F&&clearTimeout(F),F=setTimeout(()=>{F=void 0,N=!1},f(D[0])),I(D))})}}function Vn(f){return b=>f()(b)}function Wn(f){return b=>{var I=f[me()]&&f[me()]()||f,N=!1,F=!1,D=!1,L;b(pe(ie=>Bn(this,null,function*(){if(ie===1)N=!0,I.return&&I.return();else if(F)D=!0;else{for(D=F=!0;D&&!N;)if((L=yield I.next()).done)N=!0,I.return&&(yield I.return()),b(0);else try{D=!1,b(Me(L.value))}catch(ue){if(I.throw)(N=!!(yield I.throw(ue)).done)&&b(0);else throw ue}F=!1}})))}}function vn(f){return f[Symbol.asyncIterator]?Wn(f):b=>{var I=f[Symbol.iterator](),N=!1,F=!1,D=!1,L;b(pe(ie=>{if(ie===1)N=!0,I.return&&I.return();else if(F)D=!0;else{for(D=F=!0;D&&!N;)if((L=I.next()).done)N=!0,I.return&&I.return(),b(0);else try{D=!1,b(Me(L.value))}catch(ue){if(I.throw)(N=!!I.throw(ue).done)&&b(0);else throw ue}F=!1}}))}}var yn=vn;function kn(f){return b=>{var I=!1;b(pe(N=>{N===1?I=!0:I||(I=!0,b(Me(f)),b(0))}))}}function An(f){return b=>{var I=!1,N=f({next(F){I||b(Me(F))},complete(){I||(I=!0,b(0))}});b(pe(F=>{F===1&&!I&&(I=!0,N())}))}}function Nn(){var f,b;return{source:gn(An(I=>(f=I.next,b=I.complete,jt))),next(I){f&&f(I)},complete(){b&&b()}}}var $n=f=>{var b=!1;f(pe(I=>{I===1?b=!0:b||(b=!0,f(0))}))},Gn=f=>{f(pe(ae))};function Qn(f){return An(b=>{var I=0,N=setInterval(()=>b.next(I++),f);return()=>clearInterval(N)})}function Zn(f,b){return An(I=>(f.addEventListener(b,I.next),()=>f.removeEventListener(b,I.next)))}function mr(f){return An(b=>(f.then(I=>{Promise.resolve(I).then(()=>{b.next(I),b.complete()})}),jt))}function jn(f){return b=>{var I=ae,N=!1;return b(F=>{F===0?N=!0:F.tag===0?(I=F[0])(0):N||(f(F[0]),I(0))}),{unsubscribe(){N||(N=!0,I(1))}}}}function un(f){return b=>{jn(f)(b)}}function Rn(f){jn(b=>{})(f)}var xn={done:!0},Vt=f=>{var b=[],I=!1,N=!1,F=!1,D=ae,L;return{next(){return Bn(this,null,function*(){return N||(N=!0,f(ue=>{I||(ue===0?(L&&(L=L(xn)),I=!0):ue.tag===0?(F=!0,(D=ue[0])(0)):(F=!1,L?L=L({value:ue[0],done:!1}):b.push(ue[0])))})),I&&!b.length?xn:(!I&&!F&&b.length<=1&&(F=!0,D(0)),b.length?{value:b.shift(),done:!1}:new Promise(ue=>L=ue))})},return(){return Bn(this,null,function*(){return I||(L=D(1)),I=!0,xn})},[me()](){return this}}};function pn(f){var b=[],I=ae,N=!1;return f(F=>{F===0?N=!0:F.tag===0?(I=F[0])(0):(b.push(F[0]),I(0))}),N||I(1),b}function at(f){return new Promise(b=>{var I=ae,N;f(F=>{F===0?Promise.resolve(N).then(b):F.tag===0?(I=F[0])(0):(N=F[0],I(0))})})}function Dt(f){var b=Object.keys(f).length;return I=>{var N=new Set,F=Array.isArray(f)?new Array(b).fill(ae):{},D=Array.isArray(f)?new Array(b):{},L=!1,ie=!1,ue=!1,be=0,ut=function(He){f[He](pt=>{if(pt===0)be>=b-1?(ue=!0,I(0)):be++;else if(pt.tag===0)F[He]=pt[0];else if(!ue)if(D[He]=pt[0],N.add(He),!L&&N.size<b)if(ie)ie=!1;else for(var ct in f)N.has(ct)||(F[ct]||ae)(0);else L=!0,ie=!1,I(Me(Array.isArray(D)?D.slice():J({},D)))})};for(var Qe in f)ut(Qe);I(pe(He=>{if(!ue){if(He===1){ue=!0;for(var pt in F)F[pt](1)}else if(!ie){ie=!0;for(var ct in F)F[ct](0)}}}))}}function Ut(...f){return Dt(f)}function Un(f){return b=>{var I=(f[Ye()]?f[Ye()]():f).subscribe({next(N){b(Me(N))},complete(){b(0)},error(N){throw N}});b(pe(N=>{N===1&&I.unsubscribe()}))}}function Xn(f){return{subscribe(b,I,N){var F=typeof b=="object"?b:{next:b,error:I,complete:N},D=ae,L=!1;f(ue=>{L||(ue===0?(L=!0,F.complete&&F.complete()):ue.tag===0?(D=ue[0])(0):(F.next(ue[0]),D(0)))});var ie={closed:!1,unsubscribe(){ie.closed=!0,L=!0,D(1)}};return ie},[Ye()](){return this}}}function er(f){return b=>{f(0,(I,N)=>{b(I===0?pe(F=>{N(F+1)}):I===1?Me(N):0)})}}function wr(f){return(b,I)=>{b===0&&f(N=>{N===0?I(2):N.tag===0?I(0,F=>{F<3&&N[0](F-1)}):I(1,N[0])})}}var hn=(...f)=>{for(var b=f[0],I=1,N=f.length;I<N;I++)b=f[I](b);return b},Nr=f=>f&&typeof f.message=="string"&&(f.extensions||f.name==="GraphQLError")?f:typeof f=="object"&&typeof f.message=="string"?new ft(f.message,f.nodes,f.source,f.positions,f.path,f,f.extensions||{}):new ft(f);class gr extends Error{constructor(b){var I=(b.graphQLErrors||[]).map(Nr),N=((F,D)=>{var L="";if(F)return`[Network] ${F.message}`;if(D)for(var ie=0,ue=D.length;ie<ue;ie++)L&&(L+=`
229
+ `),L+=`[GraphQL] ${D[ie].message}`;return L})(b.networkError,I);super(N),this.name="CombinedError",this.message=N,this.graphQLErrors=I,this.networkError=b.networkError,this.response=b.response}toString(){return this.message}}var or=(f,b)=>{for(var I=0|(b||5381),N=0,F=0|f.length;N<F;N++)I=(I<<5)+I+f.charCodeAt(N);return I},Jn=new Set,vr=new WeakMap,tr=(f,b)=>{if(f===null||Jn.has(f))return"null";if(typeof f!="object")return JSON.stringify(f)||"";if(f.toJSON)return tr(f.toJSON(),b);if(Array.isArray(f)){for(var I="[",N=0,F=f.length;N<F;N++)I.length>1&&(I+=","),I+=tr(f[N],b)||"null";return I+="]"}else if(!b&&(qn!==Pt&&f instanceof qn||Dn!==Pt&&f instanceof Dn))return"null";var D=Object.keys(f).sort();if(!D.length&&f.constructor&&Object.getPrototypeOf(f).constructor!==Object.prototype.constructor){var L=vr.get(f)||Math.random().toString(36).slice(2);return vr.set(f,L),tr({__key:L},b)}Jn.add(f);for(var ie="{",ue=0,be=D.length;ue<be;ue++){var ut=tr(f[D[ue]],b);ut&&(ie.length>1&&(ie+=","),ie+=tr(D[ue],b)+":"+ut)}return Jn.delete(f),ie+="}"},kt=(f,b,I)=>{if(!(I==null||typeof I!="object"||I.toJSON||Jn.has(I)))if(Array.isArray(I))for(var N=0,F=I.length;N<F;N++)kt(f,`${b}.${N}`,I[N]);else if(I instanceof qn||I instanceof Dn)f.set(b,I);else{Jn.add(I);for(var D in I)kt(f,`${b}.${D}`,I[D])}},Rt=(f,b)=>(Jn.clear(),tr(f,b||!1));class Pt{}var qn=typeof File!="undefined"?File:Pt,Dn=typeof Blob!="undefined"?Blob:Pt,Sr=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,Ur=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,Br=(f,b)=>b%2==0?f.replace(Ur,`
230
+ `):f,ur=f=>f.split(Sr).map(Br).join("").trim(),ir=new Map,Er=new Map,Tr=f=>{var b;return typeof f=="string"?b=ur(f):f.loc&&Er.get(f.__key)===f?b=f.loc.source.body:(b=ir.get(f)||ur(qe(f)),ir.set(f,b)),typeof f!="string"&&!f.loc&&(f.loc={start:0,end:b.length,source:{body:b,name:"gql",locationOffset:{line:1,column:1}}}),b},zr=f=>{var b;if(f.documentId)b=or(f.documentId);else if(b=or(Tr(f)),f.definitions){var I=$r(f);I&&(b=or(`
231
+ # ${I}`,b))}return b},Vr=f=>{var b,I;return typeof f=="string"?(b=zr(f),I=Er.get(b)||Ie(f,{noLocation:!0})):(b=f.__key||zr(f),I=Er.get(b)||f),I.loc||Tr(I),I.__key=b,Er.set(b,I),I},yr=(f,b,I)=>{var N=b||{},F=Vr(f),D=Rt(N,!0),L=F.__key;return D!=="{}"&&(L=or(D,L)),{key:L,query:F,variables:N,extensions:I}},$r=f=>{for(var b=0,I=f.definitions.length;b<I;b++){var N=f.definitions[b];if(N.kind===ke.OPERATION_DEFINITION)return N.name?N.name.value:void 0}},fi=f=>{for(var b=0,I=f.definitions.length;b<I;b++){var N=f.definitions[b];if(N.kind===a.OPERATION_DEFINITION)return N.operation}},Rr=(f,b,I)=>{if(!("data"in b||"errors"in b&&Array.isArray(b.errors)))throw new Error("No Content");var N=f.kind==="subscription";return{operation:f,data:b.data,error:Array.isArray(b.errors)?new gr({graphQLErrors:b.errors,response:I}):void 0,extensions:b.extensions?J({},b.extensions):void 0,hasNext:b.hasNext==null?N:b.hasNext,stale:!1}},Cr=(f,b)=>{if(typeof f=="object"&&f!=null){if(Array.isArray(f)){f=[...f];for(var I=0,N=b.length;I<N;I++)f[I]=Cr(f[I],b[I]);return f}if(!f.constructor||f.constructor===Object){f=J({},f);for(var F in b)f[F]=Cr(f[F],b[F]);return f}}return b},Yr=(f,b,I,N)=>{var F=f.error?f.error.graphQLErrors:[],D=!!f.extensions||!!(b.payload||b).extensions,L=J(J({},f.extensions),(b.payload||b).extensions),ie=b.incremental;"path"in b&&(ie=[b]);var ue={data:f.data};if(ie)for(var be=function(){var He=ie[ut];Array.isArray(He.errors)&&F.push(...He.errors),He.extensions&&(Object.assign(L,He.extensions),D=!0);var pt="data",ct=ue,gt=[];if(He.path)gt=He.path;else if(N){var St=N.find(rt=>rt.id===He.id);He.subPath?gt=[...St.path,...He.subPath]:gt=St.path}for(var Qt=0,an=gt.length;Qt<an;pt=gt[Qt++])ct=ct[pt]=Array.isArray(ct[pt])?[...ct[pt]]:J({},ct[pt]);if(He.items)for(var en=+pt>=0?pt:0,Fe=0,At=He.items.length;Fe<At;Fe++)ct[en+Fe]=Cr(ct[en+Fe],He.items[Fe]);else He.data!==void 0&&(ct[pt]=Cr(ct[pt],He.data))},ut=0,Qe=ie.length;ut<Qe;ut++)be();else ue.data=(b.payload||b).data||f.data,F=b.errors||b.payload&&b.payload.errors||F;return{operation:f.operation,data:ue.data,error:F.length?new gr({graphQLErrors:F,response:I}):void 0,extensions:D?L:void 0,hasNext:b.hasNext!=null?b.hasNext:f.hasNext,stale:!1}},Xr=(f,b,I)=>({operation:f,data:void 0,error:new gr({networkError:b,response:I}),extensions:void 0,hasNext:!1,stale:!1});function Zr(f){var b={query:void 0,documentId:void 0,operationName:$r(f.query),variables:f.variables||void 0,extensions:f.extensions};return"documentId"in f.query&&f.query.documentId&&(!f.query.definitions||!f.query.definitions.length)?b.documentId=f.query.documentId:(!f.extensions||!f.extensions.persistedQuery||f.extensions.persistedQuery.miss)&&(b.query=Tr(f.query)),b}var ei=(f,b)=>{var I=f.kind==="query"&&f.context.preferGetMethod;if(!I||!b)return f.context.url;var N=ti(f.context.url);for(var F in b){var D=b[F];D&&N[1].set(F,typeof D=="object"?Rt(D):D)}var L=N.join("?");return L.length>2047&&I!=="force"?(f.context.preferGetMethod=!1,f.context.url):L},ti=f=>{var b=f.indexOf("?");return b>-1?[f.slice(0,b),new URLSearchParams(f.slice(b+1))]:[f,new URLSearchParams]},ni=(f,b)=>{if(b&&!(f.kind==="query"&&f.context.preferGetMethod)){var I=Rt(b),N=(ie=>{var ue=new Map;return(qn!==Pt||Dn!==Pt)&&(Jn.clear(),kt(ue,"variables",ie)),ue})(b.variables);if(N.size){var F=new FormData;F.append("operations",I),F.append("map",Rt(J({},[...N.keys()].map(ie=>[ie]))));var D=0;for(var L of N.values())F.append(""+D++,L);return F}return I}},Kr=(f,b)=>{var I={accept:f.kind==="subscription"?"text/event-stream, multipart/mixed":"application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"},N=(typeof f.context.fetchOptions=="function"?f.context.fetchOptions():f.context.fetchOptions)||{};if(N.headers)if((L=>"has"in L&&!Object.keys(L).length)(N.headers))N.headers.forEach((L,ie)=>{I[ie]=L});else if(Array.isArray(N.headers))N.headers.forEach((L,ie)=>{Array.isArray(L)?I[L[0]]?I[L[0]]=`${I[L[0]]},${L[1]}`:I[L[0]]=L[1]:I[ie]=L});else for(var F in N.headers)I[F.toLowerCase()]=N.headers[F];var D=ni(f,b);return typeof D=="string"&&!I["content-type"]&&(I["content-type"]="application/json"),it(J({},N),{method:D?"POST":"GET",body:D,headers:I})},ri=typeof TextDecoder!="undefined"?new TextDecoder:null,ii=/boundary="?([^=";]+)"?/i,ai=/data: ?([^\n]+)/,Wr=f=>f.constructor.name==="Buffer"?f.toString():ri.decode(f);function Pr(f){return _r(this,null,function*(){if(f.body[Symbol.asyncIterator])try{for(var F=jr(f.body),D,L,ie;D=!(L=yield new Fn(F.next())).done;D=!1){var b=L.value;yield Wr(b)}}catch(L){ie=[L]}finally{try{D&&(L=F.return)&&(yield new Fn(L.call(F)))}finally{if(ie)throw ie[0]}}else{var I=f.body.getReader(),N;try{for(;!(N=yield new Fn(I.read())).done;)yield Wr(N.value)}finally{I.cancel()}}})}function Ir(f,b){return _r(this,null,function*(){var I="",N;try{for(var D=jr(f),L,ie,ue;L=!(ie=yield new Fn(D.next())).done;L=!1){var F=ie.value;for(I+=F;(N=I.indexOf(b))>-1;)yield I.slice(0,N),I=I.slice(N+b.length)}}catch(ie){ue=[ie]}finally{try{L&&(ie=D.return)&&(yield new Fn(ie.call(D)))}finally{if(ue)throw ue[0]}}})}function Fr(f,b,I){return _r(this,null,function*(){var N=!0,F=null,D;try{yield yield new Fn(Promise.resolve());var L=(D=yield new Fn((f.context.fetch||fetch)(b,I))).headers.get("Content-Type")||"",ie;/multipart\/mixed/i.test(L)?ie=function(gt,St){return _r(this,null,function*(){var Qt=gt.match(ii),an="--"+(Qt?Qt[1]:"-"),en=!0,Fe;try{for(var Kn=jr(Ir(Pr(St),`\r
232
+ `+an)),ar,Fi,da;ar=!(Fi=yield new Fn(Kn.next())).done;ar=!1){var At=Fi.value;if(en){en=!1;var rt=At.indexOf(an);if(rt>-1)At=At.slice(rt+an.length);else continue}try{yield Fe=JSON.parse(At.slice(At.indexOf(`\r
233
+ \r
234
+ `)+4))}catch(yi){if(!Fe)throw yi}if(Fe&&Fe.hasNext===!1)break}}catch(Fi){da=[Fi]}finally{try{ar&&(Fi=Kn.return)&&(yield new Fn(Fi.call(Kn)))}finally{if(da)throw da[0]}}Fe&&Fe.hasNext!==!1&&(yield{hasNext:!1})})}(L,D):/text\/event-stream/i.test(L)?ie=function(gt){return _r(this,null,function*(){var St;try{for(var Fe=jr(Ir(Pr(gt),`
235
+
236
+ `)),At,rt,Kn;At=!(rt=yield new Fn(Fe.next())).done;At=!1){var Qt=rt.value;var an=Qt.match(ai);if(an){var en=an[1];try{yield St=JSON.parse(en)}catch(ar){if(!St)throw ar}if(St&&St.hasNext===!1)break}}}catch(rt){Kn=[rt]}finally{try{At&&(rt=Fe.return)&&(yield new Fn(rt.call(Fe)))}finally{if(Kn)throw Kn[0]}}St&&St.hasNext!==!1&&(yield{hasNext:!1})})}(D):/text\//i.test(L)?ie=function(gt){return _r(this,null,function*(){var St=yield new Fn(gt.text());try{var Qt=JSON.parse(St);yield Qt}catch(an){throw new Error(St)}})}(D):ie=function(gt){return _r(this,null,function*(){yield JSON.parse(yield new Fn(gt.text()))})}(D);var ue;try{for(var ut=jr(ie),Qe,He,pt;Qe=!(He=yield new Fn(ut.next())).done;Qe=!1){var be=He.value;be.pending&&!F?ue=be.pending:be.pending&&(ue=[...ue,...be.pending]),F=F?Yr(F,be,D,ue):Rr(f,be,D),N=!1,yield F,N=!0}}catch(He){pt=[He]}finally{try{Qe&&(He=ut.return)&&(yield new Fn(He.call(ut)))}finally{if(pt)throw pt[0]}}F||(yield F=Rr(f,{},D))}catch(ct){if(!N)throw ct;yield Xr(f,D&&(D.status<200||D.status>=300)&&D.statusText?new Error(D.statusText):ct,D)}})}function S(f,b,I){var N;return typeof AbortController!="undefined"&&(I.signal=(N=new AbortController).signal),bt(()=>{N&&N.abort()})(xt(F=>!!F)(Wn(Fr(f,b,I))))}var l=(f,b)=>{if(Array.isArray(f))for(var I=0,N=f.length;I<N;I++)l(f[I],b);else if(typeof f=="object"&&f!==null)for(var F in f)F==="__typename"&&typeof f[F]=="string"?b.add(f[F]):l(f[F],b);return b},h=f=>{if("definitions"in f){for(var b=[],I=0,N=f.definitions.length;I<N;I++){var F=h(f.definitions[I]);b.push(F)}return it(J({},f),{definitions:b})}if("directives"in f&&f.directives&&f.directives.length){for(var D=[],L={},ie=0,ue=f.directives.length;ie<ue;ie++){var be=f.directives[ie],ut=be.name.value;ut[0]!=="_"?D.push(be):ut=ut.slice(1),L[ut]=be}f=it(J({},f),{directives:D,_directives:L})}if("selectionSet"in f){var Qe=[],He=f.kind===ke.OPERATION_DEFINITION;if(f.selectionSet){for(var pt=0,ct=f.selectionSet.selections.length;pt<ct;pt++){var gt=f.selectionSet.selections[pt];He=He||gt.kind===ke.FIELD&&gt.name.value==="__typename"&&!gt.alias;var St=h(gt);Qe.push(St)}return He||Qe.push({kind:ke.FIELD,name:{kind:ke.NAME,value:"__typename"},_generated:!0}),it(J({},f),{selectionSet:it(J({},f.selectionSet),{selections:Qe})})}}return f},A=new Map,R=f=>{var b=Vr(f),I=A.get(b.__key);return I||(A.set(b.__key,I=h(b)),Object.defineProperty(I,"__key",{value:b.__key,enumerable:!1})),I};function P(f){var b=I=>f(I);return b.toPromise=()=>at(Mn(1)(xt(I=>!I.stale&&!I.hasNext)(b))),b.then=(I,N)=>b.toPromise().then(I,N),b.subscribe=I=>jn(I)(b),b}function oe(f,b,I){return it(J({},b),{kind:f,context:b.context?J(J({},b.context),I):I||b.context})}var le=(f,b)=>oe(f.kind,f,{meta:J(J({},f.context.meta),b)}),Be=()=>{};function Ve(f){for(var b=new Map,I=[],N=[],F=Array.isArray(f)?f[0]:f||"",D=1;D<arguments.length;D++){var L=arguments[D];L&&L.definitions?N.push(L):F+=L,F+=arguments[0][D]}N.unshift(r(F));for(var ie=0;ie<N.length;ie++)for(var ue=0;ue<N[ie].definitions.length;ue++){var be=N[ie].definitions[ue];if(be.kind===e.FRAGMENT_DEFINITION){var ut=be.name.value,Qe=t(be);b.has(ut)||(b.set(ut,Qe),I.push(be))}else I.push(be)}return r({kind:e.DOCUMENT,definitions:I})}var wt=({kind:f})=>f!=="mutation"&&f!=="query",wn=f=>{var b=R(f.query);if(b!==f.query){var I=oe(f.kind,f);return I.query=b,I}else return f},kr=({forward:f,client:b,dispatchDebug:I})=>{var N=new Map,F=new Map,D=L=>L.kind==="query"&&L.context.requestPolicy!=="network-only"&&(L.context.requestPolicy==="cache-only"||N.has(L.key));return L=>{var ie=rn(be=>{var ut=N.get(be.key),Qe=ut||Rr(be,{data:null});return Qe=it(J({},Qe),{operation:le(be,{cacheOutcome:ut?"hit":"miss"})}),be.context.requestPolicy==="cache-and-network"&&(Qe.stale=!0,lr(b,be)),Qe})(xt(be=>!wt(be)&&D(be))(L)),ue=Ct(be=>{var{operation:ut}=be;if(ut){var Qe=ut.context.additionalTypenames||[];if(be.operation.kind!=="subscription"&&(Qe=(At=>[...l(At,new Set)])(be.data).concat(Qe)),be.operation.kind==="mutation"||be.operation.kind==="subscription"){for(var He=new Set,pt=0;pt<Qe.length;pt++){var ct=Qe[pt],gt=F.get(ct);gt||F.set(ct,gt=new Set);for(var St of gt.values())He.add(St);gt.clear()}for(var Qt of He.values())N.has(Qt)&&(ut=N.get(Qt).operation,N.delete(Qt),lr(b,ut))}else if(ut.kind==="query"&&be.data){N.set(ut.key,be);for(var an=0;an<Qe.length;an++){var en=Qe[an],Fe=F.get(en);Fe||F.set(en,Fe=new Set),Fe.add(ut.key)}}}})(f(xt(be=>be.kind!=="query"||be.context.requestPolicy!=="cache-only")(rn(be=>le(be,{cacheOutcome:"miss"}))(_n([rn(wn)(xt(be=>!wt(be)&&!D(be))(L)),xt(be=>wt(be))(L)])))));return _n([ie,ue])}},lr=(f,b)=>f.reexecuteOperation(oe(b.kind,b,{requestPolicy:"network-only"})),si=new Set,Ni=(f={})=>{var b=!!f.staleWhileRevalidate,I=!!f.includeExtensions,N={},F=[],D=ie=>{F.push(ie.operation.key),F.length===1&&Promise.resolve().then(()=>{for(var ue;ue=F.shift();)N[ue]=null})},L=({client:ie,forward:ue})=>be=>{var ut=f&&typeof f.isClient=="boolean"?!!f.isClient:!ie.suspense,Qe=ue(m(wn)(k(pt=>pt.kind==="teardown"||!N[pt.key]||!!N[pt.key].hasNext||pt.context.requestPolicy==="network-only")(be))),He=m(pt=>{var ct=((gt,St,Qt)=>({operation:gt,data:St.data?JSON.parse(St.data):void 0,extensions:Qt&&St.extensions?JSON.parse(St.extensions):void 0,error:St.error?new a({networkError:St.error.networkError?new Error(St.error.networkError):void 0,graphQLErrors:St.error.graphQLErrors}):void 0,stale:!1,hasNext:!!St.hasNext}))(pt,N[pt.key],I);return b&&!si.has(pt.key)&&(ct.stale=!0,si.add(pt.key),lr(ie,pt)),it(J({},ct),{operation:le(pt,{cacheOutcome:"hit"})})})(k(pt=>pt.kind!=="teardown"&&!!N[pt.key]&&pt.context.requestPolicy!=="network-only")(be));return ut?He=x(D)(He):Qe=x(pt=>{var{operation:ct}=pt;if(ct.kind!=="mutation"){var gt=((St,Qt)=>{var an={hasNext:St.hasNext};return St.data!==void 0&&(an.data=JSON.stringify(St.data)),Qt&&St.extensions!==void 0&&(an.extensions=JSON.stringify(St.extensions)),St.error&&(an.error={graphQLErrors:St.error.graphQLErrors.map(en=>!en.path&&!en.extensions?en.message:{message:en.message,path:en.path,extensions:en.extensions})},St.error.networkError&&(an.error.networkError=""+St.error.networkError)),an})(pt,I);N[ct.key]=gt}})(Qe),g([Qe,He])};return L.restoreData=ie=>{for(var ue in ie)N[ue]!==null&&(N[ue]=ie[ue])},L.extractData=()=>{var ie={};for(var ue in N)N[ue]!=null&&(ie[ue]=N[ue]);return ie},f&&f.initialState&&L.restoreData(f.initialState),L},Ti=({forwardSubscription:f,enableAllOperations:b,isSubscriptionOperation:I})=>({client:N,forward:F})=>{var D=I||(L=>L.kind==="subscription"||!!b&&(L.kind==="query"||L.kind==="mutation"));return L=>{var ie=w(be=>{var{key:ut}=be,Qe=k(He=>He.kind==="teardown"&&He.key===ut)(L);return O(Qe)((He=>{var pt=f(o(He),He);return E(ct=>{var gt=!1,St,Qt;function an(en){ct.next(Qt=Qt?c(Qt,en):n(He,en))}return Promise.resolve().then(()=>{gt||(St=pt.subscribe({next:an,error(en){Array.isArray(en)?an({errors:en}):ct.next(s(He,en)),ct.complete()},complete(){gt||(gt=!0,He.kind==="subscription"&&N.reexecuteOperation(oe("teardown",He,He.context)),Qt&&Qt.hasNext&&an({hasNext:!1}),ct.complete())}}))}),()=>{gt=!0,St&&St.unsubscribe()}})})(be))})(k(be=>be.kind!=="teardown"&&D(be))(L)),ue=F(k(be=>be.kind==="teardown"||!D(be))(L));return g([ie,ue])}},Ri=({forward:f})=>b=>f(b),pi=({forward:f,dispatchDebug:b})=>I=>{var N=En(D=>{var L=Zr(D),ie=ei(D,L),ue=Kr(D,L),be=Mt(xt(ut=>ut.kind==="teardown"&&ut.key===D.key)(I))(S(D,ie,ue));return be})(xt(D=>D.kind!=="teardown"&&(D.kind!=="subscription"||!!D.context.fetchSubscriptions))(I)),F=f(xt(D=>D.kind==="teardown"||D.kind==="subscription"&&!D.context.fetchSubscriptions)(I));return _n([N,F])},hi=f=>({client:b,forward:I,dispatchDebug:N})=>f.reduceRight((F,D)=>{var L=!1;return D({client:b,forward(ie){return gn(F(gn(ie)))},dispatchDebug(ie){}})},I),Pi=({onOperation:f,onResult:b,onError:I})=>({forward:N})=>F=>w(D=>{I&&D.error&&I(D.error,D.operation);var L=b&&b(D)||D;return"then"in L?q(L):_(L)})(N(w(D=>{var L=f&&f(D)||D;return"then"in L?q(L):_(L)})(F))),mi=({dispatchDebug:f})=>b=>xt(I=>!1)(b),gi=function f(b){var I=0,N=new Map,F=new Map,D=new Set,L=[],ie={url:b.url,fetchSubscriptions:b.fetchSubscriptions,fetchOptions:b.fetchOptions,fetch:b.fetch,preferGetMethod:b.preferGetMethod,requestPolicy:b.requestPolicy||"cache-first"},ue=Nn();function be(Fe){(Fe.kind==="mutation"||Fe.kind==="teardown"||!D.has(Fe.key))&&(Fe.kind==="teardown"?D.delete(Fe.key):Fe.kind!=="mutation"&&D.add(Fe.key),ue.next(Fe))}var ut=!1;function Qe(Fe){if(Fe&&be(Fe),!ut){for(ut=!0;ut&&(Fe=L.shift());)be(Fe);ut=!1}}var He=Fe=>{var At=Mt(xt(rt=>rt.kind==="teardown"&&rt.key===Fe.key)(ue.source))(xt(rt=>rt.operation.kind===Fe.kind&&rt.operation.key===Fe.key&&(!rt.operation.context._instance||rt.operation.context._instance===Fe.context._instance))(en));return Fe.kind!=="query"?At=zn(rt=>!!rt.hasNext,!0)(At):At=_t(rt=>{var Kn=kn(rt);return rt.stale||rt.hasNext?Kn:_n([Kn,rn(()=>(rt.stale=!0,rt))(Mn(1)(xt(ar=>ar.key===Fe.key)(ue.source)))])})(At),Fe.kind!=="mutation"?At=bt(()=>{D.delete(Fe.key),N.delete(Fe.key),F.delete(Fe.key),ut=!1;for(var rt=L.length-1;rt>=0;rt--)L[rt].key===Fe.key&&L.splice(rt,1);be(oe("teardown",Fe,Fe.context))})(Ct(rt=>{if(rt.stale)if(!rt.hasNext)D.delete(Fe.key);else for(var Kn=0;Kn<L.length;Kn++){var ar=L[Kn];if(ar.key===rt.operation.key){D.delete(ar.key);break}}else rt.hasNext||D.delete(Fe.key);N.set(Fe.key,rt)})(At)):At=It(()=>{be(Fe)})(At),gn(At)},pt=this instanceof f?this:Object.create(f.prototype),ct=Object.assign(pt,{suspense:!!b.suspense,operations$:ue.source,reexecuteOperation(Fe){if(Fe.kind==="teardown")Qe(Fe);else if(Fe.kind==="mutation")L.push(Fe),Promise.resolve().then(Qe);else if(F.has(Fe.key)){for(var At=!1,rt=0;rt<L.length;rt++)L[rt].key===Fe.key&&(L[rt]=Fe,At=!0);At||D.has(Fe.key)&&Fe.context.requestPolicy!=="network-only"?(D.delete(Fe.key),Promise.resolve().then(Qe)):(L.push(Fe),Promise.resolve().then(Qe))}},createRequestOperation(Fe,At,rt){rt||(rt={});var Kn;return oe(Fe,At,it(J(J({_instance:Fe==="mutation"?I=I+1|0:void 0},ie),rt),{requestPolicy:rt.requestPolicy||ie.requestPolicy,suspense:rt.suspense||rt.suspense!==!1&&ct.suspense}))},executeRequestOperation(Fe){return Fe.kind==="mutation"?P(He(Fe)):P(Vn(()=>{var At=F.get(Fe.key);At||F.set(Fe.key,At=He(Fe)),At=It(()=>{Qe(Fe)})(At);var rt=N.get(Fe.key);return Fe.kind==="query"&&rt&&(rt.stale||rt.hasNext)?_t(kn)(_n([At,xt(Kn=>Kn===N.get(Fe.key))(kn(rt))])):At}))},executeQuery(Fe,At){var rt=ct.createRequestOperation("query",Fe,At);return ct.executeRequestOperation(rt)},executeSubscription(Fe,At){var rt=ct.createRequestOperation("subscription",Fe,At);return ct.executeRequestOperation(rt)},executeMutation(Fe,At){var rt=ct.createRequestOperation("mutation",Fe,At);return ct.executeRequestOperation(rt)},readQuery(Fe,At,rt){var Kn=null;return jn(ar=>{Kn=ar})(ct.query(Fe,At,rt)).unsubscribe(),Kn},query:(Fe,At,rt)=>ct.executeQuery(yr(Fe,At),rt),subscription:(Fe,At,rt)=>ct.executeSubscription(yr(Fe,At),rt),mutation:(Fe,At,rt)=>ct.executeMutation(yr(Fe,At),rt)}),gt=Be;if(0)var St,Qt;var an=hi(b.exchanges),en=gn(an({client:ct,dispatchDebug:gt,forward:mi({dispatchDebug:gt})})(ue.source));return Rn(en),ct},vi=null,cr=G(86349),oi="1.8.12-next.4",Gr=(f,b)=>(...I)=>Bn(this,null,function*(){var L;var N,F;const D=(F=(N=I[1])==null?void 0:N.headers)==null?void 0:F["x-copilotcloud-public-api-key"];try{const ie=yield fetch(I[0],it(J({},(L=I[1])!=null?L:{}),{signal:f})),ue=D?null:yield(0,cr.wo)({runtimeVersion:ie.headers.get("X-CopilotKit-Runtime-Version"),runtimeClientGqlVersion:oi});if(ie.status!==200&&ie.status>=400&&ie.status<=500)throw ue?new cr.S5(ue):new cr.bb({status:ie.status});return ue&&b&&b(ue.message),ie}catch(ie){throw ie.message.includes("BodyStreamBuffer was aborted")||ie.message.includes("signal is aborted without reason")||ie instanceof cr.KP?ie:new cr.VM({error:ie,url:I[0]})}}),Mr=class{constructor(f){const b={};this.handleGQLErrors=f.handleGQLErrors,this.handleGQLWarning=f.handleGQLWarning,f.headers&&Object.assign(b,f.headers),f.publicApiKey&&(b["x-copilotcloud-public-api-key"]=f.publicApiKey),this.client=new gi({url:f.url,exchanges:[kr,pi],fetchOptions:J({headers:it(J({},b),{"X-CopilotKit-Runtime-Client-GQL-Version":oi})},f.credentials?{credentials:f.credentials}:{})})}generateCopilotResponse({data:f,properties:b,signal:I}){const N=Gr(I,this.handleGQLWarning);return this.client.mutation(Te,{data:f,properties:b},{fetch:N})}asStream(f){const b=this.handleGQLErrors;return new ReadableStream({start(I){f.subscribe(({data:N,hasNext:F,error:D})=>{if(D){if(D.message.includes("BodyStreamBuffer was aborted")||D.message.includes("signal is aborted without reason")){F||I.close(),console.warn("Abort error suppressed");return}I.error(D),b&&b(D)}else I.enqueue(N),F||I.close()})}})}availableAgents(){const f=Gr();return this.client.query(B,{},{fetch:f})}loadAgentState(f){const b=Gr();return this.client.query(ce,{data:f},{fetch:b})}static removeGraphQLTypename(f){return Array.isArray(f)?f.forEach(b=>Mr.removeGraphQLTypename(b)):typeof f=="object"&&f!==null&&(delete f.__typename,Object.keys(f).forEach(b=>{typeof f[b]=="object"&&f[b]!==null&&Mr.removeGraphQLTypename(f[b])})),f}}},78828:function(lt,Ue,G){"use strict";G.d(Ue,{Ad:function(){return te},Bu:function(){return B},GR:function(){return ee},J3:function(){return Ce},Jc:function(){return ye},Vb:function(){return ke},eb:function(){return Oe},gY:function(){return ce},jJ:function(){return ft},lB:function(){return Te}});var ee=(M=>(M.Disabled="disabled",M.Enabled="enabled",M.Remote="remote",M))(ee||{}),Ce=(M=>(M.Chat="Chat",M.Suggestion="Suggestion",M.Task="Task",M.TextareaCompletion="TextareaCompletion",M.TextareaPopover="TextareaPopover",M))(Ce||{}),te=(M=>(M.GuardrailsValidationFailed="GUARDRAILS_VALIDATION_FAILED",M.MessageStreamInterrupted="MESSAGE_STREAM_INTERRUPTED",M.UnknownError="UNKNOWN_ERROR",M))(te||{}),Te=(M=>(M.Assistant="assistant",M.Developer="developer",M.System="system",M.Tool="tool",M.User="user",M))(Te||{}),B=(M=>(M.Failed="Failed",M.Pending="Pending",M.Success="Success",M))(B||{}),ce=(M=>(M.CopilotKitLangGraphInterruptEvent="CopilotKitLangGraphInterruptEvent",M.LangGraphInterruptEvent="LangGraphInterruptEvent",M))(ce||{}),ke=(M=>(M.Failed="Failed",M.Pending="Pending",M.Success="Success",M))(ke||{}),Oe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"generateCopilotResponse"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GenerateCopilotResponseInput"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"properties"}},type:{kind:"NamedType",name:{kind:"Name",value:"JSONObject"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"generateCopilotResponse"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}},{kind:"Argument",name:{kind:"Name",value:"properties"},value:{kind:"Variable",name:{kind:"Name",value:"properties"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threadId"}},{kind:"Field",name:{kind:"Name",value:"runId"}},{kind:"Field",name:{kind:"Name",value:"extensions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"openaiAssistantAPI"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"runId"}},{kind:"Field",name:{kind:"Name",value:"threadId"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CopilotResponse"}},directives:[{kind:"Directive",name:{kind:"Name",value:"defer"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BaseResponseStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"FailedResponseStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"reason"}},{kind:"Field",name:{kind:"Name",value:"details"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"messages"},directives:[{kind:"Directive",name:{kind:"Name",value:"stream"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BaseMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BaseMessageOutput"}},directives:[{kind:"Directive",name:{kind:"Name",value:"defer"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SuccessMessageStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"FailedMessageStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"reason"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PendingMessageStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TextMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"},directives:[{kind:"Directive",name:{kind:"Name",value:"stream"}}]},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"parentMessageId"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ImageMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"format"}},{kind:"Field",name:{kind:"Name",value:"bytes"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"parentMessageId"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionExecutionMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"arguments"},directives:[{kind:"Directive",name:{kind:"Name",value:"stream"}}]},{kind:"Field",name:{kind:"Name",value:"parentMessageId"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ResultMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"result"}},{kind:"Field",name:{kind:"Name",value:"actionExecutionId"}},{kind:"Field",name:{kind:"Name",value:"actionName"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AgentStateMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threadId"}},{kind:"Field",name:{kind:"Name",value:"state"}},{kind:"Field",name:{kind:"Name",value:"running"}},{kind:"Field",name:{kind:"Name",value:"agentName"}},{kind:"Field",name:{kind:"Name",value:"nodeName"}},{kind:"Field",name:{kind:"Name",value:"runId"}},{kind:"Field",name:{kind:"Name",value:"active"}},{kind:"Field",name:{kind:"Name",value:"role"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"metaEvents"},directives:[{kind:"Directive",name:{kind:"Name",value:"stream"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"LangGraphInterruptEvent"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CopilotKitLangGraphInterruptEvent"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messages"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BaseMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BaseMessageOutput"}},directives:[{kind:"Directive",name:{kind:"Name",value:"defer"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SuccessMessageStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"FailedMessageStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"reason"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PendingMessageStatus"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TextMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"parentMessageId"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionExecutionMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"arguments"}},{kind:"Field",name:{kind:"Name",value:"parentMessageId"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ResultMessageOutput"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"result"}},{kind:"Field",name:{kind:"Name",value:"actionExecutionId"}},{kind:"Field",name:{kind:"Name",value:"actionName"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]}}]}}]},ft={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"availableAgents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"availableAgents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"agents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"description"}}]}}]}}]}}]},ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"loadAgentState"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"LoadAgentStateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"loadAgentState"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threadId"}},{kind:"Field",name:{kind:"Name",value:"threadExists"}},{kind:"Field",name:{kind:"Name",value:"state"}},{kind:"Field",name:{kind:"Name",value:"messages"}}]}}]}}]}},35538:function(lt,Ue,G){"use strict";G.d(Ue,{Vq:function(){return ee},w8:function(){return Te},xt:function(){return te}});var ee="https://api.cloud.copilotkit.ai",Ce="v1",te=`${ee}/copilotkit/${Ce}`,Te="X-CopilotCloud-Public-Api-Key"},20106:function(lt,Ue,G){"use strict";G.d(Ue,{H:function(){return Pr}});var ee;(function(S){S.assertEqual=R=>{};function l(R){}S.assertIs=l;function h(R){throw new Error}S.assertNever=h,S.arrayToEnum=R=>{const P={};for(const oe of R)P[oe]=oe;return P},S.getValidEnumValues=R=>{const P=S.objectKeys(R).filter(le=>typeof R[R[le]]!="number"),oe={};for(const le of P)oe[le]=R[le];return S.objectValues(oe)},S.objectValues=R=>S.objectKeys(R).map(function(P){return R[P]}),S.objectKeys=typeof Object.keys=="function"?R=>Object.keys(R):R=>{const P=[];for(const oe in R)Object.prototype.hasOwnProperty.call(R,oe)&&P.push(oe);return P},S.find=(R,P)=>{for(const oe of R)if(P(oe))return oe},S.isInteger=typeof Number.isInteger=="function"?R=>Number.isInteger(R):R=>typeof R=="number"&&Number.isFinite(R)&&Math.floor(R)===R;function A(R,P=" | "){return R.map(oe=>typeof oe=="string"?`'${oe}'`:oe).join(P)}S.joinValues=A,S.jsonStringifyReplacer=(R,P)=>typeof P=="bigint"?P.toString():P})(ee||(ee={}));var Ce;(function(S){S.mergeShapes=(l,h)=>J(J({},l),h)})(Ce||(Ce={}));const te=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Te=S=>{switch(typeof S){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.isNaN(S)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(S)?te.array:S===null?te.null:S.then&&typeof S.then=="function"&&S.catch&&typeof S.catch=="function"?te.promise:typeof Map!="undefined"&&S instanceof Map?te.map:typeof Set!="undefined"&&S instanceof Set?te.set:typeof Date!="undefined"&&S instanceof Date?te.date:te.object;default:return te.unknown}},B=ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ce=S=>JSON.stringify(S,null,2).replace(/"([^"]+)":/g,"$1:");class ke extends Error{get errors(){return this.issues}constructor(l){super(),this.issues=[],this.addIssue=A=>{this.issues=[...this.issues,A]},this.addIssues=(A=[])=>{this.issues=[...this.issues,...A]};const h=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,h):this.__proto__=h,this.name="ZodError",this.issues=l}format(l){const h=l||function(P){return P.message},A={_errors:[]},R=P=>{for(const oe of P.issues)if(oe.code==="invalid_union")oe.unionErrors.map(R);else if(oe.code==="invalid_return_type")R(oe.returnTypeError);else if(oe.code==="invalid_arguments")R(oe.argumentsError);else if(oe.path.length===0)A._errors.push(h(oe));else{let le=A,Be=0;for(;Be<oe.path.length;){const Ve=oe.path[Be];Be===oe.path.length-1?(le[Ve]=le[Ve]||{_errors:[]},le[Ve]._errors.push(h(oe))):le[Ve]=le[Ve]||{_errors:[]},le=le[Ve],Be++}}};return R(this),A}static assert(l){if(!(l instanceof ke))throw new Error(`Not a ZodError: ${l}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(l=h=>h.message){const h={},A=[];for(const R of this.issues)R.path.length>0?(h[R.path[0]]=h[R.path[0]]||[],h[R.path[0]].push(l(R))):A.push(l(R));return{formErrors:A,fieldErrors:h}}get formErrors(){return this.flatten()}}ke.create=S=>new ke(S);var ft=(S,l)=>{let h;switch(S.code){case B.invalid_type:S.received===te.undefined?h="Required":h=`Expected ${S.expected}, received ${S.received}`;break;case B.invalid_literal:h=`Invalid literal value, expected ${JSON.stringify(S.expected,ee.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:h=`Unrecognized key(s) in object: ${ee.joinValues(S.keys,", ")}`;break;case B.invalid_union:h="Invalid input";break;case B.invalid_union_discriminator:h=`Invalid discriminator value. Expected ${ee.joinValues(S.options)}`;break;case B.invalid_enum_value:h=`Invalid enum value. Expected ${ee.joinValues(S.options)}, received '${S.received}'`;break;case B.invalid_arguments:h="Invalid function arguments";break;case B.invalid_return_type:h="Invalid function return type";break;case B.invalid_date:h="Invalid date";break;case B.invalid_string:typeof S.validation=="object"?"includes"in S.validation?(h=`Invalid input: must include "${S.validation.includes}"`,typeof S.validation.position=="number"&&(h=`${h} at one or more positions greater than or equal to ${S.validation.position}`)):"startsWith"in S.validation?h=`Invalid input: must start with "${S.validation.startsWith}"`:"endsWith"in S.validation?h=`Invalid input: must end with "${S.validation.endsWith}"`:ee.assertNever(S.validation):S.validation!=="regex"?h=`Invalid ${S.validation}`:h="Invalid";break;case B.too_small:S.type==="array"?h=`Array must contain ${S.exact?"exactly":S.inclusive?"at least":"more than"} ${S.minimum} element(s)`:S.type==="string"?h=`String must contain ${S.exact?"exactly":S.inclusive?"at least":"over"} ${S.minimum} character(s)`:S.type==="number"?h=`Number must be ${S.exact?"exactly equal to ":S.inclusive?"greater than or equal to ":"greater than "}${S.minimum}`:S.type==="date"?h=`Date must be ${S.exact?"exactly equal to ":S.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(S.minimum))}`:h="Invalid input";break;case B.too_big:S.type==="array"?h=`Array must contain ${S.exact?"exactly":S.inclusive?"at most":"less than"} ${S.maximum} element(s)`:S.type==="string"?h=`String must contain ${S.exact?"exactly":S.inclusive?"at most":"under"} ${S.maximum} character(s)`:S.type==="number"?h=`Number must be ${S.exact?"exactly":S.inclusive?"less than or equal to":"less than"} ${S.maximum}`:S.type==="bigint"?h=`BigInt must be ${S.exact?"exactly":S.inclusive?"less than or equal to":"less than"} ${S.maximum}`:S.type==="date"?h=`Date must be ${S.exact?"exactly":S.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(S.maximum))}`:h="Invalid input";break;case B.custom:h="Invalid input";break;case B.invalid_intersection_types:h="Intersection results could not be merged";break;case B.not_multiple_of:h=`Number must be a multiple of ${S.multipleOf}`;break;case B.not_finite:h="Number must be finite";break;default:h=l.defaultError,ee.assertNever(S)}return{message:h}};let ye=ft;function M(S){ye=S}function W(){return ye}const he=S=>{const{data:l,path:h,errorMaps:A,issueData:R}=S,P=[...h,...R.path||[]],oe=it(J({},R),{path:P});if(R.message!==void 0)return it(J({},R),{path:P,message:R.message});let le="";const Be=A.filter(Ve=>!!Ve).slice().reverse();for(const Ve of Be)le=Ve(oe,{data:l,defaultError:le}).message;return it(J({},R),{path:P,message:le})},je=null;function H(S,l){const h=W(),A=he({issueData:l,data:S.data,path:S.path,errorMaps:[S.common.contextualErrorMap,S.schemaErrorMap,h,h===ft?void 0:ft].filter(R=>!!R)});S.common.issues.push(A)}class de{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(l,h){const A=[];for(const R of h){if(R.status==="aborted")return ge;R.status==="dirty"&&l.dirty(),A.push(R.value)}return{status:l.value,value:A}}static mergeObjectAsync(l,h){return Bn(this,null,function*(){const A=[];for(const R of h){const P=yield R.key,oe=yield R.value;A.push({key:P,value:oe})}return de.mergeObjectSync(l,A)})}static mergeObjectSync(l,h){const A={};for(const R of h){const{key:P,value:oe}=R;if(P.status==="aborted"||oe.status==="aborted")return ge;P.status==="dirty"&&l.dirty(),oe.status==="dirty"&&l.dirty(),P.value!=="__proto__"&&(typeof oe.value!="undefined"||R.alwaysSet)&&(A[P.value]=oe.value)}return{status:l.value,value:A}}}const ge=Object.freeze({status:"aborted"}),Ae=S=>({status:"dirty",value:S}),We=S=>({status:"valid",value:S}),yt=S=>S.status==="aborted",st=S=>S.status==="dirty",Nt=S=>S.status==="valid",tt=S=>typeof Promise!="undefined"&&S instanceof Promise;var Ee;(function(S){S.errToObj=l=>typeof l=="string"?{message:l}:l||{},S.toString=l=>typeof l=="string"?l:l==null?void 0:l.message})(Ee||(Ee={}));class De{constructor(l,h,A,R){this._cachedPath=[],this.parent=l,this.data=h,this._path=A,this._key=R}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mt=(S,l)=>{if(Nt(l))return{success:!0,data:l.value};if(!S.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const h=new ke(S.common.issues);return this._error=h,this._error}}};function Y(S){if(!S)return{};const{errorMap:l,invalid_type_error:h,required_error:A,description:R}=S;if(l&&(h||A))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return l?{errorMap:l,description:R}:{errorMap:(oe,le)=>{var Ve,wt;const{message:Be}=S;return oe.code==="invalid_enum_value"?{message:Be!=null?Be:le.defaultError}:typeof le.data=="undefined"?{message:(Ve=Be!=null?Be:A)!=null?Ve:le.defaultError}:oe.code!=="invalid_type"?{message:le.defaultError}:{message:(wt=Be!=null?Be:h)!=null?wt:le.defaultError}},description:R}}class fe{get description(){return this._def.description}_getType(l){return Te(l.data)}_getOrReturnCtx(l,h){return h||{common:l.parent.common,data:l.data,parsedType:Te(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}_processInputParams(l){return{status:new de,ctx:{common:l.parent.common,data:l.data,parsedType:Te(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}}_parseSync(l){const h=this._parse(l);if(tt(h))throw new Error("Synchronous parse encountered promise.");return h}_parseAsync(l){const h=this._parse(l);return Promise.resolve(h)}parse(l,h){const A=this.safeParse(l,h);if(A.success)return A.data;throw A.error}safeParse(l,h){var P;const A={common:{issues:[],async:(P=h==null?void 0:h.async)!=null?P:!1,contextualErrorMap:h==null?void 0:h.errorMap},path:(h==null?void 0:h.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:Te(l)},R=this._parseSync({data:l,path:A.path,parent:A});return mt(A,R)}"~validate"(l){var A,R;const h={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:Te(l)};if(!this["~standard"].async)try{const P=this._parseSync({data:l,path:[],parent:h});return Nt(P)?{value:P.value}:{issues:h.common.issues}}catch(P){(R=(A=P==null?void 0:P.message)==null?void 0:A.toLowerCase())!=null&&R.includes("encountered")&&(this["~standard"].async=!0),h.common={issues:[],async:!0}}return this._parseAsync({data:l,path:[],parent:h}).then(P=>Nt(P)?{value:P.value}:{issues:h.common.issues})}parseAsync(l,h){return Bn(this,null,function*(){const A=yield this.safeParseAsync(l,h);if(A.success)return A.data;throw A.error})}safeParseAsync(l,h){return Bn(this,null,function*(){const A={common:{issues:[],contextualErrorMap:h==null?void 0:h.errorMap,async:!0},path:(h==null?void 0:h.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:Te(l)},R=this._parse({data:l,path:A.path,parent:A}),P=yield tt(R)?R:Promise.resolve(R);return mt(A,P)})}refine(l,h){const A=R=>typeof h=="string"||typeof h=="undefined"?{message:h}:typeof h=="function"?h(R):h;return this._refinement((R,P)=>{const oe=l(R),le=()=>P.addIssue(J({code:B.custom},A(R)));return typeof Promise!="undefined"&&oe instanceof Promise?oe.then(Be=>Be?!0:(le(),!1)):oe?!0:(le(),!1)})}refinement(l,h){return this._refinement((A,R)=>l(A)?!0:(R.addIssue(typeof h=="function"?h(A,R):h),!1))}_refinement(l){return new An({schema:this,typeName:at.ZodEffects,effect:{type:"refinement",refinement:l}})}superRefine(l){return this._refinement(l)}constructor(l){this.spa=this.safeParseAsync,this._def=l,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:h=>this["~validate"](h)}}optional(){return Nn.create(this,this._def)}nullable(){return $n.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mn.create(this)}promise(){return kn.create(this,this._def)}or(l){return Xe.create([this,l],this._def)}and(l){return Mn.create(this,l,this._def)}transform(l){return new An(it(J({},Y(this._def)),{schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:l}}))}default(l){const h=typeof l=="function"?l:()=>l;return new Gn(it(J({},Y(this._def)),{innerType:this,defaultValue:h,typeName:at.ZodDefault}))}brand(){return new jn(J({typeName:at.ZodBranded,type:this},Y(this._def)))}catch(l){const h=typeof l=="function"?l:()=>l;return new Qn(it(J({},Y(this._def)),{innerType:this,catchValue:h,typeName:at.ZodCatch}))}describe(l){const h=this.constructor;return new h(it(J({},this._def),{description:l}))}pipe(l){return un.create(this,l)}readonly(){return Rn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xe=/^c[^\s-]{8,}$/i,Ie=/^[0-9a-z]+$/,nt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Se=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Le=/^[a-z0-9_-]{21}$/i,ne=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Je="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let re;const se=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Re=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ze=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Bt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Xt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jt=new RegExp(`^${Xt}$`);function ae(S){let l="[0-5]\\d";S.precision?l=`${l}\\.\\d{${S.precision}}`:S.precision==null&&(l=`${l}(\\.\\d+)?`);const h=S.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${h}`}function pe(S){return new RegExp(`^${ae(S)}$`)}function Me(S){let l=`${Xt}T${ae(S)}`;const h=[];return h.push(S.local?"Z?":"Z"),S.offset&&h.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${h.join("|")})`,new RegExp(`^${l}$`)}function me(S,l){return!!((l==="v4"||!l)&&se.test(S)||(l==="v6"||!l)&&qe.test(S))}function Ye(S,l){if(!ne.test(S))return!1;try{const[h]=S.split("."),A=h.replace(/-/g,"+").replace(/_/g,"/").padEnd(h.length+(4-h.length%4)%4,"="),R=JSON.parse(atob(A));return!(typeof R!="object"||R===null||"typ"in R&&(R==null?void 0:R.typ)!=="JWT"||!R.alg||l&&R.alg!==l)}catch(h){return!1}}function $e(S,l){return!!((l==="v4"||!l)&&Re.test(S)||(l==="v6"||!l)&&Ze.test(S))}class Ge extends fe{_parse(l){if(this._def.coerce&&(l.data=String(l.data)),this._getType(l)!==te.string){const P=this._getOrReturnCtx(l);return H(P,{code:B.invalid_type,expected:te.string,received:P.parsedType}),ge}const A=new de;let R;for(const P of this._def.checks)if(P.kind==="min")l.data.length<P.value&&(R=this._getOrReturnCtx(l,R),H(R,{code:B.too_small,minimum:P.value,type:"string",inclusive:!0,exact:!1,message:P.message}),A.dirty());else if(P.kind==="max")l.data.length>P.value&&(R=this._getOrReturnCtx(l,R),H(R,{code:B.too_big,maximum:P.value,type:"string",inclusive:!0,exact:!1,message:P.message}),A.dirty());else if(P.kind==="length"){const oe=l.data.length>P.value,le=l.data.length<P.value;(oe||le)&&(R=this._getOrReturnCtx(l,R),oe?H(R,{code:B.too_big,maximum:P.value,type:"string",inclusive:!0,exact:!0,message:P.message}):le&&H(R,{code:B.too_small,minimum:P.value,type:"string",inclusive:!0,exact:!0,message:P.message}),A.dirty())}else if(P.kind==="email")Pe.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"email",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="emoji")re||(re=new RegExp(Je,"u")),re.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"emoji",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="uuid")Se.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"uuid",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="nanoid")Le.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"nanoid",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="cuid")xe.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"cuid",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="cuid2")Ie.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"cuid2",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="ulid")nt.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"ulid",code:B.invalid_string,message:P.message}),A.dirty());else if(P.kind==="url")try{new URL(l.data)}catch(oe){R=this._getOrReturnCtx(l,R),H(R,{validation:"url",code:B.invalid_string,message:P.message}),A.dirty()}else P.kind==="regex"?(P.regex.lastIndex=0,P.regex.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"regex",code:B.invalid_string,message:P.message}),A.dirty())):P.kind==="trim"?l.data=l.data.trim():P.kind==="includes"?l.data.includes(P.value,P.position)||(R=this._getOrReturnCtx(l,R),H(R,{code:B.invalid_string,validation:{includes:P.value,position:P.position},message:P.message}),A.dirty()):P.kind==="toLowerCase"?l.data=l.data.toLowerCase():P.kind==="toUpperCase"?l.data=l.data.toUpperCase():P.kind==="startsWith"?l.data.startsWith(P.value)||(R=this._getOrReturnCtx(l,R),H(R,{code:B.invalid_string,validation:{startsWith:P.value},message:P.message}),A.dirty()):P.kind==="endsWith"?l.data.endsWith(P.value)||(R=this._getOrReturnCtx(l,R),H(R,{code:B.invalid_string,validation:{endsWith:P.value},message:P.message}),A.dirty()):P.kind==="datetime"?Me(P).test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{code:B.invalid_string,validation:"datetime",message:P.message}),A.dirty()):P.kind==="date"?jt.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{code:B.invalid_string,validation:"date",message:P.message}),A.dirty()):P.kind==="time"?pe(P).test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{code:B.invalid_string,validation:"time",message:P.message}),A.dirty()):P.kind==="duration"?_e.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"duration",code:B.invalid_string,message:P.message}),A.dirty()):P.kind==="ip"?me(l.data,P.version)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"ip",code:B.invalid_string,message:P.message}),A.dirty()):P.kind==="jwt"?Ye(l.data,P.alg)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"jwt",code:B.invalid_string,message:P.message}),A.dirty()):P.kind==="cidr"?$e(l.data,P.version)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"cidr",code:B.invalid_string,message:P.message}),A.dirty()):P.kind==="base64"?Lt.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"base64",code:B.invalid_string,message:P.message}),A.dirty()):P.kind==="base64url"?Bt.test(l.data)||(R=this._getOrReturnCtx(l,R),H(R,{validation:"base64url",code:B.invalid_string,message:P.message}),A.dirty()):ee.assertNever(P);return{status:A.value,value:l.data}}_regex(l,h,A){return this.refinement(R=>l.test(R),J({validation:h,code:B.invalid_string},Ee.errToObj(A)))}_addCheck(l){return new Ge(it(J({},this._def),{checks:[...this._def.checks,l]}))}email(l){return this._addCheck(J({kind:"email"},Ee.errToObj(l)))}url(l){return this._addCheck(J({kind:"url"},Ee.errToObj(l)))}emoji(l){return this._addCheck(J({kind:"emoji"},Ee.errToObj(l)))}uuid(l){return this._addCheck(J({kind:"uuid"},Ee.errToObj(l)))}nanoid(l){return this._addCheck(J({kind:"nanoid"},Ee.errToObj(l)))}cuid(l){return this._addCheck(J({kind:"cuid"},Ee.errToObj(l)))}cuid2(l){return this._addCheck(J({kind:"cuid2"},Ee.errToObj(l)))}ulid(l){return this._addCheck(J({kind:"ulid"},Ee.errToObj(l)))}base64(l){return this._addCheck(J({kind:"base64"},Ee.errToObj(l)))}base64url(l){return this._addCheck(J({kind:"base64url"},Ee.errToObj(l)))}jwt(l){return this._addCheck(J({kind:"jwt"},Ee.errToObj(l)))}ip(l){return this._addCheck(J({kind:"ip"},Ee.errToObj(l)))}cidr(l){return this._addCheck(J({kind:"cidr"},Ee.errToObj(l)))}datetime(l){var h,A;return typeof l=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:l}):this._addCheck(J({kind:"datetime",precision:typeof(l==null?void 0:l.precision)=="undefined"?null:l==null?void 0:l.precision,offset:(h=l==null?void 0:l.offset)!=null?h:!1,local:(A=l==null?void 0:l.local)!=null?A:!1},Ee.errToObj(l==null?void 0:l.message)))}date(l){return this._addCheck({kind:"date",message:l})}time(l){return typeof l=="string"?this._addCheck({kind:"time",precision:null,message:l}):this._addCheck(J({kind:"time",precision:typeof(l==null?void 0:l.precision)=="undefined"?null:l==null?void 0:l.precision},Ee.errToObj(l==null?void 0:l.message)))}duration(l){return this._addCheck(J({kind:"duration"},Ee.errToObj(l)))}regex(l,h){return this._addCheck(J({kind:"regex",regex:l},Ee.errToObj(h)))}includes(l,h){return this._addCheck(J({kind:"includes",value:l,position:h==null?void 0:h.position},Ee.errToObj(h==null?void 0:h.message)))}startsWith(l,h){return this._addCheck(J({kind:"startsWith",value:l},Ee.errToObj(h)))}endsWith(l,h){return this._addCheck(J({kind:"endsWith",value:l},Ee.errToObj(h)))}min(l,h){return this._addCheck(J({kind:"min",value:l},Ee.errToObj(h)))}max(l,h){return this._addCheck(J({kind:"max",value:l},Ee.errToObj(h)))}length(l,h){return this._addCheck(J({kind:"length",value:l},Ee.errToObj(h)))}nonempty(l){return this.min(1,Ee.errToObj(l))}trim(){return new Ge(it(J({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new Ge(it(J({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ge(it(J({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(l=>l.kind==="datetime")}get isDate(){return!!this._def.checks.find(l=>l.kind==="date")}get isTime(){return!!this._def.checks.find(l=>l.kind==="time")}get isDuration(){return!!this._def.checks.find(l=>l.kind==="duration")}get isEmail(){return!!this._def.checks.find(l=>l.kind==="email")}get isURL(){return!!this._def.checks.find(l=>l.kind==="url")}get isEmoji(){return!!this._def.checks.find(l=>l.kind==="emoji")}get isUUID(){return!!this._def.checks.find(l=>l.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(l=>l.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(l=>l.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(l=>l.kind==="cuid2")}get isULID(){return!!this._def.checks.find(l=>l.kind==="ulid")}get isIP(){return!!this._def.checks.find(l=>l.kind==="ip")}get isCIDR(){return!!this._def.checks.find(l=>l.kind==="cidr")}get isBase64(){return!!this._def.checks.find(l=>l.kind==="base64")}get isBase64url(){return!!this._def.checks.find(l=>l.kind==="base64url")}get minLength(){let l=null;for(const h of this._def.checks)h.kind==="min"&&(l===null||h.value>l)&&(l=h.value);return l}get maxLength(){let l=null;for(const h of this._def.checks)h.kind==="max"&&(l===null||h.value<l)&&(l=h.value);return l}}Ge.create=S=>{var l;return new Ge(J({checks:[],typeName:at.ZodString,coerce:(l=S==null?void 0:S.coerce)!=null?l:!1},Y(S)))};function ot(S,l){const h=(S.toString().split(".")[1]||"").length,A=(l.toString().split(".")[1]||"").length,R=h>A?h:A,P=Number.parseInt(S.toFixed(R).replace(".","")),oe=Number.parseInt(l.toFixed(R).replace(".",""));return P%oe/ca(10,R)}class Ft extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(l){if(this._def.coerce&&(l.data=Number(l.data)),this._getType(l)!==te.number){const P=this._getOrReturnCtx(l);return H(P,{code:B.invalid_type,expected:te.number,received:P.parsedType}),ge}let A;const R=new de;for(const P of this._def.checks)P.kind==="int"?ee.isInteger(l.data)||(A=this._getOrReturnCtx(l,A),H(A,{code:B.invalid_type,expected:"integer",received:"float",message:P.message}),R.dirty()):P.kind==="min"?(P.inclusive?l.data<P.value:l.data<=P.value)&&(A=this._getOrReturnCtx(l,A),H(A,{code:B.too_small,minimum:P.value,type:"number",inclusive:P.inclusive,exact:!1,message:P.message}),R.dirty()):P.kind==="max"?(P.inclusive?l.data>P.value:l.data>=P.value)&&(A=this._getOrReturnCtx(l,A),H(A,{code:B.too_big,maximum:P.value,type:"number",inclusive:P.inclusive,exact:!1,message:P.message}),R.dirty()):P.kind==="multipleOf"?ot(l.data,P.value)!==0&&(A=this._getOrReturnCtx(l,A),H(A,{code:B.not_multiple_of,multipleOf:P.value,message:P.message}),R.dirty()):P.kind==="finite"?Number.isFinite(l.data)||(A=this._getOrReturnCtx(l,A),H(A,{code:B.not_finite,message:P.message}),R.dirty()):ee.assertNever(P);return{status:R.value,value:l.data}}gte(l,h){return this.setLimit("min",l,!0,Ee.toString(h))}gt(l,h){return this.setLimit("min",l,!1,Ee.toString(h))}lte(l,h){return this.setLimit("max",l,!0,Ee.toString(h))}lt(l,h){return this.setLimit("max",l,!1,Ee.toString(h))}setLimit(l,h,A,R){return new Ft(it(J({},this._def),{checks:[...this._def.checks,{kind:l,value:h,inclusive:A,message:Ee.toString(R)}]}))}_addCheck(l){return new Ft(it(J({},this._def),{checks:[...this._def.checks,l]}))}int(l){return this._addCheck({kind:"int",message:Ee.toString(l)})}positive(l){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ee.toString(l)})}negative(l){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ee.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ee.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ee.toString(l)})}multipleOf(l,h){return this._addCheck({kind:"multipleOf",value:l,message:Ee.toString(h)})}finite(l){return this._addCheck({kind:"finite",message:Ee.toString(l)})}safe(l){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ee.toString(l)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ee.toString(l)})}get minValue(){let l=null;for(const h of this._def.checks)h.kind==="min"&&(l===null||h.value>l)&&(l=h.value);return l}get maxValue(){let l=null;for(const h of this._def.checks)h.kind==="max"&&(l===null||h.value<l)&&(l=h.value);return l}get isInt(){return!!this._def.checks.find(l=>l.kind==="int"||l.kind==="multipleOf"&&ee.isInteger(l.value))}get isFinite(){let l=null,h=null;for(const A of this._def.checks){if(A.kind==="finite"||A.kind==="int"||A.kind==="multipleOf")return!0;A.kind==="min"?(h===null||A.value>h)&&(h=A.value):A.kind==="max"&&(l===null||A.value<l)&&(l=A.value)}return Number.isFinite(h)&&Number.isFinite(l)}}Ft.create=S=>new Ft(J({checks:[],typeName:at.ZodNumber,coerce:(S==null?void 0:S.coerce)||!1},Y(S)));class tn extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(l){if(this._def.coerce)try{l.data=BigInt(l.data)}catch(P){return this._getInvalidInput(l)}if(this._getType(l)!==te.bigint)return this._getInvalidInput(l);let A;const R=new de;for(const P of this._def.checks)P.kind==="min"?(P.inclusive?l.data<P.value:l.data<=P.value)&&(A=this._getOrReturnCtx(l,A),H(A,{code:B.too_small,type:"bigint",minimum:P.value,inclusive:P.inclusive,message:P.message}),R.dirty()):P.kind==="max"?(P.inclusive?l.data>P.value:l.data>=P.value)&&(A=this._getOrReturnCtx(l,A),H(A,{code:B.too_big,type:"bigint",maximum:P.value,inclusive:P.inclusive,message:P.message}),R.dirty()):P.kind==="multipleOf"?l.data%P.value!==BigInt(0)&&(A=this._getOrReturnCtx(l,A),H(A,{code:B.not_multiple_of,multipleOf:P.value,message:P.message}),R.dirty()):ee.assertNever(P);return{status:R.value,value:l.data}}_getInvalidInput(l){const h=this._getOrReturnCtx(l);return H(h,{code:B.invalid_type,expected:te.bigint,received:h.parsedType}),ge}gte(l,h){return this.setLimit("min",l,!0,Ee.toString(h))}gt(l,h){return this.setLimit("min",l,!1,Ee.toString(h))}lte(l,h){return this.setLimit("max",l,!0,Ee.toString(h))}lt(l,h){return this.setLimit("max",l,!1,Ee.toString(h))}setLimit(l,h,A,R){return new tn(it(J({},this._def),{checks:[...this._def.checks,{kind:l,value:h,inclusive:A,message:Ee.toString(R)}]}))}_addCheck(l){return new tn(it(J({},this._def),{checks:[...this._def.checks,l]}))}positive(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ee.toString(l)})}negative(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ee.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ee.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ee.toString(l)})}multipleOf(l,h){return this._addCheck({kind:"multipleOf",value:l,message:Ee.toString(h)})}get minValue(){let l=null;for(const h of this._def.checks)h.kind==="min"&&(l===null||h.value>l)&&(l=h.value);return l}get maxValue(){let l=null;for(const h of this._def.checks)h.kind==="max"&&(l===null||h.value<l)&&(l=h.value);return l}}tn.create=S=>{var l;return new tn(J({checks:[],typeName:at.ZodBigInt,coerce:(l=S==null?void 0:S.coerce)!=null?l:!1},Y(S)))};class xt extends fe{_parse(l){if(this._def.coerce&&(l.data=!!l.data),this._getType(l)!==te.boolean){const A=this._getOrReturnCtx(l);return H(A,{code:B.invalid_type,expected:te.boolean,received:A.parsedType}),ge}return We(l.data)}}xt.create=S=>new xt(J({typeName:at.ZodBoolean,coerce:(S==null?void 0:S.coerce)||!1},Y(S)));class rn extends fe{_parse(l){if(this._def.coerce&&(l.data=new Date(l.data)),this._getType(l)!==te.date){const P=this._getOrReturnCtx(l);return H(P,{code:B.invalid_type,expected:te.date,received:P.parsedType}),ge}if(Number.isNaN(l.data.getTime())){const P=this._getOrReturnCtx(l);return H(P,{code:B.invalid_date}),ge}const A=new de;let R;for(const P of this._def.checks)P.kind==="min"?l.data.getTime()<P.value&&(R=this._getOrReturnCtx(l,R),H(R,{code:B.too_small,message:P.message,inclusive:!0,exact:!1,minimum:P.value,type:"date"}),A.dirty()):P.kind==="max"?l.data.getTime()>P.value&&(R=this._getOrReturnCtx(l,R),H(R,{code:B.too_big,message:P.message,inclusive:!0,exact:!1,maximum:P.value,type:"date"}),A.dirty()):ee.assertNever(P);return{status:A.value,value:new Date(l.data.getTime())}}_addCheck(l){return new rn(it(J({},this._def),{checks:[...this._def.checks,l]}))}min(l,h){return this._addCheck({kind:"min",value:l.getTime(),message:Ee.toString(h)})}max(l,h){return this._addCheck({kind:"max",value:l.getTime(),message:Ee.toString(h)})}get minDate(){let l=null;for(const h of this._def.checks)h.kind==="min"&&(l===null||h.value>l)&&(l=h.value);return l!=null?new Date(l):null}get maxDate(){let l=null;for(const h of this._def.checks)h.kind==="max"&&(l===null||h.value<l)&&(l=h.value);return l!=null?new Date(l):null}}rn.create=S=>new rn(J({checks:[],coerce:(S==null?void 0:S.coerce)||!1,typeName:at.ZodDate},Y(S)));class En extends fe{_parse(l){if(this._getType(l)!==te.symbol){const A=this._getOrReturnCtx(l);return H(A,{code:B.invalid_type,expected:te.symbol,received:A.parsedType}),ge}return We(l.data)}}En.create=S=>new En(J({typeName:at.ZodSymbol},Y(S)));class bn extends fe{_parse(l){if(this._getType(l)!==te.undefined){const A=this._getOrReturnCtx(l);return H(A,{code:B.invalid_type,expected:te.undefined,received:A.parsedType}),ge}return We(l.data)}}bn.create=S=>new bn(J({typeName:at.ZodUndefined},Y(S)));class _n extends fe{_parse(l){if(this._getType(l)!==te.null){const A=this._getOrReturnCtx(l);return H(A,{code:B.invalid_type,expected:te.null,received:A.parsedType}),ge}return We(l.data)}}_n.create=S=>new _n(J({typeName:at.ZodNull},Y(S)));class bt extends fe{constructor(){super(...arguments),this._any=!0}_parse(l){return We(l.data)}}bt.create=S=>new bt(J({typeName:at.ZodAny},Y(S)));class Ct extends fe{constructor(){super(...arguments),this._unknown=!0}_parse(l){return We(l.data)}}Ct.create=S=>new Ct(J({typeName:at.ZodUnknown},Y(S)));class It extends fe{_parse(l){const h=this._getOrReturnCtx(l);return H(h,{code:B.invalid_type,expected:te.never,received:h.parsedType}),ge}}It.create=S=>new It(J({typeName:at.ZodNever},Y(S)));class on extends fe{_parse(l){if(this._getType(l)!==te.undefined){const A=this._getOrReturnCtx(l);return H(A,{code:B.invalid_type,expected:te.void,received:A.parsedType}),ge}return We(l.data)}}on.create=S=>new on(J({typeName:at.ZodVoid},Y(S)));class mn extends fe{_parse(l){const{ctx:h,status:A}=this._processInputParams(l),R=this._def;if(h.parsedType!==te.array)return H(h,{code:B.invalid_type,expected:te.array,received:h.parsedType}),ge;if(R.exactLength!==null){const oe=h.data.length>R.exactLength.value,le=h.data.length<R.exactLength.value;(oe||le)&&(H(h,{code:oe?B.too_big:B.too_small,minimum:le?R.exactLength.value:void 0,maximum:oe?R.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:R.exactLength.message}),A.dirty())}if(R.minLength!==null&&h.data.length<R.minLength.value&&(H(h,{code:B.too_small,minimum:R.minLength.value,type:"array",inclusive:!0,exact:!1,message:R.minLength.message}),A.dirty()),R.maxLength!==null&&h.data.length>R.maxLength.value&&(H(h,{code:B.too_big,maximum:R.maxLength.value,type:"array",inclusive:!0,exact:!1,message:R.maxLength.message}),A.dirty()),h.common.async)return Promise.all([...h.data].map((oe,le)=>R.type._parseAsync(new De(h,oe,h.path,le)))).then(oe=>de.mergeArray(A,oe));const P=[...h.data].map((oe,le)=>R.type._parseSync(new De(h,oe,h.path,le)));return de.mergeArray(A,P)}get element(){return this._def.type}min(l,h){return new mn(it(J({},this._def),{minLength:{value:l,message:Ee.toString(h)}}))}max(l,h){return new mn(it(J({},this._def),{maxLength:{value:l,message:Ee.toString(h)}}))}length(l,h){return new mn(it(J({},this._def),{exactLength:{value:l,message:Ee.toString(h)}}))}nonempty(l){return this.min(1,l)}}mn.create=(S,l)=>new mn(J({type:S,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray},Y(l)));function gn(S){if(S instanceof Wt){const l={};for(const h in S.shape){const A=S.shape[h];l[h]=Nn.create(gn(A))}return new Wt(it(J({},S._def),{shape:()=>l}))}else return S instanceof mn?new mn(it(J({},S._def),{type:gn(S.element)})):S instanceof Nn?Nn.create(gn(S.unwrap())):S instanceof $n?$n.create(gn(S.unwrap())):S instanceof cn?cn.create(S.items.map(l=>gn(l))):S}class Wt extends fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const l=this._def.shape(),h=ee.objectKeys(l);return this._cached={shape:l,keys:h},this._cached}_parse(l){if(this._getType(l)!==te.object){const Ve=this._getOrReturnCtx(l);return H(Ve,{code:B.invalid_type,expected:te.object,received:Ve.parsedType}),ge}const{status:A,ctx:R}=this._processInputParams(l),{shape:P,keys:oe}=this._getCached(),le=[];if(!(this._def.catchall instanceof It&&this._def.unknownKeys==="strip"))for(const Ve in R.data)oe.includes(Ve)||le.push(Ve);const Be=[];for(const Ve of oe){const wt=P[Ve],wn=R.data[Ve];Be.push({key:{status:"valid",value:Ve},value:wt._parse(new De(R,wn,R.path,Ve)),alwaysSet:Ve in R.data})}if(this._def.catchall instanceof It){const Ve=this._def.unknownKeys;if(Ve==="passthrough")for(const wt of le)Be.push({key:{status:"valid",value:wt},value:{status:"valid",value:R.data[wt]}});else if(Ve==="strict")le.length>0&&(H(R,{code:B.unrecognized_keys,keys:le}),A.dirty());else if(Ve!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Ve=this._def.catchall;for(const wt of le){const wn=R.data[wt];Be.push({key:{status:"valid",value:wt},value:Ve._parse(new De(R,wn,R.path,wt)),alwaysSet:wt in R.data})}}return R.common.async?Promise.resolve().then(()=>Bn(this,null,function*(){const Ve=[];for(const wt of Be){const wn=yield wt.key,kr=yield wt.value;Ve.push({key:wn,value:kr,alwaysSet:wt.alwaysSet})}return Ve})).then(Ve=>de.mergeObjectSync(A,Ve)):de.mergeObjectSync(A,Be)}get shape(){return this._def.shape()}strict(l){return Ee.errToObj,new Wt(J(it(J({},this._def),{unknownKeys:"strict"}),l!==void 0?{errorMap:(h,A)=>{var P,oe,le,Be;const R=(le=(oe=(P=this._def).errorMap)==null?void 0:oe.call(P,h,A).message)!=null?le:A.defaultError;return h.code==="unrecognized_keys"?{message:(Be=Ee.errToObj(l).message)!=null?Be:R}:{message:R}}}:{}))}strip(){return new Wt(it(J({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Wt(it(J({},this._def),{unknownKeys:"passthrough"}))}extend(l){return new Wt(it(J({},this._def),{shape:()=>J(J({},this._def.shape()),l)}))}merge(l){return new Wt({unknownKeys:l._def.unknownKeys,catchall:l._def.catchall,shape:()=>J(J({},this._def.shape()),l._def.shape()),typeName:at.ZodObject})}setKey(l,h){return this.augment({[l]:h})}catchall(l){return new Wt(it(J({},this._def),{catchall:l}))}pick(l){const h={};for(const A of ee.objectKeys(l))l[A]&&this.shape[A]&&(h[A]=this.shape[A]);return new Wt(it(J({},this._def),{shape:()=>h}))}omit(l){const h={};for(const A of ee.objectKeys(this.shape))l[A]||(h[A]=this.shape[A]);return new Wt(it(J({},this._def),{shape:()=>h}))}deepPartial(){return gn(this)}partial(l){const h={};for(const A of ee.objectKeys(this.shape)){const R=this.shape[A];l&&!l[A]?h[A]=R:h[A]=R.optional()}return new Wt(it(J({},this._def),{shape:()=>h}))}required(l){const h={};for(const A of ee.objectKeys(this.shape))if(l&&!l[A])h[A]=this.shape[A];else{let P=this.shape[A];for(;P instanceof Nn;)P=P._def.innerType;h[A]=P}return new Wt(it(J({},this._def),{shape:()=>h}))}keyof(){return Wn(ee.objectKeys(this.shape))}}Wt.create=(S,l)=>new Wt(J({shape:()=>S,unknownKeys:"strip",catchall:It.create(),typeName:at.ZodObject},Y(l))),Wt.strictCreate=(S,l)=>new Wt(J({shape:()=>S,unknownKeys:"strict",catchall:It.create(),typeName:at.ZodObject},Y(l))),Wt.lazycreate=(S,l)=>new Wt(J({shape:S,unknownKeys:"strip",catchall:It.create(),typeName:at.ZodObject},Y(l)));class Xe extends fe{_parse(l){const{ctx:h}=this._processInputParams(l),A=this._def.options;function R(P){for(const le of P)if(le.result.status==="valid")return le.result;for(const le of P)if(le.result.status==="dirty")return h.common.issues.push(...le.ctx.common.issues),le.result;const oe=P.map(le=>new ke(le.ctx.common.issues));return H(h,{code:B.invalid_union,unionErrors:oe}),ge}if(h.common.async)return Promise.all(A.map(P=>Bn(this,null,function*(){const oe=it(J({},h),{common:it(J({},h.common),{issues:[]}),parent:null});return{result:yield P._parseAsync({data:h.data,path:h.path,parent:oe}),ctx:oe}}))).then(R);{let P;const oe=[];for(const Be of A){const Ve=it(J({},h),{common:it(J({},h.common),{issues:[]}),parent:null}),wt=Be._parseSync({data:h.data,path:h.path,parent:Ve});if(wt.status==="valid")return wt;wt.status==="dirty"&&!P&&(P={result:wt,ctx:Ve}),Ve.common.issues.length&&oe.push(Ve.common.issues)}if(P)return h.common.issues.push(...P.ctx.common.issues),P.result;const le=oe.map(Be=>new ke(Be));return H(h,{code:B.invalid_union,unionErrors:le}),ge}}get options(){return this._def.options}}Xe.create=(S,l)=>new Xe(J({options:S,typeName:at.ZodUnion},Y(l)));const Kt=S=>S instanceof fn?Kt(S.schema):S instanceof An?Kt(S.innerType()):S instanceof Vn?[S.value]:S instanceof vn?S.options:S instanceof yn?ee.objectValues(S.enum):S instanceof Gn?Kt(S._def.innerType):S instanceof bn?[void 0]:S instanceof _n?[null]:S instanceof Nn?[void 0,...Kt(S.unwrap())]:S instanceof $n?[null,...Kt(S.unwrap())]:S instanceof jn||S instanceof Rn?Kt(S.unwrap()):S instanceof Qn?Kt(S._def.innerType):[];class _t extends fe{_parse(l){const{ctx:h}=this._processInputParams(l);if(h.parsedType!==te.object)return H(h,{code:B.invalid_type,expected:te.object,received:h.parsedType}),ge;const A=this.discriminator,R=h.data[A],P=this.optionsMap.get(R);return P?h.common.async?P._parseAsync({data:h.data,path:h.path,parent:h}):P._parseSync({data:h.data,path:h.path,parent:h}):(H(h,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[A]}),ge)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(l,h,A){const R=new Map;for(const P of h){const oe=Kt(P.shape[l]);if(!oe.length)throw new Error(`A discriminator value for key \`${l}\` could not be extracted from all schema options`);for(const le of oe){if(R.has(le))throw new Error(`Discriminator property ${String(l)} has duplicate value ${String(le)}`);R.set(le,P)}}return new _t(J({typeName:at.ZodDiscriminatedUnion,discriminator:l,options:h,optionsMap:R},Y(A)))}}function Tn(S,l){const h=Te(S),A=Te(l);if(S===l)return{valid:!0,data:S};if(h===te.object&&A===te.object){const R=ee.objectKeys(l),P=ee.objectKeys(S).filter(le=>R.indexOf(le)!==-1),oe=J(J({},S),l);for(const le of P){const Be=Tn(S[le],l[le]);if(!Be.valid)return{valid:!1};oe[le]=Be.data}return{valid:!0,data:oe}}else if(h===te.array&&A===te.array){if(S.length!==l.length)return{valid:!1};const R=[];for(let P=0;P<S.length;P++){const oe=S[P],le=l[P],Be=Tn(oe,le);if(!Be.valid)return{valid:!1};R.push(Be.data)}return{valid:!0,data:R}}else return h===te.date&&A===te.date&&+S==+l?{valid:!0,data:S}:{valid:!1}}class Mn extends fe{_parse(l){const{status:h,ctx:A}=this._processInputParams(l),R=(P,oe)=>{if(yt(P)||yt(oe))return ge;const le=Tn(P.value,oe.value);return le.valid?((st(P)||st(oe))&&h.dirty(),{status:h.value,value:le.data}):(H(A,{code:B.invalid_intersection_types}),ge)};return A.common.async?Promise.all([this._def.left._parseAsync({data:A.data,path:A.path,parent:A}),this._def.right._parseAsync({data:A.data,path:A.path,parent:A})]).then(([P,oe])=>R(P,oe)):R(this._def.left._parseSync({data:A.data,path:A.path,parent:A}),this._def.right._parseSync({data:A.data,path:A.path,parent:A}))}}Mn.create=(S,l,h)=>new Mn(J({left:S,right:l,typeName:at.ZodIntersection},Y(h)));class cn extends fe{_parse(l){const{status:h,ctx:A}=this._processInputParams(l);if(A.parsedType!==te.array)return H(A,{code:B.invalid_type,expected:te.array,received:A.parsedType}),ge;if(A.data.length<this._def.items.length)return H(A,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ge;!this._def.rest&&A.data.length>this._def.items.length&&(H(A,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h.dirty());const P=[...A.data].map((oe,le)=>{const Be=this._def.items[le]||this._def.rest;return Be?Be._parse(new De(A,oe,A.path,le)):null}).filter(oe=>!!oe);return A.common.async?Promise.all(P).then(oe=>de.mergeArray(h,oe)):de.mergeArray(h,P)}get items(){return this._def.items}rest(l){return new cn(it(J({},this._def),{rest:l}))}}cn.create=(S,l)=>{if(!Array.isArray(S))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cn(J({items:S,typeName:at.ZodTuple,rest:null},Y(l)))};class Mt extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:h,ctx:A}=this._processInputParams(l);if(A.parsedType!==te.object)return H(A,{code:B.invalid_type,expected:te.object,received:A.parsedType}),ge;const R=[],P=this._def.keyType,oe=this._def.valueType;for(const le in A.data)R.push({key:P._parse(new De(A,le,A.path,le)),value:oe._parse(new De(A,A.data[le],A.path,le)),alwaysSet:le in A.data});return A.common.async?de.mergeObjectAsync(h,R):de.mergeObjectSync(h,R)}get element(){return this._def.valueType}static create(l,h,A){return h instanceof fe?new Mt(J({keyType:l,valueType:h,typeName:at.ZodRecord},Y(A))):new Mt(J({keyType:Ge.create(),valueType:l,typeName:at.ZodRecord},Y(h)))}}class zn extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:h,ctx:A}=this._processInputParams(l);if(A.parsedType!==te.map)return H(A,{code:B.invalid_type,expected:te.map,received:A.parsedType}),ge;const R=this._def.keyType,P=this._def.valueType,oe=[...A.data.entries()].map(([le,Be],Ve)=>({key:R._parse(new De(A,le,A.path,[Ve,"key"])),value:P._parse(new De(A,Be,A.path,[Ve,"value"]))}));if(A.common.async){const le=new Map;return Promise.resolve().then(()=>Bn(this,null,function*(){for(const Be of oe){const Ve=yield Be.key,wt=yield Be.value;if(Ve.status==="aborted"||wt.status==="aborted")return ge;(Ve.status==="dirty"||wt.status==="dirty")&&h.dirty(),le.set(Ve.value,wt.value)}return{status:h.value,value:le}}))}else{const le=new Map;for(const Be of oe){const Ve=Be.key,wt=Be.value;if(Ve.status==="aborted"||wt.status==="aborted")return ge;(Ve.status==="dirty"||wt.status==="dirty")&&h.dirty(),le.set(Ve.value,wt.value)}return{status:h.value,value:le}}}}zn.create=(S,l,h)=>new zn(J({valueType:l,keyType:S,typeName:at.ZodMap},Y(h)));class Gt extends fe{_parse(l){const{status:h,ctx:A}=this._processInputParams(l);if(A.parsedType!==te.set)return H(A,{code:B.invalid_type,expected:te.set,received:A.parsedType}),ge;const R=this._def;R.minSize!==null&&A.data.size<R.minSize.value&&(H(A,{code:B.too_small,minimum:R.minSize.value,type:"set",inclusive:!0,exact:!1,message:R.minSize.message}),h.dirty()),R.maxSize!==null&&A.data.size>R.maxSize.value&&(H(A,{code:B.too_big,maximum:R.maxSize.value,type:"set",inclusive:!0,exact:!1,message:R.maxSize.message}),h.dirty());const P=this._def.valueType;function oe(Be){const Ve=new Set;for(const wt of Be){if(wt.status==="aborted")return ge;wt.status==="dirty"&&h.dirty(),Ve.add(wt.value)}return{status:h.value,value:Ve}}const le=[...A.data.values()].map((Be,Ve)=>P._parse(new De(A,Be,A.path,Ve)));return A.common.async?Promise.all(le).then(Be=>oe(Be)):oe(le)}min(l,h){return new Gt(it(J({},this._def),{minSize:{value:l,message:Ee.toString(h)}}))}max(l,h){return new Gt(it(J({},this._def),{maxSize:{value:l,message:Ee.toString(h)}}))}size(l,h){return this.min(l,h).max(l,h)}nonempty(l){return this.min(1,l)}}Gt.create=(S,l)=>new Gt(J({valueType:S,minSize:null,maxSize:null,typeName:at.ZodSet},Y(l)));class dn extends fe{constructor(){super(...arguments),this.validate=this.implement}_parse(l){const{ctx:h}=this._processInputParams(l);if(h.parsedType!==te.function)return H(h,{code:B.invalid_type,expected:te.function,received:h.parsedType}),ge;function A(le,Be){return he({data:le,path:h.path,errorMaps:[h.common.contextualErrorMap,h.schemaErrorMap,W(),ft].filter(Ve=>!!Ve),issueData:{code:B.invalid_arguments,argumentsError:Be}})}function R(le,Be){return he({data:le,path:h.path,errorMaps:[h.common.contextualErrorMap,h.schemaErrorMap,W(),ft].filter(Ve=>!!Ve),issueData:{code:B.invalid_return_type,returnTypeError:Be}})}const P={errorMap:h.common.contextualErrorMap},oe=h.data;if(this._def.returns instanceof kn){const le=this;return We(function(...Be){return Bn(this,null,function*(){const Ve=new ke([]),wt=yield le._def.args.parseAsync(Be,P).catch(lr=>{throw Ve.addIssue(A(Be,lr)),Ve}),wn=yield Reflect.apply(oe,this,wt);return yield le._def.returns._def.type.parseAsync(wn,P).catch(lr=>{throw Ve.addIssue(R(wn,lr)),Ve})})})}else{const le=this;return We(function(...Be){const Ve=le._def.args.safeParse(Be,P);if(!Ve.success)throw new ke([A(Be,Ve.error)]);const wt=Reflect.apply(oe,this,Ve.data),wn=le._def.returns.safeParse(wt,P);if(!wn.success)throw new ke([R(wt,wn.error)]);return wn.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...l){return new dn(it(J({},this._def),{args:cn.create(l).rest(Ct.create())}))}returns(l){return new dn(it(J({},this._def),{returns:l}))}implement(l){return this.parse(l)}strictImplement(l){return this.parse(l)}static create(l,h,A){return new dn(J({args:l||cn.create([]).rest(Ct.create()),returns:h||Ct.create(),typeName:at.ZodFunction},Y(A)))}}class fn extends fe{get schema(){return this._def.getter()}_parse(l){const{ctx:h}=this._processInputParams(l);return this._def.getter()._parse({data:h.data,path:h.path,parent:h})}}fn.create=(S,l)=>new fn(J({getter:S,typeName:at.ZodLazy},Y(l)));class Vn extends fe{_parse(l){if(l.data!==this._def.value){const h=this._getOrReturnCtx(l);return H(h,{received:h.data,code:B.invalid_literal,expected:this._def.value}),ge}return{status:"valid",value:l.data}}get value(){return this._def.value}}Vn.create=(S,l)=>new Vn(J({value:S,typeName:at.ZodLiteral},Y(l)));function Wn(S,l){return new vn(J({values:S,typeName:at.ZodEnum},Y(l)))}class vn extends fe{_parse(l){if(typeof l.data!="string"){const h=this._getOrReturnCtx(l),A=this._def.values;return H(h,{expected:ee.joinValues(A),received:h.parsedType,code:B.invalid_type}),ge}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(l.data)){const h=this._getOrReturnCtx(l),A=this._def.values;return H(h,{received:h.data,code:B.invalid_enum_value,options:A}),ge}return We(l.data)}get options(){return this._def.values}get enum(){const l={};for(const h of this._def.values)l[h]=h;return l}get Values(){const l={};for(const h of this._def.values)l[h]=h;return l}get Enum(){const l={};for(const h of this._def.values)l[h]=h;return l}extract(l,h=this._def){return vn.create(l,J(J({},this._def),h))}exclude(l,h=this._def){return vn.create(this.options.filter(A=>!l.includes(A)),J(J({},this._def),h))}}vn.create=Wn;class yn extends fe{_parse(l){const h=ee.getValidEnumValues(this._def.values),A=this._getOrReturnCtx(l);if(A.parsedType!==te.string&&A.parsedType!==te.number){const R=ee.objectValues(h);return H(A,{expected:ee.joinValues(R),received:A.parsedType,code:B.invalid_type}),ge}if(this._cache||(this._cache=new Set(ee.getValidEnumValues(this._def.values))),!this._cache.has(l.data)){const R=ee.objectValues(h);return H(A,{received:A.data,code:B.invalid_enum_value,options:R}),ge}return We(l.data)}get enum(){return this._def.values}}yn.create=(S,l)=>new yn(J({values:S,typeName:at.ZodNativeEnum},Y(l)));class kn extends fe{unwrap(){return this._def.type}_parse(l){const{ctx:h}=this._processInputParams(l);if(h.parsedType!==te.promise&&h.common.async===!1)return H(h,{code:B.invalid_type,expected:te.promise,received:h.parsedType}),ge;const A=h.parsedType===te.promise?h.data:Promise.resolve(h.data);return We(A.then(R=>this._def.type.parseAsync(R,{path:h.path,errorMap:h.common.contextualErrorMap})))}}kn.create=(S,l)=>new kn(J({type:S,typeName:at.ZodPromise},Y(l)));class An extends fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(l){const{status:h,ctx:A}=this._processInputParams(l),R=this._def.effect||null,P={addIssue:oe=>{H(A,oe),oe.fatal?h.abort():h.dirty()},get path(){return A.path}};if(P.addIssue=P.addIssue.bind(P),R.type==="preprocess"){const oe=R.transform(A.data,P);if(A.common.async)return Promise.resolve(oe).then(le=>Bn(this,null,function*(){if(h.value==="aborted")return ge;const Be=yield this._def.schema._parseAsync({data:le,path:A.path,parent:A});return Be.status==="aborted"?ge:Be.status==="dirty"||h.value==="dirty"?Ae(Be.value):Be}));{if(h.value==="aborted")return ge;const le=this._def.schema._parseSync({data:oe,path:A.path,parent:A});return le.status==="aborted"?ge:le.status==="dirty"||h.value==="dirty"?Ae(le.value):le}}if(R.type==="refinement"){const oe=le=>{const Be=R.refinement(le,P);if(A.common.async)return Promise.resolve(Be);if(Be instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return le};if(A.common.async===!1){const le=this._def.schema._parseSync({data:A.data,path:A.path,parent:A});return le.status==="aborted"?ge:(le.status==="dirty"&&h.dirty(),oe(le.value),{status:h.value,value:le.value})}else return this._def.schema._parseAsync({data:A.data,path:A.path,parent:A}).then(le=>le.status==="aborted"?ge:(le.status==="dirty"&&h.dirty(),oe(le.value).then(()=>({status:h.value,value:le.value}))))}if(R.type==="transform")if(A.common.async===!1){const oe=this._def.schema._parseSync({data:A.data,path:A.path,parent:A});if(!Nt(oe))return ge;const le=R.transform(oe.value,P);if(le instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:h.value,value:le}}else return this._def.schema._parseAsync({data:A.data,path:A.path,parent:A}).then(oe=>Nt(oe)?Promise.resolve(R.transform(oe.value,P)).then(le=>({status:h.value,value:le})):ge);ee.assertNever(R)}}An.create=(S,l,h)=>new An(J({schema:S,typeName:at.ZodEffects,effect:l},Y(h))),An.createWithPreprocess=(S,l,h)=>new An(J({schema:l,effect:{type:"preprocess",transform:S},typeName:at.ZodEffects},Y(h)));class Nn extends fe{_parse(l){return this._getType(l)===te.undefined?We(void 0):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}Nn.create=(S,l)=>new Nn(J({innerType:S,typeName:at.ZodOptional},Y(l)));class $n extends fe{_parse(l){return this._getType(l)===te.null?We(null):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}$n.create=(S,l)=>new $n(J({innerType:S,typeName:at.ZodNullable},Y(l)));class Gn extends fe{_parse(l){const{ctx:h}=this._processInputParams(l);let A=h.data;return h.parsedType===te.undefined&&(A=this._def.defaultValue()),this._def.innerType._parse({data:A,path:h.path,parent:h})}removeDefault(){return this._def.innerType}}Gn.create=(S,l)=>new Gn(J({innerType:S,typeName:at.ZodDefault,defaultValue:typeof l.default=="function"?l.default:()=>l.default},Y(l)));class Qn extends fe{_parse(l){const{ctx:h}=this._processInputParams(l),A=it(J({},h),{common:it(J({},h.common),{issues:[]})}),R=this._def.innerType._parse({data:A.data,path:A.path,parent:J({},A)});return tt(R)?R.then(P=>({status:"valid",value:P.status==="valid"?P.value:this._def.catchValue({get error(){return new ke(A.common.issues)},input:A.data})})):{status:"valid",value:R.status==="valid"?R.value:this._def.catchValue({get error(){return new ke(A.common.issues)},input:A.data})}}removeCatch(){return this._def.innerType}}Qn.create=(S,l)=>new Qn(J({innerType:S,typeName:at.ZodCatch,catchValue:typeof l.catch=="function"?l.catch:()=>l.catch},Y(l)));class Zn extends fe{_parse(l){if(this._getType(l)!==te.nan){const A=this._getOrReturnCtx(l);return H(A,{code:B.invalid_type,expected:te.nan,received:A.parsedType}),ge}return{status:"valid",value:l.data}}}Zn.create=S=>new Zn(J({typeName:at.ZodNaN},Y(S)));const mr=Symbol("zod_brand");class jn extends fe{_parse(l){const{ctx:h}=this._processInputParams(l),A=h.data;return this._def.type._parse({data:A,path:h.path,parent:h})}unwrap(){return this._def.type}}class un extends fe{_parse(l){const{status:h,ctx:A}=this._processInputParams(l);if(A.common.async)return Bn(this,null,function*(){const P=yield this._def.in._parseAsync({data:A.data,path:A.path,parent:A});return P.status==="aborted"?ge:P.status==="dirty"?(h.dirty(),Ae(P.value)):this._def.out._parseAsync({data:P.value,path:A.path,parent:A})});{const R=this._def.in._parseSync({data:A.data,path:A.path,parent:A});return R.status==="aborted"?ge:R.status==="dirty"?(h.dirty(),{status:"dirty",value:R.value}):this._def.out._parseSync({data:R.value,path:A.path,parent:A})}}static create(l,h){return new un({in:l,out:h,typeName:at.ZodPipeline})}}class Rn extends fe{_parse(l){const h=this._def.innerType._parse(l),A=R=>(Nt(R)&&(R.value=Object.freeze(R.value)),R);return tt(h)?h.then(R=>A(R)):A(h)}unwrap(){return this._def.innerType}}Rn.create=(S,l)=>new Rn(J({innerType:S,typeName:at.ZodReadonly},Y(l)));function xn(S,l){const h=typeof S=="function"?S(l):typeof S=="string"?{message:S}:S;return typeof h=="string"?{message:h}:h}function Vt(S,l={},h){return S?bt.create().superRefine((A,R)=>{var oe,le;const P=S(A);if(P instanceof Promise)return P.then(Be=>{var Ve,wt;if(!Be){const wn=xn(l,A),kr=(wt=(Ve=wn.fatal)!=null?Ve:h)!=null?wt:!0;R.addIssue(it(J({code:"custom"},wn),{fatal:kr}))}});if(!P){const Be=xn(l,A),Ve=(le=(oe=Be.fatal)!=null?oe:h)!=null?le:!0;R.addIssue(it(J({code:"custom"},Be),{fatal:Ve}))}}):bt.create()}const pn={object:Wt.lazycreate};var at;(function(S){S.ZodString="ZodString",S.ZodNumber="ZodNumber",S.ZodNaN="ZodNaN",S.ZodBigInt="ZodBigInt",S.ZodBoolean="ZodBoolean",S.ZodDate="ZodDate",S.ZodSymbol="ZodSymbol",S.ZodUndefined="ZodUndefined",S.ZodNull="ZodNull",S.ZodAny="ZodAny",S.ZodUnknown="ZodUnknown",S.ZodNever="ZodNever",S.ZodVoid="ZodVoid",S.ZodArray="ZodArray",S.ZodObject="ZodObject",S.ZodUnion="ZodUnion",S.ZodDiscriminatedUnion="ZodDiscriminatedUnion",S.ZodIntersection="ZodIntersection",S.ZodTuple="ZodTuple",S.ZodRecord="ZodRecord",S.ZodMap="ZodMap",S.ZodSet="ZodSet",S.ZodFunction="ZodFunction",S.ZodLazy="ZodLazy",S.ZodLiteral="ZodLiteral",S.ZodEnum="ZodEnum",S.ZodEffects="ZodEffects",S.ZodNativeEnum="ZodNativeEnum",S.ZodOptional="ZodOptional",S.ZodNullable="ZodNullable",S.ZodDefault="ZodDefault",S.ZodCatch="ZodCatch",S.ZodPromise="ZodPromise",S.ZodBranded="ZodBranded",S.ZodPipeline="ZodPipeline",S.ZodReadonly="ZodReadonly"})(at||(at={}));class Dt{constructor(...l){}}const Ut=(S,l={message:`Input not instance of ${S.name}`})=>Vt(h=>h instanceof S,l),Un=Ge.create,Xn=Ft.create,er=Zn.create,wr=tn.create,hn=xt.create,Nr=rn.create,gr=En.create,or=bn.create,Jn=_n.create,vr=bt.create,tr=Ct.create,kt=It.create,Rt=on.create,Pt=mn.create,qn=Wt.create,Dn=Wt.strictCreate,Sr=Xe.create,Ur=_t.create,Br=Mn.create,ur=cn.create,ir=Mt.create,Er=zn.create,Tr=Gt.create,zr=dn.create,Vr=fn.create,yr=Vn.create,$r=vn.create,fi=yn.create,Rr=kn.create,Cr=An.create,Yr=Nn.create,Xr=$n.create,Zr=An.createWithPreprocess,ei=un.create,ti=()=>Un().optional(),ni=()=>Xn().optional(),Kr=()=>hn().optional(),ri={string:S=>Ge.create(it(J({},S),{coerce:!0})),number:S=>Ft.create(it(J({},S),{coerce:!0})),boolean:S=>xt.create(it(J({},S),{coerce:!0})),bigint:S=>tn.create(it(J({},S),{coerce:!0})),date:S=>rn.create(it(J({},S),{coerce:!0}))},ii=null;var ai=null,Wr=null;function Pr(S){let l={};for(let A of S||[])l[A.name]=Ir(A);let h=[];for(let A of S||[])A.required!==!1&&h.push(A.name);return{type:"object",properties:l,required:h}}function Ir(S){var l,h,A;switch(S.type){case"string":return J({type:"string",description:S.description},S.enum&&{enum:S.enum});case"number":case"boolean":return{type:S.type,description:S.description};case"object":case"object[]":const R=(l=S.attributes)==null?void 0:l.reduce((oe,le)=>(oe[le.name]=Ir(le),oe),{}),P=(h=S.attributes)==null?void 0:h.filter(oe=>oe.required!==!1).map(oe=>oe.name);return S.type==="object[]"?{type:"array",items:J(J({type:"object"},R&&{properties:R}),P&&P.length>0&&{required:P}),description:S.description}:J(J({type:"object",description:S.description},R&&{properties:R}),P&&P.length>0&&{required:P});default:return(A=S.type)!=null&&A.endsWith("[]")?{type:"array",items:{type:S.type.slice(0,-2)},description:S.description}:{type:"string",description:S.description}}}function Fr(S,l){if(S.type==="object"){const h={};if(!S.properties||!Object.keys(S.properties).length)return l?z.object(h):z.object(h).optional();for(const[R,P]of Object.entries(S.properties))h[R]=Fr(P,S.required?S.required.includes(R):!1);let A=z.object(h).describe(S.description);return l?A:A.optional()}else if(S.type==="string"){let h=z.string().describe(S.description);return l?h:h.optional()}else if(S.type==="number"){let h=z.number().describe(S.description);return l?h:h.optional()}else if(S.type==="boolean"){let h=z.boolean().describe(S.description);return l?h:h.optional()}else if(S.type==="array"){let h=Fr(S.items,!0),A=z.array(h).describe(S.description);return l?A:A.optional()}throw new Error("Invalid JSON schema")}},86349:function(lt,Ue,G){"use strict";G.d(Ue,{qP:function(){return We},UY:function(){return Le},KP:function(){return Ee},VM:function(){return nt},S5:function(){return Y},gR:function(){return Ae},nl:function(){return ne},bb:function(){return Se},zb:function(){return ge},wo:function(){return Pe},Mo:function(){return he}});function ee(re){return typeof re=="object"&&re!==null}function Ce(re,se){if(!!!re)throw new Error(se!=null?se:"Unexpected invariant triggered.")}const te=/\r\n|[\n\r]/g;function Te(re,se){let Re=0,qe=1;for(const Ze of re.body.matchAll(te)){if(typeof Ze.index=="number"||Ce(!1),Ze.index>=se)break;Re=Ze.index+Ze[0].length,qe+=1}return{line:qe,column:se+1-Re}}function B(re){return ce(re.source,Te(re.source,re.start))}function ce(re,se){const Re=re.locationOffset.column-1,qe="".padStart(Re)+re.body,Ze=se.line-1,Lt=re.locationOffset.line-1,Bt=se.line+Lt,Xt=se.line===1?Re:0,jt=se.column+Xt,ae=`${re.name}:${Bt}:${jt}
237
+ `,pe=qe.split(/\r\n|[\n\r]/g),Me=pe[Ze];if(Me.length>120){const me=Math.floor(jt/80),Ye=jt%80,$e=[];for(let Ge=0;Ge<Me.length;Ge+=80)$e.push(Me.slice(Ge,Ge+80));return ae+ke([[`${Bt} |`,$e[0]],...$e.slice(1,me+1).map(Ge=>["|",Ge]),["|","^".padStart(Ye)],["|",$e[me+1]]])}return ae+ke([[`${Bt-1} |`,pe[Ze-1]],[`${Bt} |`,Me],["|","^".padStart(jt)],[`${Bt+1} |`,pe[Ze+1]]])}function ke(re){const se=re.filter(([qe,Ze])=>Ze!==void 0),Re=Math.max(...se.map(([qe])=>qe.length));return se.map(([qe,Ze])=>qe.padStart(Re)+(Ze?" "+Ze:"")).join(`
238
+ `)}function Oe(re){const se=re[0];return se==null||"kind"in se||"length"in se?{nodes:se,source:re[1],positions:re[2],path:re[3],originalError:re[4],extensions:re[5]}:se}class ft extends Error{constructor(se,...Re){var qe,Ze,Lt;const{nodes:Bt,source:Xt,positions:jt,path:ae,originalError:pe,extensions:Me}=Oe(Re);super(se),this.name="GraphQLError",this.path=ae!=null?ae:void 0,this.originalError=pe!=null?pe:void 0,this.nodes=ye(Array.isArray(Bt)?Bt:Bt?[Bt]:void 0);const me=ye((qe=this.nodes)===null||qe===void 0?void 0:qe.map($e=>$e.loc).filter($e=>$e!=null));this.source=Xt!=null?Xt:me==null||(Ze=me[0])===null||Ze===void 0?void 0:Ze.source,this.positions=jt!=null?jt:me==null?void 0:me.map($e=>$e.start),this.locations=jt&&Xt?jt.map($e=>Te(Xt,$e)):me==null?void 0:me.map($e=>Te($e.source,$e.start));const Ye=ee(pe==null?void 0:pe.extensions)?pe==null?void 0:pe.extensions:void 0;this.extensions=(Lt=Me!=null?Me:Ye)!==null&&Lt!==void 0?Lt:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),pe!=null&&pe.stack?Object.defineProperty(this,"stack",{value:pe.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,ft):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let se=this.message;if(this.nodes)for(const Re of this.nodes)Re.loc&&(se+=`
239
+
240
+ `+B(Re.loc));else if(this.source&&this.locations)for(const Re of this.locations)se+=`
241
+
242
+ `+ce(this.source,Re);return se}toJSON(){const se={message:this.message};return this.locations!=null&&(se.locations=this.locations),this.path!=null&&(se.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(se.extensions=this.extensions),se}}function ye(re){return re===void 0||re.length===0?void 0:re}function M(re){return re.toString()}function W(re){return re.toJSON()}function he(re,se="unset"){try{return JSON.parse(re)}catch(Re){return se==="unset"?null:se}}function je(re,se){return re.reduce((Re,qe,Ze,Lt)=>{try{Re.push(se(qe,Ze,Lt))}catch(Bt){console.error(Bt)}return Re},[])}var H="1.8.12-next.4",de=H,ge=(re=>(re.Error="error",re))(ge||{}),Ae={COPILOT_ERROR:"CopilotError",COPILOT_API_DISCOVERY_ERROR:"CopilotApiDiscoveryError",COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR:"CopilotKitRemoteEndpointDiscoveryError",COPILOT_KIT_AGENT_DISCOVERY_ERROR:"CopilotKitAgentDiscoveryError",COPILOT_KIT_LOW_LEVEL_ERROR:"CopilotKitLowLevelError",COPILOT_KIT_VERSION_MISMATCH_ERROR:"CopilotKitVersionMismatchError",RESOLVED_COPILOT_KIT_ERROR:"ResolvedCopilotKitError",CONFIGURATION_ERROR:"ConfigurationError",MISSING_PUBLIC_API_KEY_ERROR:"MissingPublicApiKeyError",UPGRADE_REQUIRED_ERROR:"UpgradeRequiredError"},We=[Ae.CONFIGURATION_ERROR,Ae.MISSING_PUBLIC_API_KEY_ERROR,Ae.UPGRADE_REQUIRED_ERROR],yt=(re=>(re.NETWORK_ERROR="NETWORK_ERROR",re.NOT_FOUND="NOT_FOUND",re.AGENT_NOT_FOUND="AGENT_NOT_FOUND",re.API_NOT_FOUND="API_NOT_FOUND",re.REMOTE_ENDPOINT_NOT_FOUND="REMOTE_ENDPOINT_NOT_FOUND",re.MISUSE="MISUSE",re.UNKNOWN="UNKNOWN",re.VERSION_MISMATCH="VERSION_MISMATCH",re.CONFIGURATION_ERROR="CONFIGURATION_ERROR",re.MISSING_PUBLIC_API_KEY_ERROR="MISSING_PUBLIC_API_KEY_ERROR",re.UPGRADE_REQUIRED_ERROR="UPGRADE_REQUIRED_ERROR",re))(yt||{}),st="https://docs.copilotkit.ai",Nt=re=>`See more: [${re}](${re})`,tt={NETWORK_ERROR:{statusCode:503,troubleshootingUrl:`${st}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`},NOT_FOUND:{statusCode:404,troubleshootingUrl:`${st}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`},AGENT_NOT_FOUND:{statusCode:500,troubleshootingUrl:`${st}/coagents/troubleshooting/common-issues#i-am-getting-agent-not-found-error`},API_NOT_FOUND:{statusCode:404,troubleshootingUrl:`${st}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`},REMOTE_ENDPOINT_NOT_FOUND:{statusCode:404,troubleshootingUrl:`${st}/troubleshooting/common-issues#i-am-getting-copilotkits-remote-endpoint-not-found-error`},MISUSE:{statusCode:400,troubleshootingUrl:null},UNKNOWN:{statusCode:500},CONFIGURATION_ERROR:{statusCode:400,troubleshootingUrl:null,severity:"error"},MISSING_PUBLIC_API_KEY_ERROR:{statusCode:400,troubleshootingUrl:null,severity:"error"},UPGRADE_REQUIRED_ERROR:{statusCode:402,troubleshootingUrl:null,severity:"error"},VERSION_MISMATCH:{statusCode:400,troubleshootingUrl:null}},Ee=class extends ft{constructor({message:re="Unknown error occurred",code:se,severity:Re}){const qe=Ae.COPILOT_ERROR,{statusCode:Ze}=tt[se];super(re,{extensions:{name:qe,statusCode:Ze}}),this.code=se,this.name=qe,this.statusCode=Ze,this.severity=Re}},De=class extends null{constructor({message:re,code:se="MISUSE"}){const Re="troubleshootingUrl"in tt[se]&&tt[se].troubleshootingUrl?Nt(tt[se].troubleshootingUrl):null,qe=Re?`${re}.
243
+
244
+ ${Re}`:re;super({message:qe,code:se}),this.name=Ae.COPILOT_API_DISCOVERY_ERROR}},mt=({reactCoreVersion:re,runtimeVersion:se,runtimeClientGqlVersion:Re})=>`Version mismatch detected: @copilotkit/runtime@${se!=null?se:""} is not compatible with @copilotkit/react-core@${re} and @copilotkit/runtime-client-gql@${Re}. Please ensure all installed copilotkit packages are on the same version.`,Y=class extends Ee{constructor({reactCoreVersion:re,runtimeVersion:se,runtimeClientGqlVersion:Re}){super({message:mt({reactCoreVersion:re,runtimeVersion:se,runtimeClientGqlVersion:Re}),code:"VERSION_MISMATCH"}),this.name=Ae.COPILOT_KIT_VERSION_MISMATCH_ERROR}},fe=class extends Ee{constructor(re={}){var Bt,Xt,jt;const se=(Bt=re.url)!=null?Bt:"";let Re="";se!=null&&se.includes("/info")?Re="when fetching CopilotKit info":se.includes("/actions/execute")?Re="when attempting to execute actions.":se.includes("/agents/state")?Re="when attempting to get agent state.":se.includes("/agents/execute")&&(Re="when attempting to execute agent(s).");const qe=(Xt=re.message)!=null?Xt:re.url?`Failed to find CopilotKit API endpoint at url ${re.url} ${Re}`:"Failed to find CopilotKit API endpoint.",Ze=(jt=re.code)!=null?jt:"API_NOT_FOUND",Lt=`${qe}.
245
+
246
+ ${Nt(tt[Ze].troubleshootingUrl)}`;super({message:Lt,code:Ze}),this.name=Ae.COPILOT_API_DISCOVERY_ERROR}},xe=class extends fe{constructor(re){var qe;const se=(qe=re==null?void 0:re.message)!=null?qe:re!=null&&re.url?`Failed to find or contact remote endpoint at url ${re.url}`:"Failed to find or contact remote endpoint";super({message:se,code:"REMOTE_ENDPOINT_NOT_FOUND"}),this.name=Ae.COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR}},Ie=class extends null{constructor(re){const{agentName:se,availableAgents:Re}=re,qe="AGENT_NOT_FOUND";let Ze="Failed to find any agents.";const Lt="Please verify the agent name exists and is properly configured.",Bt=Nt(tt[qe].troubleshootingUrl);if(Re.length){Ze=se?`Failed to find agent '${se}'. ${Lt}`:`Failed to find agent. ${Lt}`;const Xt=Re.map(jt=>`\u2022 ${jt.name} (ID: \`${jt.id}\`)`).join(`
247
+ `);Ze+=`
248
+
249
+ The available agents are:
250
+
251
+ ${Xt}
252
+
253
+ ${Bt}`}else Ze+=`
254
+
255
+ ${Bt}`;super({message:Ze,code:qe}),this.name=Ae.COPILOT_KIT_AGENT_DISCOVERY_ERROR}},nt=class extends Ee{constructor({error:re,url:se,message:Re}){let qe="NETWORK_ERROR";const Ze=re.code,Lt=Re!=null?Re:Je({errorCode:Ze,url:se});super({message:Lt,code:qe}),this.name=Ae.COPILOT_KIT_LOW_LEVEL_ERROR}},Se=class extends Ee{constructor({status:re,message:se,code:Re,isRemoteEndpoint:qe,url:Ze}){let Lt=Re;if(Lt)super({message:se,code:Lt});else switch(re){case 400:throw new fe({message:se,url:Ze});case 404:throw qe?new xe({message:se,url:Ze}):new fe({message:se,url:Ze});default:Lt="UNKNOWN",super({message:se,code:Lt})}this.name=Ae.RESOLVED_COPILOT_KIT_ERROR}},Le=class extends Ee{constructor(re){super({message:re,code:"CONFIGURATION_ERROR"}),this.name=Ae.CONFIGURATION_ERROR,this.severity="error"}},ne=class extends Le{constructor(re){super(re),this.name=Ae.MISSING_PUBLIC_API_KEY_ERROR,this.severity="error"}},_e=class extends null{constructor(re){super(re),this.name=Ae.UPGRADE_REQUIRED_ERROR,this.severity="error"}};function Pe(Re){return Bn(this,arguments,function*({runtimeVersion:re,runtimeClientGqlVersion:se}){if(!(!re||re===""||!se)&&(de!==re||de!==se||re!==se))return{runtimeVersion:re,runtimeClientGqlVersion:se,reactCoreVersion:de,message:mt({runtimeVersion:re,runtimeClientGqlVersion:se,reactCoreVersion:de})}})}var Je=({errorCode:re,url:se})=>{const Re=tt.NETWORK_ERROR.troubleshootingUrl,qe=(Ze=`Failed to fetch from url ${se}.`)=>`${Ze}.
256
+
257
+ Possible reasons:
258
+ - -The server may have an error preventing it from returning a response (Check the server logs for more info).
259
+ - -The server might be down or unreachable
260
+ - -There might be a network issue (e.g., DNS failure, connection timeout)
261
+ - -The URL might be incorrect
262
+ - -The server is not running on the specified port
263
+
264
+ ${Nt(Re)}`;if(se.includes("/info"))return qe(`Failed to fetch CopilotKit agents/action information from url ${se}.`);if(se.includes("/actions/execute"))return qe(`Fetch call to ${se} to execute actions failed.`);if(se.includes("/agents/state"))return qe(`Fetch call to ${se} to get agent state failed.`);if(se.includes("/agents/execute"))return qe(`Fetch call to ${se} to execute agent(s) failed.`);switch(re){case"ECONNREFUSED":return`Connection to ${se} was refused. Ensure the server is running and accessible.
265
+
266
+ ${Nt(Re)}`;case"ENOTFOUND":return`The server on ${se} could not be found. Check the URL or your network configuration.
267
+
268
+ ${Nt(tt.NOT_FOUND.troubleshootingUrl)}`;case"ETIMEDOUT":return`The connection to ${se} timed out. The server might be overloaded or taking too long to respond.
269
+
270
+ ${Nt(Re)}`;default:return}}},25590:function(lt,Ue,G){"use strict";G.d(Ue,{xw:function(){return Ie},kb:function(){return fe},HP:function(){return xe}});var ee=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ce={randomUUID:ee},te,Te=new Uint8Array(16);function B(){if(!te&&(te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!te))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Te)}for(var ce=[],ke=0;ke<256;++ke)ce.push((ke+256).toString(16).slice(1));function Oe(Se,Le=0){return(ce[Se[Le+0]]+ce[Se[Le+1]]+ce[Se[Le+2]]+ce[Se[Le+3]]+"-"+ce[Se[Le+4]]+ce[Se[Le+5]]+"-"+ce[Se[Le+6]]+ce[Se[Le+7]]+"-"+ce[Se[Le+8]]+ce[Se[Le+9]]+"-"+ce[Se[Le+10]]+ce[Se[Le+11]]+ce[Se[Le+12]]+ce[Se[Le+13]]+ce[Se[Le+14]]+ce[Se[Le+15]]).toLowerCase()}function ft(Se,Le=0){var ne=Oe(Se,Le);if(!validate(ne))throw TypeError("Stringified UUID is invalid");return ne}var ye=null;function M(Se,Le,ne){if(Ce.randomUUID&&!Le&&!Se)return Ce.randomUUID();Se=Se||{};var _e=Se.random||(Se.rng||B)();if(_e[6]=_e[6]&15|64,_e[8]=_e[8]&63|128,Le){ne=ne||0;for(var Pe=0;Pe<16;++Pe)Le[ne+Pe]=_e[Pe];return Le}return Oe(_e)}var W=M,he=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function je(Se){return typeof Se=="string"&&he.test(Se)}var H=je;function de(Se){if(!H(Se))throw TypeError("Invalid UUID");var Le,ne=new Uint8Array(16);return ne[0]=(Le=parseInt(Se.slice(0,8),16))>>>24,ne[1]=Le>>>16&255,ne[2]=Le>>>8&255,ne[3]=Le&255,ne[4]=(Le=parseInt(Se.slice(9,13),16))>>>8,ne[5]=Le&255,ne[6]=(Le=parseInt(Se.slice(14,18),16))>>>8,ne[7]=Le&255,ne[8]=(Le=parseInt(Se.slice(19,23),16))>>>8,ne[9]=Le&255,ne[10]=(Le=parseInt(Se.slice(24,36),16))/1099511627776&255,ne[11]=Le/4294967296&255,ne[12]=Le>>>24&255,ne[13]=Le>>>16&255,ne[14]=Le>>>8&255,ne[15]=Le&255,ne}var ge=de;function Ae(Se){Se=unescape(encodeURIComponent(Se));for(var Le=[],ne=0;ne<Se.length;++ne)Le.push(Se.charCodeAt(ne));return Le}var We="6ba7b810-9dad-11d1-80b4-00c04fd430c8",yt="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function st(Se,Le,ne){function _e(Pe,Je,re,se){var Re;if(typeof Pe=="string"&&(Pe=Ae(Pe)),typeof Je=="string"&&(Je=ge(Je)),((Re=Je)===null||Re===void 0?void 0:Re.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var qe=new Uint8Array(16+Pe.length);if(qe.set(Je),qe.set(Pe,Je.length),qe=ne(qe),qe[6]=qe[6]&15|Le,qe[8]=qe[8]&63|128,re){se=se||0;for(var Ze=0;Ze<16;++Ze)re[se+Ze]=qe[Ze];return re}return Oe(qe)}try{_e.name=Se}catch(Pe){}return _e.DNS=We,_e.URL=yt,_e}function Nt(Se,Le,ne,_e){switch(Se){case 0:return Le&ne^~Le&_e;case 1:return Le^ne^_e;case 2:return Le&ne^Le&_e^ne&_e;case 3:return Le^ne^_e}}function tt(Se,Le){return Se<<Le|Se>>>32-Le}function Ee(Se){var Le=[1518500249,1859775393,2400959708,3395469782],ne=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof Se=="string"){var _e=unescape(encodeURIComponent(Se));Se=[];for(var Pe=0;Pe<_e.length;++Pe)Se.push(_e.charCodeAt(Pe))}else Array.isArray(Se)||(Se=Array.prototype.slice.call(Se));Se.push(128);for(var Je=Se.length/4+2,re=Math.ceil(Je/16),se=new Array(re),Re=0;Re<re;++Re){for(var qe=new Uint32Array(16),Ze=0;Ze<16;++Ze)qe[Ze]=Se[Re*64+Ze*4]<<24|Se[Re*64+Ze*4+1]<<16|Se[Re*64+Ze*4+2]<<8|Se[Re*64+Ze*4+3];se[Re]=qe}se[re-1][14]=(Se.length-1)*8/Math.pow(2,32),se[re-1][14]=Math.floor(se[re-1][14]),se[re-1][15]=(Se.length-1)*8&4294967295;for(var Lt=0;Lt<re;++Lt){for(var Bt=new Uint32Array(80),Xt=0;Xt<16;++Xt)Bt[Xt]=se[Lt][Xt];for(var jt=16;jt<80;++jt)Bt[jt]=tt(Bt[jt-3]^Bt[jt-8]^Bt[jt-14]^Bt[jt-16],1);for(var ae=ne[0],pe=ne[1],Me=ne[2],me=ne[3],Ye=ne[4],$e=0;$e<80;++$e){var Ge=Math.floor($e/20),ot=tt(ae,5)+Nt(Ge,pe,Me,me)+Ye+Le[Ge]+Bt[$e]>>>0;Ye=me,me=Me,Me=tt(pe,30)>>>0,pe=ae,ae=ot}ne[0]=ne[0]+ae>>>0,ne[1]=ne[1]+pe>>>0,ne[2]=ne[2]+Me>>>0,ne[3]=ne[3]+me>>>0,ne[4]=ne[4]+Ye>>>0}return[ne[0]>>24&255,ne[0]>>16&255,ne[0]>>8&255,ne[0]&255,ne[1]>>24&255,ne[1]>>16&255,ne[1]>>8&255,ne[1]&255,ne[2]>>24&255,ne[2]>>16&255,ne[2]>>8&255,ne[2]&255,ne[3]>>24&255,ne[3]>>16&255,ne[3]>>8&255,ne[3]&255,ne[4]>>24&255,ne[4]>>16&255,ne[4]>>8&255,ne[4]&255]}var De=Ee,mt=st("v5",80,De),Y=mt;function fe(){return"ck-"+W()}function xe(){return W()}function Ie(Se,Le){const ne="e4b01160-ff74-4c6e-9b27-d53cd930fe8e",_e=Le?Y(Le,ne):ne;return Y(Se,_e)}function nt(Se){return validate(Se)}}}]);
271
+ }());