@highstate/designer 0.9.16 → 0.9.18

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 (517) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/0A0GXgOL.js +13 -0
  3. package/.output/public/_nuxt/1DNp92w6.js +1 -0
  4. package/.output/public/_nuxt/2EtD6e53.js +1 -0
  5. package/.output/public/_nuxt/2UxHyX5q.js +1 -0
  6. package/.output/public/_nuxt/3e1v2bzS.js +1 -0
  7. package/.output/public/_nuxt/4A_iFExJ.js +1 -0
  8. package/.output/public/_nuxt/5bLW0GMw.js +1 -0
  9. package/.output/public/_nuxt/5i3qLPDT.js +1 -0
  10. package/.output/public/_nuxt/6nHXG8SA.js +1 -0
  11. package/.output/public/_nuxt/84XNjSIe.js +1 -0
  12. package/.output/public/_nuxt/85-TOEBH.js +1 -0
  13. package/.output/public/_nuxt/9ZFiTIhr.js +1 -0
  14. package/.output/public/_nuxt/B-hkwWGT.js +1 -0
  15. package/.output/public/_nuxt/B0m2ddpp.js +1 -0
  16. package/.output/public/_nuxt/B1dDrJ26.js +1 -0
  17. package/.output/public/_nuxt/B1yitclQ.js +1 -0
  18. package/.output/public/_nuxt/B5ZR69Tn.js +1 -0
  19. package/.output/public/_nuxt/B6aJPvgy.js +1 -0
  20. package/.output/public/_nuxt/B7grBCAR.js +1 -0
  21. package/.output/public/_nuxt/B7mTdjB0.js +1 -0
  22. package/.output/public/_nuxt/BBGuKPBd.js +1 -0
  23. package/.output/public/_nuxt/BDzgwa52.js +1 -0
  24. package/.output/public/_nuxt/BE2KfCdU.js +1 -0
  25. package/.output/public/_nuxt/BEDo0Tqx.js +1 -0
  26. package/.output/public/_nuxt/BERRCDM3.js +1 -0
  27. package/.output/public/_nuxt/BETggiCN.js +1 -0
  28. package/.output/public/_nuxt/BEwlwnbL.js +1 -0
  29. package/.output/public/_nuxt/BFfxhgS-.js +1 -0
  30. package/.output/public/_nuxt/BGHREFWD.js +1 -0
  31. package/.output/public/_nuxt/BGJmEYvX.js +1 -0
  32. package/.output/public/_nuxt/BHrmToEH.js +1 -0
  33. package/.output/public/_nuxt/BIAuTxu3.js +1 -0
  34. package/.output/public/_nuxt/BIGW1oBm.js +1 -0
  35. package/.output/public/_nuxt/BIHI7g3E.js +1 -0
  36. package/.output/public/_nuxt/BKmAPqal.js +1 -0
  37. package/.output/public/_nuxt/BLOpwnqT.js +1 -0
  38. package/.output/public/_nuxt/BLtJtn59.js +1 -0
  39. package/.output/public/_nuxt/BLxL40Jp.js +1 -0
  40. package/.output/public/_nuxt/BM1_JUlF.js +1 -0
  41. package/.output/public/_nuxt/BMMyXqK5.js +1 -0
  42. package/.output/public/_nuxt/BMWR74SV.js +1 -0
  43. package/.output/public/_nuxt/BPzJO5Oe.js +1 -0
  44. package/.output/public/_nuxt/BQ8w6xss.js +1 -0
  45. package/.output/public/_nuxt/BQvybpQq.js +1 -0
  46. package/.output/public/_nuxt/BR7mELCv.js +1 -0
  47. package/.output/public/_nuxt/BRHolxvo.js +1 -0
  48. package/.output/public/_nuxt/BRZ36xJF.js +1 -0
  49. package/.output/public/_nuxt/BTEhxafZ.js +1 -0
  50. package/.output/public/_nuxt/BTJTHyun.js +1 -0
  51. package/.output/public/_nuxt/BU7Cl-8B.js +1 -0
  52. package/.output/public/_nuxt/BV7otONQ.js +1 -0
  53. package/.output/public/_nuxt/BWvSN4gD.js +1 -0
  54. package/.output/public/_nuxt/BXY8tDGw.js +1 -0
  55. package/.output/public/_nuxt/BXkSAIEj.js +1 -0
  56. package/.output/public/_nuxt/BYunw83y.js +1 -0
  57. package/.output/public/_nuxt/B_HjzqPZ.js +1 -0
  58. package/.output/public/_nuxt/B_m7g4N7.js +1 -0
  59. package/.output/public/_nuxt/B_wu9Dqv.js +1 -0
  60. package/.output/public/_nuxt/BbcW6ACK.js +1 -0
  61. package/.output/public/_nuxt/BcOcwvcX.js +1 -0
  62. package/.output/public/_nuxt/BdImnpbu.js +1 -0
  63. package/.output/public/_nuxt/BdnUsdx6.js +1 -0
  64. package/.output/public/_nuxt/BebE75YV.js +1 -0
  65. package/.output/public/_nuxt/BepWV7mh.js +1 -0
  66. package/.output/public/_nuxt/BfHTSMKl.js +1 -0
  67. package/.output/public/_nuxt/BfjtVDDH.js +1 -0
  68. package/.output/public/_nuxt/BgDCqdQA.js +1 -0
  69. package/.output/public/_nuxt/BhOHFoWU.js +1 -0
  70. package/.output/public/_nuxt/Bk5OV074.js +1 -0
  71. package/.output/public/_nuxt/BkPM1oy1.js +1 -0
  72. package/.output/public/_nuxt/BkioyH1T.js +1 -0
  73. package/.output/public/_nuxt/Bkuqu6BP.js +1 -0
  74. package/.output/public/_nuxt/Bl2oy6fF.js +1 -0
  75. package/.output/public/_nuxt/BmXAJ9_W.js +1 -0
  76. package/.output/public/_nuxt/Bm_zuxCd.js +1 -0
  77. package/.output/public/_nuxt/BoKiGodi.js +1 -0
  78. package/.output/public/_nuxt/Bp3cYrEr.js +1 -0
  79. package/.output/public/_nuxt/Bp6g37R7.js +1 -0
  80. package/.output/public/_nuxt/BqTXFGrv.js +1 -0
  81. package/.output/public/_nuxt/BqYA7rlc.js +1 -0
  82. package/.output/public/_nuxt/BsS91CYL.js +1 -0
  83. package/.output/public/_nuxt/BspZqrRM.js +1 -0
  84. package/.output/public/_nuxt/BtCnVYZw.js +1 -0
  85. package/.output/public/_nuxt/BtOb2qkB.js +1 -0
  86. package/.output/public/_nuxt/BthQWCQV.js +1 -0
  87. package/.output/public/_nuxt/BtqSS_iP.js +1 -0
  88. package/.output/public/_nuxt/BtsDLbAf.js +1 -0
  89. package/.output/public/_nuxt/Btyk0a-E.js +1 -0
  90. package/.output/public/_nuxt/Buea-lGh.js +1 -0
  91. package/.output/public/_nuxt/BuidTy5i.js +1 -0
  92. package/.output/public/_nuxt/BvAqAH-y.js +1 -0
  93. package/.output/public/_nuxt/BvYfgXkl.js +1 -0
  94. package/.output/public/_nuxt/Bw305WKR.js +1 -0
  95. package/.output/public/_nuxt/BzJJZx-M.js +1 -0
  96. package/.output/public/_nuxt/C-SQnVFl.js +1 -0
  97. package/.output/public/_nuxt/C-_oQ9hf.js +1 -0
  98. package/.output/public/_nuxt/C0HS_06l.js +1 -0
  99. package/.output/public/_nuxt/C0hk2d4L.js +1 -0
  100. package/.output/public/_nuxt/C151Ov-r.js +1 -0
  101. package/.output/public/_nuxt/C2t-YnRu.js +1 -0
  102. package/.output/public/_nuxt/C39BiMTA.js +1 -0
  103. package/.output/public/_nuxt/C3B-1QV4.js +1 -0
  104. package/.output/public/_nuxt/C3khCPGq.js +1 -0
  105. package/.output/public/_nuxt/C3mMm8J8.js +1 -0
  106. package/.output/public/_nuxt/C4IJs8-o.js +1 -0
  107. package/.output/public/_nuxt/C7Pw0Ztw.js +1 -0
  108. package/.output/public/_nuxt/C8-UwF3o.js +1 -0
  109. package/.output/public/_nuxt/C8M2exoo.js +1 -0
  110. package/.output/public/_nuxt/C8j9CRIf.js +1 -0
  111. package/.output/public/_nuxt/C8lEn-DE.js +1 -0
  112. package/.output/public/_nuxt/C98Dy4si.js +1 -0
  113. package/.output/public/_nuxt/C9XAeP06.js +1 -0
  114. package/.output/public/_nuxt/C9tS-k6U.js +1 -0
  115. package/.output/public/_nuxt/CA7CTBwS.js +1 -0
  116. package/.output/public/_nuxt/CDVJQ6XC.js +1 -0
  117. package/.output/public/_nuxt/CDx5xZoG.js +1 -0
  118. package/.output/public/_nuxt/CEL-wOlO.js +1 -0
  119. package/.output/public/_nuxt/CEu0bR-o.js +1 -0
  120. package/.output/public/_nuxt/CF10PKvl.js +1 -0
  121. package/.output/public/_nuxt/CG8Ifv2g.js +1 -0
  122. package/.output/public/_nuxt/CGqH5EJj.js +1 -0
  123. package/.output/public/_nuxt/CHLpvVh8.js +1 -0
  124. package/.output/public/_nuxt/CHM0blh-.js +1 -0
  125. package/.output/public/_nuxt/CHadp7IV.js +1 -0
  126. package/.output/public/_nuxt/CHh-QcGE.js +1 -0
  127. package/.output/public/_nuxt/CJc9bBzg.js +1 -0
  128. package/.output/public/_nuxt/CKIfxQSi.js +1 -0
  129. package/.output/public/_nuxt/CLvts2aQ.js +1 -0
  130. package/.output/public/_nuxt/CLxacb5B.js +1 -0
  131. package/.output/public/_nuxt/CNBtkm4J.js +6 -0
  132. package/.output/public/_nuxt/CO1LY3CK.js +1 -0
  133. package/.output/public/_nuxt/COEtLSDF.js +1 -0
  134. package/.output/public/_nuxt/COI20M4I.js +1 -0
  135. package/.output/public/_nuxt/COWjEZnb.js +1 -0
  136. package/.output/public/_nuxt/COkxafJQ.js +1 -0
  137. package/.output/public/_nuxt/COt5Ahok.js +1 -0
  138. package/.output/public/_nuxt/CPSgaaQ0.js +1 -0
  139. package/.output/public/_nuxt/CPtXGFXV.js +1 -0
  140. package/.output/public/_nuxt/CS3Unz2-.js +1 -0
  141. package/.output/public/_nuxt/CSXwinHm.js +1 -0
  142. package/.output/public/_nuxt/CTIxkRwW.js +1 -0
  143. package/.output/public/_nuxt/CTRr51gU.js +1 -0
  144. package/.output/public/_nuxt/CTUD0bHN.js +1 -0
  145. package/.output/public/_nuxt/CTWiQX6C.js +1 -0
  146. package/.output/public/_nuxt/CU1B2r8a.js +1 -0
  147. package/.output/public/_nuxt/CU27uY9n.js +1 -0
  148. package/.output/public/_nuxt/CVO1_9PV.js +1 -0
  149. package/.output/public/_nuxt/CXtECtnM.js +1 -0
  150. package/.output/public/_nuxt/CYRjgJw9.js +26 -0
  151. package/.output/public/_nuxt/CZlF05X6.js +1 -0
  152. package/.output/public/_nuxt/CafNBF8u.js +1 -0
  153. package/.output/public/_nuxt/Cb0HU5_O.js +1 -0
  154. package/.output/public/_nuxt/CbFg5uaA.js +1 -0
  155. package/.output/public/_nuxt/CbfX1IO0.js +1 -0
  156. package/.output/public/_nuxt/CcyOm34o.js +1 -0
  157. package/.output/public/_nuxt/CdggvHu8.js +1 -0
  158. package/.output/public/_nuxt/CeAyd5Ju.js +1 -0
  159. package/.output/public/_nuxt/CeZK1NFH.js +1 -0
  160. package/.output/public/_nuxt/CfQXZHmo.js +1 -0
  161. package/.output/public/_nuxt/CfeIJUat.js +1 -0
  162. package/.output/public/_nuxt/Cg-RD9OK.js +1 -0
  163. package/.output/public/_nuxt/ChMvpjG-.js +1 -0
  164. package/.output/public/_nuxt/Cj-b45ZR.js +1 -0
  165. package/.output/public/_nuxt/Cj5Yp3dK.js +1 -0
  166. package/.output/public/_nuxt/CkByrt1z.js +1 -0
  167. package/.output/public/_nuxt/CkXjmgJE.js +1 -0
  168. package/.output/public/_nuxt/ClbN2oa7.js +2 -0
  169. package/.output/public/_nuxt/Cmh6b_Ma.js +1 -0
  170. package/.output/public/_nuxt/CnK8MTSM.js +1 -0
  171. package/.output/public/_nuxt/CnnmHF94.js +1 -0
  172. package/.output/public/_nuxt/Co6uUVPk.js +1 -0
  173. package/.output/public/_nuxt/Cp-IABpG.js +1 -0
  174. package/.output/public/_nuxt/Cq5zzVJU.js +1 -0
  175. package/.output/public/_nuxt/CquLrc37.js +1 -0
  176. package/.output/public/_nuxt/CsfeWuGM.js +1 -0
  177. package/.output/public/_nuxt/Csfq5Kiy.js +1 -0
  178. package/.output/public/_nuxt/CtMxL075.js +21 -0
  179. package/.output/public/_nuxt/CtrldY6v.js +1 -0
  180. package/.output/public/_nuxt/Cuk6v7N8.js +1 -0
  181. package/.output/public/_nuxt/Cv9koXgw.js +1 -0
  182. package/.output/public/_nuxt/CxGSJlkm.js +1 -0
  183. package/.output/public/_nuxt/CyktbL80.js +1 -0
  184. package/.output/public/_nuxt/CylS5w8V.js +1 -0
  185. package/.output/public/_nuxt/CzTSHFRz.js +1 -0
  186. package/.output/public/_nuxt/D-2ljcwZ.js +1 -0
  187. package/.output/public/_nuxt/D-pF80u_.js +1 -0
  188. package/.output/public/_nuxt/D08WgyRC.js +1 -0
  189. package/.output/public/_nuxt/D0Gq3ULd.js +1 -0
  190. package/.output/public/_nuxt/D0YGMca9.js +1 -0
  191. package/.output/public/_nuxt/D0r3Knsf.js +1 -0
  192. package/.output/public/_nuxt/D17OF-Vu.js +1 -0
  193. package/.output/public/_nuxt/D1j8_8rp.js +1 -0
  194. package/.output/public/_nuxt/D1uDOp7C.js +1 -0
  195. package/.output/public/_nuxt/D22FLkUw.js +1 -0
  196. package/.output/public/_nuxt/D2CYqzqI.js +1 -0
  197. package/.output/public/_nuxt/D32k8WzR.js +1 -0
  198. package/.output/public/_nuxt/D3lLCCz7.js +1 -0
  199. package/.output/public/_nuxt/D4h5O-jR.js +1 -0
  200. package/.output/public/_nuxt/D5-asLiD.js +1 -0
  201. package/.output/public/_nuxt/D5KoaKCx.js +1 -0
  202. package/.output/public/_nuxt/D7ScPSBf.js +1 -0
  203. package/.output/public/_nuxt/D7o27uSR.js +1 -0
  204. package/.output/public/_nuxt/D7oLnXFd.js +1 -0
  205. package/.output/public/_nuxt/D82EKSYY.js +1 -0
  206. package/.output/public/_nuxt/D93ZcfNL.js +1 -0
  207. package/.output/public/_nuxt/D97Zzqfu.js +1 -0
  208. package/.output/public/_nuxt/DAi9KRSo.js +1 -0
  209. package/.output/public/_nuxt/DCWrMWBD.js +1 -0
  210. package/.output/public/_nuxt/DEsY2yuF.js +1 -0
  211. package/.output/public/_nuxt/DFQXde-d.js +1 -0
  212. package/.output/public/_nuxt/DFXneXwc.js +1 -0
  213. package/.output/public/_nuxt/DGztddWO.js +1 -0
  214. package/.output/public/_nuxt/DH5Ifo-i.js +1 -0
  215. package/.output/public/_nuxt/DHCkPAjA.js +1 -0
  216. package/.output/public/_nuxt/DHJKELXO.js +1 -0
  217. package/.output/public/_nuxt/DKYwYmdq.js +1 -0
  218. package/.output/public/_nuxt/DKzvysjW.js +1 -0
  219. package/.output/public/_nuxt/DM8c43g1.js +1 -0
  220. package/.output/public/_nuxt/DMDPKkZ0.js +1 -0
  221. package/.output/public/_nuxt/DMzUqQB5.js +1 -0
  222. package/.output/public/_nuxt/DNrj_gVY.js +1 -0
  223. package/.output/public/_nuxt/DPcUKYIF.js +1 -0
  224. package/.output/public/_nuxt/DPfMkruS.js +1 -0
  225. package/.output/public/_nuxt/DPvdOr2J.js +1 -0
  226. package/.output/public/_nuxt/DRg8JJMk.js +1 -0
  227. package/.output/public/_nuxt/DRprw4p4.js +1 -0
  228. package/.output/public/_nuxt/DS1LvVMU.js +1 -0
  229. package/.output/public/_nuxt/DU1UobuO.js +1 -0
  230. package/.output/public/_nuxt/DUSGQflk.js +1 -0
  231. package/.output/public/_nuxt/DUszq2jm.js +1 -0
  232. package/.output/public/_nuxt/DVFEvuxE.js +1 -0
  233. package/.output/public/_nuxt/DVMEJ2y_.js +1 -0
  234. package/.output/public/_nuxt/DVxCFoDh.js +1 -0
  235. package/.output/public/_nuxt/DWedfzmr.js +1 -0
  236. package/.output/public/_nuxt/DWrx1Km3.js +1 -0
  237. package/.output/public/_nuxt/DXbdFlpD.js +1 -0
  238. package/.output/public/_nuxt/DXmwc3jG.js +1 -0
  239. package/.output/public/_nuxt/DXvB9xmW.js +1 -0
  240. package/.output/public/_nuxt/DZxFcAj9.js +1 -0
  241. package/.output/public/_nuxt/D_Q5rh1f.js +1 -0
  242. package/.output/public/_nuxt/Da5cRb03.js +1 -0
  243. package/.output/public/_nuxt/DbtIzDGy.js +1 -0
  244. package/.output/public/_nuxt/DcaNXYhu.js +1 -0
  245. package/.output/public/_nuxt/Dd19v3D-.js +1 -0
  246. package/.output/public/_nuxt/DdkO51Og.js +1 -0
  247. package/.output/public/_nuxt/Ddv68eIx.js +1 -0
  248. package/.output/public/_nuxt/DeWFVDHI.js +1 -0
  249. package/.output/public/_nuxt/Des-eS-w.js +1 -0
  250. package/.output/public/_nuxt/Df68jz8_.js +1 -0
  251. package/.output/public/_nuxt/Df6bDoY_.js +1 -0
  252. package/.output/public/_nuxt/DiinP2Uv.js +1 -0
  253. package/.output/public/_nuxt/DkFqJrB1.js +1 -0
  254. package/.output/public/_nuxt/DkhsQLT2.js +1 -0
  255. package/.output/public/_nuxt/DkwncUOv.js +1 -0
  256. package/.output/public/_nuxt/DlfHMoPT.js +1 -0
  257. package/.output/public/_nuxt/DljmTZ5-.js +1 -0
  258. package/.output/public/_nuxt/Dn2_MT6a.js +1 -0
  259. package/.output/public/_nuxt/DnULxvSX.js +1 -0
  260. package/.output/public/_nuxt/Dpen1YoG.js +1 -0
  261. package/.output/public/_nuxt/DqwNpetd.js +1 -0
  262. package/.output/public/_nuxt/Dr8Zlu6v.js +1 -0
  263. package/.output/public/_nuxt/DrZfEa88.js +1 -0
  264. package/.output/public/_nuxt/Drp5UXmf.js +1 -0
  265. package/.output/public/_nuxt/DsOJ9woJ.js +1 -0
  266. package/.output/public/_nuxt/Dtc2v4kS.js +1 -0
  267. package/.output/public/_nuxt/DwheRqRn.js +1 -0
  268. package/.output/public/_nuxt/Dx-B1_4e.js +1 -0
  269. package/.output/public/_nuxt/DyJlTyXw.js +1 -0
  270. package/.output/public/_nuxt/DyxjwDmM.js +1 -0
  271. package/.output/public/_nuxt/E3gJ1_iC.js +1 -0
  272. package/.output/public/_nuxt/ETK3OkTL.js +1 -0
  273. package/.output/public/_nuxt/I3RK9BU8.js +1 -0
  274. package/.output/public/_nuxt/IeuSbFQv.js +1 -0
  275. package/.output/public/_nuxt/IvJ92aGK.js +1 -0
  276. package/.output/public/_nuxt/JhPuU2gP.js +1 -0
  277. package/.output/public/_nuxt/L9t79GZl.js +1 -0
  278. package/.output/public/_nuxt/MzD3tlZU.js +1 -0
  279. package/.output/public/_nuxt/NleAzG8P.js +1 -0
  280. package/.output/public/_nuxt/P80f7IUj.js +1 -0
  281. package/.output/public/_nuxt/Pmp26Uib.js +1 -0
  282. package/.output/public/_nuxt/PoHY5YXO.js +1 -0
  283. package/.output/public/_nuxt/QIJgUcNo.js +1 -0
  284. package/.output/public/_nuxt/SQImb3Xm.js +1513 -0
  285. package/.output/public/_nuxt/SVGiTNnK.js +1 -0
  286. package/.output/public/_nuxt/SettingsDataTable.BLJqwlEK.css +1 -0
  287. package/.output/public/_nuxt/UInuXPgp.js +1 -0
  288. package/.output/public/_nuxt/UQxqNY8s.js +273 -0
  289. package/.output/public/_nuxt/VOosw3JB.js +1 -0
  290. package/.output/public/_nuxt/Xi2tawMN.js +1 -0
  291. package/.output/public/_nuxt/Yzrsuije.js +1 -0
  292. package/.output/public/_nuxt/ZwEiOJEn.js +1 -0
  293. package/.output/public/_nuxt/_ykCGR6B.js +1 -0
  294. package/.output/public/_nuxt/about.fWlW3EhQ.css +1 -0
  295. package/.output/public/_nuxt/bCR0ucgS.js +1 -0
  296. package/.output/public/_nuxt/bN70gL4F.js +1 -0
  297. package/.output/public/_nuxt/brDaU2vB.js +1 -0
  298. package/.output/public/_nuxt/builds/latest.json +1 -0
  299. package/.output/public/_nuxt/builds/meta/b0e10f5e-bdc5-4007-9281-161aa323adf1.json +1 -0
  300. package/.output/public/_nuxt/codicon.DCmgc-ay.ttf +0 -0
  301. package/.output/public/_nuxt/components.CIe9upZ4.css +1 -0
  302. package/.output/public/_nuxt/dglhsJpM.js +1 -0
  303. package/.output/public/_nuxt/dwOrl1Do.js +1 -0
  304. package/.output/public/_nuxt/edge-router-Cceh9XsC.js +4 -0
  305. package/.output/public/_nuxt/editor.worker-7Ic39DJY.js +12 -0
  306. package/.output/public/_nuxt/entry.YsT17dxl.css +1 -0
  307. package/.output/public/_nuxt/error-404.CH3riSrg.css +1 -0
  308. package/.output/public/_nuxt/error-500.C8Qk6cR7.css +1 -0
  309. package/.output/public/_nuxt/f7oK2omx.js +1 -0
  310. package/.output/public/_nuxt/fuZLfV_i.js +1 -0
  311. package/.output/public/_nuxt/fve9TYiY.js +1 -0
  312. package/.output/public/_nuxt/g9-lgVsj.js +1 -0
  313. package/.output/public/_nuxt/gcz8RCvz.js +1 -0
  314. package/.output/public/_nuxt/graph-layout-CFj469YF.js +1 -0
  315. package/.output/public/_nuxt/graph-resolver-ClVztv7P.js +175 -0
  316. package/.output/public/_nuxt/hegEt444.js +1 -0
  317. package/.output/public/_nuxt/hira-1.DuDDiA5P.png +0 -0
  318. package/.output/public/_nuxt/hira-unlock-impossible.B5Pl3pvF.png +0 -0
  319. package/.output/public/_nuxt/index.cU4FhqMM.css +1 -0
  320. package/.output/public/_nuxt/index.smtD6lYF.css +1 -0
  321. package/.output/public/_nuxt/instances.CGwVkdDM.css +1 -0
  322. package/.output/public/_nuxt/irsrSlf-.js +1 -0
  323. package/.output/public/_nuxt/lXgVvXCa.js +1 -0
  324. package/.output/public/_nuxt/materialdesignicons-webfont.B6OSyW2I.woff2 +0 -0
  325. package/.output/public/_nuxt/materialdesignicons-webfont.BpRar1d5.ttf +0 -0
  326. package/.output/public/_nuxt/materialdesignicons-webfont.Bvl3VxMs.woff +0 -0
  327. package/.output/public/_nuxt/materialdesignicons-webfont.TEmAk13K.eot +0 -0
  328. package/.output/public/_nuxt/monaco-editor.D_J4ItrK.css +1 -0
  329. package/.output/public/_nuxt/oVh4WQ21.js +1 -0
  330. package/.output/public/_nuxt/operations.BfCOaoAx.css +1 -0
  331. package/.output/public/_nuxt/operations.DvUkbQbt.css +1 -0
  332. package/.output/public/_nuxt/p5ZwBirz.js +1 -0
  333. package/.output/public/_nuxt/pkIJ47B4.js +1 -0
  334. package/.output/public/_nuxt/q-j0iyEw.js +1 -0
  335. package/.output/public/_nuxt/qliWkHmV.js +1 -0
  336. package/.output/public/_nuxt/secrets._PitGGJK.css +1 -0
  337. package/.output/public/_nuxt/settings.BCRf8MgD.css +1 -0
  338. package/.output/public/_nuxt/terminals.B07MGsh3.css +1 -0
  339. package/.output/public/_nuxt/uMbE6_td.js +1 -0
  340. package/.output/public/_nuxt/vGWfd6FD.js +1 -0
  341. package/.output/public/_nuxt/vuetify.C_sYHwU6.css +5 -0
  342. package/.output/public/_nuxt/xVLoeQ-B.js +1 -0
  343. package/.output/public/_nuxt/yaml.worker-DLQcEOxU.js +410 -0
  344. package/.output/public/_nuxt/yv6CvBhz.js +1 -0
  345. package/.output/public/favicon.ico +0 -0
  346. package/.output/public/libavoid.wasm +0 -0
  347. package/.output/public/robots.txt +1 -0
  348. package/.output/server/index.mjs +18396 -0
  349. package/.output/server/index.mjs.map +1 -0
  350. package/.output/server/node_modules/@babel/parser/lib/index.js +14586 -0
  351. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  352. package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +58 -0
  353. package/.output/server/node_modules/@trpc/server/dist/adapters/ws.mjs +15 -0
  354. package/.output/server/node_modules/@trpc/server/dist/contentTypeParsers-SN4WL9ze.mjs +13 -0
  355. package/.output/server/node_modules/@trpc/server/dist/getErrorShape-Uhlrl4Bk.mjs +263 -0
  356. package/.output/server/node_modules/@trpc/server/dist/http-CWyjOa1l.mjs +0 -0
  357. package/.output/server/node_modules/@trpc/server/dist/index.mjs +6 -0
  358. package/.output/server/node_modules/@trpc/server/dist/initTRPC-IT_6ZYJd.mjs +358 -0
  359. package/.output/server/node_modules/@trpc/server/dist/node-http-ZvZKxPic.mjs +222 -0
  360. package/.output/server/node_modules/@trpc/server/dist/observable-CUiPknO-.mjs +158 -0
  361. package/.output/server/node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs +158 -0
  362. package/.output/server/node_modules/@trpc/server/dist/parseTRPCMessage-ByIHyFRz.mjs +63 -0
  363. package/.output/server/node_modules/@trpc/server/dist/resolveResponse-CzlbRpCI.mjs +2183 -0
  364. package/.output/server/node_modules/@trpc/server/dist/tracked-gU3ttYjg.mjs +371 -0
  365. package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import-D89CaGtL.mjs +29 -0
  366. package/.output/server/node_modules/@trpc/server/dist/utils-DdbbrDku.mjs +137 -0
  367. package/.output/server/node_modules/@trpc/server/dist/ws-DsZkVWpZ.mjs +420 -0
  368. package/.output/server/node_modules/@trpc/server/package.json +232 -0
  369. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6705 -0
  370. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  371. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +686 -0
  372. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  373. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1402 -0
  374. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  375. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1806 -0
  376. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  377. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6696 -0
  378. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  379. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1677 -0
  380. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  381. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +857 -0
  382. package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
  383. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +594 -0
  384. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  385. package/.output/server/node_modules/devalue/index.js +3 -0
  386. package/.output/server/node_modules/devalue/package.json +34 -0
  387. package/.output/server/node_modules/devalue/src/base64.js +110 -0
  388. package/.output/server/node_modules/devalue/src/constants.js +6 -0
  389. package/.output/server/node_modules/devalue/src/parse.js +160 -0
  390. package/.output/server/node_modules/devalue/src/stringify.js +232 -0
  391. package/.output/server/node_modules/devalue/src/uneval.js +351 -0
  392. package/.output/server/node_modules/devalue/src/utils.js +113 -0
  393. package/.output/server/node_modules/entities/lib/decode.js +536 -0
  394. package/.output/server/node_modules/entities/lib/decode_codepoint.js +76 -0
  395. package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +9 -0
  396. package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
  397. package/.output/server/node_modules/entities/package.json +90 -0
  398. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  399. package/.output/server/node_modules/estree-walker/package.json +37 -0
  400. package/.output/server/node_modules/hookable/dist/index.mjs +290 -0
  401. package/.output/server/node_modules/hookable/package.json +49 -0
  402. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  403. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  404. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  405. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  406. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  407. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  408. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  409. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  410. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  411. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  412. package/.output/server/node_modules/source-map-js/package.json +71 -0
  413. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  414. package/.output/server/node_modules/ufo/dist/index.mjs +638 -0
  415. package/.output/server/node_modules/ufo/package.json +47 -0
  416. package/.output/server/node_modules/unhead/dist/plugins.mjs +95 -0
  417. package/.output/server/node_modules/unhead/dist/server.mjs +219 -0
  418. package/.output/server/node_modules/unhead/dist/shared/unhead.C13swrCa.mjs +48 -0
  419. package/.output/server/node_modules/unhead/dist/shared/unhead.CAk5S5m6.mjs +180 -0
  420. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
  421. package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
  422. package/.output/server/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs +70 -0
  423. package/.output/server/node_modules/unhead/dist/shared/unhead.DeCxexjU.mjs +166 -0
  424. package/.output/server/node_modules/unhead/dist/shared/unhead.Di5OD67x.mjs +190 -0
  425. package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
  426. package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
  427. package/.output/server/node_modules/unhead/package.json +101 -0
  428. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  429. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  430. package/.output/server/node_modules/vue/index.js +7 -0
  431. package/.output/server/node_modules/vue/index.mjs +1 -0
  432. package/.output/server/node_modules/vue/package.json +112 -0
  433. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  434. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +196 -0
  435. package/.output/server/node_modules/vue-bundle-renderer/package.json +50 -0
  436. package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
  437. package/.output/server/node_modules/ws/lib/constants.js +18 -0
  438. package/.output/server/node_modules/ws/lib/event-target.js +292 -0
  439. package/.output/server/node_modules/ws/lib/extension.js +203 -0
  440. package/.output/server/node_modules/ws/lib/limiter.js +55 -0
  441. package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
  442. package/.output/server/node_modules/ws/lib/receiver.js +706 -0
  443. package/.output/server/node_modules/ws/lib/sender.js +602 -0
  444. package/.output/server/node_modules/ws/lib/stream.js +161 -0
  445. package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
  446. package/.output/server/node_modules/ws/lib/validation.js +152 -0
  447. package/.output/server/node_modules/ws/lib/websocket-server.js +550 -0
  448. package/.output/server/node_modules/ws/lib/websocket.js +1388 -0
  449. package/.output/server/node_modules/ws/package.json +69 -0
  450. package/.output/server/node_modules/ws/wrapper.mjs +8 -0
  451. package/.output/server/node_modules/zod/index.js +4 -0
  452. package/.output/server/node_modules/zod/package.json +131 -0
  453. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
  454. package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
  455. package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
  456. package/.output/server/node_modules/zod/v4/classic/errors.js +41 -0
  457. package/.output/server/node_modules/zod/v4/classic/external.js +18 -0
  458. package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
  459. package/.output/server/node_modules/zod/v4/classic/parse.js +6 -0
  460. package/.output/server/node_modules/zod/v4/classic/schemas.js +1006 -0
  461. package/.output/server/node_modules/zod/v4/core/api.js +906 -0
  462. package/.output/server/node_modules/zod/v4/core/checks.js +565 -0
  463. package/.output/server/node_modules/zod/v4/core/core.js +61 -0
  464. package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
  465. package/.output/server/node_modules/zod/v4/core/errors.js +195 -0
  466. package/.output/server/node_modules/zod/v4/core/function.js +75 -0
  467. package/.output/server/node_modules/zod/v4/core/index.js +15 -0
  468. package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
  469. package/.output/server/node_modules/zod/v4/core/parse.js +57 -0
  470. package/.output/server/node_modules/zod/v4/core/regexes.js +95 -0
  471. package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
  472. package/.output/server/node_modules/zod/v4/core/schemas.js +1718 -0
  473. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +849 -0
  474. package/.output/server/node_modules/zod/v4/core/util.js +493 -0
  475. package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
  476. package/.output/server/node_modules/zod/v4/locales/ar.js +116 -0
  477. package/.output/server/node_modules/zod/v4/locales/az.js +115 -0
  478. package/.output/server/node_modules/zod/v4/locales/be.js +164 -0
  479. package/.output/server/node_modules/zod/v4/locales/ca.js +118 -0
  480. package/.output/server/node_modules/zod/v4/locales/cs.js +135 -0
  481. package/.output/server/node_modules/zod/v4/locales/de.js +116 -0
  482. package/.output/server/node_modules/zod/v4/locales/en.js +117 -0
  483. package/.output/server/node_modules/zod/v4/locales/eo.js +116 -0
  484. package/.output/server/node_modules/zod/v4/locales/es.js +117 -0
  485. package/.output/server/node_modules/zod/v4/locales/fa.js +122 -0
  486. package/.output/server/node_modules/zod/v4/locales/fi.js +122 -0
  487. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +117 -0
  488. package/.output/server/node_modules/zod/v4/locales/fr.js +116 -0
  489. package/.output/server/node_modules/zod/v4/locales/he.js +117 -0
  490. package/.output/server/node_modules/zod/v4/locales/hu.js +117 -0
  491. package/.output/server/node_modules/zod/v4/locales/id.js +116 -0
  492. package/.output/server/node_modules/zod/v4/locales/index.js +39 -0
  493. package/.output/server/node_modules/zod/v4/locales/it.js +117 -0
  494. package/.output/server/node_modules/zod/v4/locales/ja.js +115 -0
  495. package/.output/server/node_modules/zod/v4/locales/kh.js +117 -0
  496. package/.output/server/node_modules/zod/v4/locales/ko.js +121 -0
  497. package/.output/server/node_modules/zod/v4/locales/mk.js +118 -0
  498. package/.output/server/node_modules/zod/v4/locales/ms.js +116 -0
  499. package/.output/server/node_modules/zod/v4/locales/nl.js +117 -0
  500. package/.output/server/node_modules/zod/v4/locales/no.js +116 -0
  501. package/.output/server/node_modules/zod/v4/locales/ota.js +117 -0
  502. package/.output/server/node_modules/zod/v4/locales/pl.js +117 -0
  503. package/.output/server/node_modules/zod/v4/locales/ps.js +122 -0
  504. package/.output/server/node_modules/zod/v4/locales/pt.js +116 -0
  505. package/.output/server/node_modules/zod/v4/locales/ru.js +164 -0
  506. package/.output/server/node_modules/zod/v4/locales/sl.js +117 -0
  507. package/.output/server/node_modules/zod/v4/locales/sv.js +118 -0
  508. package/.output/server/node_modules/zod/v4/locales/ta.js +117 -0
  509. package/.output/server/node_modules/zod/v4/locales/th.js +117 -0
  510. package/.output/server/node_modules/zod/v4/locales/tr.js +115 -0
  511. package/.output/server/node_modules/zod/v4/locales/ua.js +117 -0
  512. package/.output/server/node_modules/zod/v4/locales/ur.js +117 -0
  513. package/.output/server/node_modules/zod/v4/locales/vi.js +116 -0
  514. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +116 -0
  515. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +117 -0
  516. package/.output/server/package.json +29 -0
  517. package/package.json +6 -6
