requireganizer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -0
  3. package/package.json +17 -0
  4. package/requireganizer.mjs +152025 -0
  5. package/ui/404.html +1 -0
  6. package/ui/__next.__PAGE__.txt +10 -0
  7. package/ui/__next._full.txt +21 -0
  8. package/ui/__next._head.txt +6 -0
  9. package/ui/__next._index.txt +7 -0
  10. package/ui/__next._tree.txt +3 -0
  11. package/ui/_next/static/VBQlY4EUbWBsO6CE9anwE/_buildManifest.js +11 -0
  12. package/ui/_next/static/VBQlY4EUbWBsO6CE9anwE/_clientMiddlewareManifest.json +1 -0
  13. package/ui/_next/static/VBQlY4EUbWBsO6CE9anwE/_ssgManifest.js +1 -0
  14. package/ui/_next/static/chunks/0014070cb0631b77.js +1 -0
  15. package/ui/_next/static/chunks/0273fd3d4c8e219c.js +1 -0
  16. package/ui/_next/static/chunks/03ab2de6efdbc4aa.js +1 -0
  17. package/ui/_next/static/chunks/0558bd5d09feadb8.js +1 -0
  18. package/ui/_next/static/chunks/05b818bc1aa6f72c.js +1 -0
  19. package/ui/_next/static/chunks/066eb982ca6e512d.js +1 -0
  20. package/ui/_next/static/chunks/072e3a806d753825.js +1 -0
  21. package/ui/_next/static/chunks/07d75d7ff25f03c0.js +1 -0
  22. package/ui/_next/static/chunks/08112c7fa94eb42c.js +1 -0
  23. package/ui/_next/static/chunks/08f209e7c74fe6ab.js +1 -0
  24. package/ui/_next/static/chunks/09f4327a544d9194.js +1 -0
  25. package/ui/_next/static/chunks/0ccbbd924347d1ac.js +1 -0
  26. package/ui/_next/static/chunks/0dd97bf1fe2c140e.js +1 -0
  27. package/ui/_next/static/chunks/0e9ecd1480ef3a36.js +1 -0
  28. package/ui/_next/static/chunks/10608482a33ae8ae.js +1 -0
  29. package/ui/_next/static/chunks/10713cf476e8c49b.js +133 -0
  30. package/ui/_next/static/chunks/10d963b6682c0a90.js +1 -0
  31. package/ui/_next/static/chunks/162707d9a923245a.js +1 -0
  32. package/ui/_next/static/chunks/1727303de4b3405c.css +1 -0
  33. package/ui/_next/static/chunks/173081051f9066da.js +1 -0
  34. package/ui/_next/static/chunks/174cd1b9864e46c7.js +1 -0
  35. package/ui/_next/static/chunks/17545d8ecf77c53e.js +1 -0
  36. package/ui/_next/static/chunks/182ba81c7829962b.js +1 -0
  37. package/ui/_next/static/chunks/18895a3b80aee38c.js +1 -0
  38. package/ui/_next/static/chunks/188a2692436fabb1.js +7 -0
  39. package/ui/_next/static/chunks/18c8ea6b5d02b950.js +1 -0
  40. package/ui/_next/static/chunks/1938ef81859b8df8.js +1 -0
  41. package/ui/_next/static/chunks/197fb304173c3373.js +1 -0
  42. package/ui/_next/static/chunks/1a8351277630d429.js +1 -0
  43. package/ui/_next/static/chunks/1a982b37113277c1.js +55 -0
  44. package/ui/_next/static/chunks/1b18900e73d9912d.js +1 -0
  45. package/ui/_next/static/chunks/1b36e0e92032147a.js +137 -0
  46. package/ui/_next/static/chunks/1b5ca07c630ff364.js +1 -0
  47. package/ui/_next/static/chunks/1c941300aea093df.js +1 -0
  48. package/ui/_next/static/chunks/1ca0e6f95fed329f.js +1 -0
  49. package/ui/_next/static/chunks/1d7a42181cc4c34a.js +1 -0
  50. package/ui/_next/static/chunks/1dd2c7c0673ae3de.js +1 -0
  51. package/ui/_next/static/chunks/1e706068c6a09af1.js +1 -0
  52. package/ui/_next/static/chunks/1ec8e60a36061d8b.js +1 -0
  53. package/ui/_next/static/chunks/1f2cd9503cac6259.js +1 -0
  54. package/ui/_next/static/chunks/1f3b27cd15019e7d.js +1 -0
  55. package/ui/_next/static/chunks/209cd522dcb9aa5b.js +1 -0
  56. package/ui/_next/static/chunks/2186df519154b930.js +1 -0
  57. package/ui/_next/static/chunks/21abfcfd2e420eab.js +55 -0
  58. package/ui/_next/static/chunks/21b947ad3403c91c.js +1 -0
  59. package/ui/_next/static/chunks/21c3681ef2797475.js +1 -0
  60. package/ui/_next/static/chunks/22a02a1accfd6551.js +1 -0
  61. package/ui/_next/static/chunks/23ef8f977d45723f.js +1 -0
  62. package/ui/_next/static/chunks/26102878ed8f9073.js +1 -0
  63. package/ui/_next/static/chunks/27ea02083a3f73e0.js +1 -0
  64. package/ui/_next/static/chunks/28f83b5d69562dad.js +1 -0
  65. package/ui/_next/static/chunks/29de4c300420edd0.js +1 -0
  66. package/ui/_next/static/chunks/2d8048318b24ef28.js +1 -0
  67. package/ui/_next/static/chunks/2d89c000710d3fb5.js +1 -0
  68. package/ui/_next/static/chunks/2db93767a471a408.js +1 -0
  69. package/ui/_next/static/chunks/2e1966159ab35c0c.js +1 -0
  70. package/ui/_next/static/chunks/2e27bb5e35d4cca3.js +1 -0
  71. package/ui/_next/static/chunks/2e71cf0db069bb19.js +1 -0
  72. package/ui/_next/static/chunks/2e7bb7ab81b87a05.js +1 -0
  73. package/ui/_next/static/chunks/2f13869dd4c3e7b1.js +1 -0
  74. package/ui/_next/static/chunks/2f2a417ae92100eb.js +1 -0
  75. package/ui/_next/static/chunks/2f7a202775825c99.js +1 -0
  76. package/ui/_next/static/chunks/2fcf4a41ea62ab8a.js +1 -0
  77. package/ui/_next/static/chunks/2ff8c284e26ffb47.js +1 -0
  78. package/ui/_next/static/chunks/30c1629978206ffa.js +1 -0
  79. package/ui/_next/static/chunks/31126865845cc856.js +1 -0
  80. package/ui/_next/static/chunks/32574cc30749143a.js +1 -0
  81. package/ui/_next/static/chunks/3578dbf8d95b24d3.js +1 -0
  82. package/ui/_next/static/chunks/36ea33578c62f244.js +1 -0
  83. package/ui/_next/static/chunks/37b07746be292e74.js +1 -0
  84. package/ui/_next/static/chunks/37edc1640c3e040b.js +1 -0
  85. package/ui/_next/static/chunks/3811405130680ed1.js +1 -0
  86. package/ui/_next/static/chunks/38615c4374721ef6.js +1 -0
  87. package/ui/_next/static/chunks/38bfe001a4c6ca56.js +1 -0
  88. package/ui/_next/static/chunks/3a17f7db5be4334c.js +1 -0
  89. package/ui/_next/static/chunks/3a358bb6b0610d81.js +1 -0
  90. package/ui/_next/static/chunks/3a59c7bcf470e6f9.js +1 -0
  91. package/ui/_next/static/chunks/3b6cd3ccc23082c4.js +1 -0
  92. package/ui/_next/static/chunks/3b95ce1426ae64e0.js +1 -0
  93. package/ui/_next/static/chunks/3baec8bef75f945a.js +1 -0
  94. package/ui/_next/static/chunks/3bd74b67ba8b61af.js +1 -0
  95. package/ui/_next/static/chunks/3d514b42a810b8e7.js +1 -0
  96. package/ui/_next/static/chunks/3d5d3a265354ed92.css +1 -0
  97. package/ui/_next/static/chunks/3edf79569215f84b.js +1 -0
  98. package/ui/_next/static/chunks/3ef528b6184171be.js +1 -0
  99. package/ui/_next/static/chunks/3f3b1808254800a5.js +1 -0
  100. package/ui/_next/static/chunks/3ff7052ed88093e0.js +1 -0
  101. package/ui/_next/static/chunks/403a2dcb602cafaf.js +1 -0
  102. package/ui/_next/static/chunks/4050d7c9477acb3d.js +1 -0
  103. package/ui/_next/static/chunks/418b81689d8425f3.js +1 -0
  104. package/ui/_next/static/chunks/43df803986141791.js +65 -0
  105. package/ui/_next/static/chunks/43f9b47d1290b7ad.js +1 -0
  106. package/ui/_next/static/chunks/442b4e9c4ab9819e.js +1 -0
  107. package/ui/_next/static/chunks/44fce89560b0aa3b.js +1 -0
  108. package/ui/_next/static/chunks/46b8fe6b662aeefc.js +1 -0
  109. package/ui/_next/static/chunks/471042cef60901f2.js +1 -0
  110. package/ui/_next/static/chunks/47f86af0982e84ad.js +1 -0
  111. package/ui/_next/static/chunks/4849e31e8bae8046.js +1 -0
  112. package/ui/_next/static/chunks/492d267e61290059.js +1 -0
  113. package/ui/_next/static/chunks/4987e4c4ff7e6f4e.js +1 -0
  114. package/ui/_next/static/chunks/4a15097c31ce2e19.js +1 -0
  115. package/ui/_next/static/chunks/4a91c4828f8d3473.js +1 -0
  116. package/ui/_next/static/chunks/4b20182cd851dc14.js +1 -0
  117. package/ui/_next/static/chunks/4c8863f53954851d.js +1 -0
  118. package/ui/_next/static/chunks/4cf676bb538ccb0b.js +1 -0
  119. package/ui/_next/static/chunks/4dd38dfc6e5f6263.js +5 -0
  120. package/ui/_next/static/chunks/4e579cb332f87935.js +1 -0
  121. package/ui/_next/static/chunks/4eba3a1ae022187b.js +1 -0
  122. package/ui/_next/static/chunks/4edaafdc26c8efb2.js +1 -0
  123. package/ui/_next/static/chunks/4f08d14547dcb0f1.js +1 -0
  124. package/ui/_next/static/chunks/4f9c75c5552e934f.js +1 -0
  125. package/ui/_next/static/chunks/4fbb49aab7c93f4a.js +1 -0
  126. package/ui/_next/static/chunks/4fc1f7af7029a61a.js +1 -0
  127. package/ui/_next/static/chunks/4fd84c6b70e84ddc.js +1 -0
  128. package/ui/_next/static/chunks/505e43439d425514.js +1 -0
  129. package/ui/_next/static/chunks/50daec6407eede06.js +1 -0
  130. package/ui/_next/static/chunks/52a2dc24655bf053.js +1 -0
  131. package/ui/_next/static/chunks/54d7ebfd5a121dfc.js +1 -0
  132. package/ui/_next/static/chunks/5526bdc99e4a99f2.js +1 -0
  133. package/ui/_next/static/chunks/56fe0833321df747.js +1 -0
  134. package/ui/_next/static/chunks/57fc91ff672c65fd.js +1 -0
  135. package/ui/_next/static/chunks/5826e335bf3c7c72.js +1 -0
  136. package/ui/_next/static/chunks/588202ba8bbb2406.js +1 -0
  137. package/ui/_next/static/chunks/59a737ddedcb93af.js +1 -0
  138. package/ui/_next/static/chunks/5a841b6ebae3164a.js +1 -0
  139. package/ui/_next/static/chunks/5b47077149fdf0f0.js +28 -0
  140. package/ui/_next/static/chunks/5c3a6dbb69f43605.js +1 -0
  141. package/ui/_next/static/chunks/5eb9c4aa10acda02.js +1 -0
  142. package/ui/_next/static/chunks/5f66e37358860250.js +1 -0
  143. package/ui/_next/static/chunks/5f7eea23dbb63b72.js +1 -0
  144. package/ui/_next/static/chunks/5f93c191a70a3ac3.js +1 -0
  145. package/ui/_next/static/chunks/5fb4b9e09c80af10.js +1 -0
  146. package/ui/_next/static/chunks/5fd3ffc95afd56b0.js +1 -0
  147. package/ui/_next/static/chunks/5fd6615f9d7e1e80.js +1 -0
  148. package/ui/_next/static/chunks/600b79a4004c7916.js +1 -0
  149. package/ui/_next/static/chunks/60a7095ed0351254.js +1 -0
  150. package/ui/_next/static/chunks/60bca29dc60b36bc.js +1 -0
  151. package/ui/_next/static/chunks/61a0f06a5cabbdeb.js +1 -0
  152. package/ui/_next/static/chunks/6261fcfcd915c647.js +1 -0
  153. package/ui/_next/static/chunks/627489377b5d43c7.js +1 -0
  154. package/ui/_next/static/chunks/636b185341fcac1f.js +1 -0
  155. package/ui/_next/static/chunks/63884b27f9c2f212.js +1 -0
  156. package/ui/_next/static/chunks/644b44f1b1aa0177.js +1 -0
  157. package/ui/_next/static/chunks/64e33d11e71fbc04.js +1 -0
  158. package/ui/_next/static/chunks/658f73c8894ab262.js +1 -0
  159. package/ui/_next/static/chunks/659a14fe7e02911f.js +1 -0
  160. package/ui/_next/static/chunks/664293c55314123e.js +1 -0
  161. package/ui/_next/static/chunks/6700f8b9b8eb4aa9.js +1 -0
  162. package/ui/_next/static/chunks/6796fdb6b0ee5cde.js +1 -0
  163. package/ui/_next/static/chunks/69111fd77d12dc29.js +1 -0
  164. package/ui/_next/static/chunks/69133f39c0a744c4.js +1 -0
  165. package/ui/_next/static/chunks/6a378843d2f08ae9.js +52 -0
  166. package/ui/_next/static/chunks/6aa3e7a7c18b3205.js +1 -0
  167. package/ui/_next/static/chunks/6b49117630eaf620.js +1 -0
  168. package/ui/_next/static/chunks/6be152c783b850b2.js +1 -0
  169. package/ui/_next/static/chunks/6c022bf00a2aaf9d.js +1 -0
  170. package/ui/_next/static/chunks/6d4c33f5c4fa695c.js +1 -0
  171. package/ui/_next/static/chunks/6d8b530af6fa35f4.js +1 -0
  172. package/ui/_next/static/chunks/6e4223173e93cc18.js +1 -0
  173. package/ui/_next/static/chunks/6efeee0cc097ff42.js +1 -0
  174. package/ui/_next/static/chunks/6fb1ab4f7969299e.js +1 -0
  175. package/ui/_next/static/chunks/6fd64e20c07002b9.js +1 -0
  176. package/ui/_next/static/chunks/70a92d4c93b26309.js +1 -0
  177. package/ui/_next/static/chunks/71c49979aaf08454.js +1 -0
  178. package/ui/_next/static/chunks/74dbb7c8b8988790.js +1 -0
  179. package/ui/_next/static/chunks/74e5a8b58985312a.js +1 -0
  180. package/ui/_next/static/chunks/7567f6d1c2f51784.js +1 -0
  181. package/ui/_next/static/chunks/78668101d693812c.js +5 -0
  182. package/ui/_next/static/chunks/7aaaaedce5581ce5.js +1 -0
  183. package/ui/_next/static/chunks/7ab5fb8d1faeac67.js +1 -0
  184. package/ui/_next/static/chunks/7ac8beff32237502.js +1 -0
  185. package/ui/_next/static/chunks/7b9a038cc82ea2f1.js +1 -0
  186. package/ui/_next/static/chunks/7bc115b44bb2585a.js +1 -0
  187. package/ui/_next/static/chunks/7e6a73f6941ae3df.js +1 -0
  188. package/ui/_next/static/chunks/7e6e757cccc28a1d.js +1 -0
  189. package/ui/_next/static/chunks/7f6140c23bec3968.js +1 -0
  190. package/ui/_next/static/chunks/7fcf7d492c1456b1.js +1 -0
  191. package/ui/_next/static/chunks/80ccbbbf0b38d720.js +1 -0
  192. package/ui/_next/static/chunks/80e1e51fbf71f98a.js +1 -0
  193. package/ui/_next/static/chunks/812b4c885f386d1d.js +1 -0
  194. package/ui/_next/static/chunks/842d9b57178f4c40.js +1 -0
  195. package/ui/_next/static/chunks/842e7bb55d50e315.js +1 -0
  196. package/ui/_next/static/chunks/84d8fa72ac972aad.js +1 -0
  197. package/ui/_next/static/chunks/85bb5c9b153f8a4a.js +1 -0
  198. package/ui/_next/static/chunks/864b7813f1bc90ff.js +1 -0
  199. package/ui/_next/static/chunks/8906427acb90fedf.js +1 -0
  200. package/ui/_next/static/chunks/8988fd09cdad3b68.js +1 -0
  201. package/ui/_next/static/chunks/89c8110cc986d11b.js +1 -0
  202. package/ui/_next/static/chunks/8a95ad995bc58eea.js +1 -0
  203. package/ui/_next/static/chunks/8b89ac9e985653cd.js +1 -0
  204. package/ui/_next/static/chunks/8bab5b6665047c5d.js +1 -0
  205. package/ui/_next/static/chunks/8c94b742fe5df7d0.js +1 -0
  206. package/ui/_next/static/chunks/8e3c324a76f7d829.js +1 -0
  207. package/ui/_next/static/chunks/8e3fa11bf9967429.js +1 -0
  208. package/ui/_next/static/chunks/8e78cb9d801e2430.js +1 -0
  209. package/ui/_next/static/chunks/8f050677e6726e70.js +1 -0
  210. package/ui/_next/static/chunks/8f50ffbb125c68fb.js +1 -0
  211. package/ui/_next/static/chunks/8f9f15024ca0e41a.js +1 -0
  212. package/ui/_next/static/chunks/9059f9b1a668df1a.js +1 -0
  213. package/ui/_next/static/chunks/90d216ff22174166.js +1 -0
  214. package/ui/_next/static/chunks/92a7da6627399650.js +1 -0
  215. package/ui/_next/static/chunks/937edf4cb082abc5.js +1 -0
  216. package/ui/_next/static/chunks/93ef1dbdb3ba16c5.js +1 -0
  217. package/ui/_next/static/chunks/958beead188ae41a.js +1 -0
  218. package/ui/_next/static/chunks/96d83f4a55023dd8.js +1 -0
  219. package/ui/_next/static/chunks/96e280e710d2ee61.js +1 -0
  220. package/ui/_next/static/chunks/972e519334889d19.js +1 -0
  221. package/ui/_next/static/chunks/977fc5707cf8d368.js +1 -0
  222. package/ui/_next/static/chunks/978c26324993b6a7.js +1 -0
  223. package/ui/_next/static/chunks/994f69625a2ae919.js +1 -0
  224. package/ui/_next/static/chunks/99ae20c2d3af56d5.js +1 -0
  225. package/ui/_next/static/chunks/9a683bf7e8671c0f.js +55 -0
  226. package/ui/_next/static/chunks/9ab89afc5d66ce4f.js +1 -0
  227. package/ui/_next/static/chunks/9b5686f0fa9c602c.js +1 -0
  228. package/ui/_next/static/chunks/9b920e84122a52d3.js +1 -0
  229. package/ui/_next/static/chunks/9bf8a609afce25d4.js +1 -0
  230. package/ui/_next/static/chunks/9c08a1e18feca912.js +1 -0
  231. package/ui/_next/static/chunks/9c33d7d923fbf424.js +1 -0
  232. package/ui/_next/static/chunks/9d96323282f933e8.js +1 -0
  233. package/ui/_next/static/chunks/9de6e52c39b92876.js +1 -0
  234. package/ui/_next/static/chunks/9e5872f848c935be.js +1 -0
  235. package/ui/_next/static/chunks/9e6b3800f39494e8.js +1 -0
  236. package/ui/_next/static/chunks/9f89db821f05dcc9.js +1 -0
  237. package/ui/_next/static/chunks/a1374e26772447a8.js +1 -0
  238. package/ui/_next/static/chunks/a1bceb1e216a59a1.js +1 -0
  239. package/ui/_next/static/chunks/a286d941cc51f0c1.js +1 -0
  240. package/ui/_next/static/chunks/a3c34be3a08a6ea0.js +1 -0
  241. package/ui/_next/static/chunks/a4304fd1e11a20e8.js +1 -0
  242. package/ui/_next/static/chunks/a434a15aa83fc90a.js +1 -0
  243. package/ui/_next/static/chunks/a46a4a9b500dddae.js +1 -0
  244. package/ui/_next/static/chunks/a47391bd158b64c2.js +2 -0
  245. package/ui/_next/static/chunks/a6dad97d9634a72d.js +1 -0
  246. package/ui/_next/static/chunks/a6dad97d9634a72d.js.map +1 -0
  247. package/ui/_next/static/chunks/a846efb087d55e8e.js +1 -0
  248. package/ui/_next/static/chunks/a87a442453c18035.js +1 -0
  249. package/ui/_next/static/chunks/a9d8d211d49a9193.js +1 -0
  250. package/ui/_next/static/chunks/aa0411443b81e87d.js +11 -0
  251. package/ui/_next/static/chunks/aa25d126ca6a36a6.js +1 -0
  252. package/ui/_next/static/chunks/aadb9238cd7b82ad.js +1 -0
  253. package/ui/_next/static/chunks/ab90fe64ec53bcb7.js +1 -0
  254. package/ui/_next/static/chunks/ac0cd38d2c0ac86d.js +6 -0
  255. package/ui/_next/static/chunks/ac1156c657b16c77.js +1 -0
  256. package/ui/_next/static/chunks/ae39eaa0c5c6d23b.js +1 -0
  257. package/ui/_next/static/chunks/aea1190ed2fbe53f.js +1 -0
  258. package/ui/_next/static/chunks/afa6d60b8938a592.js +1 -0
  259. package/ui/_next/static/chunks/b0916906974527d3.js +1 -0
  260. package/ui/_next/static/chunks/b24be7a7b5e50303.js +1 -0
  261. package/ui/_next/static/chunks/b32be1a883f8d3f3.js +1 -0
  262. package/ui/_next/static/chunks/b37b52aef95c0be7.js +1 -0
  263. package/ui/_next/static/chunks/b38e4152f15a6123.js +1 -0
  264. package/ui/_next/static/chunks/b47ed73d5184750b.js +1 -0
  265. package/ui/_next/static/chunks/b4999365adaa7d16.js +1 -0
  266. package/ui/_next/static/chunks/b5e0a1cf3a2a0407.js +1 -0
  267. package/ui/_next/static/chunks/b5e35d43ddd54bae.js +1 -0
  268. package/ui/_next/static/chunks/b68086cd9d545bdd.js +1 -0
  269. package/ui/_next/static/chunks/b7a570325051fe57.js +4 -0
  270. package/ui/_next/static/chunks/b81f5d043fd987b0.js +1 -0
  271. package/ui/_next/static/chunks/b95efd1fbec110c4.js +1 -0
  272. package/ui/_next/static/chunks/ba79cf54cc9ad312.js +1 -0
  273. package/ui/_next/static/chunks/bb1eb5d7598c3f39.js +1 -0
  274. package/ui/_next/static/chunks/bb2a4badbc22bfda.js +1 -0
  275. package/ui/_next/static/chunks/bb7093391d9f2063.js +1 -0
  276. package/ui/_next/static/chunks/bc52a007e9e95889.js +1 -0
  277. package/ui/_next/static/chunks/bc7b17e9cc2cbab2.js +1 -0
  278. package/ui/_next/static/chunks/bc9d134c09979a26.js +1 -0
  279. package/ui/_next/static/chunks/bc9ff7b7a45bda23.js +1 -0
  280. package/ui/_next/static/chunks/bd0c8f0af53ddae4.js +1 -0
  281. package/ui/_next/static/chunks/bee3eada9af5ad3a.js +1 -0
  282. package/ui/_next/static/chunks/bef0507fdb487e7f.js +1 -0
  283. package/ui/_next/static/chunks/bf63d9c350c5d7bc.js +1 -0
  284. package/ui/_next/static/chunks/bfcac0f49616b082.js +1 -0
  285. package/ui/_next/static/chunks/c1e26552ab96ae37.js +1 -0
  286. package/ui/_next/static/chunks/c218da349b75062b.js +1 -0
  287. package/ui/_next/static/chunks/c2a9928cbaf4e424.js +1 -0
  288. package/ui/_next/static/chunks/c3241a7df399365d.js +1 -0
  289. package/ui/_next/static/chunks/c3412528c1e42b94.js +1 -0
  290. package/ui/_next/static/chunks/c57ef4711ea5a725.js +1 -0
  291. package/ui/_next/static/chunks/c7c905fbd5be3f71.js +1 -0
  292. package/ui/_next/static/chunks/c7ea2b96c92d0575.js +1 -0
  293. package/ui/_next/static/chunks/c8bf078f972f8e5b.js +1 -0
  294. package/ui/_next/static/chunks/c8f34f1f751f99c7.js +8 -0
  295. package/ui/_next/static/chunks/c9494e781c410ef9.js +1 -0
  296. package/ui/_next/static/chunks/cb08795453879abf.js +1 -0
  297. package/ui/_next/static/chunks/cb4226d4c48cecbb.js +1 -0
  298. package/ui/_next/static/chunks/cbe7f5e1aa0d9e04.js +1 -0
  299. package/ui/_next/static/chunks/cc264156cb36780d.js +1 -0
  300. package/ui/_next/static/chunks/ccc1466778a8c17a.js +1 -0
  301. package/ui/_next/static/chunks/cd0d15eba3e39813.js +1 -0
  302. package/ui/_next/static/chunks/cd0d8e1d5886ed24.js +1 -0
  303. package/ui/_next/static/chunks/cd4a82b41d794e72.js +1 -0
  304. package/ui/_next/static/chunks/ce3bfb5db50a5b3f.js +1 -0
  305. package/ui/_next/static/chunks/ceccb1f813025764.js +1 -0
  306. package/ui/_next/static/chunks/cf83de22eedfe3d9.js +1 -0
  307. package/ui/_next/static/chunks/d02405678a129049.js +1 -0
  308. package/ui/_next/static/chunks/d05333f3e283ec1d.js +1 -0
  309. package/ui/_next/static/chunks/d244a8da2623a98c.js +1 -0
  310. package/ui/_next/static/chunks/d27f0242718f163a.js +1 -0
  311. package/ui/_next/static/chunks/d53634a2b24c90a9.js +1 -0
  312. package/ui/_next/static/chunks/d5f0fa5d027d28a5.js +1 -0
  313. package/ui/_next/static/chunks/d619795403d40efb.js +1 -0
  314. package/ui/_next/static/chunks/d931c788bbb968d3.js +1 -0
  315. package/ui/_next/static/chunks/db5f020f4bc59b45.js +1 -0
  316. package/ui/_next/static/chunks/dbabc85fe448fa78.js +1 -0
  317. package/ui/_next/static/chunks/dbe21c0eff70cb05.js +1 -0
  318. package/ui/_next/static/chunks/dbe344b2b2af84e9.js +1 -0
  319. package/ui/_next/static/chunks/dcfcb52cd1a04515.js +1 -0
  320. package/ui/_next/static/chunks/dd3bcf6eef567312.js +1 -0
  321. package/ui/_next/static/chunks/dd4f504700408db2.js +1 -0
  322. package/ui/_next/static/chunks/dd51c76759bcf21c.js +1 -0
  323. package/ui/_next/static/chunks/ddc6316e063251d2.js +1 -0
  324. package/ui/_next/static/chunks/de2ec99a24b2bbec.js +1 -0
  325. package/ui/_next/static/chunks/de3ecf2e547b25bd.js +1 -0
  326. package/ui/_next/static/chunks/df0f689ac0ff4ae7.js +1 -0
  327. package/ui/_next/static/chunks/df951cf632256217.js +1 -0
  328. package/ui/_next/static/chunks/dfdc1b3d1eaffe6f.js +1 -0
  329. package/ui/_next/static/chunks/e14d70725c9442ba.js +1 -0
  330. package/ui/_next/static/chunks/e15624af5ac09cc9.js +1 -0
  331. package/ui/_next/static/chunks/e1571aa82097b49e.js +1 -0
  332. package/ui/_next/static/chunks/e243ccb397f82577.js +1 -0
  333. package/ui/_next/static/chunks/e348c123ac69ee40.js +1 -0
  334. package/ui/_next/static/chunks/e3f40438bac2a3df.js +1 -0
  335. package/ui/_next/static/chunks/e495340a7d63bf1b.js +1 -0
  336. package/ui/_next/static/chunks/e76838a76f6e123e.js +1 -0
  337. package/ui/_next/static/chunks/e7ff40ad98ae4eab.js +1 -0
  338. package/ui/_next/static/chunks/e878a3169ff1daa1.js +1 -0
  339. package/ui/_next/static/chunks/e95963060b58f8aa.js +1 -0
  340. package/ui/_next/static/chunks/e9b0d9a459d8927b.js +1 -0
  341. package/ui/_next/static/chunks/ebb4d866fd04f914.js +1 -0
  342. package/ui/_next/static/chunks/eda323f57ca34435.js +1 -0
  343. package/ui/_next/static/chunks/ee61edf626af7942.js +1 -0
  344. package/ui/_next/static/chunks/ee97350781f2fc87.js +1 -0
  345. package/ui/_next/static/chunks/ef13748dbbd16d4d.js +1 -0
  346. package/ui/_next/static/chunks/ef5e6579b0839559.js +1 -0
  347. package/ui/_next/static/chunks/efee30c9d74657f7.js +1 -0
  348. package/ui/_next/static/chunks/f0af28c3dcd107c8.js +1 -0
  349. package/ui/_next/static/chunks/f0e50da92cebf316.js +1 -0
  350. package/ui/_next/static/chunks/f0f20f9d32c40d2c.js +1 -0
  351. package/ui/_next/static/chunks/f2665a439f5727c0.js +1 -0
  352. package/ui/_next/static/chunks/f34d394aaaca65b5.js +1 -0
  353. package/ui/_next/static/chunks/f39c35ea2c2cf70e.js +1 -0
  354. package/ui/_next/static/chunks/f53d1a7f717ab2cc.js +1 -0
  355. package/ui/_next/static/chunks/f5f6ca2e55bf1deb.js +1 -0
  356. package/ui/_next/static/chunks/f697aeac429d965e.js +1 -0
  357. package/ui/_next/static/chunks/f7c3d384fa633961.js +1 -0
  358. package/ui/_next/static/chunks/f7e07f737e662117.js +1 -0
  359. package/ui/_next/static/chunks/f8bed547f395d937.js +1 -0
  360. package/ui/_next/static/chunks/f90dc289de184b62.js +1 -0
  361. package/ui/_next/static/chunks/f9696fa741dae47d.js +1 -0
  362. package/ui/_next/static/chunks/fba73129cc4346c6.js +1 -0
  363. package/ui/_next/static/chunks/fbce118b867ca3c7.js +1 -0
  364. package/ui/_next/static/chunks/fbfabd3b1df5e918.js +1 -0
  365. package/ui/_next/static/chunks/fc97c7e8137cc9ad.js +1 -0
  366. package/ui/_next/static/chunks/fca228158fc5a5db.js +1 -0
  367. package/ui/_next/static/chunks/fd621a9ee7d135d3.js +1 -0
  368. package/ui/_next/static/chunks/fe9bedfe94a30e5b.js +1 -0
  369. package/ui/_next/static/chunks/fea28c16099ba6f0.js +1 -0
  370. package/ui/_next/static/chunks/ff93ad75aa7eb00b.js +1 -0
  371. package/ui/_next/static/chunks/ffddce4d8b1ba80a.js +1 -0
  372. package/ui/_next/static/chunks/turbopack-80f4a89b2306fae3.js +4 -0
  373. package/ui/_next/static/media/favicon.0b3bf435.ico +0 -0
  374. package/ui/_not-found/__next._full.txt +19 -0
  375. package/ui/_not-found/__next._head.txt +6 -0
  376. package/ui/_not-found/__next._index.txt +7 -0
  377. package/ui/_not-found/__next._not-found.__PAGE__.txt +9 -0
  378. package/ui/_not-found/__next._not-found.txt +4 -0
  379. package/ui/_not-found/__next._tree.txt +2 -0
  380. package/ui/_not-found.html +1 -0
  381. package/ui/_not-found.txt +19 -0
  382. package/ui/favicon.ico +0 -0
  383. package/ui/index.html +1 -0
  384. package/ui/index.txt +21 -0
  385. package/ui/project/__next._full.txt +21 -0
  386. package/ui/project/__next._head.txt +6 -0
  387. package/ui/project/__next._index.txt +7 -0
  388. package/ui/project/__next._tree.txt +3 -0
  389. package/ui/project/__next.project.__PAGE__.txt +10 -0
  390. package/ui/project/__next.project.txt +4 -0
  391. package/ui/project/code/__next._full.txt +21 -0
  392. package/ui/project/code/__next._head.txt +6 -0
  393. package/ui/project/code/__next._index.txt +7 -0
  394. package/ui/project/code/__next._tree.txt +3 -0
  395. package/ui/project/code/__next.project.code.__PAGE__.txt +10 -0
  396. package/ui/project/code/__next.project.code.txt +4 -0
  397. package/ui/project/code/__next.project.txt +4 -0
  398. package/ui/project/code.html +1 -0
  399. package/ui/project/code.txt +21 -0
  400. package/ui/project.html +1 -0
  401. package/ui/project.txt +21 -0