@@ -0,0 +1,2183 @@
1
+ import { __commonJS, __toESM, getErrorShape, getHTTPStatusCode, require_defineProperty, require_objectSpread2 } from "./getErrorShape-Uhlrl4Bk.mjs";
2
+ import { TRPCError, getProcedureAtPath, getTRPCErrorFromUnknown, isTrackedEnvelope, transformTRPCResponse } from "./tracked-gU3ttYjg.mjs";
3
+ import { identity, isAsyncIterable, isFunction, isObject, run } from "./utils-DdbbrDku.mjs";
4
+ import { isObservable, observableToAsyncIterable } from "./observable-UMO3vUa_.mjs";
5
+
6
+ //#region src/unstable-core-do-not-import/http/parseConnectionParams.ts
7
+ function parseConnectionParamsFromUnknown(parsed) {
8
+ try {
9
+ if (parsed === null) return null;
10
+ if (!isObject(parsed)) throw new Error("Expected object");
11
+ const nonStringValues = Object.entries(parsed).filter(([_key, value]) => typeof value !== "string");
12
+ if (nonStringValues.length > 0) throw new Error(`Expected connectionParams to be string values. Got ${nonStringValues.map(([key, value]) => `${key}: ${typeof value}`).join(", ")}`);
13
+ return parsed;
14
+ } catch (cause) {
15
+ throw new TRPCError({
16
+ code: "PARSE_ERROR",
17
+ message: "Invalid connection params shape",
18
+ cause
19
+ });
20
+ }
21
+ }
22
+ function parseConnectionParamsFromString(str) {
23
+ let parsed;
24
+ try {
25
+ parsed = JSON.parse(str);
26
+ } catch (cause) {
27
+ throw new TRPCError({
28
+ code: "PARSE_ERROR",
29
+ message: "Not JSON-parsable query params",
30
+ cause
31
+ });
32
+ }
33
+ return parseConnectionParamsFromUnknown(parsed);
34
+ }
35
+
36
+ //#endregion
37
+ //#region src/unstable-core-do-not-import/http/contentType.ts
38
+ var import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);
39
+ /**
40
+ * Memoize a function that takes no arguments
41
+ * @internal
42
+ */
43
+ function memo(fn) {
44
+ let promise = null;
45
+ const sym = Symbol.for("@trpc/server/http/memo");
46
+ let value = sym;
47
+ return {
48
+ read: async () => {
49
+ var _promise;
50
+ if (value !== sym) return value;
51
+ (_promise = promise) !== null && _promise !== void 0 || (promise = fn().catch((cause) => {
52
+ if (cause instanceof TRPCError) throw cause;
53
+ throw new TRPCError({
54
+ code: "BAD_REQUEST",
55
+ message: cause instanceof Error ? cause.message : "Invalid input",
56
+ cause
57
+ });
58
+ }));
59
+ value = await promise;
60
+ promise = null;
61
+ return value;
62
+ },
63
+ result: () => {
64
+ return value !== sym ? value : void 0;
65
+ }
66
+ };
67
+ }
68
+ const jsonContentTypeHandler = {
69
+ isMatch(req) {
70
+ var _req$headers$get;
71
+ return !!((_req$headers$get = req.headers.get("content-type")) === null || _req$headers$get === void 0 ? void 0 : _req$headers$get.startsWith("application/json"));
72
+ },
73
+ async parse(opts) {
74
+ var _types$values$next$va;
75
+ const { req } = opts;
76
+ const isBatchCall = opts.searchParams.get("batch") === "1";
77
+ const paths = isBatchCall ? opts.path.split(",") : [opts.path];
78
+ const getInputs = memo(async () => {
79
+ let inputs = void 0;
80
+ if (req.method === "GET") {
81
+ const queryInput = opts.searchParams.get("input");
82
+ if (queryInput) inputs = JSON.parse(queryInput);
83
+ } else inputs = await req.json();
84
+ if (inputs === void 0) return {};
85
+ if (!isBatchCall) return { 0: opts.router._def._config.transformer.input.deserialize(inputs) };
86
+ if (!isObject(inputs)) throw new TRPCError({
87
+ code: "BAD_REQUEST",
88
+ message: "\"input\" needs to be an object when doing a batch call"
89
+ });
90
+ const acc = {};
91
+ for (const index of paths.keys()) {
92
+ const input = inputs[index];
93
+ if (input !== void 0) acc[index] = opts.router._def._config.transformer.input.deserialize(input);
94
+ }
95
+ return acc;
96
+ });
97
+ const calls = await Promise.all(paths.map(async (path, index) => {
98
+ const procedure = await getProcedureAtPath(opts.router, path);
99
+ return {
100
+ path,
101
+ procedure,
102
+ getRawInput: async () => {
103
+ const inputs = await getInputs.read();
104
+ let input = inputs[index];
105
+ if ((procedure === null || procedure === void 0 ? void 0 : procedure._def.type) === "subscription") {
106
+ var _ref, _opts$headers$get;
107
+ const lastEventId = (_ref = (_opts$headers$get = opts.headers.get("last-event-id")) !== null && _opts$headers$get !== void 0 ? _opts$headers$get : opts.searchParams.get("lastEventId")) !== null && _ref !== void 0 ? _ref : opts.searchParams.get("Last-Event-Id");
108
+ if (lastEventId) if (isObject(input)) input = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, input), {}, { lastEventId });
109
+ else {
110
+ var _input;
111
+ (_input = input) !== null && _input !== void 0 || (input = { lastEventId });
112
+ }
113
+ }
114
+ return input;
115
+ },
116
+ result: () => {
117
+ var _getInputs$result;
118
+ return (_getInputs$result = getInputs.result()) === null || _getInputs$result === void 0 ? void 0 : _getInputs$result[index];
119
+ }
120
+ };
121
+ }));
122
+ const types = new Set(calls.map((call) => {
123
+ var _call$procedure;
124
+ return (_call$procedure = call.procedure) === null || _call$procedure === void 0 ? void 0 : _call$procedure._def.type;
125
+ }).filter(Boolean));
126
+ /* istanbul ignore if -- @preserve */
127
+ if (types.size > 1) throw new TRPCError({
128
+ code: "BAD_REQUEST",
129
+ message: `Cannot mix procedure types in call: ${Array.from(types).join(", ")}`
130
+ });
131
+ const type = (_types$values$next$va = types.values().next().value) !== null && _types$values$next$va !== void 0 ? _types$values$next$va : "unknown";
132
+ const connectionParamsStr = opts.searchParams.get("connectionParams");
133
+ const info = {
134
+ isBatchCall,
135
+ accept: req.headers.get("trpc-accept"),
136
+ calls,
137
+ type,
138
+ connectionParams: connectionParamsStr === null ? null : parseConnectionParamsFromString(connectionParamsStr),
139
+ signal: req.signal,
140
+ url: opts.url
141
+ };
142
+ return info;
143
+ }
144
+ };
145
+ const formDataContentTypeHandler = {
146
+ isMatch(req) {
147
+ var _req$headers$get2;
148
+ return !!((_req$headers$get2 = req.headers.get("content-type")) === null || _req$headers$get2 === void 0 ? void 0 : _req$headers$get2.startsWith("multipart/form-data"));
149
+ },
150
+ async parse(opts) {
151
+ const { req } = opts;
152
+ if (req.method !== "POST") throw new TRPCError({
153
+ code: "METHOD_NOT_SUPPORTED",
154
+ message: "Only POST requests are supported for multipart/form-data requests"
155
+ });
156
+ const getInputs = memo(async () => {
157
+ const fd = await req.formData();
158
+ return fd;
159
+ });
160
+ const procedure = await getProcedureAtPath(opts.router, opts.path);
161
+ return {
162
+ accept: null,
163
+ calls: [{
164
+ path: opts.path,
165
+ getRawInput: getInputs.read,
166
+ result: getInputs.result,
167
+ procedure
168
+ }],
169
+ isBatchCall: false,
170
+ type: "mutation",
171
+ connectionParams: null,
172
+ signal: req.signal,
173
+ url: opts.url
174
+ };
175
+ }
176
+ };
177
+ const octetStreamContentTypeHandler = {
178
+ isMatch(req) {
179
+ var _req$headers$get3;
180
+ return !!((_req$headers$get3 = req.headers.get("content-type")) === null || _req$headers$get3 === void 0 ? void 0 : _req$headers$get3.startsWith("application/octet-stream"));
181
+ },
182
+ async parse(opts) {
183
+ const { req } = opts;
184
+ if (req.method !== "POST") throw new TRPCError({
185
+ code: "METHOD_NOT_SUPPORTED",
186
+ message: "Only POST requests are supported for application/octet-stream requests"
187
+ });
188
+ const getInputs = memo(async () => {
189
+ return req.body;
190
+ });
191
+ return {
192
+ calls: [{
193
+ path: opts.path,
194
+ getRawInput: getInputs.read,
195
+ result: getInputs.result,
196
+ procedure: await getProcedureAtPath(opts.router, opts.path)
197
+ }],
198
+ isBatchCall: false,
199
+ accept: null,
200
+ type: "mutation",
201
+ connectionParams: null,
202
+ signal: req.signal,
203
+ url: opts.url
204
+ };
205
+ }
206
+ };
207
+ const handlers = [
208
+ jsonContentTypeHandler,
209
+ formDataContentTypeHandler,
210
+ octetStreamContentTypeHandler
211
+ ];
212
+ function getContentTypeHandler(req) {
213
+ const handler = handlers.find((handler$1) => handler$1.isMatch(req));
214
+ if (handler) return handler;
215
+ if (!handler && req.method === "GET") return jsonContentTypeHandler;
216
+ throw new TRPCError({
217
+ code: "UNSUPPORTED_MEDIA_TYPE",
218
+ message: req.headers.has("content-type") ? `Unsupported content-type "${req.headers.get("content-type")}` : "Missing content-type header"
219
+ });
220
+ }
221
+ async function getRequestInfo(opts) {
222
+ const handler = getContentTypeHandler(opts.req);
223
+ return await handler.parse(opts);
224
+ }
225
+
226
+ //#endregion
227
+ //#region src/unstable-core-do-not-import/http/abortError.ts
228
+ function isAbortError(error) {
229
+ return isObject(error) && error["name"] === "AbortError";
230
+ }
231
+ function throwAbortError(message = "AbortError") {
232
+ throw new DOMException(message, "AbortError");
233
+ }
234
+
235
+ //#endregion
236
+ //#region src/vendor/unpromise/unpromise.ts
237
+ var import_defineProperty = __toESM(require_defineProperty(), 1);
238
+ let _Symbol$toStringTag;
239
+ /** Memory safe (weakmapped) cache of the ProxyPromise for each Promise,
240
+ * which is retained for the lifetime of the original Promise.
241
+ */
242
+ const subscribableCache = /* @__PURE__ */ new WeakMap();
243
+ /** A NOOP function allowing a consistent interface for settled
244
+ * SubscribedPromises (settled promises are not subscribed - they resolve
245
+ * immediately). */
246
+ const NOOP = () => {};
247
+ _Symbol$toStringTag = Symbol.toStringTag;
248
+ /**
249
+ * Every `Promise<T>` can be shadowed by a single `ProxyPromise<T>`. It is
250
+ * created once, cached and reused throughout the lifetime of the Promise. Get a
251
+ * Promise's ProxyPromise using `Unpromise.proxy(promise)`.
252
+ *
253
+ * The `ProxyPromise<T>` attaches handlers to the original `Promise<T>`
254
+ * `.then()` and `.catch()` just once. Promises derived from it use a
255
+ * subscription- (and unsubscription-) based mechanism that monitors these
256
+ * handlers.
257
+ *
258
+ * Every time you call `.subscribe()`, `.then()` `.catch()` or `.finally()` on a
259
+ * `ProxyPromise<T>` it returns a `SubscribedPromise<T>` having an additional
260
+ * `unsubscribe()` method. Calling `unsubscribe()` detaches reference chains
261
+ * from the original, potentially long-lived Promise, eliminating memory leaks.
262
+ *
263
+ * This approach can eliminate the memory leaks that otherwise come about from
264
+ * repeated `race()` or `any()` calls invoking `.then()` and `.catch()` multiple
265
+ * times on the same long-lived native Promise (subscriptions which can never be
266
+ * cleaned up).
267
+ *
268
+ * `Unpromise.race(promises)` is a reference implementation of `Promise.race`
269
+ * avoiding memory leaks when using long-lived unsettled Promises.
270
+ *
271
+ * `Unpromise.any(promises)` is a reference implementation of `Promise.any`
272
+ * avoiding memory leaks when using long-lived unsettled Promises.
273
+ *
274
+ * `Unpromise.resolve(promise)` returns an ephemeral `SubscribedPromise<T>` for
275
+ * any given `Promise<T>` facilitating arbitrary async/await patterns. Behind
276
+ * the scenes, `resolve` is implemented simply as
277
+ * `Unpromise.proxy(promise).subscribe()`. Don't forget to call `.unsubscribe()`
278
+ * to tidy up!
279
+ *
280
+ */
281
+ var Unpromise = class Unpromise {
282
+ constructor(arg) {
283
+ (0, import_defineProperty.default)(this, "promise", void 0);
284
+ (0, import_defineProperty.default)(this, "subscribers", []);
285
+ (0, import_defineProperty.default)(this, "settlement", null);
286
+ (0, import_defineProperty.default)(this, _Symbol$toStringTag, "Unpromise");
287
+ if (typeof arg === "function") this.promise = new Promise(arg);
288
+ else this.promise = arg;
289
+ const thenReturn = this.promise.then((value) => {
290
+ const { subscribers } = this;
291
+ this.subscribers = null;
292
+ this.settlement = {
293
+ status: "fulfilled",
294
+ value
295
+ };
296
+ subscribers === null || subscribers === void 0 || subscribers.forEach(({ resolve }) => {
297
+ resolve(value);
298
+ });
299
+ });
300
+ if ("catch" in thenReturn) thenReturn.catch((reason) => {
301
+ const { subscribers } = this;
302
+ this.subscribers = null;
303
+ this.settlement = {
304
+ status: "rejected",
305
+ reason
306
+ };
307
+ subscribers === null || subscribers === void 0 || subscribers.forEach(({ reject }) => {
308
+ reject(reason);
309
+ });
310
+ });
311
+ }
312
+ /** Create a promise that mitigates uncontrolled subscription to a long-lived
313
+ * Promise via .then() and .catch() - otherwise a source of memory leaks.
314
+ *
315
+ * The returned promise has an `unsubscribe()` method which can be called when
316
+ * the Promise is no longer being tracked by application logic, and which
317
+ * ensures that there is no reference chain from the original promise to the
318
+ * new one, and therefore no memory leak.
319
+ *
320
+ * If original promise has not yet settled, this adds a new unique promise
321
+ * that listens to then/catch events, along with an `unsubscribe()` method to
322
+ * detach it.
323
+ *
324
+ * If original promise has settled, then creates a new Promise.resolve() or
325
+ * Promise.reject() and provided unsubscribe is a noop.
326
+ *
327
+ * If you call `unsubscribe()` before the returned Promise has settled, it
328
+ * will never settle.
329
+ */
330
+ subscribe() {
331
+ let promise;
332
+ let unsubscribe;
333
+ const { settlement } = this;
334
+ if (settlement === null) {
335
+ if (this.subscribers === null) throw new Error("Unpromise settled but still has subscribers");
336
+ const subscriber = withResolvers();
337
+ this.subscribers = listWithMember(this.subscribers, subscriber);
338
+ promise = subscriber.promise;
339
+ unsubscribe = () => {
340
+ if (this.subscribers !== null) this.subscribers = listWithoutMember(this.subscribers, subscriber);
341
+ };
342
+ } else {
343
+ const { status } = settlement;
344
+ if (status === "fulfilled") promise = Promise.resolve(settlement.value);
345
+ else promise = Promise.reject(settlement.reason);
346
+ unsubscribe = NOOP;
347
+ }
348
+ return Object.assign(promise, { unsubscribe });
349
+ }
350
+ /** STANDARD PROMISE METHODS (but returning a SubscribedPromise) */
351
+ then(onfulfilled, onrejected) {
352
+ const subscribed = this.subscribe();
353
+ const { unsubscribe } = subscribed;
354
+ return Object.assign(subscribed.then(onfulfilled, onrejected), { unsubscribe });
355
+ }
356
+ catch(onrejected) {
357
+ const subscribed = this.subscribe();
358
+ const { unsubscribe } = subscribed;
359
+ return Object.assign(subscribed.catch(onrejected), { unsubscribe });
360
+ }
361
+ finally(onfinally) {
362
+ const subscribed = this.subscribe();
363
+ const { unsubscribe } = subscribed;
364
+ return Object.assign(subscribed.finally(onfinally), { unsubscribe });
365
+ }
366
+ /** Unpromise STATIC METHODS */
367
+ /** Create or Retrieve the proxy Unpromise (a re-used Unpromise for the VM lifetime
368
+ * of the provided Promise reference) */
369
+ static proxy(promise) {
370
+ const cached = Unpromise.getSubscribablePromise(promise);
371
+ return typeof cached !== "undefined" ? cached : Unpromise.createSubscribablePromise(promise);
372
+ }
373
+ /** Create and store an Unpromise keyed by an original Promise. */
374
+ static createSubscribablePromise(promise) {
375
+ const created = new Unpromise(promise);
376
+ subscribableCache.set(promise, created);
377
+ subscribableCache.set(created, created);
378
+ return created;
379
+ }
380
+ /** Retrieve a previously-created Unpromise keyed by an original Promise. */
381
+ static getSubscribablePromise(promise) {
382
+ return subscribableCache.get(promise);
383
+ }
384
+ /** Promise STATIC METHODS */
385
+ /** Lookup the Unpromise for this promise, and derive a SubscribedPromise from
386
+ * it (that can be later unsubscribed to eliminate Memory leaks) */
387
+ static resolve(value) {
388
+ const promise = typeof value === "object" && value !== null && "then" in value && typeof value.then === "function" ? value : Promise.resolve(value);
389
+ return Unpromise.proxy(promise).subscribe();
390
+ }
391
+ static async any(values) {
392
+ const valuesArray = Array.isArray(values) ? values : [...values];
393
+ const subscribedPromises = valuesArray.map(Unpromise.resolve);
394
+ try {
395
+ return await Promise.any(subscribedPromises);
396
+ } finally {
397
+ subscribedPromises.forEach(({ unsubscribe }) => {
398
+ unsubscribe();
399
+ });
400
+ }
401
+ }
402
+ static async race(values) {
403
+ const valuesArray = Array.isArray(values) ? values : [...values];
404
+ const subscribedPromises = valuesArray.map(Unpromise.resolve);
405
+ try {
406
+ return await Promise.race(subscribedPromises);
407
+ } finally {
408
+ subscribedPromises.forEach(({ unsubscribe }) => {
409
+ unsubscribe();
410
+ });
411
+ }
412
+ }
413
+ /** Create a race of SubscribedPromises that will fulfil to a single winning
414
+ * Promise (in a 1-Tuple). Eliminates memory leaks from long-lived promises
415
+ * accumulating .then() and .catch() subscribers. Allows simple logic to
416
+ * consume the result, like...
417
+ * ```ts
418
+ * const [ winner ] = await Unpromise.race([ promiseA, promiseB ]);
419
+ * if(winner === promiseB){
420
+ * const result = await promiseB;
421
+ * // do the thing
422
+ * }
423
+ * ```
424
+ * */
425
+ static async raceReferences(promises) {
426
+ const selfPromises = promises.map(resolveSelfTuple);
427
+ try {
428
+ return await Promise.race(selfPromises);
429
+ } finally {
430
+ for (const promise of selfPromises) promise.unsubscribe();
431
+ }
432
+ }
433
+ };
434
+ /** Promises a 1-tuple containing the original promise when it resolves. Allows
435
+ * awaiting the eventual Promise ***reference*** (easy to destructure and
436
+ * exactly compare with ===). Avoids resolving to the Promise ***value*** (which
437
+ * may be ambiguous and therefore hard to identify as the winner of a race).
438
+ * You can call unsubscribe on the Promise to mitigate memory leaks.
439
+ * */
440
+ function resolveSelfTuple(promise) {
441
+ return Unpromise.proxy(promise).then(() => [promise]);
442
+ }
443
+ /** VENDORED (Future) PROMISE UTILITIES */
444
+ /** Reference implementation of https://github.com/tc39/proposal-promise-with-resolvers */
445
+ function withResolvers() {
446
+ let resolve;
447
+ let reject;
448
+ const promise = new Promise((_resolve, _reject) => {
449
+ resolve = _resolve;
450
+ reject = _reject;
451
+ });
452
+ return {
453
+ promise,
454
+ resolve,
455
+ reject
456
+ };
457
+ }
458
+ /** IMMUTABLE LIST OPERATIONS */
459
+ function listWithMember(arr, member) {
460
+ return [...arr, member];
461
+ }
462
+ function listWithoutIndex(arr, index) {
463
+ return [...arr.slice(0, index), ...arr.slice(index + 1)];
464
+ }
465
+ function listWithoutMember(arr, member) {
466
+ const index = arr.indexOf(member);
467
+ if (index !== -1) return listWithoutIndex(arr, index);
468
+ return arr;
469
+ }
470
+
471
+ //#endregion
472
+ //#region src/unstable-core-do-not-import/stream/utils/disposable.ts
473
+ var _Symbol, _Symbol$dispose, _Symbol2, _Symbol2$asyncDispose;
474
+ (_Symbol$dispose = (_Symbol = Symbol).dispose) !== null && _Symbol$dispose !== void 0 || (_Symbol.dispose = Symbol());
475
+ (_Symbol2$asyncDispose = (_Symbol2 = Symbol).asyncDispose) !== null && _Symbol2$asyncDispose !== void 0 || (_Symbol2.asyncDispose = Symbol());
476
+ /**
477
+ * Takes a value and a dispose function and returns a new object that implements the Disposable interface.
478
+ * The returned object is the original value augmented with a Symbol.dispose method.
479
+ * @param thing The value to make disposable
480
+ * @param dispose Function to call when disposing the resource
481
+ * @returns The original value with Symbol.dispose method added
482
+ */
483
+ function makeResource(thing, dispose) {
484
+ const it = thing;
485
+ const existing = it[Symbol.dispose];
486
+ it[Symbol.dispose] = () => {
487
+ dispose();
488
+ existing === null || existing === void 0 || existing();
489
+ };
490
+ return it;
491
+ }
492
+ /**
493
+ * Takes a value and an async dispose function and returns a new object that implements the AsyncDisposable interface.
494
+ * The returned object is the original value augmented with a Symbol.asyncDispose method.
495
+ * @param thing The value to make async disposable
496
+ * @param dispose Async function to call when disposing the resource
497
+ * @returns The original value with Symbol.asyncDispose method added
498
+ */
499
+ function makeAsyncResource(thing, dispose) {
500
+ const it = thing;
501
+ const existing = it[Symbol.asyncDispose];
502
+ it[Symbol.asyncDispose] = async () => {
503
+ await dispose();
504
+ await (existing === null || existing === void 0 ? void 0 : existing());
505
+ };
506
+ return it;
507
+ }
508
+
509
+ //#endregion
510
+ //#region src/unstable-core-do-not-import/stream/utils/timerResource.ts
511
+ const disposablePromiseTimerResult = Symbol();
512
+ function timerResource(ms) {
513
+ let timer = null;
514
+ return makeResource({ start() {
515
+ if (timer) throw new Error("Timer already started");
516
+ const promise = new Promise((resolve) => {
517
+ timer = setTimeout(() => resolve(disposablePromiseTimerResult), ms);
518
+ });
519
+ return promise;
520
+ } }, () => {
521
+ if (timer) clearTimeout(timer);
522
+ });
523
+ }
524
+
525
+ //#endregion
526
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
527
+ var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
528
+ function _usingCtx() {
529
+ var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
530
+ var n$1 = Error();
531
+ return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1;
532
+ }, e = {}, n = [];
533
+ function using(r$1, e$1) {
534
+ if (null != e$1) {
535
+ if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
536
+ if (r$1) var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
537
+ if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t = o;
538
+ if ("function" != typeof o) throw new TypeError("Object is not disposable.");
539
+ t && (o = function o$1() {
540
+ try {
541
+ t.call(e$1);
542
+ } catch (r$2) {
543
+ return Promise.reject(r$2);
544
+ }
545
+ }), n.push({
546
+ v: e$1,
547
+ d: o,
548
+ a: r$1
549
+ });
550
+ } else r$1 && n.push({
551
+ d: e$1,
552
+ a: r$1
553
+ });
554
+ return e$1;
555
+ }
556
+ return {
557
+ e,
558
+ u: using.bind(null, !1),
559
+ a: using.bind(null, !0),
560
+ d: function d() {
561
+ var o, t = this.e, s = 0;
562
+ function next() {
563
+ for (; o = n.pop();) try {
564
+ if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
565
+ if (o.d) {
566
+ var r$1 = o.d.call(o.v);
567
+ if (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);
568
+ } else s |= 1;
569
+ } catch (r$2) {
570
+ return err(r$2);
571
+ }
572
+ if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
573
+ if (t !== e) throw t;
574
+ }
575
+ function err(n$1) {
576
+ return t = t !== e ? new r(n$1, t) : n$1, next();
577
+ }
578
+ return next();
579
+ }
580
+ };
581
+ }
582
+ module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
583
+ } });
584
+
585
+ //#endregion
586
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js
587
+ var require_OverloadYield = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(exports, module) {
588
+ function _OverloadYield(e, d) {
589
+ this.v = e, this.k = d;
590
+ }
591
+ module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
592
+ } });
593
+
594
+ //#endregion
595
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js
596
+ var require_awaitAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(exports, module) {
597
+ var OverloadYield$2 = require_OverloadYield();
598
+ function _awaitAsyncGenerator$5(e) {
599
+ return new OverloadYield$2(e, 0);
600
+ }
601
+ module.exports = _awaitAsyncGenerator$5, module.exports.__esModule = true, module.exports["default"] = module.exports;
602
+ } });
603
+
604
+ //#endregion
605
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js
606
+ var require_wrapAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(exports, module) {
607
+ var OverloadYield$1 = require_OverloadYield();
608
+ function _wrapAsyncGenerator$6(e) {
609
+ return function() {
610
+ return new AsyncGenerator(e.apply(this, arguments));
611
+ };
612
+ }
613
+ function AsyncGenerator(e) {
614
+ var r, t;
615
+ function resume(r$1, t$1) {
616
+ try {
617
+ var n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield$1;
618
+ Promise.resolve(u ? o.v : o).then(function(t$2) {
619
+ if (u) {
620
+ var i = "return" === r$1 ? "return" : "next";
621
+ if (!o.k || t$2.done) return resume(i, t$2);
622
+ t$2 = e[i](t$2).value;
623
+ }
624
+ settle(n.done ? "return" : "normal", t$2);
625
+ }, function(e$1) {
626
+ resume("throw", e$1);
627
+ });
628
+ } catch (e$1) {
629
+ settle("throw", e$1);
630
+ }
631
+ }
632
+ function settle(e$1, n) {
633
+ switch (e$1) {
634
+ case "return":
635
+ r.resolve({
636
+ value: n,
637
+ done: !0
638
+ });
639
+ break;
640
+ case "throw":
641
+ r.reject(n);
642
+ break;
643
+ default: r.resolve({
644
+ value: n,
645
+ done: !1
646
+ });
647
+ }
648
+ (r = r.next) ? resume(r.key, r.arg) : t = null;
649
+ }
650
+ this._invoke = function(e$1, n) {
651
+ return new Promise(function(o, u) {
652
+ var i = {
653
+ key: e$1,
654
+ arg: n,
655
+ resolve: o,
656
+ reject: u,
657
+ next: null
658
+ };
659
+ t ? t = t.next = i : (r = t = i, resume(e$1, n));
660
+ });
661
+ }, "function" != typeof e["return"] && (this["return"] = void 0);
662
+ }
663
+ AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() {
664
+ return this;
665
+ }, AsyncGenerator.prototype.next = function(e) {
666
+ return this._invoke("next", e);
667
+ }, AsyncGenerator.prototype["throw"] = function(e) {
668
+ return this._invoke("throw", e);
669
+ }, AsyncGenerator.prototype["return"] = function(e) {
670
+ return this._invoke("return", e);
671
+ };
672
+ module.exports = _wrapAsyncGenerator$6, module.exports.__esModule = true, module.exports["default"] = module.exports;
673
+ } });
674
+
675
+ //#endregion
676
+ //#region src/unstable-core-do-not-import/stream/utils/asyncIterable.ts
677
+ var import_usingCtx$4 = __toESM(require_usingCtx(), 1);
678
+ var import_awaitAsyncGenerator$4 = __toESM(require_awaitAsyncGenerator(), 1);
679
+ var import_wrapAsyncGenerator$5 = __toESM(require_wrapAsyncGenerator(), 1);
680
+ function iteratorResource(iterable) {
681
+ const iterator = iterable[Symbol.asyncIterator]();
682
+ if (iterator[Symbol.asyncDispose]) return iterator;
683
+ return makeAsyncResource(iterator, async () => {
684
+ var _iterator$return;
685
+ await ((_iterator$return = iterator.return) === null || _iterator$return === void 0 ? void 0 : _iterator$return.call(iterator));
686
+ });
687
+ }
688
+ /**
689
+ * Derives a new {@link AsyncGenerator} based on {@link iterable}, that automatically aborts after the specified duration.
690
+ */
691
+ function withMaxDuration(_x, _x2) {
692
+ return _withMaxDuration.apply(this, arguments);
693
+ }
694
+ function _withMaxDuration() {
695
+ _withMaxDuration = (0, import_wrapAsyncGenerator$5.default)(function* (iterable, opts) {
696
+ try {
697
+ var _usingCtx$1 = (0, import_usingCtx$4.default)();
698
+ const iterator = _usingCtx$1.a(iteratorResource(iterable));
699
+ const timer = _usingCtx$1.u(timerResource(opts.maxDurationMs));
700
+ const timerPromise = timer.start();
701
+ let result;
702
+ while (true) {
703
+ result = yield (0, import_awaitAsyncGenerator$4.default)(Unpromise.race([iterator.next(), timerPromise]));
704
+ if (result === disposablePromiseTimerResult) throwAbortError();
705
+ if (result.done) return result;
706
+ yield result.value;
707
+ result = null;
708
+ }
709
+ } catch (_) {
710
+ _usingCtx$1.e = _;
711
+ } finally {
712
+ yield (0, import_awaitAsyncGenerator$4.default)(_usingCtx$1.d());
713
+ }
714
+ });
715
+ return _withMaxDuration.apply(this, arguments);
716
+ }
717
+ /**
718
+ * Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields its first
719
+ * {@link count} values. Then, a grace period of {@link gracePeriodMs} is started in which further
720
+ * values may still come through. After this period, the generator aborts.
721
+ */
722
+ function takeWithGrace(_x3, _x4) {
723
+ return _takeWithGrace.apply(this, arguments);
724
+ }
725
+ function _takeWithGrace() {
726
+ _takeWithGrace = (0, import_wrapAsyncGenerator$5.default)(function* (iterable, opts) {
727
+ try {
728
+ var _usingCtx3 = (0, import_usingCtx$4.default)();
729
+ const iterator = _usingCtx3.a(iteratorResource(iterable));
730
+ let result;
731
+ const timer = _usingCtx3.u(timerResource(opts.gracePeriodMs));
732
+ let count = opts.count;
733
+ let timerPromise = new Promise(() => {});
734
+ while (true) {
735
+ result = yield (0, import_awaitAsyncGenerator$4.default)(Unpromise.race([iterator.next(), timerPromise]));
736
+ if (result === disposablePromiseTimerResult) throwAbortError();
737
+ if (result.done) return result.value;
738
+ yield result.value;
739
+ if (--count === 0) timerPromise = timer.start();
740
+ result = null;
741
+ }
742
+ } catch (_) {
743
+ _usingCtx3.e = _;
744
+ } finally {
745
+ yield (0, import_awaitAsyncGenerator$4.default)(_usingCtx3.d());
746
+ }
747
+ });
748
+ return _takeWithGrace.apply(this, arguments);
749
+ }
750
+
751
+ //#endregion
752
+ //#region src/unstable-core-do-not-import/stream/utils/createDeferred.ts
753
+ function createDeferred() {
754
+ let resolve;
755
+ let reject;
756
+ const promise = new Promise((res, rej) => {
757
+ resolve = res;
758
+ reject = rej;
759
+ });
760
+ return {
761
+ promise,
762
+ resolve,
763
+ reject
764
+ };
765
+ }
766
+
767
+ //#endregion
768
+ //#region src/unstable-core-do-not-import/stream/utils/mergeAsyncIterables.ts
769
+ var import_usingCtx$3 = __toESM(require_usingCtx(), 1);
770
+ var import_awaitAsyncGenerator$3 = __toESM(require_awaitAsyncGenerator(), 1);
771
+ var import_wrapAsyncGenerator$4 = __toESM(require_wrapAsyncGenerator(), 1);
772
+ function createManagedIterator(iterable, onResult) {
773
+ const iterator = iterable[Symbol.asyncIterator]();
774
+ let state = "idle";
775
+ function cleanup() {
776
+ state = "done";
777
+ onResult = () => {};
778
+ }
779
+ function pull() {
780
+ if (state !== "idle") return;
781
+ state = "pending";
782
+ const next = iterator.next();
783
+ next.then((result) => {
784
+ if (result.done) {
785
+ state = "done";
786
+ onResult({
787
+ status: "return",
788
+ value: result.value
789
+ });
790
+ cleanup();
791
+ return;
792
+ }
793
+ state = "idle";
794
+ onResult({
795
+ status: "yield",
796
+ value: result.value
797
+ });
798
+ }).catch((cause) => {
799
+ onResult({
800
+ status: "error",
801
+ error: cause
802
+ });
803
+ cleanup();
804
+ });
805
+ }
806
+ return {
807
+ pull,
808
+ destroy: async () => {
809
+ var _iterator$return;
810
+ cleanup();
811
+ await ((_iterator$return = iterator.return) === null || _iterator$return === void 0 ? void 0 : _iterator$return.call(iterator));
812
+ }
813
+ };
814
+ }
815
+ /**
816
+ * Creates a new async iterable that merges multiple async iterables into a single stream.
817
+ * Values from the input iterables are yielded in the order they resolve, similar to Promise.race().
818
+ *
819
+ * New iterables can be added dynamically using the returned {@link MergedAsyncIterables.add} method, even after iteration has started.
820
+ *
821
+ * If any of the input iterables throws an error, that error will be propagated through the merged stream.
822
+ * Other iterables will not continue to be processed.
823
+ *
824
+ * @template TYield The type of values yielded by the input iterables
825
+ */
826
+ function mergeAsyncIterables() {
827
+ let state = "idle";
828
+ let flushSignal = createDeferred();
829
+ /**
830
+ * used while {@link state} is `idle`
831
+ */
832
+ const iterables = [];
833
+ /**
834
+ * used while {@link state} is `pending`
835
+ */
836
+ const iterators = /* @__PURE__ */ new Set();
837
+ const buffer = [];
838
+ function initIterable(iterable) {
839
+ if (state !== "pending") return;
840
+ const iterator = createManagedIterator(iterable, (result) => {
841
+ if (state !== "pending") return;
842
+ switch (result.status) {
843
+ case "yield":
844
+ buffer.push([iterator, result]);
845
+ break;
846
+ case "return":
847
+ iterators.delete(iterator);
848
+ break;
849
+ case "error":
850
+ buffer.push([iterator, result]);
851
+ iterators.delete(iterator);
852
+ break;
853
+ }
854
+ flushSignal.resolve();
855
+ });
856
+ iterators.add(iterator);
857
+ iterator.pull();
858
+ }
859
+ return {
860
+ add(iterable) {
861
+ switch (state) {
862
+ case "idle":
863
+ iterables.push(iterable);
864
+ break;
865
+ case "pending":
866
+ initIterable(iterable);
867
+ break;
868
+ case "done": break;
869
+ }
870
+ },
871
+ [Symbol.asyncIterator]() {
872
+ return (0, import_wrapAsyncGenerator$4.default)(function* () {
873
+ try {
874
+ var _usingCtx$1 = (0, import_usingCtx$3.default)();
875
+ if (state !== "idle") throw new Error("Cannot iterate twice");
876
+ state = "pending";
877
+ const _finally = _usingCtx$1.a(makeAsyncResource({}, async () => {
878
+ state = "done";
879
+ const errors = [];
880
+ await Promise.all(Array.from(iterators.values()).map(async (it) => {
881
+ try {
882
+ await it.destroy();
883
+ } catch (cause) {
884
+ errors.push(cause);
885
+ }
886
+ }));
887
+ buffer.length = 0;
888
+ iterators.clear();
889
+ flushSignal.resolve();
890
+ if (errors.length > 0) throw new AggregateError(errors);
891
+ }));
892
+ while (iterables.length > 0) initIterable(iterables.shift());
893
+ while (iterators.size > 0) {
894
+ yield (0, import_awaitAsyncGenerator$3.default)(flushSignal.promise);
895
+ while (buffer.length > 0) {
896
+ const [iterator, result] = buffer.shift();
897
+ switch (result.status) {
898
+ case "yield":
899
+ yield result.value;
900
+ iterator.pull();
901
+ break;
902
+ case "error": throw result.error;
903
+ }
904
+ }
905
+ flushSignal = createDeferred();
906
+ }
907
+ } catch (_) {
908
+ _usingCtx$1.e = _;
909
+ } finally {
910
+ yield (0, import_awaitAsyncGenerator$3.default)(_usingCtx$1.d());
911
+ }
912
+ })();
913
+ }
914
+ };
915
+ }
916
+
917
+ //#endregion
918
+ //#region src/unstable-core-do-not-import/stream/utils/readableStreamFrom.ts
919
+ /**
920
+ * Creates a ReadableStream from an AsyncIterable.
921
+ *
922
+ * @param iterable - The source AsyncIterable to stream from
923
+ * @returns A ReadableStream that yields values from the AsyncIterable
924
+ */
925
+ function readableStreamFrom(iterable) {
926
+ const iterator = iterable[Symbol.asyncIterator]();
927
+ return new ReadableStream({
928
+ async cancel() {
929
+ var _iterator$return;
930
+ await ((_iterator$return = iterator.return) === null || _iterator$return === void 0 ? void 0 : _iterator$return.call(iterator));
931
+ },
932
+ async pull(controller) {
933
+ const result = await iterator.next();
934
+ if (result.done) {
935
+ controller.close();
936
+ return;
937
+ }
938
+ controller.enqueue(result.value);
939
+ }
940
+ });
941
+ }
942
+
943
+ //#endregion
944
+ //#region src/unstable-core-do-not-import/stream/utils/withPing.ts
945
+ var import_usingCtx$2 = __toESM(require_usingCtx(), 1);
946
+ var import_awaitAsyncGenerator$2 = __toESM(require_awaitAsyncGenerator(), 1);
947
+ var import_wrapAsyncGenerator$3 = __toESM(require_wrapAsyncGenerator(), 1);
948
+ const PING_SYM = Symbol("ping");
949
+ /**
950
+ * Derives a new {@link AsyncGenerator} based of {@link iterable}, that yields {@link PING_SYM}
951
+ * whenever no value has been yielded for {@link pingIntervalMs}.
952
+ */
953
+ function withPing(_x, _x2) {
954
+ return _withPing.apply(this, arguments);
955
+ }
956
+ function _withPing() {
957
+ _withPing = (0, import_wrapAsyncGenerator$3.default)(function* (iterable, pingIntervalMs) {
958
+ try {
959
+ var _usingCtx$1 = (0, import_usingCtx$2.default)();
960
+ const iterator = _usingCtx$1.a(iteratorResource(iterable));
961
+ let result;
962
+ let nextPromise = iterator.next();
963
+ while (true) try {
964
+ var _usingCtx3 = (0, import_usingCtx$2.default)();
965
+ const pingPromise = _usingCtx3.u(timerResource(pingIntervalMs));
966
+ result = yield (0, import_awaitAsyncGenerator$2.default)(Unpromise.race([nextPromise, pingPromise.start()]));
967
+ if (result === disposablePromiseTimerResult) {
968
+ yield PING_SYM;
969
+ continue;
970
+ }
971
+ if (result.done) return result.value;
972
+ nextPromise = iterator.next();
973
+ yield result.value;
974
+ result = null;
975
+ } catch (_) {
976
+ _usingCtx3.e = _;
977
+ } finally {
978
+ _usingCtx3.d();
979
+ }
980
+ } catch (_) {
981
+ _usingCtx$1.e = _;
982
+ } finally {
983
+ yield (0, import_awaitAsyncGenerator$2.default)(_usingCtx$1.d());
984
+ }
985
+ });
986
+ return _withPing.apply(this, arguments);
987
+ }
988
+
989
+ //#endregion
990
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js
991
+ var require_asyncIterator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) {
992
+ function _asyncIterator$2(r) {
993
+ var n, t, o, e = 2;
994
+ for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {
995
+ if (t && null != (n = r[t])) return n.call(r);
996
+ if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
997
+ t = "@@asyncIterator", o = "@@iterator";
998
+ }
999
+ throw new TypeError("Object is not async iterable");
1000
+ }
1001
+ function AsyncFromSyncIterator(r) {
1002
+ function AsyncFromSyncIteratorContinuation(r$1) {
1003
+ if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object."));
1004
+ var n = r$1.done;
1005
+ return Promise.resolve(r$1.value).then(function(r$2) {
1006
+ return {
1007
+ value: r$2,
1008
+ done: n
1009
+ };
1010
+ });
1011
+ }
1012
+ return AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) {
1013
+ this.s = r$1, this.n = r$1.next;
1014
+ }, AsyncFromSyncIterator.prototype = {
1015
+ s: null,
1016
+ n: null,
1017
+ next: function next() {
1018
+ return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
1019
+ },
1020
+ "return": function _return(r$1) {
1021
+ var n = this.s["return"];
1022
+ return void 0 === n ? Promise.resolve({
1023
+ value: r$1,
1024
+ done: !0
1025
+ }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
1026
+ },
1027
+ "throw": function _throw(r$1) {
1028
+ var n = this.s["return"];
1029
+ return void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
1030
+ }
1031
+ }, new AsyncFromSyncIterator(r);
1032
+ }
1033
+ module.exports = _asyncIterator$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
1034
+ } });
1035
+
1036
+ //#endregion
1037
+ //#region src/unstable-core-do-not-import/stream/jsonl.ts
1038
+ var import_awaitAsyncGenerator$1 = __toESM(require_awaitAsyncGenerator(), 1);
1039
+ var import_wrapAsyncGenerator$2 = __toESM(require_wrapAsyncGenerator(), 1);
1040
+ var import_usingCtx$1 = __toESM(require_usingCtx(), 1);
1041
+ var import_asyncIterator$1 = __toESM(require_asyncIterator(), 1);
1042
+ function isPlainObject(value) {
1043
+ return Object.prototype.toString.call(value) === "[object Object]";
1044
+ }
1045
+ const CHUNK_VALUE_TYPE_PROMISE = 0;
1046
+ const CHUNK_VALUE_TYPE_ASYNC_ITERABLE = 1;
1047
+ const PROMISE_STATUS_FULFILLED = 0;
1048
+ const PROMISE_STATUS_REJECTED = 1;
1049
+ const ASYNC_ITERABLE_STATUS_RETURN = 0;
1050
+ const ASYNC_ITERABLE_STATUS_YIELD = 1;
1051
+ const ASYNC_ITERABLE_STATUS_ERROR = 2;
1052
+ function isPromise(value) {
1053
+ return (isObject(value) || isFunction(value)) && typeof (value === null || value === void 0 ? void 0 : value["then"]) === "function" && typeof (value === null || value === void 0 ? void 0 : value["catch"]) === "function";
1054
+ }
1055
+ var MaxDepthError = class extends Error {
1056
+ constructor(path) {
1057
+ super("Max depth reached at path: " + path.join("."));
1058
+ this.path = path;
1059
+ }
1060
+ };
1061
+ function createBatchStreamProducer(_x3) {
1062
+ return _createBatchStreamProducer.apply(this, arguments);
1063
+ }
1064
+ function _createBatchStreamProducer() {
1065
+ _createBatchStreamProducer = (0, import_wrapAsyncGenerator$2.default)(function* (opts) {
1066
+ const { data } = opts;
1067
+ let counter = 0;
1068
+ const placeholder = 0;
1069
+ const mergedIterables = mergeAsyncIterables();
1070
+ function registerAsync(callback) {
1071
+ const idx = counter++;
1072
+ const iterable$1 = callback(idx);
1073
+ mergedIterables.add(iterable$1);
1074
+ return idx;
1075
+ }
1076
+ function encodePromise(promise, path) {
1077
+ return registerAsync(/* @__PURE__ */ function() {
1078
+ var _ref = (0, import_wrapAsyncGenerator$2.default)(function* (idx) {
1079
+ const error = checkMaxDepth(path);
1080
+ if (error) {
1081
+ promise.catch((cause) => {
1082
+ var _opts$onError;
1083
+ (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, {
1084
+ error: cause,
1085
+ path
1086
+ });
1087
+ });
1088
+ promise = Promise.reject(error);
1089
+ }
1090
+ try {
1091
+ const next = yield (0, import_awaitAsyncGenerator$1.default)(promise);
1092
+ yield [
1093
+ idx,
1094
+ PROMISE_STATUS_FULFILLED,
1095
+ encode(next, path)
1096
+ ];
1097
+ } catch (cause) {
1098
+ var _opts$onError2, _opts$formatError;
1099
+ (_opts$onError2 = opts.onError) === null || _opts$onError2 === void 0 || _opts$onError2.call(opts, {
1100
+ error: cause,
1101
+ path
1102
+ });
1103
+ yield [
1104
+ idx,
1105
+ PROMISE_STATUS_REJECTED,
1106
+ (_opts$formatError = opts.formatError) === null || _opts$formatError === void 0 ? void 0 : _opts$formatError.call(opts, {
1107
+ error: cause,
1108
+ path
1109
+ })
1110
+ ];
1111
+ }
1112
+ });
1113
+ return function(_x) {
1114
+ return _ref.apply(this, arguments);
1115
+ };
1116
+ }());
1117
+ }
1118
+ function encodeAsyncIterable(iterable$1, path) {
1119
+ return registerAsync(/* @__PURE__ */ function() {
1120
+ var _ref2 = (0, import_wrapAsyncGenerator$2.default)(function* (idx) {
1121
+ try {
1122
+ var _usingCtx$1 = (0, import_usingCtx$1.default)();
1123
+ const error = checkMaxDepth(path);
1124
+ if (error) throw error;
1125
+ const iterator = _usingCtx$1.a(iteratorResource(iterable$1));
1126
+ try {
1127
+ while (true) {
1128
+ const next = yield (0, import_awaitAsyncGenerator$1.default)(iterator.next());
1129
+ if (next.done) {
1130
+ yield [
1131
+ idx,
1132
+ ASYNC_ITERABLE_STATUS_RETURN,
1133
+ encode(next.value, path)
1134
+ ];
1135
+ break;
1136
+ }
1137
+ yield [
1138
+ idx,
1139
+ ASYNC_ITERABLE_STATUS_YIELD,
1140
+ encode(next.value, path)
1141
+ ];
1142
+ }
1143
+ } catch (cause) {
1144
+ var _opts$onError3, _opts$formatError2;
1145
+ (_opts$onError3 = opts.onError) === null || _opts$onError3 === void 0 || _opts$onError3.call(opts, {
1146
+ error: cause,
1147
+ path
1148
+ });
1149
+ yield [
1150
+ idx,
1151
+ ASYNC_ITERABLE_STATUS_ERROR,
1152
+ (_opts$formatError2 = opts.formatError) === null || _opts$formatError2 === void 0 ? void 0 : _opts$formatError2.call(opts, {
1153
+ error: cause,
1154
+ path
1155
+ })
1156
+ ];
1157
+ }
1158
+ } catch (_) {
1159
+ _usingCtx$1.e = _;
1160
+ } finally {
1161
+ yield (0, import_awaitAsyncGenerator$1.default)(_usingCtx$1.d());
1162
+ }
1163
+ });
1164
+ return function(_x2) {
1165
+ return _ref2.apply(this, arguments);
1166
+ };
1167
+ }());
1168
+ }
1169
+ function checkMaxDepth(path) {
1170
+ if (opts.maxDepth && path.length > opts.maxDepth) return new MaxDepthError(path);
1171
+ return null;
1172
+ }
1173
+ function encodeAsync(value, path) {
1174
+ if (isPromise(value)) return [CHUNK_VALUE_TYPE_PROMISE, encodePromise(value, path)];
1175
+ if (isAsyncIterable(value)) {
1176
+ if (opts.maxDepth && path.length >= opts.maxDepth) throw new Error("Max depth reached");
1177
+ return [CHUNK_VALUE_TYPE_ASYNC_ITERABLE, encodeAsyncIterable(value, path)];
1178
+ }
1179
+ return null;
1180
+ }
1181
+ function encode(value, path) {
1182
+ if (value === void 0) return [[]];
1183
+ const reg = encodeAsync(value, path);
1184
+ if (reg) return [[placeholder], [null, ...reg]];
1185
+ if (!isPlainObject(value)) return [[value]];
1186
+ const newObj = {};
1187
+ const asyncValues = [];
1188
+ for (const [key, item] of Object.entries(value)) {
1189
+ const transformed = encodeAsync(item, [...path, key]);
1190
+ if (!transformed) {
1191
+ newObj[key] = item;
1192
+ continue;
1193
+ }
1194
+ newObj[key] = placeholder;
1195
+ asyncValues.push([key, ...transformed]);
1196
+ }
1197
+ return [[newObj], ...asyncValues];
1198
+ }
1199
+ const newHead = {};
1200
+ for (const [key, item] of Object.entries(data)) newHead[key] = encode(item, [key]);
1201
+ yield newHead;
1202
+ let iterable = mergedIterables;
1203
+ if (opts.pingMs) iterable = withPing(mergedIterables, opts.pingMs);
1204
+ var _iteratorAbruptCompletion = false;
1205
+ var _didIteratorError = false;
1206
+ var _iteratorError;
1207
+ try {
1208
+ for (var _iterator = (0, import_asyncIterator$1.default)(iterable), _step; _iteratorAbruptCompletion = !(_step = yield (0, import_awaitAsyncGenerator$1.default)(_iterator.next())).done; _iteratorAbruptCompletion = false) {
1209
+ const value = _step.value;
1210
+ yield value;
1211
+ }
1212
+ } catch (err) {
1213
+ _didIteratorError = true;
1214
+ _iteratorError = err;
1215
+ } finally {
1216
+ try {
1217
+ if (_iteratorAbruptCompletion && _iterator.return != null) yield (0, import_awaitAsyncGenerator$1.default)(_iterator.return());
1218
+ } finally {
1219
+ if (_didIteratorError) throw _iteratorError;
1220
+ }
1221
+ }
1222
+ });
1223
+ return _createBatchStreamProducer.apply(this, arguments);
1224
+ }
1225
+ /**
1226
+ * JSON Lines stream producer
1227
+ * @see https://jsonlines.org/
1228
+ */
1229
+ function jsonlStreamProducer(opts) {
1230
+ let stream = readableStreamFrom(createBatchStreamProducer(opts));
1231
+ const { serialize } = opts;
1232
+ if (serialize) stream = stream.pipeThrough(new TransformStream({ transform(chunk, controller) {
1233
+ if (chunk === PING_SYM) controller.enqueue(PING_SYM);
1234
+ else controller.enqueue(serialize(chunk));
1235
+ } }));
1236
+ return stream.pipeThrough(new TransformStream({ transform(chunk, controller) {
1237
+ if (chunk === PING_SYM) controller.enqueue(" ");
1238
+ else controller.enqueue(JSON.stringify(chunk) + "\n");
1239
+ } })).pipeThrough(new TextEncoderStream());
1240
+ }
1241
+ var AsyncError = class extends Error {
1242
+ constructor(data) {
1243
+ super("Received error from server");
1244
+ this.data = data;
1245
+ }
1246
+ };
1247
+ const nodeJsStreamToReaderEsque = (source) => {
1248
+ return { getReader() {
1249
+ const stream = new ReadableStream({ start(controller) {
1250
+ source.on("data", (chunk) => {
1251
+ controller.enqueue(chunk);
1252
+ });
1253
+ source.on("end", () => {
1254
+ controller.close();
1255
+ });
1256
+ source.on("error", (error) => {
1257
+ controller.error(error);
1258
+ });
1259
+ } });
1260
+ return stream.getReader();
1261
+ } };
1262
+ };
1263
+ function createLineAccumulator(from) {
1264
+ const reader = "getReader" in from ? from.getReader() : nodeJsStreamToReaderEsque(from).getReader();
1265
+ let lineAggregate = "";
1266
+ return new ReadableStream({
1267
+ async pull(controller) {
1268
+ const { done, value } = await reader.read();
1269
+ if (done) controller.close();
1270
+ else controller.enqueue(value);
1271
+ },
1272
+ cancel() {
1273
+ return reader.cancel();
1274
+ }
1275
+ }).pipeThrough(new TextDecoderStream()).pipeThrough(new TransformStream({ transform(chunk, controller) {
1276
+ var _parts$pop;
1277
+ lineAggregate += chunk;
1278
+ const parts = lineAggregate.split("\n");
1279
+ lineAggregate = (_parts$pop = parts.pop()) !== null && _parts$pop !== void 0 ? _parts$pop : "";
1280
+ for (const part of parts) controller.enqueue(part);
1281
+ } }));
1282
+ }
1283
+ function createConsumerStream(from) {
1284
+ const stream = createLineAccumulator(from);
1285
+ let sentHead = false;
1286
+ return stream.pipeThrough(new TransformStream({ transform(line, controller) {
1287
+ if (!sentHead) {
1288
+ const head = JSON.parse(line);
1289
+ controller.enqueue(head);
1290
+ sentHead = true;
1291
+ } else {
1292
+ const chunk = JSON.parse(line);
1293
+ controller.enqueue(chunk);
1294
+ }
1295
+ } }));
1296
+ }
1297
+ /**
1298
+ * Creates a handler for managing stream controllers and their lifecycle
1299
+ */
1300
+ function createStreamsManager(abortController) {
1301
+ const controllerMap = /* @__PURE__ */ new Map();
1302
+ /**
1303
+ * Checks if there are no pending controllers or deferred promises
1304
+ */
1305
+ function isEmpty() {
1306
+ return Array.from(controllerMap.values()).every((c) => c.closed);
1307
+ }
1308
+ /**
1309
+ * Creates a stream controller
1310
+ */
1311
+ function createStreamController() {
1312
+ let originalController;
1313
+ const stream = new ReadableStream({ start(controller) {
1314
+ originalController = controller;
1315
+ } });
1316
+ const streamController = {
1317
+ enqueue: (v) => originalController.enqueue(v),
1318
+ close: () => {
1319
+ originalController.close();
1320
+ clear();
1321
+ if (isEmpty()) abortController.abort();
1322
+ },
1323
+ closed: false,
1324
+ getReaderResource: () => {
1325
+ const reader = stream.getReader();
1326
+ return makeResource(reader, () => {
1327
+ reader.releaseLock();
1328
+ streamController.close();
1329
+ });
1330
+ },
1331
+ error: (reason) => {
1332
+ originalController.error(reason);
1333
+ clear();
1334
+ }
1335
+ };
1336
+ function clear() {
1337
+ Object.assign(streamController, {
1338
+ closed: true,
1339
+ close: () => {},
1340
+ enqueue: () => {},
1341
+ getReaderResource: null,
1342
+ error: () => {}
1343
+ });
1344
+ }
1345
+ return streamController;
1346
+ }
1347
+ /**
1348
+ * Gets or creates a stream controller
1349
+ */
1350
+ function getOrCreate(chunkId) {
1351
+ let c = controllerMap.get(chunkId);
1352
+ if (!c) {
1353
+ c = createStreamController();
1354
+ controllerMap.set(chunkId, c);
1355
+ }
1356
+ return c;
1357
+ }
1358
+ /**
1359
+ * Cancels all pending controllers and rejects deferred promises
1360
+ */
1361
+ function cancelAll(reason) {
1362
+ for (const controller of controllerMap.values()) controller.error(reason);
1363
+ }
1364
+ return {
1365
+ getOrCreate,
1366
+ isEmpty,
1367
+ cancelAll
1368
+ };
1369
+ }
1370
+ /**
1371
+ * JSON Lines stream consumer
1372
+ * @see https://jsonlines.org/
1373
+ */
1374
+ async function jsonlStreamConsumer(opts) {
1375
+ const { deserialize = (v) => v } = opts;
1376
+ let source = createConsumerStream(opts.from);
1377
+ if (deserialize) source = source.pipeThrough(new TransformStream({ transform(chunk, controller) {
1378
+ controller.enqueue(deserialize(chunk));
1379
+ } }));
1380
+ let headDeferred = createDeferred();
1381
+ const streamManager = createStreamsManager(opts.abortController);
1382
+ function decodeChunkDefinition(value) {
1383
+ const [_path, type, chunkId] = value;
1384
+ const controller = streamManager.getOrCreate(chunkId);
1385
+ switch (type) {
1386
+ case CHUNK_VALUE_TYPE_PROMISE: return run(async () => {
1387
+ try {
1388
+ var _usingCtx3 = (0, import_usingCtx$1.default)();
1389
+ const reader = _usingCtx3.u(controller.getReaderResource());
1390
+ const { value: value$1 } = await reader.read();
1391
+ const [_chunkId, status, data] = value$1;
1392
+ switch (status) {
1393
+ case PROMISE_STATUS_FULFILLED: return decode(data);
1394
+ case PROMISE_STATUS_REJECTED:
1395
+ var _opts$formatError3, _opts$formatError4;
1396
+ throw (_opts$formatError3 = (_opts$formatError4 = opts.formatError) === null || _opts$formatError4 === void 0 ? void 0 : _opts$formatError4.call(opts, { error: data })) !== null && _opts$formatError3 !== void 0 ? _opts$formatError3 : new AsyncError(data);
1397
+ }
1398
+ } catch (_) {
1399
+ _usingCtx3.e = _;
1400
+ } finally {
1401
+ _usingCtx3.d();
1402
+ }
1403
+ });
1404
+ case CHUNK_VALUE_TYPE_ASYNC_ITERABLE: return run((0, import_wrapAsyncGenerator$2.default)(function* () {
1405
+ try {
1406
+ var _usingCtx4 = (0, import_usingCtx$1.default)();
1407
+ const reader = _usingCtx4.u(controller.getReaderResource());
1408
+ while (true) {
1409
+ const { value: value$1 } = yield (0, import_awaitAsyncGenerator$1.default)(reader.read());
1410
+ const [_chunkId, status, data] = value$1;
1411
+ switch (status) {
1412
+ case ASYNC_ITERABLE_STATUS_YIELD:
1413
+ yield decode(data);
1414
+ break;
1415
+ case ASYNC_ITERABLE_STATUS_RETURN: return decode(data);
1416
+ case ASYNC_ITERABLE_STATUS_ERROR:
1417
+ var _opts$formatError5, _opts$formatError6;
1418
+ throw (_opts$formatError5 = (_opts$formatError6 = opts.formatError) === null || _opts$formatError6 === void 0 ? void 0 : _opts$formatError6.call(opts, { error: data })) !== null && _opts$formatError5 !== void 0 ? _opts$formatError5 : new AsyncError(data);
1419
+ }
1420
+ }
1421
+ } catch (_) {
1422
+ _usingCtx4.e = _;
1423
+ } finally {
1424
+ _usingCtx4.d();
1425
+ }
1426
+ }));
1427
+ }
1428
+ }
1429
+ function decode(value) {
1430
+ const [[data], ...asyncProps] = value;
1431
+ for (const value$1 of asyncProps) {
1432
+ const [key] = value$1;
1433
+ const decoded = decodeChunkDefinition(value$1);
1434
+ if (key === null) return decoded;
1435
+ data[key] = decoded;
1436
+ }
1437
+ return data;
1438
+ }
1439
+ const closeOrAbort = (reason) => {
1440
+ headDeferred === null || headDeferred === void 0 || headDeferred.reject(reason);
1441
+ streamManager.cancelAll(reason);
1442
+ };
1443
+ source.pipeTo(new WritableStream({
1444
+ write(chunkOrHead) {
1445
+ if (headDeferred) {
1446
+ const head = chunkOrHead;
1447
+ for (const [key, value] of Object.entries(chunkOrHead)) {
1448
+ const parsed = decode(value);
1449
+ head[key] = parsed;
1450
+ }
1451
+ headDeferred.resolve(head);
1452
+ headDeferred = null;
1453
+ return;
1454
+ }
1455
+ const chunk = chunkOrHead;
1456
+ const [idx] = chunk;
1457
+ const controller = streamManager.getOrCreate(idx);
1458
+ controller.enqueue(chunk);
1459
+ },
1460
+ close: () => closeOrAbort(new Error("Stream closed")),
1461
+ abort: closeOrAbort
1462
+ }), { signal: opts.abortController.signal }).catch((error) => {
1463
+ var _opts$onError4;
1464
+ (_opts$onError4 = opts.onError) === null || _opts$onError4 === void 0 || _opts$onError4.call(opts, { error });
1465
+ closeOrAbort(error);
1466
+ });
1467
+ return [await headDeferred.promise, streamManager];
1468
+ }
1469
+
1470
+ //#endregion
1471
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js
1472
+ var require_asyncGeneratorDelegate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js"(exports, module) {
1473
+ var OverloadYield = require_OverloadYield();
1474
+ function _asyncGeneratorDelegate$1(t) {
1475
+ var e = {}, n = !1;
1476
+ function pump(e$1, r) {
1477
+ return n = !0, r = new Promise(function(n$1) {
1478
+ n$1(t[e$1](r));
1479
+ }), {
1480
+ done: !1,
1481
+ value: new OverloadYield(r, 1)
1482
+ };
1483
+ }
1484
+ return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function() {
1485
+ return this;
1486
+ }, e.next = function(t$1) {
1487
+ return n ? (n = !1, t$1) : pump("next", t$1);
1488
+ }, "function" == typeof t["throw"] && (e["throw"] = function(t$1) {
1489
+ if (n) throw n = !1, t$1;
1490
+ return pump("throw", t$1);
1491
+ }), "function" == typeof t["return"] && (e["return"] = function(t$1) {
1492
+ return n ? (n = !1, t$1) : pump("return", t$1);
1493
+ }), e;
1494
+ }
1495
+ module.exports = _asyncGeneratorDelegate$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
1496
+ } });
1497
+
1498
+ //#endregion
1499
+ //#region src/unstable-core-do-not-import/stream/sse.ts
1500
+ var import_asyncIterator = __toESM(require_asyncIterator(), 1);
1501
+ var import_awaitAsyncGenerator = __toESM(require_awaitAsyncGenerator(), 1);
1502
+ var import_wrapAsyncGenerator$1 = __toESM(require_wrapAsyncGenerator(), 1);
1503
+ var import_asyncGeneratorDelegate = __toESM(require_asyncGeneratorDelegate(), 1);
1504
+ var import_usingCtx = __toESM(require_usingCtx(), 1);
1505
+ const PING_EVENT = "ping";
1506
+ const SERIALIZED_ERROR_EVENT = "serialized-error";
1507
+ const CONNECTED_EVENT = "connected";
1508
+ const RETURN_EVENT = "return";
1509
+ /**
1510
+ *
1511
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html
1512
+ */
1513
+ function sseStreamProducer(opts) {
1514
+ var _opts$ping$enabled, _opts$ping, _opts$ping$intervalMs, _opts$ping2, _opts$client;
1515
+ const { serialize = identity } = opts;
1516
+ const ping = {
1517
+ enabled: (_opts$ping$enabled = (_opts$ping = opts.ping) === null || _opts$ping === void 0 ? void 0 : _opts$ping.enabled) !== null && _opts$ping$enabled !== void 0 ? _opts$ping$enabled : false,
1518
+ intervalMs: (_opts$ping$intervalMs = (_opts$ping2 = opts.ping) === null || _opts$ping2 === void 0 ? void 0 : _opts$ping2.intervalMs) !== null && _opts$ping$intervalMs !== void 0 ? _opts$ping$intervalMs : 1e3
1519
+ };
1520
+ const client = (_opts$client = opts.client) !== null && _opts$client !== void 0 ? _opts$client : {};
1521
+ if (ping.enabled && client.reconnectAfterInactivityMs && ping.intervalMs > client.reconnectAfterInactivityMs) throw new Error(`Ping interval must be less than client reconnect interval to prevent unnecessary reconnection - ping.intervalMs: ${ping.intervalMs} client.reconnectAfterInactivityMs: ${client.reconnectAfterInactivityMs}`);
1522
+ function generator() {
1523
+ return _generator.apply(this, arguments);
1524
+ }
1525
+ function _generator() {
1526
+ _generator = (0, import_wrapAsyncGenerator$1.default)(function* () {
1527
+ yield {
1528
+ event: CONNECTED_EVENT,
1529
+ data: JSON.stringify(client)
1530
+ };
1531
+ let iterable = opts.data;
1532
+ if (opts.emitAndEndImmediately) iterable = takeWithGrace(iterable, {
1533
+ count: 1,
1534
+ gracePeriodMs: 1
1535
+ });
1536
+ if (opts.maxDurationMs && opts.maxDurationMs > 0 && opts.maxDurationMs !== Infinity) iterable = withMaxDuration(iterable, { maxDurationMs: opts.maxDurationMs });
1537
+ if (ping.enabled && ping.intervalMs !== Infinity && ping.intervalMs > 0) iterable = withPing(iterable, ping.intervalMs);
1538
+ let value;
1539
+ let chunk;
1540
+ var _iteratorAbruptCompletion = false;
1541
+ var _didIteratorError = false;
1542
+ var _iteratorError;
1543
+ try {
1544
+ for (var _iterator = (0, import_asyncIterator.default)(iterable), _step; _iteratorAbruptCompletion = !(_step = yield (0, import_awaitAsyncGenerator.default)(_iterator.next())).done; _iteratorAbruptCompletion = false) {
1545
+ value = _step.value;
1546
+ {
1547
+ if (value === PING_SYM) {
1548
+ yield {
1549
+ event: PING_EVENT,
1550
+ data: ""
1551
+ };
1552
+ continue;
1553
+ }
1554
+ chunk = isTrackedEnvelope(value) ? {
1555
+ id: value[0],
1556
+ data: value[1]
1557
+ } : { data: value };
1558
+ chunk.data = JSON.stringify(serialize(chunk.data));
1559
+ yield chunk;
1560
+ value = null;
1561
+ chunk = null;
1562
+ }
1563
+ }
1564
+ } catch (err) {
1565
+ _didIteratorError = true;
1566
+ _iteratorError = err;
1567
+ } finally {
1568
+ try {
1569
+ if (_iteratorAbruptCompletion && _iterator.return != null) yield (0, import_awaitAsyncGenerator.default)(_iterator.return());
1570
+ } finally {
1571
+ if (_didIteratorError) throw _iteratorError;
1572
+ }
1573
+ }
1574
+ });
1575
+ return _generator.apply(this, arguments);
1576
+ }
1577
+ function generatorWithErrorHandling() {
1578
+ return _generatorWithErrorHandling.apply(this, arguments);
1579
+ }
1580
+ function _generatorWithErrorHandling() {
1581
+ _generatorWithErrorHandling = (0, import_wrapAsyncGenerator$1.default)(function* () {
1582
+ try {
1583
+ yield* (0, import_asyncGeneratorDelegate.default)((0, import_asyncIterator.default)(generator()));
1584
+ yield {
1585
+ event: RETURN_EVENT,
1586
+ data: ""
1587
+ };
1588
+ } catch (cause) {
1589
+ var _opts$formatError, _opts$formatError2;
1590
+ if (isAbortError(cause)) return;
1591
+ const error = getTRPCErrorFromUnknown(cause);
1592
+ const data = (_opts$formatError = (_opts$formatError2 = opts.formatError) === null || _opts$formatError2 === void 0 ? void 0 : _opts$formatError2.call(opts, { error })) !== null && _opts$formatError !== void 0 ? _opts$formatError : null;
1593
+ yield {
1594
+ event: SERIALIZED_ERROR_EVENT,
1595
+ data: JSON.stringify(serialize(data))
1596
+ };
1597
+ }
1598
+ });
1599
+ return _generatorWithErrorHandling.apply(this, arguments);
1600
+ }
1601
+ const stream = readableStreamFrom(generatorWithErrorHandling());
1602
+ return stream.pipeThrough(new TransformStream({ transform(chunk, controller) {
1603
+ if ("event" in chunk) controller.enqueue(`event: ${chunk.event}\n`);
1604
+ if ("data" in chunk) controller.enqueue(`data: ${chunk.data}\n`);
1605
+ if ("id" in chunk) controller.enqueue(`id: ${chunk.id}\n`);
1606
+ if ("comment" in chunk) controller.enqueue(`: ${chunk.comment}\n`);
1607
+ controller.enqueue("\n\n");
1608
+ } })).pipeThrough(new TextEncoderStream());
1609
+ }
1610
+ async function withTimeout(opts) {
1611
+ try {
1612
+ var _usingCtx$1 = (0, import_usingCtx.default)();
1613
+ const timeoutPromise = _usingCtx$1.u(timerResource(opts.timeoutMs));
1614
+ const res = await Unpromise.race([opts.promise, timeoutPromise.start()]);
1615
+ if (res === disposablePromiseTimerResult) return await opts.onTimeout();
1616
+ return res;
1617
+ } catch (_) {
1618
+ _usingCtx$1.e = _;
1619
+ } finally {
1620
+ _usingCtx$1.d();
1621
+ }
1622
+ }
1623
+ /**
1624
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html
1625
+ */
1626
+ function sseStreamConsumer(opts) {
1627
+ const { deserialize = (v) => v } = opts;
1628
+ let clientOptions = {};
1629
+ const signal = opts.signal;
1630
+ let _es = null;
1631
+ const createStream = () => new ReadableStream({
1632
+ async start(controller) {
1633
+ const [url, init] = await Promise.all([opts.url(), opts.init()]);
1634
+ const eventSource = _es = new opts.EventSource(url, init);
1635
+ controller.enqueue({
1636
+ type: "connecting",
1637
+ eventSource: _es,
1638
+ event: null
1639
+ });
1640
+ eventSource.addEventListener(CONNECTED_EVENT, (_msg) => {
1641
+ const msg = _msg;
1642
+ const options = JSON.parse(msg.data);
1643
+ clientOptions = options;
1644
+ controller.enqueue({
1645
+ type: "connected",
1646
+ options,
1647
+ eventSource
1648
+ });
1649
+ });
1650
+ eventSource.addEventListener(SERIALIZED_ERROR_EVENT, (_msg) => {
1651
+ const msg = _msg;
1652
+ controller.enqueue({
1653
+ type: "serialized-error",
1654
+ error: deserialize(JSON.parse(msg.data)),
1655
+ eventSource
1656
+ });
1657
+ });
1658
+ eventSource.addEventListener(PING_EVENT, () => {
1659
+ controller.enqueue({
1660
+ type: "ping",
1661
+ eventSource
1662
+ });
1663
+ });
1664
+ eventSource.addEventListener(RETURN_EVENT, () => {
1665
+ eventSource.close();
1666
+ controller.close();
1667
+ _es = null;
1668
+ });
1669
+ eventSource.addEventListener("error", (event) => {
1670
+ if (eventSource.readyState === eventSource.CLOSED) controller.error(event);
1671
+ else controller.enqueue({
1672
+ type: "connecting",
1673
+ eventSource,
1674
+ event
1675
+ });
1676
+ });
1677
+ eventSource.addEventListener("message", (_msg) => {
1678
+ const msg = _msg;
1679
+ const chunk = deserialize(JSON.parse(msg.data));
1680
+ const def = { data: chunk };
1681
+ if (msg.lastEventId) def.id = msg.lastEventId;
1682
+ controller.enqueue({
1683
+ type: "data",
1684
+ data: def,
1685
+ eventSource
1686
+ });
1687
+ });
1688
+ const onAbort = () => {
1689
+ try {
1690
+ eventSource.close();
1691
+ controller.close();
1692
+ } catch (_unused) {}
1693
+ };
1694
+ if (signal.aborted) onAbort();
1695
+ else signal.addEventListener("abort", onAbort);
1696
+ },
1697
+ cancel() {
1698
+ _es === null || _es === void 0 || _es.close();
1699
+ }
1700
+ });
1701
+ const getStreamResource = () => {
1702
+ let stream = createStream();
1703
+ let reader = stream.getReader();
1704
+ async function dispose() {
1705
+ await reader.cancel();
1706
+ _es = null;
1707
+ }
1708
+ return makeAsyncResource({
1709
+ read() {
1710
+ return reader.read();
1711
+ },
1712
+ async recreate() {
1713
+ await dispose();
1714
+ stream = createStream();
1715
+ reader = stream.getReader();
1716
+ }
1717
+ }, dispose);
1718
+ };
1719
+ return run((0, import_wrapAsyncGenerator$1.default)(function* () {
1720
+ try {
1721
+ var _usingCtx3 = (0, import_usingCtx.default)();
1722
+ const stream = _usingCtx3.a(getStreamResource());
1723
+ while (true) {
1724
+ let promise = stream.read();
1725
+ const timeoutMs = clientOptions.reconnectAfterInactivityMs;
1726
+ if (timeoutMs) promise = withTimeout({
1727
+ promise,
1728
+ timeoutMs,
1729
+ onTimeout: async () => {
1730
+ const res = {
1731
+ value: {
1732
+ type: "timeout",
1733
+ ms: timeoutMs,
1734
+ eventSource: _es
1735
+ },
1736
+ done: false
1737
+ };
1738
+ await stream.recreate();
1739
+ return res;
1740
+ }
1741
+ });
1742
+ const result = yield (0, import_awaitAsyncGenerator.default)(promise);
1743
+ if (result.done) return result.value;
1744
+ yield result.value;
1745
+ }
1746
+ } catch (_) {
1747
+ _usingCtx3.e = _;
1748
+ } finally {
1749
+ yield (0, import_awaitAsyncGenerator.default)(_usingCtx3.d());
1750
+ }
1751
+ }));
1752
+ }
1753
+ const sseHeaders = {
1754
+ "Content-Type": "text/event-stream",
1755
+ "Cache-Control": "no-cache, no-transform",
1756
+ "X-Accel-Buffering": "no",
1757
+ Connection: "keep-alive"
1758
+ };
1759
+
1760
+ //#endregion
1761
+ //#region src/unstable-core-do-not-import/http/resolveResponse.ts
1762
+ var import_wrapAsyncGenerator = __toESM(require_wrapAsyncGenerator(), 1);
1763
+ var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
1764
+ function errorToAsyncIterable(err) {
1765
+ return run((0, import_wrapAsyncGenerator.default)(function* () {
1766
+ throw err;
1767
+ }));
1768
+ }
1769
+ const TYPE_ACCEPTED_METHOD_MAP = {
1770
+ mutation: ["POST"],
1771
+ query: ["GET"],
1772
+ subscription: ["GET"]
1773
+ };
1774
+ const TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE = {
1775
+ mutation: ["POST"],
1776
+ query: ["GET", "POST"],
1777
+ subscription: ["GET", "POST"]
1778
+ };
1779
+ function initResponse(initOpts) {
1780
+ var _responseMeta, _info$calls$find$proc, _info$calls$find;
1781
+ const { ctx, info, responseMeta, untransformedJSON, errors = [], headers } = initOpts;
1782
+ let status = untransformedJSON ? getHTTPStatusCode(untransformedJSON) : 200;
1783
+ const eagerGeneration = !untransformedJSON;
1784
+ const data = eagerGeneration ? [] : Array.isArray(untransformedJSON) ? untransformedJSON : [untransformedJSON];
1785
+ const meta = (_responseMeta = responseMeta === null || responseMeta === void 0 ? void 0 : responseMeta({
1786
+ ctx,
1787
+ info,
1788
+ paths: info === null || info === void 0 ? void 0 : info.calls.map((call) => call.path),
1789
+ data,
1790
+ errors,
1791
+ eagerGeneration,
1792
+ type: (_info$calls$find$proc = info === null || info === void 0 || (_info$calls$find = info.calls.find((call) => {
1793
+ var _call$procedure;
1794
+ return (_call$procedure = call.procedure) === null || _call$procedure === void 0 ? void 0 : _call$procedure._def.type;
1795
+ })) === null || _info$calls$find === void 0 || (_info$calls$find = _info$calls$find.procedure) === null || _info$calls$find === void 0 ? void 0 : _info$calls$find._def.type) !== null && _info$calls$find$proc !== void 0 ? _info$calls$find$proc : "unknown"
1796
+ })) !== null && _responseMeta !== void 0 ? _responseMeta : {};
1797
+ if (meta.headers) {
1798
+ if (meta.headers instanceof Headers) for (const [key, value] of meta.headers.entries()) headers.append(key, value);
1799
+ else
1800
+ /**
1801
+ * @deprecated, delete in v12
1802
+ */
1803
+ for (const [key, value] of Object.entries(meta.headers)) if (Array.isArray(value)) for (const v of value) headers.append(key, v);
1804
+ else if (typeof value === "string") headers.set(key, value);
1805
+ }
1806
+ if (meta.status) status = meta.status;
1807
+ return { status };
1808
+ }
1809
+ function caughtErrorToData(cause, errorOpts) {
1810
+ const { router, req, onError } = errorOpts.opts;
1811
+ const error = getTRPCErrorFromUnknown(cause);
1812
+ onError === null || onError === void 0 || onError({
1813
+ error,
1814
+ path: errorOpts.path,
1815
+ input: errorOpts.input,
1816
+ ctx: errorOpts.ctx,
1817
+ type: errorOpts.type,
1818
+ req
1819
+ });
1820
+ const untransformedJSON = { error: getErrorShape({
1821
+ config: router._def._config,
1822
+ error,
1823
+ type: errorOpts.type,
1824
+ path: errorOpts.path,
1825
+ input: errorOpts.input,
1826
+ ctx: errorOpts.ctx
1827
+ }) };
1828
+ const transformedJSON = transformTRPCResponse(router._def._config, untransformedJSON);
1829
+ const body = JSON.stringify(transformedJSON);
1830
+ return {
1831
+ error,
1832
+ untransformedJSON,
1833
+ body
1834
+ };
1835
+ }
1836
+ /**
1837
+ * Check if a value is a stream-like object
1838
+ * - if it's an async iterable
1839
+ * - if it's an object with async iterables or promises
1840
+ */
1841
+ function isDataStream(v) {
1842
+ if (!isObject(v)) return false;
1843
+ if (isAsyncIterable(v)) return true;
1844
+ return Object.values(v).some(isPromise) || Object.values(v).some(isAsyncIterable);
1845
+ }
1846
+ async function resolveResponse(opts) {
1847
+ var _ref, _opts$allowBatching, _opts$batching, _opts$allowMethodOver, _config$sse$enabled, _config$sse;
1848
+ const { router, req } = opts;
1849
+ const headers = new Headers([["vary", "trpc-accept"]]);
1850
+ const config = router._def._config;
1851
+ const url = new URL(req.url);
1852
+ if (req.method === "HEAD") return new Response(null, { status: 204 });
1853
+ const allowBatching = (_ref = (_opts$allowBatching = opts.allowBatching) !== null && _opts$allowBatching !== void 0 ? _opts$allowBatching : (_opts$batching = opts.batching) === null || _opts$batching === void 0 ? void 0 : _opts$batching.enabled) !== null && _ref !== void 0 ? _ref : true;
1854
+ const allowMethodOverride = ((_opts$allowMethodOver = opts.allowMethodOverride) !== null && _opts$allowMethodOver !== void 0 ? _opts$allowMethodOver : false) && req.method === "POST";
1855
+ const infoTuple = await run(async () => {
1856
+ try {
1857
+ return [void 0, await getRequestInfo({
1858
+ req,
1859
+ path: decodeURIComponent(opts.path),
1860
+ router,
1861
+ searchParams: url.searchParams,
1862
+ headers: opts.req.headers,
1863
+ url
1864
+ })];
1865
+ } catch (cause) {
1866
+ return [getTRPCErrorFromUnknown(cause), void 0];
1867
+ }
1868
+ });
1869
+ const ctxManager = run(() => {
1870
+ let result = void 0;
1871
+ return {
1872
+ valueOrUndefined: () => {
1873
+ if (!result) return void 0;
1874
+ return result[1];
1875
+ },
1876
+ value: () => {
1877
+ const [err, ctx] = result;
1878
+ if (err) throw err;
1879
+ return ctx;
1880
+ },
1881
+ create: async (info) => {
1882
+ if (result) throw new Error("This should only be called once - report a bug in tRPC");
1883
+ try {
1884
+ const ctx = await opts.createContext({ info });
1885
+ result = [void 0, ctx];
1886
+ } catch (cause) {
1887
+ result = [getTRPCErrorFromUnknown(cause), void 0];
1888
+ }
1889
+ }
1890
+ };
1891
+ });
1892
+ const methodMapper = allowMethodOverride ? TYPE_ACCEPTED_METHOD_MAP_WITH_METHOD_OVERRIDE : TYPE_ACCEPTED_METHOD_MAP;
1893
+ /**
1894
+ * @deprecated
1895
+ */
1896
+ const isStreamCall = req.headers.get("trpc-accept") === "application/jsonl";
1897
+ const experimentalSSE = (_config$sse$enabled = (_config$sse = config.sse) === null || _config$sse === void 0 ? void 0 : _config$sse.enabled) !== null && _config$sse$enabled !== void 0 ? _config$sse$enabled : true;
1898
+ try {
1899
+ const [infoError, info] = infoTuple;
1900
+ if (infoError) throw infoError;
1901
+ if (info.isBatchCall && !allowBatching) throw new TRPCError({
1902
+ code: "BAD_REQUEST",
1903
+ message: `Batching is not enabled on the server`
1904
+ });
1905
+ /* istanbul ignore if -- @preserve */
1906
+ if (isStreamCall && !info.isBatchCall) throw new TRPCError({
1907
+ message: `Streaming requests must be batched (you can do a batch of 1)`,
1908
+ code: "BAD_REQUEST"
1909
+ });
1910
+ await ctxManager.create(info);
1911
+ const rpcCalls = info.calls.map(async (call) => {
1912
+ const proc = call.procedure;
1913
+ try {
1914
+ if (opts.error) throw opts.error;
1915
+ if (!proc) throw new TRPCError({
1916
+ code: "NOT_FOUND",
1917
+ message: `No procedure found on path "${call.path}"`
1918
+ });
1919
+ if (!methodMapper[proc._def.type].includes(req.method)) throw new TRPCError({
1920
+ code: "METHOD_NOT_SUPPORTED",
1921
+ message: `Unsupported ${req.method}-request to ${proc._def.type} procedure at path "${call.path}"`
1922
+ });
1923
+ if (proc._def.type === "subscription") {
1924
+ /* istanbul ignore if -- @preserve */
1925
+ if (info.isBatchCall) throw new TRPCError({
1926
+ code: "BAD_REQUEST",
1927
+ message: `Cannot batch subscription calls`
1928
+ });
1929
+ }
1930
+ const data = await proc({
1931
+ path: call.path,
1932
+ getRawInput: call.getRawInput,
1933
+ ctx: ctxManager.value(),
1934
+ type: proc._def.type,
1935
+ signal: opts.req.signal
1936
+ });
1937
+ return [void 0, { data }];
1938
+ } catch (cause) {
1939
+ var _opts$onError, _call$procedure$_def$, _call$procedure2;
1940
+ const error = getTRPCErrorFromUnknown(cause);
1941
+ const input = call.result();
1942
+ (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, {
1943
+ error,
1944
+ path: call.path,
1945
+ input,
1946
+ ctx: ctxManager.valueOrUndefined(),
1947
+ type: (_call$procedure$_def$ = (_call$procedure2 = call.procedure) === null || _call$procedure2 === void 0 ? void 0 : _call$procedure2._def.type) !== null && _call$procedure$_def$ !== void 0 ? _call$procedure$_def$ : "unknown",
1948
+ req: opts.req
1949
+ });
1950
+ return [error, void 0];
1951
+ }
1952
+ });
1953
+ if (!info.isBatchCall) {
1954
+ const [call] = info.calls;
1955
+ const [error, result] = await rpcCalls[0];
1956
+ switch (info.type) {
1957
+ case "unknown":
1958
+ case "mutation":
1959
+ case "query": {
1960
+ headers.set("content-type", "application/json");
1961
+ if (isDataStream(result === null || result === void 0 ? void 0 : result.data)) throw new TRPCError({
1962
+ code: "UNSUPPORTED_MEDIA_TYPE",
1963
+ message: "Cannot use stream-like response in non-streaming request - use httpBatchStreamLink"
1964
+ });
1965
+ const res = error ? { error: getErrorShape({
1966
+ config,
1967
+ ctx: ctxManager.valueOrUndefined(),
1968
+ error,
1969
+ input: call.result(),
1970
+ path: call.path,
1971
+ type: info.type
1972
+ }) } : { result: { data: result.data } };
1973
+ const headResponse$1 = initResponse({
1974
+ ctx: ctxManager.valueOrUndefined(),
1975
+ info,
1976
+ responseMeta: opts.responseMeta,
1977
+ errors: error ? [error] : [],
1978
+ headers,
1979
+ untransformedJSON: [res]
1980
+ });
1981
+ return new Response(JSON.stringify(transformTRPCResponse(config, res)), {
1982
+ status: headResponse$1.status,
1983
+ headers
1984
+ });
1985
+ }
1986
+ case "subscription": {
1987
+ const iterable = run(() => {
1988
+ if (error) return errorToAsyncIterable(error);
1989
+ if (!experimentalSSE) return errorToAsyncIterable(new TRPCError({
1990
+ code: "METHOD_NOT_SUPPORTED",
1991
+ message: "Missing experimental flag \"sseSubscriptions\""
1992
+ }));
1993
+ if (!isObservable(result.data) && !isAsyncIterable(result.data)) return errorToAsyncIterable(new TRPCError({
1994
+ message: `Subscription ${call.path} did not return an observable or a AsyncGenerator`,
1995
+ code: "INTERNAL_SERVER_ERROR"
1996
+ }));
1997
+ const dataAsIterable = isObservable(result.data) ? observableToAsyncIterable(result.data, opts.req.signal) : result.data;
1998
+ return dataAsIterable;
1999
+ });
2000
+ const stream = sseStreamProducer((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, config.sse), {}, {
2001
+ data: iterable,
2002
+ serialize: (v) => config.transformer.output.serialize(v),
2003
+ formatError(errorOpts) {
2004
+ var _call$procedure$_def$2, _call$procedure3, _opts$onError2;
2005
+ const error$1 = getTRPCErrorFromUnknown(errorOpts.error);
2006
+ const input = call === null || call === void 0 ? void 0 : call.result();
2007
+ const path = call === null || call === void 0 ? void 0 : call.path;
2008
+ const type = (_call$procedure$_def$2 = call === null || call === void 0 || (_call$procedure3 = call.procedure) === null || _call$procedure3 === void 0 ? void 0 : _call$procedure3._def.type) !== null && _call$procedure$_def$2 !== void 0 ? _call$procedure$_def$2 : "unknown";
2009
+ (_opts$onError2 = opts.onError) === null || _opts$onError2 === void 0 || _opts$onError2.call(opts, {
2010
+ error: error$1,
2011
+ path,
2012
+ input,
2013
+ ctx: ctxManager.valueOrUndefined(),
2014
+ req: opts.req,
2015
+ type
2016
+ });
2017
+ const shape = getErrorShape({
2018
+ config,
2019
+ ctx: ctxManager.valueOrUndefined(),
2020
+ error: error$1,
2021
+ input,
2022
+ path,
2023
+ type
2024
+ });
2025
+ return shape;
2026
+ }
2027
+ }));
2028
+ for (const [key, value] of Object.entries(sseHeaders)) headers.set(key, value);
2029
+ const headResponse$1 = initResponse({
2030
+ ctx: ctxManager.valueOrUndefined(),
2031
+ info,
2032
+ responseMeta: opts.responseMeta,
2033
+ errors: [],
2034
+ headers,
2035
+ untransformedJSON: null
2036
+ });
2037
+ return new Response(stream, {
2038
+ headers,
2039
+ status: headResponse$1.status
2040
+ });
2041
+ }
2042
+ }
2043
+ }
2044
+ if (info.accept === "application/jsonl") {
2045
+ headers.set("content-type", "application/json");
2046
+ headers.set("transfer-encoding", "chunked");
2047
+ const headResponse$1 = initResponse({
2048
+ ctx: ctxManager.valueOrUndefined(),
2049
+ info,
2050
+ responseMeta: opts.responseMeta,
2051
+ errors: [],
2052
+ headers,
2053
+ untransformedJSON: null
2054
+ });
2055
+ const stream = jsonlStreamProducer((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, config.jsonl), {}, {
2056
+ maxDepth: Infinity,
2057
+ data: rpcCalls.map(async (res) => {
2058
+ const [error, result] = await res;
2059
+ const call = info.calls[0];
2060
+ if (error) {
2061
+ var _procedure$_def$type, _procedure;
2062
+ return { error: getErrorShape({
2063
+ config,
2064
+ ctx: ctxManager.valueOrUndefined(),
2065
+ error,
2066
+ input: call.result(),
2067
+ path: call.path,
2068
+ type: (_procedure$_def$type = (_procedure = call.procedure) === null || _procedure === void 0 ? void 0 : _procedure._def.type) !== null && _procedure$_def$type !== void 0 ? _procedure$_def$type : "unknown"
2069
+ }) };
2070
+ }
2071
+ /**
2072
+ * Not very pretty, but we need to wrap nested data in promises
2073
+ * Our stream producer will only resolve top-level async values or async values that are directly nested in another async value
2074
+ */
2075
+ const iterable = isObservable(result.data) ? observableToAsyncIterable(result.data, opts.req.signal) : Promise.resolve(result.data);
2076
+ return { result: Promise.resolve({ data: iterable }) };
2077
+ }),
2078
+ serialize: config.transformer.output.serialize,
2079
+ onError: (cause) => {
2080
+ var _opts$onError3, _info$type;
2081
+ (_opts$onError3 = opts.onError) === null || _opts$onError3 === void 0 || _opts$onError3.call(opts, {
2082
+ error: getTRPCErrorFromUnknown(cause),
2083
+ path: void 0,
2084
+ input: void 0,
2085
+ ctx: ctxManager.valueOrUndefined(),
2086
+ req: opts.req,
2087
+ type: (_info$type = info === null || info === void 0 ? void 0 : info.type) !== null && _info$type !== void 0 ? _info$type : "unknown"
2088
+ });
2089
+ },
2090
+ formatError(errorOpts) {
2091
+ var _call$procedure$_def$3, _call$procedure4;
2092
+ const call = info === null || info === void 0 ? void 0 : info.calls[errorOpts.path[0]];
2093
+ const error = getTRPCErrorFromUnknown(errorOpts.error);
2094
+ const input = call === null || call === void 0 ? void 0 : call.result();
2095
+ const path = call === null || call === void 0 ? void 0 : call.path;
2096
+ const type = (_call$procedure$_def$3 = call === null || call === void 0 || (_call$procedure4 = call.procedure) === null || _call$procedure4 === void 0 ? void 0 : _call$procedure4._def.type) !== null && _call$procedure$_def$3 !== void 0 ? _call$procedure$_def$3 : "unknown";
2097
+ const shape = getErrorShape({
2098
+ config,
2099
+ ctx: ctxManager.valueOrUndefined(),
2100
+ error,
2101
+ input,
2102
+ path,
2103
+ type
2104
+ });
2105
+ return shape;
2106
+ }
2107
+ }));
2108
+ return new Response(stream, {
2109
+ headers,
2110
+ status: headResponse$1.status
2111
+ });
2112
+ }
2113
+ /**
2114
+ * Non-streaming response:
2115
+ * - await all responses in parallel, blocking on the slowest one
2116
+ * - create headers with known response body
2117
+ * - return a complete HTTPResponse
2118
+ */
2119
+ headers.set("content-type", "application/json");
2120
+ const results = (await Promise.all(rpcCalls)).map((res) => {
2121
+ const [error, result] = res;
2122
+ if (error) return res;
2123
+ if (isDataStream(result.data)) return [new TRPCError({
2124
+ code: "UNSUPPORTED_MEDIA_TYPE",
2125
+ message: "Cannot use stream-like response in non-streaming request - use httpBatchStreamLink"
2126
+ }), void 0];
2127
+ return res;
2128
+ });
2129
+ const resultAsRPCResponse = results.map(([error, result], index) => {
2130
+ const call = info.calls[index];
2131
+ if (error) {
2132
+ var _call$procedure$_def$4, _call$procedure5;
2133
+ return { error: getErrorShape({
2134
+ config,
2135
+ ctx: ctxManager.valueOrUndefined(),
2136
+ error,
2137
+ input: call.result(),
2138
+ path: call.path,
2139
+ type: (_call$procedure$_def$4 = (_call$procedure5 = call.procedure) === null || _call$procedure5 === void 0 ? void 0 : _call$procedure5._def.type) !== null && _call$procedure$_def$4 !== void 0 ? _call$procedure$_def$4 : "unknown"
2140
+ }) };
2141
+ }
2142
+ return { result: { data: result.data } };
2143
+ });
2144
+ const errors = results.map(([error]) => error).filter(Boolean);
2145
+ const headResponse = initResponse({
2146
+ ctx: ctxManager.valueOrUndefined(),
2147
+ info,
2148
+ responseMeta: opts.responseMeta,
2149
+ untransformedJSON: resultAsRPCResponse,
2150
+ errors,
2151
+ headers
2152
+ });
2153
+ return new Response(JSON.stringify(transformTRPCResponse(config, resultAsRPCResponse)), {
2154
+ status: headResponse.status,
2155
+ headers
2156
+ });
2157
+ } catch (cause) {
2158
+ var _info$type2;
2159
+ const [_infoError, info] = infoTuple;
2160
+ const ctx = ctxManager.valueOrUndefined();
2161
+ const { error, untransformedJSON, body } = caughtErrorToData(cause, {
2162
+ opts,
2163
+ ctx: ctxManager.valueOrUndefined(),
2164
+ type: (_info$type2 = info === null || info === void 0 ? void 0 : info.type) !== null && _info$type2 !== void 0 ? _info$type2 : "unknown"
2165
+ });
2166
+ const headResponse = initResponse({
2167
+ ctx,
2168
+ info,
2169
+ responseMeta: opts.responseMeta,
2170
+ untransformedJSON,
2171
+ errors: [error],
2172
+ headers
2173
+ });
2174
+ return new Response(body, {
2175
+ status: headResponse.status,
2176
+ headers
2177
+ });
2178
+ }
2179
+ }
2180
+
2181
+ //#endregion
2182
+ export { Unpromise, createDeferred, getRequestInfo, isAbortError, isPromise, iteratorResource, jsonlStreamConsumer, jsonlStreamProducer, makeAsyncResource, makeResource, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, require_usingCtx, resolveResponse, sseHeaders, sseStreamConsumer, sseStreamProducer, takeWithGrace, throwAbortError, withMaxDuration };
2183
+ //# sourceMappingURL=resolveResponse-CzlbRpCI.mjs.map