@@ -0,0 +1,65 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,587164,e=>{"use strict";function t(e,s=0){return s>4||null==e?"":"string"==typeof e?e.trim():Array.isArray(e)?e.map(e=>t(e,s+1)).filter(e=>e.length>0).join("\n\n"):"object"==typeof e?t(e.text??e.thinking,s+1)||t(e.summary,s+1)||t(e.content,s+1):""}function s(e){return t(e.thinking)||t(e.text)||function(e){if("string"!=typeof e||0===e.length)return"";try{let s=JSON.parse(e);if(null==s||"object"!=typeof s)return"";return t(s.summary)||t(s.content)}catch{return""}}(e.thinkingSignature)}function n(e){return e.map(e=>{if(null==e||"object"!=typeof e||!Array.isArray(e.content))return e;let t=!1,n=e.content.map(e=>{if(null==e||"object"!=typeof e||"thinking"!==e.type)return e;let n=s(e);return 0===n.length||e.thinking===n?e:(t=!0,{...e,thinking:n})});return t?{...e,content:n}:e})}function i(e){if(null==e||"object"!=typeof e)return null;let s=e.output_index;if("number"!=typeof s)return null;if("response.content_part.added"===e.type||"response.content_part.done"===e.type){let n=e.part;if(null!=n&&"object"==typeof n&&"reasoning_text"===n.type){let e=t(n.text);if(e.length>0)return{outputIndex:s,text:e}}}if("response.reasoning_text.done"===e.type||"response.reasoning_summary_text.done"===e.type){let n=t(e.text);if(n.length>0)return{outputIndex:s,text:n}}if(("response.output_item.added"===e.type||"response.output_item.done"===e.type)&&null!=e.item&&"object"==typeof e.item){let n=e.item;if("reasoning"===n.type){let e=t(n.summary)||t(n.content);if(e.length>0)return{outputIndex:s,text:e}}}return null}function r(e,t){return{type:"response.reasoning_text.delta",output_index:e,delta:t}}e.s(["disclosedThinking",()=>s,"hydrateConversationThinking",()=>n,"reasoningTextDeltaEvent",()=>r,"reasoningTextFromEvent",()=>i])},705267,e=>{"use strict";var t=e.i(587164);async function s(e,s){var n;let i,r,a,o,l=await fetch(e,s);return null!=l.body&&(l.headers.get("content-type")??"").includes("text/event-stream")?new Response((n=l.body,i=new TextDecoder,r=new TextEncoder,a=new Map,o="",n.pipeThrough(new TransformStream({transform(e,s){let{blocks:n,rest:l}=function(e){let t=[],s=e;for(;;){let e=s.search(/\r?\n\r?\n/);if(e<0)break;let n=s.slice(e).match(/^\r?\n\r?\n/),i=n?.[0].length??2,r=s.slice(0,e);s=s.slice(e+i),r.trim().length>0&&t.push(r)}return{blocks:t,rest:s}}(o+=i.decode(e,{stream:!0}));for(let e of(o=l,n)){var c;s.enqueue(r.encode(`${e}
2
+
3
+ `));let n=function(e){let t=e.split(/\r?\n/).filter(e=>e.startsWith("data:")).map(e=>e.slice(5).replace(/^\s/,"")).join("\n");if(0===t.length||"[DONE]"===t)return null;try{return JSON.parse(t)}catch{return null}}(e),i=null==n||"object"!=typeof n||"response.reasoning_text.delta"!==n.type||"number"!=typeof n.output_index||"string"!=typeof n.delta?null:{outputIndex:n.output_index,delta:n.delta};if(null!=i){a.set(i.outputIndex,(a.get(i.outputIndex)??"")+i.delta);continue}let o=(0,t.reasoningTextFromEvent)(n);if(null==o)continue;let l=a.get(o.outputIndex)??"",u="";0===l.length?u=o.text:o.text.startsWith(l)&&o.text.length>l.length&&(u=o.text.slice(l.length)),0!==u.length&&(a.set(o.outputIndex,o.text),s.enqueue(r.encode((c=(0,t.reasoningTextDeltaEvent)(o.outputIndex,u),`data: ${JSON.stringify(c)}
4
+
5
+ `))))}},flush(e){o.trim().length>0&&e.enqueue(r.encode(o))}}))),{status:l.status,statusText:l.statusText,headers:l.headers}):l}e.s(["fetchWithReasoningTextBridge",()=>s])},323329,633955,e=>{"use strict";let t="https://openrouter.ai/api/v1",s="nvidia/nemotron-3-ultra-550b-a55b:free";function n(e,t){return{id:e,name:e,api:"openai-responses",provider:new URL(t).hostname,baseUrl:t,reasoning:!0,thinkingLevelMap:{off:null,minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},input:["text","image"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:1048576,maxTokens:131072}}e.s(["DEFAULT_AI_BASE_URL",0,t,"DEFAULT_AI_MODEL_ID",0,s,"gatewayModel",()=>n],633955);let i={baseUrl:t,apiKey:"",model:s,reviewerModel:null};function r(e){try{let t=new URL(e);return"https:"===t.protocol||"http:"===t.protocol}catch{return!1}}function a(e){let t=e=>"string"==typeof e&&e.trim().length>0?e.trim():null,s=t(e.baseUrl),n=null==s||r(s)?null:s;return{settings:{baseUrl:(null==n?s:null)??i.baseUrl,apiKey:t(e.apiKey)??"",model:t(e.model)??i.model,reviewerModel:t(e.reviewerModel)},invalidBaseUrl:n}}let o={read:()=>i,subscribe:()=>()=>{},missingApiKeyMessage:"No API key is configured for the AI endpoint.",missingReviewerModelMessage:"No reviewer model is configured, so auto review is unavailable."};function l(e){o=e}function c(){return o}function u(e=o.read()){return n(e.model,e.baseUrl)}function h(e=o.read()){return null==e.reviewerModel?null:n(e.reviewerModel,e.baseUrl)}e.s(["DEFAULT_AI_SETTINGS",0,i,"aiSettings",()=>c,"configureAiSettings",()=>l,"isHttpUrl",()=>r,"readAiSettings",()=>a,"reviewerModel",()=>h,"writerModel",()=>u],323329)},373662,e=>{"use strict";var t=e.i(336343),s=e.i(705267),n=e.i(323329);function i(e){if(null!=e&&"object"==typeof e&&null!=e.reasoning&&"object"==typeof e.reasoning)return{...e,reasoning:{...e.reasoning,summary:"detailed"}}}let r=null;function a(e){r=(t,r,a)=>e(t,r,{...a,apiKey:(0,n.aiSettings)().read().apiKey,fetch:s.fetchWithReasoningTextBridge,onPayload:i})}function o(){if(null==r)throw Error("The AI runtime is not installed, so no model can be called.");let e=(0,n.aiSettings)();if(0===e.read().apiKey.length)throw new t.UserFacingError(e.missingApiKeyMessage);return r}e.s(["gatewayStream",()=>o,"installGateway",()=>a])},159878,(e,t,s)=>{function n(e){return Array.isArray(e)?e:[e]}let i,r=/^\s+$/,a=/(?:[^\\]|^)\\$/,o=/^\\!/,l=/^\\#/,c=/\r?\n/g,u=/^\.{0,2}\/|^\.{1,2}$/,h=/\/$/,f="node-ignore";"u">typeof Symbol&&(f=Symbol.for("node-ignore"));let d=f,p=(e,t,s)=>(Object.defineProperty(e,t,{value:s}),s),m=/([0-z])-([0-z])/g,g=()=>!1,y=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,s)=>t+(0===s.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{let{length:s}=t;return t.slice(0,s-s%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,s)=>t+6<s.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,s)=>t+s.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,s,n,i)=>"\\"===t?`\\[${s}${(e=>{let{length:t}=e;return e.slice(0,t-t%2)})(n)}${i}`:"]"===i&&n.length%2==0?`[${s.replace(m,(e,t,s)=>t.charCodeAt(0)<=s.charCodeAt(0)?e:"")}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],b=/(^|\\\/)?\\\*$/,w="regex",k="checkRegex",v={[w](e,t){let s=t?`${t}[^/]+`:"[^/]*";return`${s}(?=$|\\/$)`},[k](e,t){let s=t?`${t}[^/]*`:"[^/]*";return`${s}(?=$|\\/$)`}};class S{constructor(e,t,s,n,i,r){this.pattern=e,this.mark=t,this.negative=i,p(this,"body",s),p(this,"ignoreCase",n),p(this,"regexPrefix",r)}get regex(){let e="_"+w;return this[e]?this[e]:this._make(w,e)}get checkRegex(){let e="_"+k;return this[e]?this[e]:this._make(k,e)}_make(e,t){let s=this.regexPrefix.replace(b,v[e]);return p(this,t,this.ignoreCase?RegExp(s,"i"):new RegExp(s))}}class E{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){let t;if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if("string"==typeof e&&(e={pattern:e}),(t=e.pattern)&&"string"==typeof t&&!r.test(t)&&!a.test(t)&&0!==t.indexOf("#")){let t=(({pattern:e,mark:t},s)=>{let n,i=!1,r=e;0===r.indexOf("!")&&(i=!0,r=r.substr(1));let a=(n=r=r.replace(o,"!").replace(l,"#"),y.reduce((e,[t,s])=>e.replace(t,s.bind(n)),n));return new S(e,t,r,s,i,a)})(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n("string"==typeof e?e.split(c).filter(Boolean):e).forEach(this._add,this),this._added}test(e,t,s){let n,r=!1,a=!1;this._rules.forEach(o=>{let{negative:l}=o;(a!==l||r===a)&&(!l||r||a||t)&&o[s].test(e)&&(r=!l,a=l,n=l?i:o)});let o={ignored:r,unignored:a};return n&&(o.rule=n),o}}let T=(e,t)=>{throw new t(e)},x=(e,t,s)=>"string"!=typeof e?s(`path must be a string, but got \`${t}\``,TypeError):e?!x.isNotRelative(e)||s(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):s("path must not be empty",TypeError),_=e=>u.test(e);x.isNotRelative=_,x.convert=e=>e;class N{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:s=!1}={}){p(this,d,!0),this._rules=new E(t),this._strictPathCheck=!s,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,s,n){let i=e&&x.convert(e);return x(i,e,this._strictPathCheck?T:g),this._t(i,t,s,n)}checkIgnore(e){if(!h.test(e))return this.test(e);let t=e.split("/").filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join("/")+"/",this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,k)}_t(e,t,s,n){if(e in t)return t[e];if(n||(n=e.split("/").filter(Boolean)),n.pop(),!n.length)return t[e]=this._rules.test(e,s,w);let i=this._t(n.join("/")+"/",t,s,n);return t[e]=i.ignored?i:this._rules.test(e,s,w)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}let O=e=>new N(e);t.exports=O,O.default=O,t.exports.isPathValid=e=>x(e&&x.convert(e),e,g),p(t.exports,Symbol.for("setupWindows"),()=>{x.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");let e=/^[a-z]:\//i;x.isNotRelative=t=>e.test(t)||_(t)})},12340,687339,e=>{"use strict";let t,s,n={startSpan:function(e,t){try{return Promise.resolve(t(n))}catch(e){return Promise.reject(e)}},addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(n);var i=e.i(658539);function r(){if(!t)throw Error("No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn().");return t}async function a(e,t,s,n,i,a){let o=[...e],c={...t,messages:[...t.messages,...e]};for(let t of(await n({type:"agent_start"}),await n({type:"turn_start"}),e))await n({type:"message_start",message:t}),await n({type:"message_end",message:t});return await l(c,o,s,i,n,a??r()),o}async function o(e,t,s,n,i){if(0===e.messages.length)throw Error("Cannot continue: no messages in context");if("assistant"===e.messages[e.messages.length-1].role)throw Error("Cannot continue from message role: assistant");let a=[],o={...e};return await s({type:"agent_start"}),await s({type:"turn_start"}),await l(o,a,t,n,s,i??r()),a}async function l(e,t,s,n,i,r){let a=e,o=s,l=!0,f=await o.getSteeringMessages?.()||[];for(;;){let e=!0;for(;e||f.length>0;){if(l?l=!1:await i({type:"turn_start"}),f.length>0){for(let e of f)await i({type:"message_start",message:e}),await i({type:"message_end",message:e}),a.messages.push(e),t.push(e);f=[]}let s=await c(a,o,n,i,r);if(t.push(s),"error"===s.stopReason||"aborted"===s.stopReason){await i({type:"turn_end",message:s,toolResults:[]}),await i({type:"agent_end",messages:t});return}let d=s.content.filter(e=>"toolCall"===e.type),p=[];if(e=!1,d.length>0){let r="length"===s.stopReason?await u(d,i):await h(a,s,o,n,i);for(let s of(p.push(...r.messages),e=!r.terminate,p))a.messages.push(s),t.push(s)}await i({type:"turn_end",message:s,toolResults:p});let m={message:s,toolResults:p,context:a,newMessages:t},g=await o.prepareNextTurn?.(m);if(g&&(a=g.context??a,o={...o,model:g.model??o.model,reasoning:void 0===g.thinkingLevel?o.reasoning:"off"===g.thinkingLevel?void 0:g.thinkingLevel}),await o.shouldStopAfterTurn?.({message:s,toolResults:p,context:a,newMessages:t}))return void await i({type:"agent_end",messages:t});f=await o.getSteeringMessages?.()||[]}let s=await o.getFollowUpMessages?.()||[];if(s.length>0){f=s;continue}break}await i({type:"agent_end",messages:t})}async function c(e,t,s,n,i){let r=e.messages;t.transformContext&&(r=await t.transformContext(r,s));let a=await t.convertToLlm(r),o={systemPrompt:e.systemPrompt,messages:a,tools:e.tools},l=(t.getApiKey?await t.getApiKey(t.model.provider):void 0)||t.apiKey,c=await i(t.model,o,{...t,apiKey:l,signal:s}),u=null,h=!1;for await(let t of c)switch(t.type){case"start":u=t.partial,e.messages.push(u),h=!0,await n({type:"message_start",message:{...u}});break;case"text_start":case"text_delta":case"text_end":case"thinking_start":case"thinking_delta":case"thinking_end":case"toolcall_start":case"toolcall_delta":case"toolcall_end":u&&(u=t.partial,e.messages[e.messages.length-1]=u,await n({type:"message_update",assistantMessageEvent:t,message:{...u}}));break;case"done":case"error":{let t=await c.result();return h?e.messages[e.messages.length-1]=t:e.messages.push(t),h||await n({type:"message_start",message:{...t}}),await n({type:"message_end",message:t}),t}}let f=await c.result();return h?e.messages[e.messages.length-1]=f:(e.messages.push(f),await n({type:"message_start",message:{...f}})),await n({type:"message_end",message:f}),f}async function u(e,t){let s=[];for(let n of e){await t({type:"tool_execution_start",toolCallId:n.id,toolName:n.name,args:n.arguments});let e={toolCall:n,result:b(`Tool call "${n.name}" was not executed: the response hit the output token limit, so its arguments may be truncated. Re-issue the tool call with complete arguments.`),isError:!0};await w(e,t);let i=k(e);await v(i,t),s.push(i)}return{messages:s,terminate:!1}}async function h(e,t,s,n,i){let r=t.content.filter(e=>"toolCall"===e.type),a=r.some(t=>e.tools?.find(e=>e.name===t.name)?.executionMode==="sequential");return"sequential"===s.toolExecution||a?f(e,t,r,s,n,i):d(e,t,r,s,n,i)}async function f(e,t,s,n,i,r){let a=[],o=[];for(let l of s){let s;await r({type:"tool_execution_start",toolCallId:l.id,toolName:l.name,args:l.arguments});let c=await m(e,t,l,n,i);if("immediate"===c.kind)s={toolCall:l,result:c.result,isError:c.isError};else{let a=await g(c,i,r);s=await y(e,t,c,a,n,i)}await w(s,r);let u=k(s);if(await v(u,r),a.push(s),o.push(u),i?.aborted)break}return{messages:o,terminate:p(a)}}async function d(e,t,s,n,i,r){let a=[];for(let o of s){await r({type:"tool_execution_start",toolCallId:o.id,toolName:o.name,args:o.arguments});let s=await m(e,t,o,n,i);if("immediate"===s.kind){let e={toolCall:o,result:s.result,isError:s.isError};if(await w(e,r),a.push(e),i?.aborted)break;continue}if(a.push(async()=>{let a=await g(s,i,r),o=await y(e,t,s,a,n,i);return await w(o,r),o}),i?.aborted)break}let o=await Promise.all(a.map(e=>"function"==typeof e?e():Promise.resolve(e))),l=[];for(let e of o){let t=k(e);await v(t,r),l.push(t)}return{messages:l,terminate:p(o)}}function p(e){return e.length>0&&e.every(e=>!0===e.result.terminate)}async function m(e,t,s,n,r){let a=e.tools?.find(e=>e.name===s.name);if(!a)return{kind:"immediate",result:b(`Tool ${s.name} not found`),isError:!0};try{let o=function(e,t){if(!e.prepareArguments)return t;let s=e.prepareArguments(t.arguments);return s===t.arguments?t:{...t,arguments:s}}(a,s),l=(0,i.validateToolArguments)(a,o);if(n.beforeToolCall){let i=await n.beforeToolCall({assistantMessage:t,toolCall:s,args:l,context:e},r);if(r?.aborted)return{kind:"immediate",result:b("Operation aborted"),isError:!0};if(i?.block){let e=b(i.reason||"Tool execution was blocked");return!0===i.terminate&&(e.terminate=!0),{kind:"immediate",result:e,isError:!0}}}if(r?.aborted)return{kind:"immediate",result:b("Operation aborted"),isError:!0};return{kind:"prepared",toolCall:s,tool:a,args:l}}catch(e){return{kind:"immediate",result:b(e instanceof Error?e.message:String(e)),isError:!0}}}async function g(e,t,s){let n=[],i=!0;try{let r=await e.tool.execute(e.toolCall.id,e.args,t,t=>{i&&n.push(Promise.resolve(s({type:"tool_execution_update",toolCallId:e.toolCall.id,toolName:e.toolCall.name,args:e.toolCall.arguments,partialResult:t})))});return i=!1,await Promise.all(n),{result:r,isError:!1}}catch(e){return i=!1,await Promise.all(n),{result:b(e instanceof Error?e.message:String(e)),isError:!0}}finally{i=!1}}async function y(e,t,s,n,i,r){let a=n.result,o=n.isError;if(i.afterToolCall)try{let n=await i.afterToolCall({assistantMessage:t,toolCall:s.toolCall,args:s.args,result:a,isError:o,context:e},r);n&&(a={...a,content:n.content??a.content,details:n.details??a.details,usage:n.usage??a.usage,terminate:n.terminate??a.terminate},o=n.isError??o)}catch(e){a=b(e instanceof Error?e.message:String(e)),o=!0}return{toolCall:s.toolCall,result:a,isError:o}}function b(e){return{content:[{type:"text",text:e}],details:{}}}async function w(e,t){await t({type:"tool_execution_end",toolCallId:e.toolCall.id,toolName:e.toolCall.name,result:e.result,isError:e.isError})}function k(e){return{role:"toolResult",toolCallId:e.toolCall.id,toolName:e.toolCall.name,content:e.result.content??[],details:e.result.details,usage:e.result.usage,...e.result.addedToolNames?.length?{addedToolNames:e.result.addedToolNames}:{},isError:e.isError,timestamp:Date.now()}}async function v(e,t){await t({type:"message_start",message:e}),await t({type:"message_end",message:e})}function S(e){return e.filter(e=>"user"===e.role||"assistant"===e.role||"toolResult"===e.role)}let E={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},T={id:"unknown",name:"unknown",api:"unknown",provider:"unknown",baseUrl:"",reasoning:!1,input:[],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:0,maxTokens:0};class x{messages=[];mode;constructor(e){this.mode=e}enqueue(e){this.messages.push(e)}hasItems(){return this.messages.length>0}drain(){if("all"===this.mode){let e=this.messages.slice();return this.messages=[],e}let e=this.messages[0];return e?(this.messages=this.messages.slice(1),[e]):[]}clear(){this.messages=[]}}class _{_state;listeners=new Set;steeringQueue;followUpQueue;convertToLlm;transformContext;streamFunction;getApiKey;onPayload;onResponse;beforeToolCall;afterToolCall;shouldStopAfterTurn;prepareNextTurn;prepareNextTurnWithContext;activeRun;sessionId;thinkingBudgets;transport;maxRetryDelayMs;toolExecution;constructor(e){const t=e??{};this._state=function(e){let t=e?.tools?.slice()??[],s=e?.messages?.slice()??[];return{systemPrompt:e?.systemPrompt??"",model:e?.model??T,thinkingLevel:e?.thinkingLevel??"off",get tools(){return t},set tools(nextTools){t=nextTools.slice()},get messages(){return s},set messages(nextMessages){s=nextMessages.slice()},isStreaming:!1,streamingMessage:void 0,pendingToolCalls:new Set,errorMessage:void 0}}(t.initialState),this.convertToLlm=t.convertToLlm??S,this.transformContext=t.transformContext,this.streamFunction=t.streamFn??r(),this.getApiKey=t.getApiKey,this.onPayload=t.onPayload,this.onResponse=t.onResponse,this.beforeToolCall=t.beforeToolCall,this.afterToolCall=t.afterToolCall,this.shouldStopAfterTurn=t.shouldStopAfterTurn,this.prepareNextTurn=t.prepareNextTurn,this.prepareNextTurnWithContext=t.prepareNextTurnWithContext,this.steeringQueue=new x(t.steeringMode??"one-at-a-time"),this.followUpQueue=new x(t.followUpMode??"one-at-a-time"),this.sessionId=t.sessionId,this.thinkingBudgets=t.thinkingBudgets,this.transport=t.transport??"auto",this.maxRetryDelayMs=t.maxRetryDelayMs,this.toolExecution=t.toolExecution??"parallel"}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get state(){return this._state}set steeringMode(e){this.steeringQueue.mode=e}get steeringMode(){return this.steeringQueue.mode}set followUpMode(e){this.followUpQueue.mode=e}get followUpMode(){return this.followUpQueue.mode}steer(e){this.steeringQueue.enqueue(e)}followUp(e){this.followUpQueue.enqueue(e)}clearSteeringQueue(){this.steeringQueue.clear()}clearFollowUpQueue(){this.followUpQueue.clear()}clearAllQueues(){this.clearSteeringQueue(),this.clearFollowUpQueue()}hasQueuedMessages(){return this.steeringQueue.hasItems()||this.followUpQueue.hasItems()}get signal(){return this.activeRun?.abortController.signal}abort(){this.activeRun?.abortController.abort()}waitForIdle(){return this.activeRun?.promise??Promise.resolve()}reset(){if(this.activeRun)throw Error("Agent is already processing. Wait for completion before resetting.");this._state.messages=[],this._state.isStreaming=!1,this._state.streamingMessage=void 0,this._state.pendingToolCalls=new Set,this._state.errorMessage=void 0,this.clearFollowUpQueue(),this.clearSteeringQueue()}async prompt(e,t){if(this.activeRun)throw Error("Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.");let s=this.normalizePromptInput(e,t);await this.runPromptMessages(s)}async continue(){if(this.activeRun)throw Error("Agent is already processing. Wait for completion before continuing.");let e=this._state.messages[this._state.messages.length-1];if(!e)throw Error("No messages to continue from");if("assistant"===e.role){let e=this.steeringQueue.drain();if(e.length>0)return void await this.runPromptMessages(e,{skipInitialSteeringPoll:!0});let t=this.followUpQueue.drain();if(t.length>0)return void await this.runPromptMessages(t);throw Error("Cannot continue from message role: assistant")}await this.runContinuation()}normalizePromptInput(e,t){if(Array.isArray(e))return e;if("string"!=typeof e)return[e];let s=[{type:"text",text:e}];return t&&t.length>0&&s.push(...t),[{role:"user",content:s,timestamp:Date.now()}]}async runPromptMessages(e,t={}){await this.runWithLifecycle(async s=>{await a(e,this.createContextSnapshot(),this.createLoopConfig(t),e=>this.processEvents(e),s,this.streamFunction)})}async runContinuation(){await this.runWithLifecycle(async e=>{await o(this.createContextSnapshot(),this.createLoopConfig(),e=>this.processEvents(e),e,this.streamFunction)})}createContextSnapshot(){return{systemPrompt:this._state.systemPrompt,messages:this._state.messages.slice(),tools:this._state.tools.slice()}}createLoopConfig(e={}){let t=!0===e.skipInitialSteeringPoll,s=this.shouldStopAfterTurn;return{model:this._state.model,reasoning:"off"===this._state.thinkingLevel?void 0:this._state.thinkingLevel,sessionId:this.sessionId,onPayload:this.onPayload,onResponse:this.onResponse,transport:this.transport,thinkingBudgets:this.thinkingBudgets,maxRetryDelayMs:this.maxRetryDelayMs,toolExecution:this.toolExecution,beforeToolCall:this.beforeToolCall,afterToolCall:this.afterToolCall,shouldStopAfterTurn:s?async e=>await s(e,this.signal):void 0,prepareNextTurn:this.prepareNextTurnWithContext||this.prepareNextTurn?async e=>this.prepareNextTurnWithContext?await this.prepareNextTurnWithContext(e,this.signal):await this.prepareNextTurn?.(this.signal):void 0,convertToLlm:this.convertToLlm,transformContext:this.transformContext,getApiKey:this.getApiKey,getSteeringMessages:async()=>t?(t=!1,[]):this.steeringQueue.drain(),getFollowUpMessages:async()=>this.followUpQueue.drain()}}async runWithLifecycle(e){if(this.activeRun)throw Error("Agent is already processing.");let t=new AbortController,s=()=>{},n=new Promise(e=>{s=e});this.activeRun={promise:n,resolve:s,abortController:t},this._state.isStreaming=!0,this._state.streamingMessage=void 0,this._state.errorMessage=void 0;try{await e(t.signal)}catch(e){await this.handleRunFailure(e,t.signal.aborted)}finally{this.finishRun()}}async handleRunFailure(e,t){let s={role:"assistant",content:[{type:"text",text:""}],api:this._state.model.api,provider:this._state.model.provider,model:this._state.model.id,usage:E,stopReason:t?"aborted":"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()};await this.processEvents({type:"message_start",message:s}),await this.processEvents({type:"message_end",message:s}),await this.processEvents({type:"turn_end",message:s,toolResults:[]}),await this.processEvents({type:"agent_end",messages:[s]})}finishRun(){this._state.isStreaming=!1,this._state.streamingMessage=void 0,this._state.pendingToolCalls=new Set,this.activeRun?.resolve(),this.activeRun=void 0}async processEvents(e){switch(e.type){case"message_start":case"message_update":this._state.streamingMessage=e.message;break;case"message_end":this._state.streamingMessage=void 0,this._state.messages.push(e.message);break;case"tool_execution_start":{let t=new Set(this._state.pendingToolCalls);t.add(e.toolCallId),this._state.pendingToolCalls=t;break}case"tool_execution_end":{let t=new Set(this._state.pendingToolCalls);t.delete(e.toolCallId),this._state.pendingToolCalls=t;break}case"turn_end":"assistant"===e.message.role&&e.message.errorMessage&&(this._state.errorMessage=e.message.errorMessage);break;case"agent_end":this._state.streamingMessage=void 0}let t=this.activeRun?.abortController.signal;if(!t)throw Error("Agent listener invoked outside active run");for(let s of this.listeners)await s(e,t)}}function N(e){class t extends Error{_tag=e;constructor(t){super(t.message),this.name=e,Object.assign(this,t)}toJSON(){let t={};for(let e of Object.keys(this))"_tag"!==e&&(t[e]=this[e]);return{_tag:e,message:this.message,...t}}static is(e){return e instanceof t}}return t}e.s(["Agent",()=>_],687339),N("LaneBusy"),N("MissingIdentities"),N("NoActiveRun"),N("NoActiveOperation"),N("NothingToResume"),N("InvalidMessage"),N("UnknownSkill"),N("UnknownTemplate"),N("UnknownTarget"),N("UnknownQueueItem"),N("LaneExists"),N("InvalidLane"),N("NothingToCompact"),N("Closed");e.i(310147);class O extends Error{code;constructor(e,t,s){super(t,void 0===s?void 0:{cause:s}),this.name="SessionError",this.code=e}}function I(e){return{ok:!0,value:e}}function A(e){return{ok:!1,error:e}}class C extends Error{kind;constructor(e,t,s){super(t,void 0===s?void 0:{cause:s}),this.name="JsonlDecodeError",this.kind=e}}function L(e,t){if(!e.ok)throw new O("not_found"===e.error.code?"not_found":"storage",`${t}: ${e.error.message}`,e.error);return e.value}function $(e,t,s){return new O("invalid_entry",`Invalid JSONL v4 session ${e}: line ${t} ${s.message}`,s)}let M=new Set(["message","model_change","thinking_level_change","active_tools_change","compaction","branch_summary","custom"]),q=new Set(["operation_started","abort_requested","operation_finished","step_attempt","tool_started","queue_enqueued","queue_cancelled","write_deferred","usage"]),R=new Set(["run","compaction","navigation"]);function B(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function j(e){let t;try{t=JSON.parse(e)}catch(e){throw new C("syntax","is not valid JSON",e instanceof Error?e:void 0)}if(!B(t))throw new C("schema","is not a JSON object");return t}function P(e,t){if("string"!=typeof e)throw new C("schema",`has invalid ${t}`);return e}function D(e){if(!Number.isSafeInteger(e)||e<0)throw new C("schema","has invalid timestamp");return e}function K(e,t){if(null!==e&&"string"!=typeof e)throw new C("schema",`has invalid ${t}`);return e}function U(e){try{return I(function(e){let t=j(e);if("header"!==t.kind)throw new C("schema","is not a header");if(4!==t.version)throw new C("schema","has unsupported session version");let s=t.parentSessionId;if(void 0!==s&&"string"!=typeof s)throw new C("schema","has invalid parentSessionId");let n=t.legacyParentSessionPath;if(void 0!==n&&"string"!=typeof n)throw new C("schema","has invalid legacyParentSessionPath");if(void 0!==s&&void 0!==n)throw new C("schema","has both parentSessionId and legacyParentSessionPath");let i=t.metadata;if(void 0!==i&&!B(i))throw new C("schema","has invalid metadata");return{kind:"header",version:4,id:P(t.id,"id"),createdAt:D(t.createdAt),cwd:P(t.cwd,"cwd"),parentSessionId:s,legacyParentSessionPath:n,metadata:i}}(e))}catch(e){if(e instanceof C)return A(e);throw e}}function F(e,t,s){return{id:e.id,createdAt:e.createdAt,cwd:e.cwd,path:t,modifiedAt:s,sourceFormat:4,...void 0===e.parentSessionId?{}:{parentSessionId:e.parentSessionId},...void 0===e.legacyParentSessionPath?{}:{legacyParentSessionPath:e.legacyParentSessionPath},...void 0===e.metadata?{}:{metadata:e.metadata}}}function W(e){throw new O("invalid_entry",`Invalid session mutation: ${e}`)}function J(e){if(void 0!==e&&(!Number.isInteger(e)||e<=0))throw new O("invalid_query","limit must be a positive integer")}function Q(e){if(void 0!==e&&(!Number.isInteger(e)||e<0))throw new O("invalid_query","cursor sequence must be a non-negative integer")}function*V(e,t){if("oldestFirst"===t)return void(yield*e);for(let t=e.length-1;t>=0;t--)yield e[t]}class G{sequence=0;usedIds=new Set;entries=[];entriesById=new Map;records=[];openOperationsByLane=new Map;lanes=new Map([["main",null]]);log=[];stats={messageCount:0,cachedTokens:0,uncachedTokens:0,totalTokens:0,costTotal:0};name;labels=new Map;get nextSequence(){return this.sequence+1}getLanes(){return[...this.lanes].map(([e,t])=>({lane:e,leafId:t}))}requireLane(e){let t=this.lanes.get(e);if(void 0===t)throw new O("invalid_lane",`Lane not found: ${e}`);return t}validateNewLane(e){if(this.lanes.has(e))throw new O("already_exists",`Lane already exists: ${e}`)}validateTarget(e){if(null!==e&&!this.entriesById.has(e))throw new O("not_found",`Entry not found: ${e}`)}validateUnusedId(e){if(this.usedIds.has(e))throw new O("already_exists",`Session id already exists: ${e}`)}applyMutation(e,t=W){let s="entry"===e.kind?e.entry.seq:"record"===e.kind?e.record.seq:e.seq;switch(s!==this.sequence+1&&t(`has non-consecutive seq ${s}`),e.kind){case"entry":if(this.usedIds.has(e.entry.id)&&t(`contains duplicate id ${e.entry.id}`),void 0!==e.lane){let s=this.lanes.get(e.lane);void 0===s&&t(`references missing lane ${e.lane}`),e.entry.parentId!==s&&t("does not chain to the lane leaf")}null===e.entry.parentId||this.entriesById.has(e.entry.parentId)||t(`references missing parent ${e.entry.parentId}`),this.sequence=s,this.usedIds.add(e.entry.id),this.entries.push(e.entry),this.entriesById.set(e.entry.id,e.entry),void 0!==e.lane&&this.lanes.set(e.lane,e.entry.id),this.log.push({kind:"entry",seq:s,entry:e.entry}),"message"===e.entry.type&&(this.stats.messageCount+=1);break;case"record":if(this.lanes.has(e.record.lane)||t(`references missing lane ${e.record.lane}`),this.usedIds.has(e.record.id)&&t(`contains duplicate id ${e.record.id}`),this.sequence=s,this.usedIds.add(e.record.id),this.records.push(e.record),"operation_started"===e.record.type){let t=this.openOperationsByLane.get(e.record.lane);t||(t=new Map,this.openOperationsByLane.set(e.record.lane,t)),t.set(e.record.id,e.record)}else"operation_finished"===e.record.type&&this.openOperationsByLane.get(e.record.lane)?.delete(e.record.runId);this.log.push({kind:"record",seq:s,record:e.record}),"usage"===e.record.type&&(this.stats.cachedTokens+=e.record.usage.cacheRead,this.stats.uncachedTokens+=e.record.usage.input+e.record.usage.cacheWrite,this.stats.totalTokens+=e.record.usage.totalTokens,this.stats.costTotal+=e.record.usage.cost.total);break;case"lane":null===e.leafId||this.entriesById.has(e.leafId)||t(`references missing lane target ${e.leafId}`),this.sequence=s,this.lanes.set(e.lane,e.leafId),this.log.push({kind:"lane",seq:s,lane:e.lane,leafId:e.leafId});break;case"fact":"label"!==e.fact||this.entriesById.has(e.targetId)||t(`references missing label target ${e.targetId}`),this.sequence=s,"name"===e.fact?(this.name=e.name,this.log.push({kind:"fact",seq:s,fact:"name",name:e.name})):(void 0===e.label?this.labels.delete(e.targetId):this.labels.set(e.targetId,e.label),this.log.push({kind:"fact",seq:s,fact:"label",targetId:e.targetId,label:e.label}))}}getEntry(e){return this.entriesById.get(e)}findEntries(e={}){J(e.limit),Q(e.cursor?.afterSeq);let t=[];for(let s of V(this.entries,e.order))if(this.matchesEntryQuery(s,e)&&(t.push(s),t.length===e.limit))break;return t}findEntriesOnBranch(e){J(e.limit),Q(e.cursor?.afterSeq);let t=[];if("oldestFirst"===e.order)for(let s of[...this.walkToRoot(e.start)].reverse()){let n=s.id===e.stopAtId||s.type===e.stopAtType;if(this.matchesEntryQuery(s,e)&&t.push(s),n||t.length===e.limit)break}else for(let s of this.walkToRoot(e.start,e))if(this.matchesEntryQuery(s,e)&&t.push(s),t.length===e.limit)break;return t}findRecords(e={}){J(e.limit),Q(e.afterSeq);let t=[];for(let s of V(this.records,e.order))if(this.matchesRecordQuery(s,e)&&(t.push(s),t.length===e.limit))break;return t}findOpenOperations(e,t){J(t?.limit);let s=this.openOperationsByLane.get(e),n=s?[...s.values()].reverse():[];return t?.limit===void 0?n:n.slice(0,t.limit)}getLog(e={}){J(e.limit),Q(e.afterSeq);let t=[];for(let s of this.log)if((void 0===e.afterSeq||!(s.seq<=e.afterSeq))&&(t.push(s),t.length===e.limit))break;return t}getName(){return this.name}getLabel(e){return this.labels.get(e)}getStats(){return this.stats}createForkMutations(e){let t,s;if("tree"===e.scope)t=this.findEntries({order:"oldestFirst"}),s=this.getLanes();else{let n=e.entryId??this.requireLane("main"),i=null;if(null!==n){let t=this.getEntry(n);if(!t||"message"!==t.type)throw new O("invalid_fork_target",`Fork target is not a message entry: ${n}`);i="at"===(e.position??(void 0===e.entryId?"at":"before"))?t.id:t.parentId}t=null===i?[]:this.findEntriesOnBranch({start:i,order:"oldestFirst"}),s=[{lane:"main",leafId:i}]}let n=[],i=1;for(let e of t)n.push({kind:"entry",entry:{...structuredClone(e),seq:i++}});for(let e of s)n.push({kind:"lane",seq:i++,lane:e.lane,leafId:e.leafId});for(let e of(void 0!==this.name&&n.push({kind:"fact",seq:i++,fact:"name",name:this.name}),t)){let t=this.labels.get(e.id);void 0!==t&&n.push({kind:"fact",seq:i++,fact:"label",targetId:e.id,label:t})}return n}*walkToRoot(e,t){if(null===e)return;let s=new Set,n=this.entriesById.get(e);if(!n)throw new O("not_found",`Entry not found: ${e}`);for(;n;){if(s.has(n.id))throw new O("invalid_entry",`Session branch contains a cycle at ${n.id}`);if(s.add(n.id),yield n,n.id===t?.stopAtId||n.type===t?.stopAtType||null===n.parentId)break;let e=n.parentId;if(!(n=this.entriesById.get(e)))throw new O("invalid_entry",`Entry not found: ${e}`)}}matchesEntryQuery(e,t){return(void 0===t.type||e.type===t.type)&&(void 0===t.customType||"custom"===e.type&&e.customType===t.customType)&&(void 0===t.cursor||("oldestFirst"===t.order?e.seq>t.cursor.afterSeq:e.seq<t.cursor.afterSeq))}matchesRecordQuery(e,t){return(void 0===t.lane||e.lane===t.lane)&&(void 0===t.type||e.type===t.type)&&(void 0===t.runId||("operation_started"===e.type?e.id===t.runId:"runId"in e&&e.runId===t.runId))&&(void 0===t.operationKind||"operation_started"===e.type&&e.intent.kind===t.operationKind)&&(void 0===t.afterSeq||e.seq>t.afterSeq)}}async function Y(e,t,s){let n=`${t}.tmp`;try{await s(n),L(await e.renameFile(n,t),`Failed to publish staged file ${t}`)}catch(t){throw await e.remove(n,{force:!0}),t}}class H{fs;metadata;state=new G;tail=Promise.resolve();constructor(e,t){this.fs=e,this.metadata=structuredClone(t)}static async create(e,t,s){L(await e.writeFile(t,`${JSON.stringify(s)}
6
+ `),`Failed to initialize session ${t}`);let n=L(await e.fileInfo(t),`Failed to read session metadata ${t}`);return new H(e,F(s,t,n.mtimeMs))}static async load(e,t){let s=L(await e.readTextFile(t),`Failed to read session ${t}`),n=s.split("\n");if(""===n.at(-1)&&n.pop(),0===n.length||!n[0])throw $(t,1,new C("schema","is missing a header"));let i=U(n[0]);if(!i.ok)throw $(t,1,i.error);let r=L(await e.fileInfo(t),`Failed to read session metadata ${t}`),a=new H(e,F(i.value,t,r.mtimeMs));for(let s=1;s<n.length;s++){let i=function(e){try{return I(function(e){let t=j(e),s=function(e){if(!Number.isSafeInteger(e)||e<=0)throw new C("schema","has invalid seq");return e}(t.seq);switch(t.kind){case"entry":return function(e,t){let s=void 0===e.lane?void 0:P(e.lane,"lane"),n=P(e.id,"id"),i=P(e.type,"entry type");if(!M.has(i))throw new C("schema",`has unknown entry type ${i}`);let r=K(e.parentId,"parentId"),a=D(e.timestamp);"custom"===i&&P(e.customType,"customType");let{kind:o,lane:l,...c}=e,u={...c,id:n,type:i,parentId:r,seq:t,timestamp:a};return void 0===s?{kind:"entry",entry:u}:{kind:"entry",lane:s,entry:u}}(t,s);case"record":return function(e,t){let s=P(e.id,"id"),n=P(e.lane,"lane"),i=P(e.type,"record type");if(!q.has(i))throw new C("schema",`has unknown record type ${i}`);let r=D(e.timestamp);if("operation_started"===i){if(!B(e.intent))throw new C("schema","has invalid intent");let t=P(e.intent.kind,"operation kind");if(!R.has(t))throw new C("schema",`has unknown operation kind ${t}`)}"operation_finished"===i&&P(e.runId,"runId");let{kind:a,...o}=e;return{kind:"record",record:{...o,id:s,lane:n,type:i,seq:t,timestamp:r}}}(t,s);case"lane":return{kind:"lane",seq:s,lane:P(t.lane,"lane"),leafId:K(t.leafId,"leafId")};case"fact":if("name"===t.fact){if(void 0!==t.name&&"string"!=typeof t.name)throw new C("schema","has invalid name");return{kind:"fact",seq:s,fact:"name",name:t.name}}if("label"===t.fact){if(void 0!==t.label&&"string"!=typeof t.label)throw new C("schema","has invalid label");return{kind:"fact",seq:s,fact:"label",targetId:P(t.targetId,"targetId"),label:t.label}}throw new C("schema","has unknown fact type");default:throw new C("schema","has unknown mutation kind")}}(e))}catch(e){if(e instanceof C)return A(e);throw e}}(n[s]);if(!i.ok){if(s===n.length-1&&"syntax"===i.error.kind){let i=`${n.slice(0,s).join("\n")}
7
+ `;return await Y(e,t,async s=>{L(await e.writeFile(s,i),`Failed to stage torn-tail repair ${t}`)}),a}throw $(t,s+1,i.error)}try{a.applyMutation(i.value)}catch(e){if(e instanceof O&&"invalid_entry"===e.code)throw $(t,s+1,e);throw e}}return s.endsWith("\n")||L(await e.appendFile(t,"\n"),`Failed to repair unterminated session tail ${t}`),a}async fork(e,t,s){let n=this.state.createForkMutations(s);return await Y(this.fs,e,async e=>{let s=await H.create(this.fs,e,t);for(let e of n)await s.appendMutation(e),s.applyMutation(e)}),H.load(this.fs,e)}async drain(){await this.tail}async getMetadata(){return structuredClone(this.metadata)}async getLanes(){return this.state.getLanes()}createLane(e,t){return this.enqueue(async()=>{this.state.validateNewLane(e),this.state.validateTarget(t);let s={kind:"lane",seq:this.state.nextSequence,lane:e,leafId:t};await this.appendMutation(s),this.applyMutation(s)})}moveLane(e,t){return this.enqueue(async()=>{this.state.requireLane(e),this.state.validateTarget(t);let s={kind:"lane",seq:this.state.nextSequence,lane:e,leafId:t};await this.appendMutation(s),this.applyMutation(s)})}appendEntry(e,t){return this.enqueue(async()=>{let s=this.state.requireLane(t);this.state.validateUnusedId(e.id);let n={...structuredClone(e),parentId:s,seq:this.state.nextSequence,timestamp:Date.now()},i={kind:"entry",lane:t,entry:n};return await this.appendMutation(i),this.applyMutation(i),structuredClone(n)})}appendRecord(e){return this.enqueue(async()=>{this.state.requireLane(e.lane),this.state.validateUnusedId(e.id);let t=this.state.findOpenOperations(e.lane,{limit:1})[0]?.id;if("operation_started"===e.type&&void 0!==t)throw new O("storage",`Lane ${e.lane} already has an open operation ${t}`);let s={...structuredClone(e),seq:this.state.nextSequence,timestamp:Date.now()},n={kind:"record",record:s};return await this.appendMutation(n),this.applyMutation(n),structuredClone(s)})}async getEntry(e){let t=this.state.getEntry(e);return void 0===t?void 0:structuredClone(t)}async findEntries(e={}){return structuredClone(this.state.findEntries(e))}async findEntriesOnBranch(e){return structuredClone(this.state.findEntriesOnBranch(e))}async findRecords(e={}){return structuredClone(this.state.findRecords(e))}async findOpenOperations(e,t){return structuredClone(this.state.findOpenOperations(e,t))}async getLog(e={}){return structuredClone(this.state.getLog(e))}async getName(){return this.state.getName()}setName(e){return this.enqueue(async()=>{let t={kind:"fact",seq:this.state.nextSequence,fact:"name",name:e};await this.appendMutation(t),this.applyMutation(t)})}async getLabel(e){return this.state.getLabel(e)}setLabel(e,t){return this.enqueue(async()=>{this.state.validateTarget(e);let s={kind:"fact",seq:this.state.nextSequence,fact:"label",targetId:e,label:t};await this.appendMutation(s),this.applyMutation(s)})}async getStats(){return structuredClone(this.state.getStats())}enqueue(e){let t=this.tail.then(e);return this.tail=t.then(()=>void 0,()=>void 0),t}async appendMutation(e){L(await this.fs.appendFile(this.metadata.path,function(e){switch(e.kind){case"entry":return`${JSON.stringify({kind:"entry",lane:e.lane,...e.entry})}
8
+ `;case"record":return`${JSON.stringify({kind:"record",...e.record})}
9
+ `;case"lane":case"fact":return`${JSON.stringify(e)}
10
+ `}}(e)),`Failed to append session ${this.metadata.path}`)}applyMutation(e){this.state.applyMutation(e)}}class z{metadata;state=new G;constructor(e){this.metadata=structuredClone(e)}fork(e,t){let s=new z(e);for(let e of this.state.createForkMutations(t))s.state.applyMutation(e);return s}async getMetadata(){return structuredClone(this.metadata)}async getLanes(){return this.state.getLanes()}async createLane(e,t){this.state.validateNewLane(e),this.state.validateTarget(t),this.state.applyMutation({kind:"lane",seq:this.state.nextSequence,lane:e,leafId:t})}async moveLane(e,t){this.state.requireLane(e),this.state.validateTarget(t),this.state.applyMutation({kind:"lane",seq:this.state.nextSequence,lane:e,leafId:t})}async appendEntry(e,t){let s=this.state.requireLane(t);this.state.validateUnusedId(e.id);let n={...structuredClone(e),parentId:s,seq:this.state.nextSequence,timestamp:Date.now()};return this.state.applyMutation({kind:"entry",lane:t,entry:n}),structuredClone(n)}async appendRecord(e){this.state.requireLane(e.lane),this.state.validateUnusedId(e.id);let t=this.state.findOpenOperations(e.lane,{limit:1})[0]?.id;if("operation_started"===e.type&&void 0!==t)throw new O("storage",`Lane ${e.lane} already has an open operation ${t}`);let s={...structuredClone(e),seq:this.state.nextSequence,timestamp:Date.now()};return this.state.applyMutation({kind:"record",record:s}),structuredClone(s)}async getEntry(e){let t=this.state.getEntry(e);return void 0===t?void 0:structuredClone(t)}async findEntries(e={}){return structuredClone(this.state.findEntries(e))}async findEntriesOnBranch(e){return structuredClone(this.state.findEntriesOnBranch(e))}async findRecords(e={}){return structuredClone(this.state.findRecords(e))}async findOpenOperations(e,t){return structuredClone(this.state.findOpenOperations(e,t))}async getLog(e={}){return structuredClone(this.state.getLog(e))}async getName(){return this.state.getName()}async setName(e){this.state.applyMutation({kind:"fact",seq:this.state.nextSequence,fact:"name",name:e})}async getLabel(e){return this.state.getLabel(e)}async setLabel(e,t){this.state.validateTarget(e),this.state.applyMutation({kind:"fact",seq:this.state.nextSequence,fact:"label",targetId:e,label:t})}async getStats(){return structuredClone(this.state.getStats())}}let X=Symbol.for("yaml.alias"),Z=Symbol.for("yaml.document"),ee=Symbol.for("yaml.map"),et=Symbol.for("yaml.pair"),es=Symbol.for("yaml.scalar"),en=Symbol.for("yaml.seq"),ei=Symbol.for("yaml.node.type"),er=e=>!!e&&"object"==typeof e&&e[ei]===X,ea=e=>!!e&&"object"==typeof e&&e[ei]===Z,eo=e=>!!e&&"object"==typeof e&&e[ei]===ee,el=e=>!!e&&"object"==typeof e&&e[ei]===et,ec=e=>!!e&&"object"==typeof e&&e[ei]===es,eu=e=>!!e&&"object"==typeof e&&e[ei]===en;function eh(e){if(e&&"object"==typeof e)switch(e[ei]){case ee:case en:return!0}return!1}function ef(e){if(e&&"object"==typeof e)switch(e[ei]){case X:case ee:case es:case en:return!0}return!1}let ed=e=>(ec(e)||eh(e))&&!!e.anchor,ep=Symbol("break visit"),em=Symbol("skip children"),eg=Symbol("remove node");function ey(e,t){let s=ev(t);ea(e)?eb(null,e.contents,s,Object.freeze([e]))===eg&&(e.contents=null):eb(null,e,s,Object.freeze([]))}function eb(e,t,s,n){let i=eS(e,t,s,n);if(ef(i)||el(i))return eE(e,n,i),eb(e,i,s,n);if("symbol"!=typeof i){if(eh(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=eb(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===ep)return ep;i===eg&&(t.items.splice(e,1),e-=1)}}}else if(el(t)){n=Object.freeze(n.concat(t));let e=eb("key",t.key,s,n);if(e===ep)return ep;e===eg&&(t.key=null);let i=eb("value",t.value,s,n);if(i===ep)return ep;i===eg&&(t.value=null)}}return i}async function ew(e,t){let s=ev(t);ea(e)?await ek(null,e.contents,s,Object.freeze([e]))===eg&&(e.contents=null):await ek(null,e,s,Object.freeze([]))}async function ek(e,t,s,n){let i=await eS(e,t,s,n);if(ef(i)||el(i))return eE(e,n,i),ek(e,i,s,n);if("symbol"!=typeof i){if(eh(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=await ek(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===ep)return ep;i===eg&&(t.items.splice(e,1),e-=1)}}}else if(el(t)){n=Object.freeze(n.concat(t));let e=await ek("key",t.key,s,n);if(e===ep)return ep;e===eg&&(t.key=null);let i=await ek("value",t.value,s,n);if(i===ep)return ep;i===eg&&(t.value=null)}}return i}function ev(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function eS(e,t,s,n){return"function"==typeof s?s(e,t,n):eo(t)?s.Map?.(e,t,n):eu(t)?s.Seq?.(e,t,n):el(t)?s.Pair?.(e,t,n):ec(t)?s.Scalar?.(e,t,n):er(t)?s.Alias?.(e,t,n):void 0}function eE(e,t,s){let n=t[t.length-1];if(eh(n))n.items[e]=s;else if(el(n))"key"===e?n.key=s:n.value=s;else if(ea(n))n.contents=s;else{let e=er(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}ey.BREAK=ep,ey.SKIP=em,ey.REMOVE=eg,ew.BREAK=ep,ew.SKIP=em,ew.REMOVE=eg;let eT={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ex=e=>e.replace(/[!,[\]{}]/g,e=>eT[e]);class e_{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e_.defaultYaml,e),this.tags=Object.assign({},e_.defaultTags,t)}clone(){let e=new e_(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new e_(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e_.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e_.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:e_.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e_.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(2!==s.length&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[e,n]=s;return this.tags[e]=n,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==s.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=s;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let s=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,s),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let s=e.slice(2,-1);return"!"===s||"!!"===s?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),s)}let[,s,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(e){return t(String(e)),null}return"!"===s?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+ex(e.substring(s.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);if(e&&n.length>0&&ef(e.contents)){let s={};ey(e.contents,(e,t)=>{ef(t)&&t.tag&&(s[t.tag]=!0)}),t=Object.keys(s)}else t=[];for(let[i,r]of n)("!!"!==i||"tag:yaml.org,2002:"!==r)&&(!e||t.some(e=>e.startsWith(r)))&&s.push(`%TAG ${i} ${r}`);return s.join("\n")}}function eN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function eO(e){let t=new Set;return ey(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function eI(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function eA(e,t,s,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,s=n.length;t<s;++t){let s=n[t],i=eA(e,n,String(t),s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let s=n.get(t),i=eA(e,n,t,s);void 0===i?n.delete(t):i!==s&&n.set(t,i)}else if(n instanceof Set)for(let t of Array.from(n)){let s=eA(e,n,t,t);void 0===s?n.delete(t):s!==t&&(n.delete(t),n.add(s))}else for(let[t,s]of Object.entries(n)){let i=eA(e,n,t,s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}return e.call(t,s,n)}function eC(e,t,s){if(Array.isArray(e))return e.map((e,t)=>eC(e,String(t),s));if(e&&"function"==typeof e.toJSON){if(!s||!ed(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=e=>{n.res=e,delete s.onCreate};let i=e.toJSON(t,s);return s.onCreate&&s.onCreate(i),i}return"bigint"!=typeof e||s?.keep?e:Number(e)}e_.defaultYaml={explicit:!1,version:"1.2"},e_.defaultTags={"!!":"tag:yaml.org,2002:"};class eL{constructor(e){Object.defineProperty(this,ei,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:n,reviver:i}={}){if(!ea(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},a=eC(this,"",r);if("function"==typeof n)for(let{count:e,res:t}of r.anchors.values())n(t,e);return"function"==typeof i?eA(i,{"":a},"",a):a}}class e$ extends eL{constructor(e){super(X),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let s,n;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let i of(t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],ey(e,{Node:(e,t)=>{(er(t)||ed(t))&&s.push(t)}}),t&&(t.aliasResolveCache=s)),s)){if(i===this)break;i.anchor===this.source&&(n=i)}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);let a=s.get(r);if(a||(eC(r,null,t),a=s.get(r)),a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=function e(t,s,n){if(er(s)){let e=s.resolve(t),i=n&&e&&n.get(e);return i?i.count*i.aliasCount:0}if(eh(s)){let i=0;for(let r of s.items){let s=e(t,r,n);s>i&&(i=s)}return i}return el(s)?Math.max(e(t,s.key,n),e(t,s.value,n)):1}(n,r,s)),a.count*a.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack");return a.res}toString(e,t,s){let n=`*${this.source}`;if(e){if(eN(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${n} `}return n}}let eM=e=>!e||"function"!=typeof e&&"object"!=typeof e;class eq extends eL{constructor(e){super(es),this.value=e}toJSON(e,t){return t?.keep?this.value:eC(this.value,e,t)}toString(){return String(this.value)}}function eR(e,t,s){let n;if(ea(e)&&(e=e.contents),ef(e))return e;if(el(e)){let t=s.schema[ee].createNode?.(s.schema,null,s);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:a,schema:o,sourceObjects:l}=s;if(i&&e&&"object"==typeof e){if(n=l.get(e))return n.anchor??(n.anchor=r(e)),new e$(n.anchor);n={anchor:null,node:null},l.set(e,n)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let c=function(e,t,s){if(t){let e=s.filter(e=>e.tag===t),n=e.find(e=>!e.format)??e[0];if(!n)throw Error(`Tag ${t} not found`);return n}return s.find(t=>t.identify?.(e)&&!t.format)}(e,t,o.tags);if(!c){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new eq(e);return n&&(n.node=t),t}c=e instanceof Map?o[ee]:Symbol.iterator in Object(e)?o[en]:o[ee]}a&&(a(c),delete s.onTagObj);let u=c?.createNode?c.createNode(s.schema,e,s):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(s.schema,e,s):new eq(e);return t?u.tag=t:c.default||(u.tag=c.tag),n&&(n.node=u),u}function eB(e,t,s){let n=s;for(let e=t.length-1;e>=0;--e){let s=t[e];if("number"==typeof s&&Number.isInteger(s)&&s>=0){let e=[];e[s]=n,n=e}else n=new Map([[s,n]])}return eR(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}eq.BLOCK_FOLDED="BLOCK_FOLDED",eq.BLOCK_LITERAL="BLOCK_LITERAL",eq.PLAIN="PLAIN",eq.QUOTE_DOUBLE="QUOTE_DOUBLE",eq.QUOTE_SINGLE="QUOTE_SINGLE";let ej=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class eP extends eL{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>ef(t)||el(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ej(e))this.add(t);else{let[s,...n]=e,i=this.get(s,!0);if(eh(i))i.addIn(n,t);else if(void 0===i&&this.schema)this.set(s,eB(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){let[t,...s]=e;if(0===s.length)return this.delete(t);let n=this.get(t,!0);if(eh(n))return n.deleteIn(s);throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...n]=e,i=this.get(s,!0);return 0===n.length?!t&&ec(i)?i.value:i:eh(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!el(t))return!1;let s=t.value;return null==s||e&&ec(s)&&null==s.value&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(0===s.length)return this.has(t);let n=this.get(t,!0);return!!eh(n)&&n.hasIn(s)}setIn(e,t){let[s,...n]=e;if(0===n.length)this.set(s,t);else{let e=this.get(s,!0);if(eh(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(s,eB(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}let eD=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function eK(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let eU=(e,t,s)=>e.endsWith("\n")?eK(s,t):s.includes("\n")?"\n"+eK(s,t):(e.endsWith(" ")?"":" ")+s,eF="flow",eW="block",eJ="quoted";function eQ(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:a,onOverflow:o}={}){let l,c,u;if(!i||i<0)return e;i<r&&(r=0);let h=Math.max(1+r,1+i-t.length);if(e.length<=h)return e;let f=[],d={},p=i-t.length;"number"==typeof n&&(n>i-Math.max(2,r)?f.push(0):p=i-n);let m=!1,g=-1,y=-1,b=-1;for(s===eW&&-1!==(g=eV(e,g,t.length))&&(p=g+h);u=e[g+=1];){if(s===eJ&&"\\"===u){switch(y=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if("\n"===u)s===eW&&(g=eV(e,g,t.length)),p=g+t.length+h,l=void 0;else{if(" "===u&&c&&" "!==c&&"\n"!==c&&" "!==c){let t=e[g+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=g)}if(g>=p)if(l)f.push(l),p=l+h,l=void 0;else if(s===eJ){for(;" "===c||" "===c;)c=u,u=e[g+=1],m=!0;let t=g>b+1?g-2:y-1;if(d[t])return e;f.push(t),d[t]=!0,p=t+h,l=void 0}else m=!0}c=u}if(m&&o&&o(),0===f.length)return e;a&&a();let w=e.slice(0,f[0]);for(let n=0;n<f.length;++n){let i=f[n],r=f[n+1]||e.length;0===i?w=`
11
+ ${t}${e.slice(0,r)}`:(s===eJ&&d[i]&&(w+=`${e[i]}\\`),w+=`
12
+ ${t}${e.slice(i+1,r)}`)}return w}function eV(e,t,s){let n=t,i=t+1,r=e[i];for(;" "===r||" "===r;)if(t<i+s)r=e[++t];else{do r=e[++t];while(r&&"\n"!==r)n=t,r=e[i=t+1]}return n}let eG=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function eY(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),a="",o=0;for(let e=0,t=s[e];t;t=s[++e])if(" "===t&&"\\"===s[e+1]&&"n"===s[e+2]&&(a+=s.slice(o,e)+"\\ ",e+=1,o=e,t="\\"),"\\"===t)switch(s[e+1]){case"u":{a+=s.slice(o,e);let t=s.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===t.substr(0,2)?a+="\\x"+t.substr(2):a+=s.substr(e,6)}e+=5,o=e+1}break;case"n":if(n||'"'===s[e+2]||s.length<i)e+=1;else{for(a+=s.slice(o,e)+"\n\n";"\\"===s[e+2]&&"n"===s[e+3]&&'"'!==s[e+4];)a+="\n",e+=2;a+=r," "===s[e+2]&&(a+="\\"),e+=1,o=e+1}break;default:e+=1}return a=o?a+s.slice(o):s,n?a:eQ(a,r,eJ,eG(t,!1))}function eH(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return eY(e,t);let s=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
13
+ ${s}`)+"'";return t.implicitKey?n:eQ(n,s,eF,eG(t,!1))}function ez(e,t){let s,{singleQuote:n}=t.options;if(!1===n)s=eY;else{let t=e.includes('"'),i=e.includes("'");s=t&&!i?eH:i&&!t?eY:n?eH:eY}return s(e,t)}try{s=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{s=/\n+(?!\n|$)/g}function eX({comment:e,type:t,value:n},i,r,a){let o,l,c,u,{blockQuote:h,commentString:f,lineWidth:d}=i.options;if(!h||/\n[\t ]+$/.test(n))return ez(n,i);let p=i.indent||(i.forceBlockIndent||(u=n,/^(%|---|\.\.\.)/m.test(u))?" ":""),m="literal"===h||"folded"!==h&&t!==eq.BLOCK_FOLDED&&(t===eq.BLOCK_LITERAL||!function(e,t,s){if(!t||t<0)return!1;let n=t-s,i=e.length;if(i<=n)return!1;for(let t=0,s=0;t<i;++t)if("\n"===e[t]){if(t-s>n)return!0;if(i-(s=t+1)<=n)return!1}return!0}(n,d,p.length));if(!n)return m?"|\n":">\n";for(l=n.length;l>0;--l){let e=n[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let g=n.substring(l),y=g.indexOf("\n");-1===y?o="-":n===g||y!==g.length-1?(o="+",a&&a()):o="",g&&(n=n.slice(0,-g.length),"\n"===g[g.length-1]&&(g=g.slice(0,-1)),g=g.replace(s,`$&${p}`));let b=!1,w=-1;for(c=0;c<n.length;++c){let e=n[c];if(" "===e)b=!0;else if("\n"===e)w=c;else break}let k=n.substring(0,w<c?w+1:c);k&&(n=n.substring(k.length),k=k.replace(/\n+/g,`$&${p}`));let v=p?"2":"1",S=(b?v:"")+o;if(e&&(S+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!m){let e=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`),s=!1,r=eG(i,!0);"folded"!==h&&t!==eq.BLOCK_FOLDED&&(r.onOverflow=()=>{s=!0});let a=eQ(`${k}${e}${g}`,p,eW,r);if(!s)return`>${S}
14
+ ${p}${a}`}return n=n.replace(/\n+/g,`$&${p}`),`|${S}
15
+ ${p}${k}${n}${g}`}function eZ(e,t,s,n){let{implicitKey:i,inFlow:r}=t,a="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==eq.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=eq.QUOTE_DOUBLE);let l=e=>{switch(e){case eq.BLOCK_FOLDED:case eq.BLOCK_LITERAL:return i||r?ez(a.value,t):eX(a,t,s,n);case eq.QUOTE_DOUBLE:return eY(a.value,t);case eq.QUOTE_SINGLE:return eH(a.value,t);case eq.PLAIN:return function(e,t,s,n){let{type:i,value:r}=e,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:u}=t;if(o&&r.includes("\n")||u&&/[[\]{},]/.test(r))return ez(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return o||u||!r.includes("\n")?ez(r,t):eX(e,t,s,n);if(!o&&!u&&i!==eq.PLAIN&&r.includes("\n"))return eX(e,t,s,n);if(/^(%|---|\.\.\.)/m.test(r)){if(""===l)return t.forceBlockIndent=!0,eX(e,t,s,n);else if(o&&l===c)return ez(r,t)}let h=r.replace(/\n+/g,`$&
16
+ ${l}`);if(a){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(h),{compat:s,tags:n}=t.doc.schema;if(n.some(e)||s?.some(e))return ez(r,t)}return o?h:eQ(h,l,eF,eG(t,!1))}(a,t,s,n);default:return null}},c=l(o);if(null===c){let{defaultKeyType:e,defaultStringType:s}=t.options,n=i&&e||s;if(null===(c=l(n)))throw Error(`Unsupported default string type ${n}`)}return c}function e0(e,t){let s,n=Object.assign({blockQuote:!0,commentString:eD,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:s,options:n}}function e1(e,t,s,n){let i;if(el(e))return e.toString(t,s,n);if(er(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r=ef(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=function(e,t){let s,n;if(t.tag){let s=e.filter(e=>e.tag===t.tag);if(s.length>0)return s.find(e=>e.format===t.format)??s[0]}if(ec(t)){s=t.value;let i=e.filter(e=>e.identify?.(s));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else s=t,n=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!n){let e=s?.constructor?.name??(null===s?"null":typeof s);throw Error(`Tag not resolved for ${e} value`)}return n}(t.doc.schema.tags,r));let a=function(e,t,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(ec(e)||eh(e))&&e.anchor;r&&eN(r)&&(s.add(r),i.push(`&${r}`));let a=e.tag??(t.default?null:t.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}(r,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o="function"==typeof i.stringify?i.stringify(r,t,s,n):ec(r)?eZ(r,t,s,n):r.toString(t,s,n);return a?ec(r)||"{"===o[0]||"["===o[0]?`${a} ${o}`:`${a}
17
+ ${t.indent}${o}`:o}function e2(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let e9={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new eq(Symbol("<<")),{addToJSMap:e3}),stringify:()=>"<<"};function e3(e,t,s){let n=e4(e,s);if(eu(n))for(let s of n.items)e8(e,t,s);else if(Array.isArray(n))for(let s of n)e8(e,t,s);else e8(e,t,n)}function e8(e,t,s){let n=e4(e,s);if(!eo(n))throw Error("Merge sources must be maps or map aliases");for(let[s,i]of n.toJSON(null,e,Map))t instanceof Map?t.has(s)||t.set(s,i):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function e4(e,t){return e&&er(t)?t.resolve(e.doc,e):t}function e6(e,t,{key:s,value:n}){if(ef(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if((e9.identify(s)||ec(s)&&(!s.type||s.type===eq.PLAIN)&&e9.identify(s.value))&&e?.doc.schema.tags.some(e=>e.tag===e9.tag&&e.default))e3(e,t,n);else{let i=eC(s,"",e);if(t instanceof Map)t.set(i,eC(n,i,e));else if(t instanceof Set)t.add(i);else{let r=function(e,t,s){if(null===t)return"";if("object"!=typeof t)return String(t);if(ef(e)&&s?.doc){let t=e0(s.doc,{});for(let e of(t.anchors=new Set,s.anchors.keys()))t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let n=e.toString(t);if(!s.mapKeyWarned){let e=JSON.stringify(n);e.length>40&&(e=e.substring(0,36)+'..."'),e2(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return n}return JSON.stringify(t)}(s,i,e),a=eC(n,r,e);r in t?Object.defineProperty(t,r,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[r]=a}}return t}function e7(e,t,s){return new e5(eR(e,void 0,s),eR(t,void 0,s))}class e5{constructor(e,t=null){Object.defineProperty(this,ei,{value:et}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return ef(t)&&(t=t.clone(e)),ef(s)&&(s=s.clone(e)),new e5(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return e6(t,s,this)}toString(e,t,s){return e?.doc?function({key:e,value:t},s,n,i){let r,a,o,{allNullValues:l,doc:c,indent:u,indentStep:h,options:{commentString:f,indentSeq:d,simpleKeys:p}}=s,m=ef(e)&&e.comment||null;if(p){if(m)throw Error("With simple keys, key nodes cannot have comments");if(eh(e)||!ef(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let g=!p&&(!e||m&&null==t&&!s.inFlow||eh(e)||(ec(e)?e.type===eq.BLOCK_FOLDED||e.type===eq.BLOCK_LITERAL:"object"==typeof e));s=Object.assign({},s,{allNullValues:!1,implicitKey:!g&&(p||!l),indent:u+h});let y=!1,b=!1,w=e1(e,s,()=>y=!0,()=>b=!0);if(!g&&!s.inFlow&&w.length>1024){if(p)throw Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(s.inFlow){if(l||null==t)return y&&n&&n(),""===w?"?":g?`? ${w}`:w}else if(l&&!p||null==t&&g)return w=`? ${w}`,m&&!y?w+=eU(w,s.indent,f(m)):b&&i&&i(),w;y&&(m=null),g?(m&&(w+=eU(w,s.indent,f(m))),w=`? ${w}
18
+ ${u}:`):(w=`${w}:`,m&&(w+=eU(w,s.indent,f(m)))),ef(t)?(r=!!t.spaceBefore,a=t.commentBefore,o=t.comment):(r=!1,a=null,o=null,t&&"object"==typeof t&&(t=c.createNode(t))),s.implicitKey=!1,!g&&!m&&ec(t)&&(s.indentAtStart=w.length+1),b=!1,!(!d&&h.length>=2&&!s.inFlow&&!g&&eu(t))||t.flow||t.tag||t.anchor||(s.indent=s.indent.substring(2));let k=!1,v=e1(t,s,()=>k=!0,()=>b=!0),S=" ";if(m||r||a){if(S=r?"\n":"",a){let e=f(a);S+=`
19
+ ${eK(e,s.indent)}`}""!==v||s.inFlow?S+=`
20
+ ${s.indent}`:"\n"===S&&o&&(S="\n\n")}else if(!g&&eh(t)){let e=v[0],n=v.indexOf("\n"),i=-1!==n,r=s.inFlow??t.flow??0===t.items.length;if(i||!r){let t=!1;if(i&&("&"===e||"!"===e)){let s=v.indexOf(" ");"&"===e&&-1!==s&&s<n&&"!"===v[s+1]&&(s=v.indexOf(" ",s+1)),(-1===s||n<s)&&(t=!0)}t||(S=`
21
+ ${s.indent}`)}}else(""===v||"\n"===v[0])&&(S="");return w+=S+v,s.inFlow?k&&n&&n():o&&!k?w+=eU(w,s.indent,f(o)):b&&i&&i(),w}(this,e,t,s):JSON.stringify(this)}}function te(e,t,s){return(t.inFlow??e.flow?function({items:e},t,{flowChars:s,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:a,options:{commentString:o}}=t,l=Object.assign({},t,{indent:n+=r,inFlow:!0,type:null}),c=!1,u=0,h=[];for(let s=0;s<e.length;++s){let i=e[s],r=null;if(ef(i))i.spaceBefore&&h.push(""),tt(t,h,i.commentBefore,!1),i.comment&&(r=i.comment);else if(el(i)){let e=ef(i.key)?i.key:null;e&&(e.spaceBefore&&h.push(""),tt(t,h,e.commentBefore,!1),e.comment&&(c=!0));let s=ef(i.value)?i.value:null;s?(s.comment&&(r=s.comment),s.commentBefore&&(c=!0)):null==i.value&&e?.comment&&(r=e.comment)}r&&(c=!0);let a=e1(i,l,()=>r=null);c||(c=h.length>u||a.includes("\n")),s<e.length-1?a+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=h.reduce((e,t)=>e+t.length+2,2)+(a.length+2)>t.options.lineWidth)),c&&(a+=",")),r&&(a+=eU(a,n,o(r))),h.push(a),u=h.length}let{start:f,end:d}=s;if(0===h.length)return f+d;if(!c){let e=h.reduce((e,t)=>e+t.length+2,2);c=t.options.lineWidth>0&&e>t.options.lineWidth}if(!c)return`${f}${a}${h.join(" ")}${a}${d}`;{let e=f;for(let t of h)e+=t?`
22
+ ${r}${i}${t}`:"\n";return`${e}
23
+ ${i}${d}`}}:function({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:a,onComment:o}){let l,{indent:c,options:{commentString:u}}=s,h=Object.assign({},s,{indent:r,type:null}),f=!1,d=[];for(let e=0;e<t.length;++e){let i=t[e],a=null;if(ef(i))!f&&i.spaceBefore&&d.push(""),tt(s,d,i.commentBefore,f),i.comment&&(a=i.comment);else if(el(i)){let e=ef(i.key)?i.key:null;e&&(!f&&e.spaceBefore&&d.push(""),tt(s,d,e.commentBefore,f))}f=!1;let o=e1(i,h,()=>a=null,()=>f=!0);a&&(o+=eU(o,r,u(a))),f&&a&&(f=!1),d.push(n+o)}if(0===d.length)l=i.start+i.end;else{l=d[0];for(let e=1;e<d.length;++e){let t=d[e];l+=t?`
24
+ ${c}${t}`:"\n"}}return e?(l+="\n"+eK(u(e),c),o&&o()):f&&a&&a(),l})(e,t,s)}function tt({indent:e,options:{commentString:t}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let i=eK(t(n),e);s.push(i.trimStart())}}function ts(e,t){let s=ec(t)?t.value:t;for(let n of e)if(el(n)&&(n.key===t||n.key===s||ec(n.key)&&n.key.value===s))return n}class tn extends eP{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ee,e),this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),a=(e,a)=>{if("function"==typeof i)a=i.call(t,e,a);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==a||n)&&r.items.push(e7(e,a,s))};if(t instanceof Map)for(let[e,s]of t)a(e,s);else if(t&&"object"==typeof t)for(let e of Object.keys(t))a(e,t[e]);return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r}add(e,t){let s;s=el(e)?e:e&&"object"==typeof e&&"key"in e?new e5(e.key,e.value):new e5(e,e?.value);let n=ts(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);ec(n.value)&&eM(s.value)?n.value.value=s.value:n.value=s.value}else if(i){let e=this.items.findIndex(e=>0>i(s,e));-1===e?this.items.push(s):this.items.splice(e,0,s)}else this.items.push(s)}delete(e){let t=ts(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let s=ts(this.items,e),n=s?.value;return(!t&&ec(n)?n.value:n)??void 0}has(e){return!!ts(this.items,e)}set(e,t){this.add(new e5(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(n),this.items))e6(t,n,e);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let e of this.items)if(!el(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),te(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}let ti={collection:"map",default:!0,nodeClass:tn,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(eo(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,s)=>tn.from(e,t,s)};class tr extends eP{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(en,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ta(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let s=ta(e);if("number"!=typeof s)return;let n=this.items[s];return!t&&ec(n)?n.value:n}has(e){let t=ta(e);return"number"==typeof t&&t<this.items.length}set(e,t){let s=ta(e);if("number"!=typeof s)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];ec(n)&&eM(t)?n.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let n=0;for(let e of this.items)s.push(eC(e,String(n++),t));return s}toString(e,t,s){return e?te(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let r of t){if("function"==typeof n){let s=t instanceof Set?r:String(e++);r=n.call(t,s,r)}i.items.push(eR(r,void 0,s))}}return i}}function ta(e){let t=ec(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let to={collection:"seq",default:!0,nodeClass:tr,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(eu(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,s)=>tr.from(e,t,s)},tl={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,s,n)=>eZ(e,t=Object.assign({actualString:!0},t),s,n)},tc={identify:e=>null==e,createNode:()=>new eq(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new eq(null),stringify:({source:e},t)=>"string"==typeof e&&tc.test.test(e)?e:t.options.nullStr},tu={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new eq("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},s)=>e&&tu.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?s.options.trueStr:s.options.falseStr};function th({format:e,minFractionDigits:t,tag:s,value:n}){if("bigint"==typeof n)return String(n);let i="number"==typeof n?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!s||"tag:yaml.org,2002:float"===s)&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");e<0&&(e=r.length,r+=".");let s=t-(r.length-e-1);for(;s-- >0;)r+="0"}return r}let tf={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:th},td={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():th(e)}},tp={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new eq(parseFloat(e)),s=e.indexOf(".");return -1!==s&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-s-1),t},stringify:th},tm=e=>"bigint"==typeof e||Number.isInteger(e),tg=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function ty(e,t,s){let{value:n}=e;return tm(n)&&n>=0?s+n.toString(t):th(e)}let tb={identify:e=>tm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>tg(e,2,8,s),stringify:e=>ty(e,8,"0o")},tw={identify:tm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>tg(e,0,10,s),stringify:th},tk={identify:e=>tm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>tg(e,2,16,s),stringify:e=>ty(e,16,"0x")},tv=[ti,to,tl,tc,tu,tb,tw,tk,tf,td,tp];function tS(e){return"bigint"==typeof e||Number.isInteger(e)}let tE=({value:e})=>JSON.stringify(e),tT=[ti,to].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:tE},{identify:e=>null==e,createNode:()=>new eq(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tE},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:tE},{identify:tS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>tS(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:tE}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),tx={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"!=typeof atob)return t("This environment does not support reading binary tags; either Buffer or atob is required"),e;{let t=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let e=0;e<t.length;++e)s[e]=t.charCodeAt(e);return s}},stringify({comment:e,type:t,value:s},n,i,r){let a;if(!s)return"";if("function"==typeof btoa){let e="";for(let t=0;t<s.length;++t)e+=String.fromCharCode(s[t]);a=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=eq.BLOCK_LITERAL),t!==eq.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),s=Math.ceil(a.length/e),i=Array(s);for(let t=0,n=0;t<s;++t,n+=e)i[t]=a.substr(n,e);a=i.join(t===eq.BLOCK_LITERAL?"\n":" ")}return eZ({comment:e,type:t,value:a},n,i,r)}};function t_(e,t){if(eu(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(!el(n)){if(eo(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new e5(new eq(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
25
+ ${e.key.commentBefore}`:n.commentBefore),n.comment){let t=e.value??e.key;t.comment=t.comment?`${n.comment}
26
+ ${t.comment}`:n.comment}n=e}e.items[s]=el(n)?n:new e5(n)}}else t("Expected a sequence for this tag");return e}function tN(e,t,s){let{replacer:n}=s,i=new tr(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let a,o;if("function"==typeof n&&(e=n.call(t,String(r++),e)),Array.isArray(e))if(2===e.length)a=e[0],o=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)o=e[a=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else a=e;i.items.push(e7(a,o,s))}return i}let tO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:t_,createNode:tN};class tI extends tr{constructor(){super(),this.add=tn.prototype.add.bind(this),this.delete=tn.prototype.delete.bind(this),this.get=tn.prototype.get.bind(this),this.has=tn.prototype.has.bind(this),this.set=tn.prototype.set.bind(this),this.tag=tI.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;for(let e of(t?.onCreate&&t.onCreate(s),this.items)){let n,i;if(el(e)?(n=eC(e.key,"",t),i=eC(e.value,n,t)):n=eC(e,"",t),s.has(n))throw Error("Ordered maps must not include duplicate keys");s.set(n,i)}return s}static from(e,t,s){let n=tN(e,t,s),i=new this;return i.items=n.items,i}}tI.tag="tag:yaml.org,2002:omap";let tA={collection:"seq",identify:e=>e instanceof Map,nodeClass:tI,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=t_(e,t),n=[];for(let{key:e}of s.items)ec(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new tI,s)},createNode:(e,t,s)=>tI.from(e,t,s)};function tC({value:e,source:t},s){return t&&(e?tL:t$).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}let tL={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new eq(!0),stringify:tC},t$={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new eq(!1),stringify:tC},tM=e=>"bigint"==typeof e||Number.isInteger(e);function tq(e,t,s,{intAsBigInt:n}){let i=e[0];if(("-"===i||"+"===i)&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return"-"===i?BigInt(-1)*t:t}let r=parseInt(e,s);return"-"===i?-1*r:r}function tR(e,t,s){let{value:n}=e;if(tM(n)){let e=n.toString(t);return n<0?"-"+s+e.substr(1):s+e}return th(e)}class tB extends tn{constructor(e){super(e),this.tag=tB.tag}add(e){let t;t=el(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new e5(e.key,null):new e5(e,null),ts(this.items,t.key)||this.items.push(t)}get(e,t){let s=ts(this.items,e);return!t&&el(s)?ec(s.key)?s.key.value:s.key:s}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=ts(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new e5(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(e7(e,null,s));return i}}tB.tag="tag:yaml.org,2002:set";let tj={collection:"map",identify:e=>e instanceof Set,nodeClass:tB,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>tB.from(e,t,s),resolve(e,t){if(eo(e))if(e.hasAllNullValues(!0))return Object.assign(new tB,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function tP(e,t){let s=e[0],n="-"===s||"+"===s?e.substring(1):e,i=e=>t?BigInt(e):Number(e),r=n.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===s?i(-1)*r:r}function tD(e){let{value:t}=e,s=e=>e;if("bigint"==typeof t)s=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return th(e);let n="";t<0&&(n="-",t*=s(-1));let i=s(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),n+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let tK={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>tP(e,s),stringify:tD},tU={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>tP(e,!1),stringify:tD},tF={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(tF.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,a,o]=t.map(Number),l=Date.UTC(s,n-1,i,r||0,a||0,o||0,t[7]?Number((t[7]+"00").substr(1,3)):0),c=t[8];if(c&&"Z"!==c){let e=tP(c,!1);30>Math.abs(e)&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},tW=[ti,to,tl,tc,tL,t$,{identify:tM,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>tq(e,2,2,s),stringify:e=>tR(e,2,"0b")},{identify:tM,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>tq(e,1,8,s),stringify:e=>tR(e,8,"0")},{identify:tM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>tq(e,0,10,s),stringify:th},{identify:tM,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>tq(e,2,16,s),stringify:e=>tR(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:th},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():th(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new eq(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(-1!==s){let n=e.substring(s+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:th},tx,e9,tA,tO,tj,tK,tU,tF],tJ=new Map([["core",tv],["failsafe",[ti,to,tl]],["json",tT],["yaml11",tW],["yaml-1.1",tW]]),tQ={binary:tx,bool:tu,float:tp,floatExp:td,floatNaN:tf,floatTime:tU,int:tw,intHex:tk,intOct:tb,intTime:tK,map:ti,merge:e9,null:tc,omap:tA,pairs:tO,seq:to,set:tj,timestamp:tF},tV={"tag:yaml.org,2002:binary":tx,"tag:yaml.org,2002:merge":e9,"tag:yaml.org,2002:omap":tA,"tag:yaml.org,2002:pairs":tO,"tag:yaml.org,2002:set":tj,"tag:yaml.org,2002:timestamp":tF};function tG(e,t,s){let n=tJ.get(t);if(n&&!e)return s&&!n.includes(e9)?n.concat(e9):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(tJ.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return s&&(i=i.concat(e9)),i.reduce((e,t)=>{let s="string"==typeof t?tQ[t]:t;if(!s){let e=JSON.stringify(t),s=Object.keys(tQ).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${s}`)}return e.includes(s)||e.push(s),e},[])}let tY=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class tH{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:a}){this.compat=Array.isArray(e)?tG(e,"compat"):e?tG(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=n?tV:{},this.tags=tG(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,ee,{value:ti}),Object.defineProperty(this,es,{value:tl}),Object.defineProperty(this,en,{value:to}),this.sortMapEntries="function"==typeof r?r:!0===r?tY:null}clone(){let e=Object.create(tH.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class tz{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ei,{value:Z});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===s&&t&&(s=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:r}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(r=this.directives.yaml.version)):this.directives=new e_({version:r}),this.setSchema(r,s),this.contents=void 0===e?null:this.createNode(e,n,s)}clone(){let e=Object.create(tz.prototype,{[ei]:{value:Z}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=ef(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){tX(this.contents)&&this.contents.add(e)}addIn(e,t){tX(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=eO(this);e.anchor=!t||s.has(t)?eI(t||"a",s):t}return new e$(e.anchor)}createNode(e,t,s){var n,i;let r,a,o,l;if("function"==typeof t)e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else void 0===s&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:c,anchorPrefix:u,flow:h,keepUndefined:f,onTagObj:d,tag:p}=s??{},{onAnchor:m,setAnchors:g,sourceObjects:y}=(n=this,i=u||"a",a=[],o=new Map,l=null,{onAnchor:e=>{a.push(e),l??(l=eO(n));let t=eI(i,l);return l.add(t),t},setAnchors:()=>{for(let e of a){let t=o.get(e);if("object"==typeof t&&t.anchor&&(ec(t.node)||eh(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:o}),b={aliasDuplicateObjects:c??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:d,replacer:r,schema:this.schema,sourceObjects:y},w=eR(e,p,b);return h&&eh(w)&&(w.flow=!0),g(),w}createPair(e,t,s={}){return new e5(this.createNode(e,null,s),this.createNode(t,null,s))}delete(e){return!!tX(this.contents)&&this.contents.delete(e)}deleteIn(e){return ej(e)?null!=this.contents&&(this.contents=null,!0):!!tX(this.contents)&&this.contents.deleteIn(e)}get(e,t){return eh(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ej(e)?!t&&ec(this.contents)?this.contents.value:this.contents:eh(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!eh(this.contents)&&this.contents.has(e)}hasIn(e){return ej(e)?void 0!==this.contents:!!eh(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=eB(this.schema,[e],t):tX(this.contents)&&this.contents.set(e,t)}setIn(e,t){ej(e)?this.contents=t:null==this.contents?this.contents=eB(this.schema,Array.from(e),t):tX(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let s;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new e_({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new e_({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new tH(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=eC(this.contents,t??"",a);if("function"==typeof i)for(let{count:e,res:t}of a.anchors.values())i(t,e);return"function"==typeof r?eA(r,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let s=[],n=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(s.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&s.push("---");let i=e0(e,t),{commentString:r}=i.options;if(e.commentBefore){1!==s.length&&s.unshift("");let t=r(e.commentBefore);s.unshift(eK(t,""))}let a=!1,o=null;if(e.contents){if(ef(e.contents)){if(e.contents.spaceBefore&&n&&s.push(""),e.contents.commentBefore){let t=r(e.contents.commentBefore);s.push(eK(t,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let t=o?void 0:()=>a=!0,l=e1(e.contents,i,()=>o=null,t);o&&(l+=eU(l,"",r(o))),("|"===l[0]||">"===l[0])&&"---"===s[s.length-1]?s[s.length-1]=`--- ${l}`:s.push(l)}else s.push(e1(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=r(e.comment);t.includes("\n")?(s.push("..."),s.push(eK(t,""))):s.push(`... ${t}`)}else s.push("...");else{let t=e.comment;t&&a&&(t=t.replace(/^\n+/,"")),t&&((!a||o)&&""!==s[s.length-1]&&s.push(""),s.push(eK(r(t),"")))}return s.join("\n")+"\n"}(this,e)}}function tX(e){if(eh(e))return!0;throw Error("Expected a YAML collection as document contents")}class tZ extends Error{constructor(e,t,s,n){super(),this.name=e,this.code=s,this.message=n,this.pos=t}}class t0 extends tZ{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class t1 extends tZ{constructor(e,t,s){super("YAMLWarning",e,t,s)}}let t2=(e,t)=>s=>{if(-1===s.pos[0])return;s.linePos=s.pos.map(e=>t.linePos(e));let{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,a=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&a.length>80){let e=Math.min(r-39,a.length-79);a="…"+a.substring(e),r-=e-1}if(a.length>80&&(a=a.substring(0,79)+"…"),n>1&&/^ *$/.test(a.substring(0,r))){let s=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);s.length>80&&(s=s.substring(0,79)+"…\n"),a=s+a}if(/[^ ]/.test(a)){let e=1,t=s.linePos[1];t?.line===n&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-r)));let o=" ".repeat(r)+"^".repeat(e);s.message+=`:
27
+
28
+ ${a}
29
+ ${o}
30
+ `}};function t9(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:a,startOnNewline:o}){let l=!1,c=o,u=o,h="",f="",d=!1,p=!1,m=null,g=null,y=null,b=null,w=null,k=null,v=null;for(let i of e)switch(p&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),m&&(c&&"comment"!==i.type&&"newline"!==i.type&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":!t&&("doc-start"!==s||n?.type!=="flow-collection")&&i.source.includes(" ")&&(m=i),u=!0;break;case"comment":{u||r(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=i.source.substring(1)||" ";h?h+=f+e:h=e,f="",c=!1;break}case"newline":c?h?h+=i.source:k&&"seq-item-ind"===s||(l=!0):f+=i.source,c=!0,d=!0,(g||y)&&(b=i),u=!0;break;case"anchor":g&&r(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&r(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=i,v??(v=i.offset),c=!1,u=!1,p=!0;break;case"tag":y&&r(i,"MULTIPLE_TAGS","A node can have at most one tag"),y=i,v??(v=i.offset),c=!1,u=!1,p=!0;break;case s:(g||y)&&r(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),k&&r(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),k=i,c="seq-item-ind"===s||"explicit-key-ind"===s,u=!1;break;case"comma":if(t){w&&r(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=i,c=!1,u=!1;break}default:r(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),c=!1,u=!1}let S=e[e.length-1],E=S?S.offset+S.source.length:i;return p&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:l,comment:h,hasNewline:d,anchor:g,tag:y,newlineAfterProp:b,end:E,start:v??E}}function t3(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end){for(let t of e.end)if("newline"===t.type)return!0}return!1;case"flow-collection":for(let t of e.items){for(let e of t.start)if("newline"===e.type)return!0;if(t.sep){for(let e of t.sep)if("newline"===e.type)return!0}if(t3(t.key)||t3(t.value))return!0}return!1;default:return!0}}function t8(e,t,s){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&("]"===n.source||"}"===n.source)&&t3(t)&&s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function t4(e,t,s){let{uniqueKeys:n}=e.options;if(!1===n)return!1;let i="function"==typeof n?n:(e,t)=>e===t||ec(e)&&ec(t)&&e.value===t.value;return t.some(e=>i(e.key,s))}let t6="All mapping items must start at the same column";function t7(e,t,s,n){let i="";if(e){let r=!1,a="";for(let o of e){let{source:e,type:l}=o;switch(l){case"space":r=!0;break;case"comment":{s&&!r&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";i?i+=a+t:i=t,a="";break}case"newline":i&&(a+=e),r=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:i,offset:t}}let t5="Block collections are not allowed within flow collections",se=e=>e&&("block-map"===e.type||"block-seq"===e.type);function st(e,t,s,n,i,r){let a="block-map"===s.type?function({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??tn)(s.schema);s.atRoot&&(s.atRoot=!1);let o=n.offset,l=null;for(let r of n.items){let{start:c,key:u,sep:h,value:f}=r,d=t9(c,{indicator:"explicit-key-ind",next:u??h?.[0],offset:o,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!d.found;if(p){if(u&&("block-seq"===u.type?i(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&i(o,"BAD_INDENT",t6)),!d.anchor&&!d.tag&&!h){l=d.end,d.comment&&(a.comment?a.comment+="\n"+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||t3(u))&&i(u??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(o,"BAD_INDENT",t6);s.atKey=!0;let m=d.end,g=u?e(s,u,d,i):t(s,m,c,null,d,i);s.schema.compat&&t8(n.indent,u,i),s.atKey=!1,t4(s,a.items,g)&&i(m,"DUPLICATE_KEY","Map keys must be unique");let y=t9(h??[],{indicator:"map-value-ind",next:f,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||"block-scalar"===u.type});if(o=y.end,y.found){p&&(f?.type!=="block-map"||y.hasNewline||i(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&d.start<y.found.offset-1024&&i(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=f?e(s,f,y,i):t(s,o,h,null,y,i);s.schema.compat&&t8(n.indent,f,i),o=l.range[2];let c=new e5(g,l);s.options.keepSourceTokens&&(c.srcToken=r),a.items.push(c)}else{p&&i(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),y.comment&&(g.comment?g.comment+="\n"+y.comment:g.comment=y.comment);let e=new e5(g);s.options.keepSourceTokens&&(e.srcToken=r),a.items.push(e)}}return l&&l<o&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,o,l??o],a}(e,t,s,n,r):"block-seq"===s.type?function({composeNode:e,composeEmptyNode:t},s,n,i,r){let a=new(r?.nodeClass??tr)(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let o=n.offset,l=null;for(let{start:r,value:c}of n.items){let u=t9(r,{indicator:"seq-item-ind",next:c,offset:o,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||c)c?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(o,"MISSING_CHAR","Sequence item without - indicator");else{l=u.end,u.comment&&(a.comment=u.comment);continue}let h=c?e(s,c,u,i):t(s,u.end,r,null,u,i);s.schema.compat&&t8(n.indent,c,i),o=h.range[2],a.items.push(h)}return a.range=[n.offset,o,l??o],a}(e,t,s,n,r):function({composeNode:e,composeEmptyNode:t},s,n,i,r){let a="{"===n.start.source,o=a?"flow map":"flow sequence",l=new(r?.nodeClass??(a?tn:tr))(s.schema);l.flow=!0;let c=s.atRoot;c&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let u=n.offset+n.start.source.length;for(let r=0;r<n.items.length;++r){let c=n.items[r],{start:h,key:f,sep:d,value:p}=c,m=t9(h,{flow:o,indicator:"explicit-key-ind",next:f??d?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!m.found){if(!m.anchor&&!m.tag&&!d&&!p){0===r&&m.comma?i(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):r<n.items.length-1&&i(m.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),m.comment&&(l.comment?l.comment+="\n"+m.comment:l.comment=m.comment),u=m.end;continue}!a&&s.options.strict&&t3(f)&&i(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)m.comma&&i(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(m.comma||i(m.start,"MISSING_CHAR",`Missing , between ${o} items`),m.comment){let e="";e:for(let t of h)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=l.items[l.items.length-1];el(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,m.comment=m.comment.substring(e.length+1)}}if(a||d||m.found){s.atKey=!0;let r=m.end,g=f?e(s,f,m,i):t(s,r,h,null,m,i);se(f)&&i(g.range,"BLOCK_IN_FLOW",t5),s.atKey=!1;let y=t9(d??[],{flow:o,indicator:"map-value-ind",next:p,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(y.found){if(!a&&!m.found&&s.options.strict){if(d)for(let e of d){if(e===y.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}m.start<y.found.offset-1024&&i(y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else p&&("source"in p&&p.source?.[0]===":"?i(p,"MISSING_CHAR",`Missing space after : in ${o}`):i(y.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let b=p?e(s,p,y,i):y.found?t(s,y.end,d,null,y,i):null;b?se(p)&&i(b.range,"BLOCK_IN_FLOW",t5):y.comment&&(g.comment?g.comment+="\n"+y.comment:g.comment=y.comment);let w=new e5(g,b);if(s.options.keepSourceTokens&&(w.srcToken=c),a)t4(s,l.items,g)&&i(r,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(w);else{let e=new tn(s.schema);e.flow=!0,e.items.push(w);let t=(b??g).range;e.range=[g.range[0],t[1],t[2]],l.items.push(e)}u=b?b.range[2]:y.end}else{let n=p?e(s,p,m,i):t(s,m.end,d,null,m,i);l.items.push(n),u=n.range[2],se(p)&&i(n.range,"BLOCK_IN_FLOW",t5)}}let h=a?"}":"]",[f,...d]=n.end,p=u;if(f?.source===h)p=f.offset+f.source.length;else{let e=o[0].toUpperCase()+o.substring(1),t=c?`${e} must end with a ${h}`:`${e} in block collection must be sufficiently indented and end with a ${h}`;i(u,c?"MISSING_CHAR":"BAD_INDENT",t),f&&1!==f.source.length&&d.unshift(f)}if(d.length>0){let e=t7(d,p,s.options.strict,i);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[n.offset,p,e.offset]}else l.range=[n.offset,p,p];return l}(e,t,s,n,r),o=a.constructor;return"!"===i||i===o.tagName?a.tag=o.tagName:i&&(a.tag=i),a}function ss(e,t,s){let n=t.offset,i=function({offset:e,props:t},s,n){if("block-scalar-header"!==t[0].type)return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],a=0,o="",l=-1;for(let t=1;t<i.length;++t){let s=i[t];if(o||"-"!==s&&"+"!==s){let n=Number(s);!a&&n?a=n:-1===l&&(l=e+t)}else o=s}-1!==l&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",h=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case"space":c=!0;case"newline":h+=i.source.length;break;case"comment":s&&!c&&n(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=i.source.length,u=i.source.substring(1);break;case"error":n(i,"UNEXPECTED_TOKEN",i.message),h+=i.source.length;break;default:{let e=`Unexpected token in block scalar header: ${i.type}`;n(i,"UNEXPECTED_TOKEN",e);let t=i.source;t&&"string"==typeof t&&(h+=t.length)}}}return{mode:r,indent:a,chomp:o,comment:u,length:h}}(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=">"===i.mode?eq.BLOCK_FOLDED:eq.BLOCK_LITERAL,a=t.source?function(e){let t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),i=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[],o=a.length;for(let e=a.length-1;e>=0;--e){let t=a[e][1];if(""===t||"\r"===t)o=e;else break}if(0===o){let e="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"",s=n+i.length;return t.source&&(s+=t.source.length),{value:e,type:r,comment:i.comment,range:[n,s,s]}}let l=t.indent+i.indent,c=t.offset+i.length,u=0;for(let t=0;t<o;++t){let[n,r]=a[t];if(""===r||"\r"===r)0===i.indent&&n.length>l&&(l=n.length);else{n.length<l&&s(c+n.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),0===i.indent&&(l=n.length),u=t,0!==l||e.atRoot||s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=n.length+r.length+1}for(let e=a.length-1;e>=o;--e)a[e][0].length>l&&(o=e+1);let h="",f="",d=!1;for(let e=0;e<u;++e)h+=a[e][0].slice(l)+"\n";for(let e=u;e<o;++e){let[t,n]=a[e];c+=t.length+n.length+1;let o="\r"===n[n.length-1];if(o&&(n=n.slice(0,-1)),n&&t.length<l){let e=i.indent?"explicit indentation indicator":"first line",r=`Block scalar lines must not be less indented than their ${e}`;s(c-n.length-(o?2:1),"BAD_INDENT",r),t=""}r===eq.BLOCK_LITERAL?(h+=f+t.slice(l)+n,f="\n"):t.length>l||" "===n[0]?(" "===f?f="\n":d||"\n"!==f||(f="\n\n"),h+=f+t.slice(l)+n,f="\n",d=!0):""===n?"\n"===f?h+="\n":f="\n":(h+=f+n,f=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=o;e<a.length;++e)h+="\n"+a[e][0].slice(l);"\n"!==h[h.length-1]&&(h+="\n");break;default:h+="\n"}let p=n+i.length+t.source.length;return{value:h,type:r,comment:i.comment,range:[n,p,p]}}function sn(e,t,s){let n,i,{offset:r,type:a,source:o,end:l}=e,c=(e,t,n)=>s(r+e,t,n);switch(a){case"scalar":n=eq.PLAIN,i=function(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":s=`block scalar indicator ${e[0]}`;break;case"@":case"`":s=`reserved character ${e[0]}`}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),si(e)}(o,c);break;case"single-quoted-scalar":var u,h;n=eq.QUOTE_SINGLE,u=o,h=c,("'"!==u[u.length-1]||1===u.length)&&h(u.length,"MISSING_CHAR","Missing closing 'quote"),i=si(u.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":n=eq.QUOTE_DOUBLE,i=function(e,t){let s="";for(let n=1;n<e.length-1;++n){let i=e[n];if("\r"!==i||"\n"!==e[n+1])if("\n"===i){let{fold:t,offset:i}=function(e,t){let s="",n=e[t+1];for(;(" "===n||" "===n||"\n"===n||"\r"===n)&&("\r"!==n||"\n"===e[t+2]);)"\n"===n&&(s+="\n"),t+=1,n=e[t+1];return s||(s=" "),{fold:s,offset:t}}(e,n);s+=t,n=i}else if("\\"===i){let i=e[++n],r=sr[i];if(r)s+=r;else if("\n"===i)for(i=e[n+1];" "===i||" "===i;)i=e[++n+1];else if("\r"===i&&"\n"===e[n+1])for(i=e[++n+1];" "===i||" "===i;)i=e[++n+1];else if("x"===i||"u"===i||"U"===i){let r="x"===i?2:"u"===i?4:8;s+=function(e,t,s,n){let i=e.substr(t,s),r=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(r)}catch{let i=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}(e,n+1,r,t),n+=r}else{let i=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),s+=i}}else if(" "===i||" "===i){let t=n,r=e[n+1];for(;" "===r||" "===r;)r=e[++n+1];"\n"!==r&&("\r"!==r||"\n"!==e[n+2])&&(s+=n>t?e.slice(t,n+1):i)}else s+=i}return('"'!==e[e.length-1]||1===e.length)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}(o,c);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let f=r+o.length,d=t7(l,f,t,s);return{value:i,type:n,comment:d.comment,range:[r,f,d.offset]}}function si(e){let t,s;try{t=RegExp("(.*?)(?<![ ])[ ]*\r?\n","sy"),s=RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],r=" ",a=t.lastIndex;for(s.lastIndex=a;n=s.exec(e);)""===n[1]?"\n"===r?i+=r:r="\n":(i+=r+n[1],r=" "),a=s.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,n=o.exec(e),i+r+(n?.[1]??"")}let sr={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function sa(e,t,s,n){let i,r,{value:a,type:o,comment:l,range:c}="block-scalar"===t.type?ss(e,t,n):sn(t,e.options.strict,n),u=s?e.directives.tagName(s.source,e=>n(s,"TAG_RESOLVE_FAILED",e)):null;i=e.options.stringKeys&&e.atKey?e.schema[es]:u?function(e,t,s,n,i){if("!"===s)return e[es];let r=[];for(let t of e.tags)if(!t.collection&&t.tag===s)if(!t.default||!t.test)return t;else r.push(t);for(let e of r)if(e.test?.test(t))return e;let a=e.knownTags[s];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,"tag:yaml.org,2002:str"!==s),e[es])}(e.schema,a,u,s,n):"scalar"===t.type?function({atKey:e,directives:t,schema:s},n,i,r){let a=s.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n))||s[es];if(s.compat){let e=s.compat.find(e=>e.default&&e.test?.test(n))??s[es];if(a.tag!==e.tag){let s=t.tagString(a.tag),n=t.tagString(e.tag);r(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${s} or ${n}`,!0)}}return a}(e,a,t,n):e.schema[es];try{let o=i.resolve(a,e=>n(s??t,"TAG_RESOLVE_FAILED",e),e.options);r=ec(o)?o:new eq(o)}catch(e){n(s??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),r=new eq(a)}return r.range=c,r.source=a,o&&(r.type=o),u&&(r.tag=u),i.format&&(r.format=i.format),l&&(r.comment=l),r}let so={composeNode:sl,composeEmptyNode:sc};function sl(e,t,s,n){let i,r=e.atKey,{spaceBefore:a,comment:o,anchor:l,tag:c}=s,u=!0;switch(t.type){case"alias":i=function({options:e},{offset:t,source:s,end:n},i){let r=new e$(s.substring(1));""===r.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+s.length,o=t7(n,a,e.strict,i);return r.range=[t,a,o.offset],o.comment&&(r.comment=o.comment),r}(e,t,n),(l||c)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":i=sa(e,t,c,n),l&&(i.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{i=function(e,t,s,n,i){let r=n.tag,a=r?t.directives.tagName(r.source,e=>i(r,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===s.type){let{anchor:e,newlineAfterProp:t}=n,s=e&&r?e.offset>r.offset?e:r:e??r;s&&(!t||t.offset<s.offset)&&i(s,"MISSING_CHAR","Missing newline after block sequence props")}let o="block-map"===s.type?"map":"block-seq"===s.type?"seq":"{"===s.start.source?"map":"seq";if(!r||!a||"!"===a||a===tn.tagName&&"map"===o||a===tr.tagName&&"seq"===o)return st(e,t,s,i,a);let l=t.schema.tags.find(e=>e.tag===a&&e.collection===o);if(!l){let n=t.schema.knownTags[a];if(n?.collection!==o)return n?i(r,"BAD_COLLECTION_TYPE",`${n.tag} used for ${o} collection, but expects ${n.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),st(e,t,s,i,a);t.schema.tags.push(Object.assign({},n,{default:!1})),l=n}let c=st(e,t,s,i,a,l),u=l.resolve?.(c,e=>i(r,"TAG_RESOLVE_FAILED",e),t.options)??c,h=ef(u)?u:new eq(u);return h.range=c.range,h.tag=a,l?.format&&(h.format=l.format),h}(so,e,t,s,n),l&&(i.anchor=l.source.substring(1))}catch(e){n(t,"RESOURCE_EXHAUSTION",e instanceof Error?e.message:String(e))}break;default:{let e="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",e),u=!1}}return i??(i=sc(e,t.offset,void 0,null,s,n)),l&&""===i.anchor&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ec(i)||"string"!=typeof i.value||i.tag&&"tag:yaml.org,2002:str"!==i.tag)&&n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(i.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?i.comment=o:i.commentBefore=o),e.options.keepSourceTokens&&u&&(i.srcToken=t),i}function sc(e,t,s,n,{spaceBefore:i,comment:r,anchor:a,tag:o,end:l},c){let u=sa(e,{type:"scalar",offset:function(e,t,s){if(t){s??(s=t.length);for(let n=s-1;n>=0;--n){let s=t[n];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++n];s?.type==="space";)e+=s.source.length,s=t[++n];break}}return e}(t,s,n),indent:-1,source:""},o,c);return a&&(u.anchor=a.source.substring(1),""===u.anchor&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function su(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];let{offset:t,source:s}=e;return[t,t+("string"==typeof s?s.length:1)]}function sh(e){let t="",s=!1,n=!1;for(let i=0;i<e.length;++i){let r=e[i];switch(r[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(r.substring(1)||" "),s=!0,n=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:t,afterEmptyLine:n}}class sf{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,s,n)=>{let i=su(e);n?this.warnings.push(new t1(i,t,s)):this.errors.push(new t0(i,t,s))},this.directives=new e_({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:n}=sh(this.prelude);if(s){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
31
+ ${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(eh(i)&&!i.flow&&i.items.length>0){let e=i.items[0];el(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${s}
32
+ ${t}`:s}else{let e=i.commentBefore;i.commentBefore=e?`${s}
33
+ ${e}`:s}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:sh(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let t of e)yield*this.next(t);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=su(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:s,start:n,value:i,end:r},a){let o=new tz(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},c=t9(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:a,parentIndent:0,startOnNewline:!0});c.found&&(o.directives.docStart=!0,i&&("block-map"===i.type||"block-seq"===i.type)&&!c.hasNewline&&a(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=i?sl(l,i,c,a):sc(l,c.end,n,null,c,a);let u=o.contents.range[2],h=t7(r,u,!1,a);return h.comment&&(o.comment=h.comment),o.range=[s,u,h.offset],o}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new t0(su(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new t0(su(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=t7(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
34
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new t0(su(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new tz(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function sd(e,t=!0,s){if(e){let n=(e,t,n)=>{let i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(s)s(i,t,n);else throw new t0([i,i+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return sn(e,t,n);case"block-scalar":return ss({options:{strict:t}},e,n)}}return null}function sp(e,t){let{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:a="PLAIN"}=t,o=eZ({type:a,value:e},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:"\n"}];switch(o[0]){case"|":case">":{let e=o.indexOf("\n"),t=o.substring(0,e),s=o.substring(e+1)+"\n",i=[{type:"block-scalar-header",offset:r,indent:n,source:t}];return sg(i,l)||i.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:r,indent:n,props:i,source:s}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:o,end:l};default:return{type:"scalar",offset:r,indent:n,source:o,end:l}}}function sm(e,t,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:a}=s,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");a=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=eZ({type:a,value:t},{implicitKey:i||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let s=t.indexOf("\n"),n=t.substring(0,s),i=t.substring(s+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=n,e.source=i}else{let{offset:t}=e,s="indent"in e?e.indent:-1,r=[{type:"block-scalar-header",offset:t,indent:s,source:n}];for(let t of(sg(r,"end"in e?e.end:void 0)||r.push({type:"newline",offset:-1,indent:s,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:s,props:r,source:i})}}(e,l);break;case'"':sy(e,l,"double-quoted-scalar");break;case"'":sy(e,l,"single-quoted-scalar");break;default:sy(e,l,"scalar")}}function sg(e,t){if(t)for(let s of t)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function sy(e,t,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length),n))t.offset+=i;delete e.props,Object.assign(e,{type:s,source:t,end:n});break}case"block-map":case"block-seq":{let n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:s,source:t,end:[n]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}let sb=e=>"type"in e?sw(e):sk(e);function sw(e){switch(e.type){case"block-scalar":{let t="";for(let s of e.props)t+=sw(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(let s of e.items)t+=sk(s);return t}case"flow-collection":{let t=e.start.source;for(let s of e.items)t+=sk(s);for(let s of e.end)t+=s.source;return t}case"document":{let t=sk(e);if(e.end)for(let s of e.end)t+=s.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let s of e.end)t+=s.source;return t}}}function sk({start:e,key:t,sep:s,value:n}){let i="";for(let t of e)i+=t.source;if(t&&(i+=sw(t)),s)for(let e of s)i+=e.source;return n&&(i+=sw(n)),i}let sv=Symbol("break visit"),sS=Symbol("skip children"),sE=Symbol("remove item");function sT(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,s,n){let i=n(s,t);if("symbol"==typeof i)return i;for(let r of["key","value"]){let a=s[r];if(a&&"items"in a){for(let s=0;s<a.items.length;++s){let i=e(Object.freeze(t.concat([[r,s]])),a.items[s],n);if("number"==typeof i)s=i-1;else{if(i===sv)return sv;i===sE&&(a.items.splice(s,1),s-=1)}}"function"==typeof i&&"key"===r&&(i=i(s,t))}}return"function"==typeof i?i(s,t):i}(Object.freeze([]),e,t)}sT.BREAK=sv,sT.SKIP=sS,sT.REMOVE=sE,sT.itemAtPath=(e,t)=>{let s=e;for(let[e,n]of t){let t=s?.[e];if(!t||!("items"in t))return;s=t.items[n]}return s},sT.parentCollection=(e,t)=>{let s=sT.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};let sx=e=>!!e&&"items"in e,s_=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type);function sN(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}}function sO(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}e.s(["BOM",()=>"\uFEFF","DOCUMENT",()=>"\x02","FLOW_END",()=>"\x18","SCALAR",()=>"\x1f","isCollection",()=>sx,"isScalar",()=>s_,"prettyToken",()=>sN,"tokenType",()=>sO],778514),e.i(778514),e.s(["BOM",()=>"\uFEFF","DOCUMENT",()=>"\x02","FLOW_END",()=>"\x18","SCALAR",()=>"\x1f","createScalarToken",()=>sp,"isCollection",()=>sx,"isScalar",()=>s_,"prettyToken",()=>sN,"resolveAsScalar",()=>sd,"setScalarValue",()=>sm,"stringify",()=>sb,"tokenType",()=>sO,"visit",()=>sT],178465);var sI=e.i(178465);function sA(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let sC=new Set("0123456789ABCDEFabcdef"),sL=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),s$=new Set(",[]{}"),sM=new Set(" ,[]{}\n\r "),sq=e=>!e||sM.has(e);class sR{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;" "===t;)t=this.buffer[++s+e];if("\r"===t){let t=this.buffer[s+e+1];if("\n"===t||!t&&!this.atEnd)return e+s+1}return"\n"!==t&&!(s>=this.indentNext)&&(t||this.atEnd)?-1:e+s}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&sA(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,s=e.indexOf("#");for(;-1!==s;){let n=e[s-1];if(" "===n||" "===n){t=s-1;break}s=e.indexOf("#",s+1)}for(;;){let s=e[t-1];if(" "===s||" "===s)t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&sA(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!sA(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&sA(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(sq),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==s&&s<this.indentNext&&"#"!==n[0]||0===s&&(n.startsWith("---")||n.startsWith("..."))&&sA(n[3]))&&(s!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let i=0;for(;","===n[i];)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[i+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(sq),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||sA(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),n=s.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){let e=this.continueScalar(n+1);if(-1===e)break;n=s.indexOf("\n",e)}-1!==n&&(t=n-("\r"===s[n-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>sA(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,s=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":s+=1;break;case"\n":t=n,s=0;break;case"\r":{let e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=s:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);let i=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+s>i)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,s=this.pos-1,n=this.pos-1;for(;e=this.buffer[++n];)if(":"===e){let e=this.buffer[n+1];if(sA(e)||t&&s$.has(e))break;s=n}else if(sA(e)){let i=this.buffer[n+1];if("\r"===e&&("\n"===i?(n+=1,e="\n",i=this.buffer[n+1]):s=n),"#"===i||t&&s$.has(i))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&s$.has(e))break;s=n}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(s+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(sq),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(sA(s)||t&&s$.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!sA(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(sL.has(t))t=this.buffer[++e];else if("%"===t&&sC.has(this.buffer[e+1])&&sC.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,s=this.pos-1;do t=this.buffer[++s];while(" "===t||e&&" "===t)let n=s-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=s),n}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class sB{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let n=t+s>>1;this.lineStarts[n]<e?t=n+1:s=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function sj(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function sP(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function sD(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function sK(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function sU(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function sF(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let s=0;s<t.length;++s)e.push(t[s])}function sW(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||sj(t.start,"explicit-key-ind")||sj(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,sD(t.value)?t.value.end?sF(t.value.end,t.sep):t.value.end=t.sep:sF(t.start,t.sep),delete t.sep)}class sJ{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new sR,this.onNewLine=e}*parse(e,t=!1){for(let s of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=sO(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&sW(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let s=e.items[e.items.length-1];if(s.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=e.items[e.items.length-1];s.value?e.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=e.items[e.items.length-1];!s||s.value?e.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&-1===sP(s.start)&&(0===t.indent||s.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=s.start:e.items.push({start:s.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==sP(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,s=sU(sK(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0,n=Array.isArray(s)?s[s.length-1]:void 0;n?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2],n=s?.value?.end;if(Array.isArray(n)){sF(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,i=[];if(n&&t.sep&&!t.value){let s=[];for(let n=0;n<t.sep.length;++n){let i=t.sep[n];switch(i.type){case"newline":s.push(n);break;case"space":break;case"comment":i.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?n||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(sj(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(sD(t.key)&&!sj(t.sep,"newline")){let e=sU(t.start),s=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:s,sep:n}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(sj(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=sU(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:i,key:null,sep:[this.sourceToken]}):sj(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);n||t.value?(e.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!sj(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else s&&e.items.push({start:i});this.stack.push(n);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0,n=Array.isArray(s)?s[s.length-1]:void 0;n?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2],n=s?.value?.end;if(Array.isArray(n)){sF(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||sj(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let s=sU(sK(t));sW(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=sU(sK(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=sU(sK(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function sQ(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new sB||null,prettyErrors:t}}function sV(e,t={}){let{lineCounter:s,prettyErrors:n}=sQ(t),i=new sJ(s?.addNewLine),r=new sf(t),a=Array.from(r.compose(i.parse(e)));if(n&&s)for(let t of a)t.errors.forEach(t2(e,s)),t.warnings.forEach(t2(e,s));return a.length>0?a:Object.assign([],{empty:!0},r.streamInfo())}function sG(e,t={}){let{lineCounter:s,prettyErrors:n}=sQ(t),i=new sJ(s?.addNewLine),r=new sf(t),a=null;for(let t of r.compose(i.parse(e),!0,e.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new t0(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=t;return n&&s&&(a.errors.forEach(t2(e,s)),a.warnings.forEach(t2(e,s))),a}function sY(e,t,s){let n;"function"==typeof t?n=t:void 0===s&&t&&"object"==typeof t&&(s=t);let i=sG(e,s);if(!i)return null;if(i.warnings.forEach(e=>e2(i.options.logLevel,e)),i.errors.length>0)if("silent"!==i.options.logLevel)throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},s))}function sH(e,t,s){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===s&&t&&(s=t),"string"==typeof s&&(s=s.length),"number"==typeof s){let e=Math.round(s);s=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=s??t??{};if(!e)return}return ea(e)&&!n?e.toString(s):new tz(e,n,s).toString(s)}e.s([],480375),e.i(480375),e.s(["Alias",()=>e$,"CST",0,sI,"Composer",()=>sf,"Document",()=>tz,"Lexer",()=>sR,"LineCounter",()=>sB,"Pair",()=>e5,"Parser",()=>sJ,"Scalar",()=>eq,"Schema",()=>tH,"YAMLError",()=>tZ,"YAMLMap",()=>tn,"YAMLParseError",()=>t0,"YAMLSeq",()=>tr,"YAMLWarning",()=>t1,"isAlias",()=>er,"isCollection",()=>eh,"isDocument",()=>ea,"isMap",()=>eo,"isNode",()=>ef,"isPair",()=>el,"isScalar",()=>ec,"isSeq",()=>eu,"parse",()=>sY,"parseAllDocuments",()=>sV,"parseDocument",()=>sG,"stringify",()=>sH,"visit",()=>ey,"visitAsync",()=>ew],175603),e.i(175603),e.i(159878);e.i(129155);var sz=e.i(49893);sz.Type.Object({command:sz.Type.String({description:"Bash command to execute"}),timeout:sz.Type.Optional(sz.Type.Number({description:"Timeout in seconds (optional, no default timeout)"}))}),new WeakMap;let sX=sz.Type.Object({oldText:sz.Type.String({description:"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."}),newText:sz.Type.String({description:"Replacement text for this targeted edit."})},{});sz.Type.Object({path:sz.Type.String({description:"Path to the file to edit (relative or absolute)"}),edits:sz.Type.Array(sX,{description:"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."})},{}),sz.Type.Object({path:sz.Type.String({description:"Path to the file to read (relative or absolute)"}),offset:sz.Type.Optional(sz.Type.Number({description:"Line number to start reading from (1-indexed)"})),limit:sz.Type.Optional(sz.Type.Number({description:"Maximum number of lines to read"}))}),sz.Type.Object({path:sz.Type.String({description:"Path to the file to write (relative or absolute)"}),content:sz.Type.String({description:"Content to write to the file"})}),e.i(32977).EventStream,e.s([],12340)},154003,421320,e=>{"use strict";e.i(12340);var t=e.i(687339),s=e.i(463608),n=e.i(373662),i=e.i(49893),r=e.i(147182),a=e.i(625013);function o(e){return{content:[{type:"text",text:e}],details:{}}}function l(e,t){return e.stageUnits(t).flatMap(t=>{if(t.approved||t.outdated)return[];let s=e.currentVerdictOf(t.id);return s?.verdict==="reject"?[{unitId:t.id,reason:s.reason}]:[]})}function c(e,t={}){let{moduleName:s}=t,n=r.CANONICAL_WORKFLOW.filter(e=>e!==a.WorkflowStage.Code),u=e=>{let t=n.find(t=>t===e);if(null==t)throw Error(`Unknown stage ${e}. Valid stages: ${n.join(", ")}.`);return t};return[{name:"get_workflow_state",label:"Get workflow state",description:`${null==s?"":"Get the module the person has open in Requireganizer, which every tool reads and submits to, and its workflow state. "}Get the frontier (the first stage that is not complete; only it and earlier stages can change) and each stage's status: pending, completed, outdated, needs-approval, waiting (holds work, read-only until the frontier reaches it), or locked. Each stage lists its outdated items, which must be regenerated, its unapproved review units, and the reviewer model's rejections of them. Inputs that changed since the stage acknowledged them are listed by id; read them with get_input_changes.`,parameters:i.Type.Object({}),execute:async()=>{let t=n.map(t=>{let s=e.stageUnits(t);return{stage:t,label:a.WORKFLOW_STAGE_LABELS[t],status:e.getStepStatus(t),hasArtifacts:e.hasStepArtifacts(t),outdatedItemIds:s.filter(({outdated:e})=>e).map(({id:e})=>e),unapprovedUnitIds:s.filter(({approved:e,outdated:t})=>!e&&!t).map(({id:e})=>e),reviewerRejections:l(e,t),changedInputIds:e.changedInputIds(t),mechanicalIssues:e.mechanicalIssuesForStage(t).map(({itemId:e,message:t})=>({itemId:e,message:t}))}});return o(JSON.stringify({...null==s?{}:{module:s},frontier:e.frontier,stages:t}))}},{name:"get_stage_artifacts",label:"Get stage artifacts",description:'Get the full JSON serialization of the current artifacts up to and including one workflow stage. Stages use kebab-case names matching the workflow (e.g. "product-overview", "boundary-design").',parameters:i.Type.Object({stage:i.Type.String({description:"The workflow stage to read."})}),execute:async(t,s)=>{let{stage:n}=s;return o(e.json(u(n)))}},{name:"get_input_changes",label:"Get input changes",description:"Get every input of one stage that changed since the stage acknowledged its inputs: each entry has the input's id and its content before and after (null when it did not exist).",parameters:i.Type.Object({stage:i.Type.String({description:"The workflow stage whose changed inputs to read."})}),execute:async(t,s)=>{let{stage:n}=s;return o(JSON.stringify(e.inputChanges(u(n))))}},{name:"get_scaffold_files",label:"Get scaffold files",description:"List generated scaffold files with their paths and contents. Pass a path to read one file; omit the path to list all files.",parameters:i.Type.Object({path:i.Type.Optional(i.Type.String({description:"An exact scaffold file path."}))}),execute:async(t,s)=>{let{path:n}=s;if(null!=n){let t=e.scaffoldFiles.find(({path:e})=>e===n);if(null==t)throw Error(`No scaffold file at ${n}.`);return o(JSON.stringify(t))}return o(JSON.stringify(e.scaffoldFiles.map(({path:e,content:t})=>({path:e,content:t}))))}}]}e.s(["buildReadTools",()=>c,"reviewerRejections",()=>l],421320);var u=e.i(266847),h=e.i(323329);let f=null;function d(e){f=e}function p(e,t,s,n,i){if(0===s.turns)return[];let r=s.usage.reduce((e,t)=>({inputTokens:e.inputTokens+t.input,cachedInputTokens:e.cachedInputTokens+t.cacheRead,outputTokens:e.outputTokens+t.output,totalTokens:e.totalTokens+t.totalTokens}),{inputTokens:0,cachedInputTokens:0,outputTokens:0,totalTokens:0});return[{operation:e,attempt:1,promptVersion:"agent-conversation.1",protocolVersion:6,startedAt:new Date(t).toISOString(),durationMs:Date.now()-t,provider:i.provider,model:i.id,outcome:n,toolCallCount:0,finishReason:"success"===n?"stop":void 0,errorCode:"failed"===n?"agent_run_failed":void 0,usage:r}]}function m(e,s){let i;return new t.Agent({initialState:{systemPrompt:(i=r.CANONICAL_WORKFLOW.filter(e=>e!==a.WorkflowStage.Code).map(e=>`- ${a.WORKFLOW_STAGE_LABELS[e]}`).join("\n"),`You are Requireganizer's engineering agent. You drive a contract-first software specification workflow together with the user.
35
+
36
+ ## Workflow stages
37
+
38
+ ${i}
39
+
40
+ Each stage consumes the complete stages before it. The frontier is the first stage that is not complete; only the frontier and earlier stages can change, and later stages are read-only until the frontier reaches them. Generate produces draft, and every item is approved before its stage is complete. Never skip ahead: if the stage you need is after the frontier, say so and stop instead of guessing.
41
+
42
+ An item is outdated when an item it references changed since it was generated. Regenerate every outdated item before anything else in its stage: keep it word for word when the change does not affect it. Every regenerated item returns to draft, kept or changed.
43
+
44
+ ## How turns work
45
+
46
+ The user sends short JSON commands such as {"kind":"generate","stage":"requirements"}, {"kind":"revise","stage":"user-stories","comment":"..."}, or {"kind":"comment","id":"...","comment":"..."}.
47
+
48
+ - Commands tell you WHEN to work; they contain no stored artifact content.
49
+ - A generate command may include "seed": one-time starting intent for this Product Overview draft only. It is kept as revision 0 provenance on the project, outside every stage. Use it for this turn, then rely on submitted overview artifacts and tool reads.
50
+ - The Product Overview's name, once set, is the name the person gave the project or module: keep it. A rename goes through a comment on the Name field.
51
+ - Before producing or changing anything, read the current project state with your read tools (get_workflow_state, get_stage_artifacts, get_input_changes, get_scaffold_files). Never assume artifact content from memory of earlier turns; always re-read what you will modify or reference. To see what changed in a stage's inputs, read get_input_changes for that stage.
52
+ - Produce results by calling exactly one result tool ("submit_*") with the complete proposal for the stage. Do not paste proposals as chat text.
53
+ - If the submit tool for the stage you need is not in your toolset, call activate_stage_result_tool with that stage to unlock it (prerequisites are validated), then submit. Do not ask the user to unlock tools for you.
54
+ - If essential information is missing, contradictory, or unsafe to infer, call the communicate tool with one concise question instead of guessing.
55
+ - After a result tool succeeds, reply with at most two sentences summarizing what changed.
56
+
57
+ ## Quality
58
+
59
+ The submit tool for the current stage states that stage's quality contract. Satisfy it before submitting. Graph errors (unknown IDs, missing coverage, cycles, empty required fields) come back from the tool; fix those exactly and resubmit. Never weaken the proposal to dodge a validator.
60
+
61
+ Respect revision isolation: when revising, change only the requested target and keep every other artifact byte-stable.
62
+
63
+ Output prose is for the user, not for artifact storage. Keep it brief.`),model:(0,h.writerModel)(),thinkingLevel:"high",tools:[],messages:e.conversation??[]},streamFn:s??(0,n.gatewayStream)(),...null!=f&&{sessionId:f},prepareNextTurnWithContext:e=>{let t=(0,u.consumePendingStageUnlock)();if(null==t)return;let s=e.context.tools??[],n=[...s,...t.filter(e=>!s.some(t=>t.name===e.name))];return{context:{...e.context,tools:n}}}})}function g(e){return[...c(e),...(0,u.buildStageSubmissionTools)(e).map(({tool:e})=>e),(0,u.buildStageActivationTool)(e),(0,u.buildCommunicateTool)(e)]}async function y(e,t,n,i){!function(e,t){let s=[...e.conversation??[]],n=-1;for(let e=s.length-1;e>=0;e-=1){let i=s[e];if("user"===i.role){(function(e){if("user"!==e.role)return;let t=e.content;if(!Array.isArray(t))return;let s=t[0];return"string"==typeof s?s:null!=s&&"object"==typeof s&&"text"in s?String(s.text):void 0})(i)===t&&(n=e);break}}if(n<0)return;let i=s.slice(n+1),r=i.every(e=>"assistant"===e.role||"toolResult"===e.role),a=i[i.length-1],o=0===i.length||a?.role==="assistant"&&"error"===a.stopReason;r&&o&&e.setConversation(s.slice(0,n))}(e,(0,s.renderCommand)(n));let r=g(e),a=(0,u.buildResultTools)(e,n).filter(e=>!r.some(t=>t.name===e.name));await w(e,t,(0,s.renderCommand)(n),[...r,...a],i)}async function b(e,t,s,n){await w(e,t,s,g(e),n)}async function w(e,t,s,n,i){let r,a,o,l=m(e,i);e.setActiveAgent(l);let c={usage:[],turns:0},u=[...e.conversation??[]],h=l.subscribe((r=0,a="",o=(t=!1)=>{let s=Date.now();(t||!(s-r<80))&&(r=s,a.length>0&&(e.appendThinking(a),a=""),e.setConversation([...u]))},t=>{switch(t.type){case"turn_start":e.beginThinkingSegment();break;case"message_start":u.push(t.message),o(!0);break;case"message_update":{let e=t.assistantMessageEvent;("thinking_delta"===e.type||"text_delta"===e.type)&&(a+=e.delta),u.length>0&&(u[u.length-1]=t.message),o();break}case"message_end":u.length>0&&(u[u.length-1]=t.message),o(!0);break;case"tool_execution_start":e.appendThinking(`
64
+ [tool: ${t.toolName}]
65
+ `);break;case"turn_end":{c.turns+=1;let e=t.message;"assistant"===e.role&&c.usage.push(e.usage)}}})),f=Date.now();try{l.state.tools=n,null==s?await l.continue():await l.prompt(s),e.setConversation(l.state.messages);let i=[...l.state.messages].reverse().find(e=>"assistant"===e.role);if(null!=i&&"assistant"===i.role){if("aborted"===i.stopReason)return;if("error"===i.stopReason)throw e.recordProviderCalls(p(t,f,c,"failed",l.state.model)),Error(i.errorMessage??"The AI request failed.")}e.recordProviderCalls(p(t,f,c,"success",l.state.model))}finally{h(),e.clearActiveAgent()}}e.s(["getProjectAgent",()=>m,"recordedMetadata",()=>p,"runAgentCommand",()=>y,"runConversationTurn",()=>b,"setAgentSessionId",()=>d],154003)}]);