@pubinfo-nightly/devtools 2025.12.9 → 2026.2.6

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 (365) hide show
  1. package/dist/client/assets/core-DZ0_U_pO.js +6115 -0
  2. package/dist/client/assets/css-D-vtiAqw.js +2 -0
  3. package/dist/client/assets/css-DbgpCiOq.js +2 -0
  4. package/dist/client/assets/engine-oniguruma-Cxk0otvy.js +392 -0
  5. package/dist/client/assets/fetch-Df05JmPt.js +991 -0
  6. package/dist/client/assets/html-74krLQbR.js +2 -0
  7. package/dist/client/assets/html-Tu6OX5Eq.js +9 -0
  8. package/dist/client/assets/{index-Co6hzA6u.css → index-Blntvu93.css} +1 -1
  9. package/dist/client/assets/{index-BSkduMKH.js → index-Cn9-H915.js} +3456 -1729
  10. package/dist/client/assets/javascript-QnJdw8u5.js +2 -0
  11. package/dist/client/assets/javascript-_FvKZjd1.js +2 -0
  12. package/dist/client/assets/json-CzPoZe0r.js +2 -0
  13. package/dist/client/assets/json-WgRhEAOB.js +2 -0
  14. package/dist/client/assets/pages-BdQpgtx4.js +20 -0
  15. package/dist/client/assets/{server-router-BiZSSnZD.css → server-router-8PynUpe5.css} +2 -2
  16. package/dist/client/assets/server-router-BHD-n_Wi.js +2261 -0
  17. package/dist/client/assets/typescript-BEfC8S_c.js +2 -0
  18. package/dist/client/assets/typescript-C5tShSk5.js +2 -0
  19. package/dist/client/assets/vue-Be3tcD1h.js +27 -0
  20. package/dist/client/assets/wasm-D0Echd05.js +5 -0
  21. package/dist/client/index.html +2 -2
  22. package/dist/dirs.mjs +3 -0
  23. package/dist/{index.js → index.mjs} +2 -2
  24. package/dist/panel/{index.js → index.mjs} +3 -3
  25. package/package.json +19 -19
  26. package/dist/client/assets/abap-C4bT1QEl.js +0 -3
  27. package/dist/client/assets/actionscript-3-BCWJ3mFB.js +0 -3
  28. package/dist/client/assets/ada-BwfYJ3cr.js +0 -3
  29. package/dist/client/assets/andromeeda-B_6dIUNk.js +0 -2
  30. package/dist/client/assets/angular-html-BPWgfvBc.js +0 -23
  31. package/dist/client/assets/angular-html-CAmvPqke.js +0 -5
  32. package/dist/client/assets/angular-ts-DGzTDMev.js +0 -24
  33. package/dist/client/assets/apache-kfYmMYjJ.js +0 -3
  34. package/dist/client/assets/apex-BEradrtF.js +0 -3
  35. package/dist/client/assets/apl-BPuavpVx.js +0 -16
  36. package/dist/client/assets/applescript-CuHZw4Cf.js +0 -3
  37. package/dist/client/assets/ara-BkKR-TQQ.js +0 -3
  38. package/dist/client/assets/asciidoc-CBayNp_C.js +0 -3
  39. package/dist/client/assets/asm-BwfqIsue.js +0 -3
  40. package/dist/client/assets/astro-S5XuEH5N.js +0 -17
  41. package/dist/client/assets/aurora-x-BXNTnfne.js +0 -2
  42. package/dist/client/assets/awk-BTtzreuE.js +0 -3
  43. package/dist/client/assets/ayu-dark-DqipJzHd.js +0 -2
  44. package/dist/client/assets/ballerina-Cr0e12Uh.js +0 -3
  45. package/dist/client/assets/bat--mz103Th.js +0 -3
  46. package/dist/client/assets/beancount-CFAdYWr2.js +0 -3
  47. package/dist/client/assets/berry-Bzd2YdCH.js +0 -3
  48. package/dist/client/assets/bibtex-DT-WcF1n.js +0 -3
  49. package/dist/client/assets/bicep-DUXUP27W.js +0 -3
  50. package/dist/client/assets/blade-BD3Ti8S8.js +0 -20
  51. package/dist/client/assets/bsl-FJCc2ZjR.js +0 -4
  52. package/dist/client/assets/c-0S9FUYVg.js +0 -2
  53. package/dist/client/assets/c-DcdCmnmu.js +0 -3
  54. package/dist/client/assets/cadence-Du0qqjuO.js +0 -3
  55. package/dist/client/assets/cairo-CT1kFY4g.js +0 -4
  56. package/dist/client/assets/catppuccin-frappe-DZIny9D9.js +0 -2
  57. package/dist/client/assets/catppuccin-latte-HfmdJgD2.js +0 -2
  58. package/dist/client/assets/catppuccin-macchiato-1ffQHJ6s.js +0 -2
  59. package/dist/client/assets/catppuccin-mocha-DRYMSOp4.js +0 -2
  60. package/dist/client/assets/clarity-CW1NMBSy.js +0 -3
  61. package/dist/client/assets/clojure-DkHpOkH2.js +0 -3
  62. package/dist/client/assets/cmake-87ADX9pg.js +0 -2
  63. package/dist/client/assets/cmake-CXVvo3Mh.js +0 -3
  64. package/dist/client/assets/cobol-CE0tFF5i.js +0 -11
  65. package/dist/client/assets/codeowners-DYf_YsrY.js +0 -3
  66. package/dist/client/assets/codeql-BeSKjUdD.js +0 -3
  67. package/dist/client/assets/coffee-D8rtNx1a.js +0 -4
  68. package/dist/client/assets/common-lisp-CsedMwlK.js +0 -3
  69. package/dist/client/assets/coq-Cfs5oQ5z.js +0 -3
  70. package/dist/client/assets/cpp-B4kRV-Mr.js +0 -6
  71. package/dist/client/assets/cpp-C4U1u9xk.js +0 -19
  72. package/dist/client/assets/crystal-C51LLczf.js +0 -17
  73. package/dist/client/assets/csharp-CxX8v9Z1.js +0 -2
  74. package/dist/client/assets/csharp-DYqgfnaO.js +0 -3
  75. package/dist/client/assets/css-BmwDvvHL.js +0 -2
  76. package/dist/client/assets/css-DVW7ZXKV.js +0 -3
  77. package/dist/client/assets/csv-B2eUHTA8.js +0 -2
  78. package/dist/client/assets/csv-rLH0WuQO.js +0 -3
  79. package/dist/client/assets/cue-CzLrU992.js +0 -3
  80. package/dist/client/assets/cypher-C2RENEAP.js +0 -3
  81. package/dist/client/assets/d-BJOAQFpK.js +0 -3
  82. package/dist/client/assets/dark-plus-Db9rRSHq.js +0 -2
  83. package/dist/client/assets/dart-B-KTJ0-J.js +0 -3
  84. package/dist/client/assets/dax-B7qtS36S.js +0 -3
  85. package/dist/client/assets/desktop-DfgAqZ8-.js +0 -3
  86. package/dist/client/assets/diff-akky_HM9.js +0 -3
  87. package/dist/client/assets/diff-pjHYd3BC.js +0 -2
  88. package/dist/client/assets/docker-CRnIvYqh.js +0 -3
  89. package/dist/client/assets/dotenv-CwGZ7tJA.js +0 -3
  90. package/dist/client/assets/dracula-C0nacXF8.js +0 -2
  91. package/dist/client/assets/dracula-soft-wdVBcfBY.js +0 -2
  92. package/dist/client/assets/dream-maker-B9ezz9kX.js +0 -3
  93. package/dist/client/assets/edge-WSoBDjCt.js +0 -13
  94. package/dist/client/assets/elixir-4Bcc41kI.js +0 -6
  95. package/dist/client/assets/elm-DisSriNR.js +0 -5
  96. package/dist/client/assets/emacs-lisp-fLGPzin6.js +0 -3
  97. package/dist/client/assets/erb-BuJIU0wX.js +0 -26
  98. package/dist/client/assets/erlang-BbsDmeCk.js +0 -4
  99. package/dist/client/assets/everforest-dark-NN95DCJl.js +0 -2
  100. package/dist/client/assets/everforest-light-idPY23JU.js +0 -2
  101. package/dist/client/assets/fennel-CSR5Mk7N.js +0 -3
  102. package/dist/client/assets/fetch-CTfoU6yt.js +0 -873
  103. package/dist/client/assets/fish-BlTQgKCk.js +0 -3
  104. package/dist/client/assets/fluent-TT7fQWak.js +0 -3
  105. package/dist/client/assets/fortran-fixed-form-DvnLkzBN.js +0 -4
  106. package/dist/client/assets/fortran-free-form-B1QQVoTU.js +0 -3
  107. package/dist/client/assets/fortran-free-form-xkm1udFL.js +0 -2
  108. package/dist/client/assets/fsharp-DyWqhI4o.js +0 -4
  109. package/dist/client/assets/gdresource-Ddtxl8Ni.js +0 -9
  110. package/dist/client/assets/gdscript-DLFBRMyo.js +0 -2
  111. package/dist/client/assets/gdscript-DLJhaHhX.js +0 -3
  112. package/dist/client/assets/gdshader-BFRlv_nM.js +0 -3
  113. package/dist/client/assets/gdshader-tCO8fx4f.js +0 -2
  114. package/dist/client/assets/genie-BmogPuVq.js +0 -3
  115. package/dist/client/assets/gherkin-uh-Mxnsi.js +0 -3
  116. package/dist/client/assets/git-commit-4JodcKYl.js +0 -4
  117. package/dist/client/assets/git-rebase-DZ3MZg-o.js +0 -4
  118. package/dist/client/assets/github-dark-C6J_EBvu.js +0 -2
  119. package/dist/client/assets/github-dark-default-DQDadoHp.js +0 -2
  120. package/dist/client/assets/github-dark-dimmed-DU7K1EZq.js +0 -2
  121. package/dist/client/assets/github-dark-high-contrast-BfsjVJDY.js +0 -2
  122. package/dist/client/assets/github-light-CM4f7fBZ.js +0 -2
  123. package/dist/client/assets/github-light-default-B_A-12O3.js +0 -2
  124. package/dist/client/assets/github-light-high-contrast-BhG28-t6.js +0 -2
  125. package/dist/client/assets/gleam-BByYw7_b.js +0 -3
  126. package/dist/client/assets/glimmer-js-Dw1YG46K.js +0 -13
  127. package/dist/client/assets/glimmer-ts-BoTKtLAn.js +0 -13
  128. package/dist/client/assets/glsl-BcvqNIzr.js +0 -4
  129. package/dist/client/assets/glsl-D7d1_ns-.js +0 -3
  130. package/dist/client/assets/gnuplot-CgWtMBol.js +0 -3
  131. package/dist/client/assets/go-B0RP9LHI.js +0 -3
  132. package/dist/client/assets/go-C2ti7VbT.js +0 -2
  133. package/dist/client/assets/graphql-CZtSUIVW.js +0 -13
  134. package/dist/client/assets/graphql-CeZ4pvez.js +0 -6
  135. package/dist/client/assets/groovy-Bpl59neu.js +0 -3
  136. package/dist/client/assets/gruvbox-dark-hard-BddnLFai.js +0 -2
  137. package/dist/client/assets/gruvbox-dark-medium-DClLifyq.js +0 -2
  138. package/dist/client/assets/gruvbox-dark-soft-CoL2WoEr.js +0 -2
  139. package/dist/client/assets/gruvbox-light-hard-CF2FUQYG.js +0 -2
  140. package/dist/client/assets/gruvbox-light-medium-DdKpn-Z3.js +0 -2
  141. package/dist/client/assets/gruvbox-light-soft-CXnF8CjV.js +0 -2
  142. package/dist/client/assets/hack-BYb9BCJH.js +0 -11
  143. package/dist/client/assets/haml-BImF9_sT.js +0 -9
  144. package/dist/client/assets/haml-DW6kjLLA.js +0 -4
  145. package/dist/client/assets/handlebars-BioaJ5nM.js +0 -13
  146. package/dist/client/assets/haskell-BmWZ6TRE.js +0 -3
  147. package/dist/client/assets/haxe-D-HM2q7w.js +0 -3
  148. package/dist/client/assets/haxe-DIufun--.js +0 -2
  149. package/dist/client/assets/hcl-S6uG4iQ0.js +0 -3
  150. package/dist/client/assets/hjson-mO0ORdeS.js +0 -3
  151. package/dist/client/assets/hlsl-C0jZ0PCe.js +0 -2
  152. package/dist/client/assets/hlsl-hj232ngO.js +0 -3
  153. package/dist/client/assets/houston-CdK1CUz1.js +0 -2
  154. package/dist/client/assets/html-BLAmfzfF.js +0 -9
  155. package/dist/client/assets/html-BpqLChx7.js +0 -4
  156. package/dist/client/assets/html-derivative-D5DGRC4b.js +0 -5
  157. package/dist/client/assets/html-derivative-EjRHFpnu.js +0 -4
  158. package/dist/client/assets/http-lZvWEzFG.js +0 -18
  159. package/dist/client/assets/hurl-Cq9E8TWb.js +0 -16
  160. package/dist/client/assets/hxml-ee_Yi0Bv.js +0 -4
  161. package/dist/client/assets/hy-DICTrdi3.js +0 -3
  162. package/dist/client/assets/imba-kv1YCcqW.js +0 -3
  163. package/dist/client/assets/ini-CeoNvVsQ.js +0 -3
  164. package/dist/client/assets/java-BUOns_Ip.js +0 -2
  165. package/dist/client/assets/java-DvTil0N3.js +0 -3
  166. package/dist/client/assets/javascript-239S-npV.js +0 -3
  167. package/dist/client/assets/javascript-qk0JMc6B.js +0 -2
  168. package/dist/client/assets/jinja-Bg3R28jD.js +0 -8
  169. package/dist/client/assets/jison-BC1q7dZB.js +0 -4
  170. package/dist/client/assets/json-B7uypvxJ.js +0 -2
  171. package/dist/client/assets/json-DugJQEGz.js +0 -3
  172. package/dist/client/assets/json5-7yQVqemE.js +0 -3
  173. package/dist/client/assets/jsonc-D8JMlU2y.js +0 -3
  174. package/dist/client/assets/jsonl-C08qrvBf.js +0 -3
  175. package/dist/client/assets/jsonnet-BvmZyW4T.js +0 -3
  176. package/dist/client/assets/jssm-DKBgqWqY.js +0 -3
  177. package/dist/client/assets/jsx-CT1RQ-OJ.js +0 -3
  178. package/dist/client/assets/jsx-CsU_AUfl.js +0 -2
  179. package/dist/client/assets/julia-EKUZwWmm.js +0 -18
  180. package/dist/client/assets/kanagawa-dragon-CT0GKJCY.js +0 -2
  181. package/dist/client/assets/kanagawa-lotus-BnTLrrY2.js +0 -2
  182. package/dist/client/assets/kanagawa-wave-DZKSoWHj.js +0 -2
  183. package/dist/client/assets/kdl-DVROzgs-.js +0 -3
  184. package/dist/client/assets/kotlin-DccTc7ae.js +0 -3
  185. package/dist/client/assets/kusto-DfjJ0A2b.js +0 -3
  186. package/dist/client/assets/laserwave-tIFKC5tj.js +0 -2
  187. package/dist/client/assets/latex-CflrJF-D.js +0 -5
  188. package/dist/client/assets/lean-CPP8F_7u.js +0 -3
  189. package/dist/client/assets/less-C1zBW-s6.js +0 -3
  190. package/dist/client/assets/less-CICUgOj-.js +0 -2
  191. package/dist/client/assets/light-plus-DhWyKCGQ.js +0 -2
  192. package/dist/client/assets/liquid-PHiGTwj1.js +0 -13
  193. package/dist/client/assets/llvm-I5QJoasC.js +0 -3
  194. package/dist/client/assets/log-gyTYf2xU.js +0 -3
  195. package/dist/client/assets/logo-DfMKoOqX.js +0 -3
  196. package/dist/client/assets/lua-CBf0ggeL.js +0 -4
  197. package/dist/client/assets/lua-crOEWYZ0.js +0 -3
  198. package/dist/client/assets/luau-B17X0UH2.js +0 -3
  199. package/dist/client/assets/make-B8j2I5oP.js +0 -3
  200. package/dist/client/assets/markdown-BIZO6UqW.js +0 -2
  201. package/dist/client/assets/markdown-DVA_ZXYg.js +0 -3
  202. package/dist/client/assets/marko-CE_g888v.js +0 -13
  203. package/dist/client/assets/material-theme-CoPt-P4I.js +0 -2
  204. package/dist/client/assets/material-theme-darker-FEG2rAOf.js +0 -2
  205. package/dist/client/assets/material-theme-lighter-BF7TTIIN.js +0 -2
  206. package/dist/client/assets/material-theme-ocean-DLZ8d_BI.js +0 -2
  207. package/dist/client/assets/material-theme-palenight-DDSTuCs0.js +0 -2
  208. package/dist/client/assets/matlab-k1xjK_b6.js +0 -3
  209. package/dist/client/assets/mdc-CTYOzD1j.js +0 -14
  210. package/dist/client/assets/mdx-BQUZJDaf.js +0 -3
  211. package/dist/client/assets/mermaid-DJ04LSyL.js +0 -3
  212. package/dist/client/assets/min-dark-B0gHld8V.js +0 -2
  213. package/dist/client/assets/min-light-DsiXGiCk.js +0 -2
  214. package/dist/client/assets/mipsasm-eWlP57CF.js +0 -3
  215. package/dist/client/assets/mojo-DPKjCktn.js +0 -3
  216. package/dist/client/assets/monokai-wE1Oe3ZE.js +0 -2
  217. package/dist/client/assets/move-jfk5_q-h.js +0 -3
  218. package/dist/client/assets/narrat-pUgLLkv0.js +0 -3
  219. package/dist/client/assets/nextflow-Cc6ZMjG9.js +0 -3
  220. package/dist/client/assets/nginx-Dj2-Xu09.js +0 -5
  221. package/dist/client/assets/night-owl-Bhwe1yQ8.js +0 -2
  222. package/dist/client/assets/nim-Btzc76t3.js +0 -20
  223. package/dist/client/assets/nix-D9NfD_az.js +0 -3
  224. package/dist/client/assets/nord-BSQfXDuM.js +0 -2
  225. package/dist/client/assets/nushell-BRDcl2mr.js +0 -3
  226. package/dist/client/assets/objective-c-DlHl8NyP.js +0 -3
  227. package/dist/client/assets/objective-cpp-B0dcjsTM.js +0 -3
  228. package/dist/client/assets/ocaml-F3DDYO_6.js +0 -3
  229. package/dist/client/assets/one-dark-pro-B5HIL-pf.js +0 -2
  230. package/dist/client/assets/one-light-hd3TKOg4.js +0 -2
  231. package/dist/client/assets/pages-BPB-93sD.js +0 -18
  232. package/dist/client/assets/pascal-k-jf8TbO.js +0 -3
  233. package/dist/client/assets/perl-DLie958B.js +0 -16
  234. package/dist/client/assets/php-CeVstFNC.js +0 -17
  235. package/dist/client/assets/php-Dqyegpf1.js +0 -9
  236. package/dist/client/assets/pkl-CTBspQUg.js +0 -3
  237. package/dist/client/assets/plastic-DTqiHuTe.js +0 -2
  238. package/dist/client/assets/plsql-CronX4zK.js +0 -3
  239. package/dist/client/assets/po-DIoaMCjY.js +0 -3
  240. package/dist/client/assets/poimandres-Ct2BSofG.js +0 -2
  241. package/dist/client/assets/polar-B5raTfsD.js +0 -3
  242. package/dist/client/assets/postcss-4oWH01ol.js +0 -3
  243. package/dist/client/assets/postcss-C4klqPVI.js +0 -2
  244. package/dist/client/assets/powerquery-Cq13nLq4.js +0 -3
  245. package/dist/client/assets/powershell-u1gI72JX.js +0 -3
  246. package/dist/client/assets/prisma-HKQ5cqp8.js +0 -3
  247. package/dist/client/assets/prolog-BesjPHql.js +0 -3
  248. package/dist/client/assets/proto-AagVn4-5.js +0 -3
  249. package/dist/client/assets/pug-D9BazAbt.js +0 -11
  250. package/dist/client/assets/puppet-DH-RAFaa.js +0 -3
  251. package/dist/client/assets/purescript-DfNGfmFP.js +0 -3
  252. package/dist/client/assets/python-BmLHvQtk.js +0 -2
  253. package/dist/client/assets/python-Dn88StJc.js +0 -3
  254. package/dist/client/assets/qml-Dsl5qRow.js +0 -4
  255. package/dist/client/assets/qmldir-DDMrTfWZ.js +0 -3
  256. package/dist/client/assets/qss-CHdy7svE.js +0 -3
  257. package/dist/client/assets/r-CbolghQs.js +0 -2
  258. package/dist/client/assets/r-DT24G0Sx.js +0 -3
  259. package/dist/client/assets/racket-B79KAvJY.js +0 -3
  260. package/dist/client/assets/raku-CTMhaGVX.js +0 -3
  261. package/dist/client/assets/razor-BjH6275R.js +0 -11
  262. package/dist/client/assets/red-CEj0QRPt.js +0 -2
  263. package/dist/client/assets/reg-Cypx77mL.js +0 -3
  264. package/dist/client/assets/regexp-ClZtLNbS.js +0 -3
  265. package/dist/client/assets/regexp-DJtnbMg9.js +0 -2
  266. package/dist/client/assets/rel-BpE3syVu.js +0 -3
  267. package/dist/client/assets/riscv-DyE_5IvB.js +0 -3
  268. package/dist/client/assets/rose-pine-6IUiFzUI.js +0 -2
  269. package/dist/client/assets/rose-pine-dawn-DoRlotcg.js +0 -2
  270. package/dist/client/assets/rose-pine-moon-B5Df1HyW.js +0 -2
  271. package/dist/client/assets/rosmsg-CIAJEgNV.js +0 -3
  272. package/dist/client/assets/rst-Pxh4TKKn.js +0 -35
  273. package/dist/client/assets/ruby-CAlvFaP5.js +0 -29
  274. package/dist/client/assets/ruby-Y14tynbZ.js +0 -20
  275. package/dist/client/assets/rust-DJhGYCa5.js +0 -3
  276. package/dist/client/assets/sas-BQQp9-K3.js +0 -4
  277. package/dist/client/assets/sass-DeLGkK3L.js +0 -3
  278. package/dist/client/assets/scala-cReyE3Yh.js +0 -3
  279. package/dist/client/assets/scheme-B1Lo-75f.js +0 -3
  280. package/dist/client/assets/scss-BP3WrVDm.js +0 -3
  281. package/dist/client/assets/scss-CJyb8K_U.js +0 -4
  282. package/dist/client/assets/sdbl-BKlGfwqV.js +0 -3
  283. package/dist/client/assets/sdbl-CLmP1IYn.js +0 -2
  284. package/dist/client/assets/server-router-BPUoghL2.js +0 -8930
  285. package/dist/client/assets/shaderlab-C8C8_BgV.js +0 -4
  286. package/dist/client/assets/shellscript-Bd0FHBYA.js +0 -2
  287. package/dist/client/assets/shellscript-DsF2JDJS.js +0 -3
  288. package/dist/client/assets/shellsession-YAJaKmo5.js +0 -4
  289. package/dist/client/assets/slack-dark-BmjvCrQc.js +0 -2
  290. package/dist/client/assets/slack-ochin-PXT7PX3o.js +0 -2
  291. package/dist/client/assets/smalltalk-B3peVJF-.js +0 -3
  292. package/dist/client/assets/snazzy-light-DJv4SeqQ.js +0 -2
  293. package/dist/client/assets/solarized-dark-BvCiP_16.js +0 -2
  294. package/dist/client/assets/solarized-light-Bcu-a8JZ.js +0 -2
  295. package/dist/client/assets/solidity-2avG4OxK.js +0 -3
  296. package/dist/client/assets/soy-BwO6v7SS.js +0 -6
  297. package/dist/client/assets/sparql-Ctv9JmsW.js +0 -4
  298. package/dist/client/assets/splunk-UTnMmJ7Q.js +0 -3
  299. package/dist/client/assets/sql-DJRi7-HS.js +0 -3
  300. package/dist/client/assets/sql-DxeQhHVR.js +0 -2
  301. package/dist/client/assets/ssh-config-Du7ucyU5.js +0 -3
  302. package/dist/client/assets/stata-CBQSMhJu.js +0 -4
  303. package/dist/client/assets/stylus-BcbGHyGm.js +0 -2
  304. package/dist/client/assets/stylus-ESl0ir-D.js +0 -3
  305. package/dist/client/assets/svelte-C7A5FsG_.js +0 -13
  306. package/dist/client/assets/swift-BEUwwDAA.js +0 -3
  307. package/dist/client/assets/synthwave-84-BIVTX2kK.js +0 -2
  308. package/dist/client/assets/system-verilog-jIIGzizp.js +0 -3
  309. package/dist/client/assets/systemd-Do-I7Dk6.js +0 -3
  310. package/dist/client/assets/talonscript-B8BQ8lUi.js +0 -3
  311. package/dist/client/assets/tasl-Yr56vlbD.js +0 -3
  312. package/dist/client/assets/tcl-DHCz_jpi.js +0 -3
  313. package/dist/client/assets/templ-Dan_9-H5.js +0 -11
  314. package/dist/client/assets/terraform-CFJJDCa4.js +0 -3
  315. package/dist/client/assets/tex-CrNYpU8F.js +0 -3
  316. package/dist/client/assets/tex-DQvqQIPT.js +0 -4
  317. package/dist/client/assets/tokyo-night-C-8sx9_4.js +0 -2
  318. package/dist/client/assets/toml-CBSc9ib7.js +0 -3
  319. package/dist/client/assets/ts-tags-BSSXKo8m.js +0 -49
  320. package/dist/client/assets/tsv-B0JD-xkP.js +0 -3
  321. package/dist/client/assets/tsx-BV_Ie_mt.js +0 -3
  322. package/dist/client/assets/tsx-BzJMQxCY.js +0 -2
  323. package/dist/client/assets/turtle-kxVyEHLU.js +0 -3
  324. package/dist/client/assets/turtle-vZsG0FWM.js +0 -2
  325. package/dist/client/assets/twig-CUV6hi0h.js +0 -34
  326. package/dist/client/assets/typescript-Crma8FE2.js +0 -3
  327. package/dist/client/assets/typescript-nzfneafv.js +0 -2
  328. package/dist/client/assets/typespec-DCuJQu6m.js +0 -3
  329. package/dist/client/assets/typst-BDgLoDzV.js +0 -3
  330. package/dist/client/assets/v-DMA-YYXE.js +0 -3
  331. package/dist/client/assets/vala-BtBKHkJB.js +0 -3
  332. package/dist/client/assets/vb-CyVTXibQ.js +0 -3
  333. package/dist/client/assets/verilog-CC_Yo3jQ.js +0 -3
  334. package/dist/client/assets/vesper-BLuvFGfg.js +0 -2
  335. package/dist/client/assets/vhdl-C7ADyr0o.js +0 -3
  336. package/dist/client/assets/viml-hax2M4w6.js +0 -3
  337. package/dist/client/assets/vitesse-black-58mZKXM9.js +0 -2
  338. package/dist/client/assets/vue-BuGHx9kw.js +0 -8
  339. package/dist/client/assets/vue-CahofuY8.js +0 -29
  340. package/dist/client/assets/vue-html-B9xEgjjB.js +0 -14
  341. package/dist/client/assets/vue-vine-B9sh5nZz.js +0 -23
  342. package/dist/client/assets/vyper-BDpDemAA.js +0 -3
  343. package/dist/client/assets/wasm-BuJrhBgW.js +0 -5
  344. package/dist/client/assets/wasm-C9wAFEif.js +0 -3
  345. package/dist/client/assets/wenyan-DSsQqdmG.js +0 -3
  346. package/dist/client/assets/wgsl-CMOam7bY.js +0 -3
  347. package/dist/client/assets/wikitext-BqkWeRVY.js +0 -3
  348. package/dist/client/assets/wit-CHHZn0fR.js +0 -3
  349. package/dist/client/assets/wolfram-DhJOgCbz.js +0 -3
  350. package/dist/client/assets/xml-dAX-08G9.js +0 -4
  351. package/dist/client/assets/xml-yLaOmctb.js +0 -3
  352. package/dist/client/assets/xsl-mTp08Xh_.js +0 -5
  353. package/dist/client/assets/yaml-C5_iem5C.js +0 -2
  354. package/dist/client/assets/yaml-CN2n3pDD.js +0 -3
  355. package/dist/client/assets/zenscript-BmWf_m5U.js +0 -3
  356. package/dist/client/assets/zig-QOlp4jTZ.js +0 -3
  357. package/dist/dirs.js +0 -3
  358. /package/dist/client/assets/{vitesse-dark-BE2jsHp9.js → vitesse-dark-Bz6RXfkV.js} +0 -0
  359. /package/dist/client/assets/{vitesse-light-Bko17iRe.js → vitesse-light-NvDlvJl2.js} +0 -0
  360. /package/dist/{constants.d.ts → constants.d.mts} +0 -0
  361. /package/dist/{constants.js → constants.mjs} +0 -0
  362. /package/dist/{dirs.d.ts → dirs.d.mts} +0 -0
  363. /package/dist/{dirs2.js → dirs2.mjs} +0 -0
  364. /package/dist/{index.d.ts → index.d.mts} +0 -0
  365. /package/dist/panel/{index.d.ts → index.d.mts} +0 -0
@@ -0,0 +1,2261 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./javascript-QnJdw8u5.js","./javascript-_FvKZjd1.js","./typescript-C5tShSk5.js","./typescript-BEfC8S_c.js","./vue-Be3tcD1h.js","./css-DbgpCiOq.js","./html-Tu6OX5Eq.js","./json-CzPoZe0r.js","./json-WgRhEAOB.js","./html-74krLQbR.js","./css-D-vtiAqw.js"])))=>i.map(i=>d[i]);
2
+ import { $ as normalizeStyle, A as resolveComponent, C as nextTick, D as provide, E as openBlock, F as watch, H as isRef, I as watchEffect, J as shallowRef, K as ref, L as withCtx, M as resolveDynamicComponent, N as useModel, O as renderList, P as useSlots, Q as normalizeClass, R as withDirectives, S as mergeProps, T as onMounted, W as reactive, Y as toRef, Z as unref, _ as defineComponent, a as vModelDynamic, b as inject, c as Fragment, d as createBaseVNode, et as toDisplayString, f as createBlock, g as createVNode, h as createTextVNode, i as vModelCheckbox, j as resolveDirective, k as renderSlot, l as KeepAlive, m as createElementBlock, n as RouterLink, o as vModelSelect, p as createCommentVNode, r as Transition, s as withKeys, t as __vitePreload, u as computed, v as getCurrentInstance, w as onBeforeUnmount, x as mergeModels, y as h } from "./index-Cn9-H915.js";
3
+ import { a as useElementSize, c as createSharedComposable, i as onClickOutside, o as useLocalStorage, r as createReusableTemplate, s as useVModel, t as apiListFetch } from "./fetch-Df05JmPt.js";
4
+ var _hoisted_1$16 = { class: "flex gap-3 items-center" };
5
+ var IconTitle_default = /* @__PURE__ */ defineComponent({
6
+ __name: "IconTitle",
7
+ props: {
8
+ icon: {},
9
+ text: {}
10
+ },
11
+ setup(__props) {
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createElementBlock("div", _hoisted_1$16, [__props.icon ? (openBlock(), createElementBlock("div", {
14
+ key: 0,
15
+ class: normalizeClass(__props.icon)
16
+ }, null, 2)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default", {}, () => [createBaseVNode("div", null, toDisplayString(__props.text), 1)])]);
17
+ };
18
+ }
19
+ });
20
+ var Icon_default = /* @__PURE__ */ defineComponent({
21
+ __name: "Icon",
22
+ props: { icon: {} },
23
+ setup(__props) {
24
+ return (_ctx, _cache) => {
25
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["n-icon", __props.icon]) }, null, 2);
26
+ };
27
+ }
28
+ });
29
+ var _hoisted_1$15 = ["open"];
30
+ var _hoisted_2$10 = { "text-base": "" };
31
+ var _hoisted_3$5 = {
32
+ key: 0,
33
+ "text-sm": "",
34
+ op50: ""
35
+ };
36
+ var SectionBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
37
+ __name: "SectionBlock",
38
+ props: {
39
+ icon: {},
40
+ text: {},
41
+ description: {},
42
+ containerClass: { default: "" },
43
+ headerClass: {},
44
+ collapse: {
45
+ type: Boolean,
46
+ default: true
47
+ },
48
+ open: {
49
+ type: Boolean,
50
+ default: true
51
+ },
52
+ padding: {
53
+ type: [Boolean, String],
54
+ default: true
55
+ }
56
+ },
57
+ setup(__props) {
58
+ const open = useVModel(__props, "open", void 0, { passive: true });
59
+ function onToggle(e) {
60
+ open.value = e.target.open;
61
+ }
62
+ return (_ctx, _cache) => {
63
+ const _component_Icon = Icon_default;
64
+ const _component_IconTitle = IconTitle_default;
65
+ const _directive_lazy_show = resolveDirective("lazy-show");
66
+ return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("details", {
67
+ open: unref(open),
68
+ onToggle: _cache[0] || (_cache[0] = (...args) => onToggle && onToggle(...args))
69
+ }, [createBaseVNode("summary", { class: normalizeClass(["cursor-pointer select-none p4 hover:bg-active", __props.collapse ? "" : "pointer-events-none"]) }, [createVNode(_component_IconTitle, {
70
+ icon: __props.icon,
71
+ text: __props.text,
72
+ "text-xl": "",
73
+ transition: "",
74
+ class: normalizeClass([unref(open) ? "op100" : "op60", __props.headerClass])
75
+ }, {
76
+ default: withCtx(() => [
77
+ createBaseVNode("div", null, [createBaseVNode("div", _hoisted_2$10, [renderSlot(_ctx.$slots, "text", {}, () => [createTextVNode(toDisplayString(__props.text), 1)], true)]), __props.description || _ctx.$slots.description ? (openBlock(), createElementBlock("div", _hoisted_3$5, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)], true)])) : createCommentVNode("", true)]),
78
+ _cache[1] || (_cache[1] = createBaseVNode("div", { class: "flex-auto" }, null, -1)),
79
+ renderSlot(_ctx.$slots, "actions", {}, void 0, true),
80
+ __props.collapse ? (openBlock(), createBlock(_component_Icon, {
81
+ key: 0,
82
+ icon: "i-ph-caret-down",
83
+ class: "chevron",
84
+ "cursor-pointer": "",
85
+ "place-self-start": "",
86
+ "text-base": "",
87
+ op75: "",
88
+ transition: "",
89
+ "duration-500": ""
90
+ })) : createCommentVNode("", true)
91
+ ]),
92
+ _: 3
93
+ }, 8, [
94
+ "icon",
95
+ "text",
96
+ "class"
97
+ ])], 2), withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass(["flex flex-col flex-gap2 pb6 pt2", typeof __props.padding === "string" ? __props.padding : __props.padding ? "px4" : ""]) }, [
98
+ renderSlot(_ctx.$slots, "details", {}, void 0, true),
99
+ createBaseVNode("div", { class: normalizeClass([__props.containerClass, "mt1"]) }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2),
100
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
101
+ ], 2)), [[_directive_lazy_show, unref(open)]])], 40, _hoisted_1$15), _cache[2] || (_cache[2] = createBaseVNode("div", { class: "x-divider" }, null, -1))], 64);
102
+ };
103
+ }
104
+ });
105
+ var _plugin_vue_export_helper_default = (sfc, props) => {
106
+ const target = sfc.__vccOpts || sfc;
107
+ for (const [key, val] of props) target[key] = val;
108
+ return target;
109
+ };
110
+ var SectionBlock_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SectionBlock_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-deaf669f"]]);
111
+ var Button_default = defineComponent({
112
+ name: "Button",
113
+ props: {
114
+ to: String,
115
+ icon: String,
116
+ border: {
117
+ type: Boolean,
118
+ default: true
119
+ },
120
+ disabled: Boolean,
121
+ type: {
122
+ type: String,
123
+ default: "button"
124
+ }
125
+ },
126
+ setup(props, { attrs, slots }) {
127
+ return () => h(props.to ? RouterLink : "button", {
128
+ to: props.to,
129
+ ...attrs,
130
+ ...!props.to && { type: props.type },
131
+ ...props.disabled ? { disabled: true } : { tabindex: 0 },
132
+ class: [
133
+ props.border ? "n-button-base active:n-button-active focus-visible:n-focus-base hover:n-button-hover" : "",
134
+ slots.default ? "" : "n-icon-button",
135
+ "n-button n-transition n-disabled:n-disabled"
136
+ ].join(" ")
137
+ }, { default: () => [renderSlot(slots, "icon", {}, () => props.icon ? [h(Icon_default, {
138
+ icon: props.icon,
139
+ class: slots.default ? "n-button-icon" : ""
140
+ })] : []), renderSlot(slots, "default")] });
141
+ }
142
+ });
143
+ var _sfc_main$1 = {};
144
+ var _hoisted_1$14 = { class: "n-card n-card-base" };
145
+ function _sfc_render$1(_ctx, _cache) {
146
+ return openBlock(), createElementBlock("div", _hoisted_1$14, [renderSlot(_ctx.$slots, "default")]);
147
+ }
148
+ var Card_default = /* @__PURE__ */ _plugin_vue_export_helper_default(_sfc_main$1, [["render", _sfc_render$1]]);
149
+ var _hoisted_1$13 = ["border"];
150
+ var _hoisted_2$9 = { class: "relative h-full w-full of-auto" };
151
+ var Drawer_default = /* @__PURE__ */ defineComponent({
152
+ __name: "Drawer",
153
+ props: {
154
+ modelValue: { type: Boolean },
155
+ top: {},
156
+ left: {},
157
+ autoClose: { type: Boolean },
158
+ transition: { default: "right" }
159
+ },
160
+ emits: ["close"],
161
+ setup(__props, { emit: __emit }) {
162
+ const props = __props;
163
+ const emit = __emit;
164
+ const el = ref();
165
+ const { height } = useElementSize(() => props.top, void 0, { box: "border-box" });
166
+ const width = typeof props.left === "string" && props.left.startsWith("#") ? document.querySelector(props.left)?.getBoundingClientRect().width : useElementSize(() => props.left, void 0, { box: "border-box" }).width;
167
+ onClickOutside(el, () => {
168
+ if (props.modelValue && props.autoClose) emit("close");
169
+ }, { ignore: [
170
+ "a",
171
+ "button",
172
+ "summary",
173
+ "[role=\"dialog\"]"
174
+ ] });
175
+ const transitionType = {
176
+ right: {
177
+ "enter-from-class": "transform translate-x-1/1",
178
+ "leave-to-class": "transform translate-x-1/1"
179
+ },
180
+ top: {
181
+ "enter-from-class": "transform translate-y--1/1",
182
+ "leave-to-class": "transform translate-y--1/1"
183
+ },
184
+ bottom: {
185
+ "enter-from-class": "transform translate-y-1/1",
186
+ "leave-to-class": "transform translate-y-1/1"
187
+ }
188
+ };
189
+ return (_ctx, _cache) => {
190
+ return openBlock(), createBlock(Transition, mergeProps(transitionType[__props.transition], {
191
+ "enter-active-class": "duration-200 ease-in",
192
+ "enter-to-class": "opacity-100",
193
+ "leave-active-class": "duration-200 ease-out",
194
+ "leave-from-class": "opacity-100"
195
+ }), {
196
+ default: withCtx(() => [__props.modelValue ? (openBlock(), createElementBlock("div", mergeProps({
197
+ key: 0,
198
+ ref_key: "el",
199
+ ref: el,
200
+ border: `${__props.transition === "right" ? "l" : __props.transition === "bottom" ? "t" : "b"} border`,
201
+ class: [{ "right-0": __props.transition === "right" || __props.transition === "bottom" }, "absolute bottom-0 z-10 z-20 of-auto n-glass-effect text-sm flex flex-col gap-1"],
202
+ style: {
203
+ top: __props.transition === "bottom" ? "auto" : `${unref(height)}px`,
204
+ left: __props.transition === "right" && !unref(width) ? "auto" : `${unref(width)}px`
205
+ }
206
+ }, _ctx.$attrs), [createVNode(unref(Button_default), {
207
+ class: "absolute right-2 top-2 z-20 text-xl",
208
+ icon: "i-ph-x-bold",
209
+ border: false,
210
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
211
+ }), createBaseVNode("div", _hoisted_2$9, [renderSlot(_ctx.$slots, "default")])], 16, _hoisted_1$13)) : createCommentVNode("", true)]),
212
+ _: 3
213
+ }, 16);
214
+ };
215
+ }
216
+ });
217
+ var _hoisted_1$12 = { class: "flex items-center border n-border-base rounded n-bg-base py-1 pl-1 pr-2 focus-within:border-primary" };
218
+ var TextInput_default = /* @__PURE__ */ defineComponent({
219
+ __name: "TextInput",
220
+ props: {
221
+ modelValue: { default: "" },
222
+ icon: {},
223
+ placeholder: {},
224
+ disabled: { type: Boolean },
225
+ autofocus: { type: Boolean },
226
+ autocomplete: {},
227
+ readonly: { type: Boolean },
228
+ type: { default: "text" }
229
+ },
230
+ emits: [
231
+ "keydown",
232
+ "keyup",
233
+ "change"
234
+ ],
235
+ setup(__props, { emit: __emit }) {
236
+ const input = useVModel(__props, "modelValue", __emit, { passive: true });
237
+ return (_ctx, _cache) => {
238
+ return openBlock(), createElementBlock("div", _hoisted_1$12, [renderSlot(_ctx.$slots, "icon", {}, () => [__props.icon ? (openBlock(), createBlock(Icon_default, {
239
+ key: 0,
240
+ icon: __props.icon,
241
+ class: "ml-0.3em mr-0.1em text-1.1em op50"
242
+ }, null, 8, ["icon"])) : createCommentVNode("", true)]), withDirectives(createBaseVNode("input", mergeProps({ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(input) ? input.value = $event : null) }, _ctx.$props, { class: "ml-0.4em w-full flex-auto n-bg-base outline-none!" }), null, 16), [[vModelDynamic, unref(input)]])]);
243
+ };
244
+ }
245
+ });
246
+ var _hoisted_1$11 = { class: "flex gap-4 flex-wrap items-center" };
247
+ var Navbar_default = /* @__PURE__ */ defineComponent({
248
+ name: "Navbar",
249
+ __name: "Navbar",
250
+ props: /* @__PURE__ */ mergeModels({
251
+ search: {},
252
+ noPadding: { type: Boolean }
253
+ }, {
254
+ "search": {},
255
+ "searchModifiers": {}
256
+ }),
257
+ emits: /* @__PURE__ */ mergeModels(["update:search"], ["update:search"]),
258
+ setup(__props, { emit: __emit }) {
259
+ const emit = __emit;
260
+ function update(event) {
261
+ emit("update:search", event.target.value);
262
+ }
263
+ const search = useModel(__props, "search");
264
+ return (_ctx, _cache) => {
265
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["flex flex-col gap-2 flex-wrap border-b n-border-base flex-1", [{ p4: !__props.noPadding }]]) }, [createBaseVNode("div", _hoisted_1$11, [renderSlot(_ctx.$slots, "search", {}, () => [search.value !== void 0 ? (openBlock(), createBlock(TextInput_default, {
266
+ key: 0,
267
+ placeholder: "Search...",
268
+ icon: "i-carbon-search",
269
+ class: normalizeClass(["flex-auto", { "px-3 py-2": !__props.noPadding }]),
270
+ value: search.value,
271
+ onInput: update
272
+ }, null, 8, ["class", "value"])) : createCommentVNode("", true)]), renderSlot(_ctx.$slots, "actions")]), renderSlot(_ctx.$slots, "default")], 2);
273
+ };
274
+ }
275
+ });
276
+ var _sfc_main = {};
277
+ var _hoisted_1$10 = { class: "n-panel-grids-center" };
278
+ function _sfc_render(_ctx, _cache) {
279
+ return openBlock(), createElementBlock("div", _hoisted_1$10, [renderSlot(_ctx.$slots, "default")]);
280
+ }
281
+ var PanelGrids_default = /* @__PURE__ */ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
282
+ var Pe = {
283
+ __name: "splitpanes",
284
+ props: {
285
+ horizontal: {
286
+ type: Boolean,
287
+ default: !1
288
+ },
289
+ pushOtherPanes: {
290
+ type: Boolean,
291
+ default: !0
292
+ },
293
+ maximizePanes: {
294
+ type: Boolean,
295
+ default: !0
296
+ },
297
+ rtl: {
298
+ type: Boolean,
299
+ default: !1
300
+ },
301
+ firstSplitter: {
302
+ type: Boolean,
303
+ default: !1
304
+ }
305
+ },
306
+ emits: [
307
+ "ready",
308
+ "resize",
309
+ "resized",
310
+ "pane-click",
311
+ "pane-maximize",
312
+ "pane-add",
313
+ "pane-remove",
314
+ "splitter-click",
315
+ "splitter-dblclick"
316
+ ],
317
+ setup(D, { emit: h$1 }) {
318
+ const y = h$1, u = D, E = useSlots(), l = ref([]), M = computed(() => l.value.reduce((e, n) => (e[~~n.id] = n) && e, {})), m = computed(() => l.value.length), x = ref(null), S = ref(!1), c = ref({
319
+ mouseDown: !1,
320
+ dragging: !1,
321
+ activeSplitter: null,
322
+ cursorOffset: 0
323
+ }), f = ref({
324
+ splitter: null,
325
+ timeoutId: null
326
+ }), _ = computed(() => ({
327
+ [`splitpanes splitpanes--${u.horizontal ? "horizontal" : "vertical"}`]: !0,
328
+ "splitpanes--dragging": c.value.dragging
329
+ })), R = () => {
330
+ document.addEventListener("mousemove", r, { passive: !1 }), document.addEventListener("mouseup", P), "ontouchstart" in window && (document.addEventListener("touchmove", r, { passive: !1 }), document.addEventListener("touchend", P));
331
+ }, O = () => {
332
+ document.removeEventListener("mousemove", r, { passive: !1 }), document.removeEventListener("mouseup", P), "ontouchstart" in window && (document.removeEventListener("touchmove", r, { passive: !1 }), document.removeEventListener("touchend", P));
333
+ }, b = (e, n) => {
334
+ const t = e.target.closest(".splitpanes__splitter");
335
+ if (t) {
336
+ const { left: i, top: a } = t.getBoundingClientRect(), { clientX: s, clientY: o } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
337
+ c.value.cursorOffset = u.horizontal ? o - a : s - i;
338
+ }
339
+ R(), c.value.mouseDown = !0, c.value.activeSplitter = n;
340
+ }, r = (e) => {
341
+ c.value.mouseDown && (e.preventDefault(), c.value.dragging = !0, requestAnimationFrame(() => {
342
+ K(I(e)), d("resize", { event: e }, !0);
343
+ }));
344
+ }, P = (e) => {
345
+ c.value.dragging && (window.getSelection().removeAllRanges(), d("resized", { event: e }, !0)), c.value.mouseDown = !1, c.value.activeSplitter = null, setTimeout(() => {
346
+ c.value.dragging = !1, O();
347
+ }, 100);
348
+ }, A = (e, n) => {
349
+ "ontouchstart" in window && (e.preventDefault(), f.value.splitter === n ? (clearTimeout(f.value.timeoutId), f.value.timeoutId = null, U(e, n), f.value.splitter = null) : (f.value.splitter = n, f.value.timeoutId = setTimeout(() => f.value.splitter = null, 500))), c.value.dragging || d("splitter-click", {
350
+ event: e,
351
+ index: n
352
+ }, !0);
353
+ }, U = (e, n) => {
354
+ if (d("splitter-dblclick", {
355
+ event: e,
356
+ index: n
357
+ }, !0), u.maximizePanes) {
358
+ let t = 0;
359
+ l.value = l.value.map((i, a) => (i.size = a === n ? i.max : i.min, a !== n && (t += i.min), i)), l.value[n].size -= t, d("pane-maximize", {
360
+ event: e,
361
+ index: n,
362
+ pane: l.value[n]
363
+ }), d("resized", {
364
+ event: e,
365
+ index: n
366
+ }, !0);
367
+ }
368
+ }, W = (e, n) => {
369
+ d("pane-click", {
370
+ event: e,
371
+ index: M.value[n].index,
372
+ pane: M.value[n]
373
+ });
374
+ }, I = (e) => {
375
+ const n = x.value.getBoundingClientRect(), { clientX: t, clientY: i } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
376
+ return {
377
+ x: t - (u.horizontal ? 0 : c.value.cursorOffset) - n.left,
378
+ y: i - (u.horizontal ? c.value.cursorOffset : 0) - n.top
379
+ };
380
+ }, J = (e) => {
381
+ e = e[u.horizontal ? "y" : "x"];
382
+ const n = x.value[u.horizontal ? "clientHeight" : "clientWidth"];
383
+ return u.rtl && !u.horizontal && (e = n - e), e * 100 / n;
384
+ }, K = (e) => {
385
+ const n = c.value.activeSplitter;
386
+ let t = {
387
+ prevPanesSize: $(n),
388
+ nextPanesSize: N(n),
389
+ prevReachedMinPanes: 0,
390
+ nextReachedMinPanes: 0
391
+ };
392
+ const i = 0 + (u.pushOtherPanes ? 0 : t.prevPanesSize), a = 100 - (u.pushOtherPanes ? 0 : t.nextPanesSize), s = Math.max(Math.min(J(e), a), i);
393
+ let o = [n, n + 1], v = l.value[o[0]] || null, p = l.value[o[1]] || null;
394
+ const H = v.max < 100 && s >= v.max + t.prevPanesSize, ue = p.max < 100 && s <= 100 - (p.max + N(n + 1));
395
+ if (H || ue) {
396
+ H ? (v.size = v.max, p.size = Math.max(100 - v.max - t.prevPanesSize - t.nextPanesSize, 0)) : (v.size = Math.max(100 - p.max - t.prevPanesSize - N(n + 1), 0), p.size = p.max);
397
+ return;
398
+ }
399
+ if (u.pushOtherPanes) {
400
+ const j = Q(t, s);
401
+ if (!j) return;
402
+ ({sums: t, panesToResize: o} = j), v = l.value[o[0]] || null, p = l.value[o[1]] || null;
403
+ }
404
+ v !== null && (v.size = Math.min(Math.max(s - t.prevPanesSize - t.prevReachedMinPanes, v.min), v.max)), p !== null && (p.size = Math.min(Math.max(100 - s - t.nextPanesSize - t.nextReachedMinPanes, p.min), p.max));
405
+ }, Q = (e, n) => {
406
+ const t = c.value.activeSplitter, i = [t, t + 1];
407
+ return n < e.prevPanesSize + l.value[i[0]].min && (i[0] = V(t).index, e.prevReachedMinPanes = 0, i[0] < t && l.value.forEach((a, s) => {
408
+ s > i[0] && s <= t && (a.size = a.min, e.prevReachedMinPanes += a.min);
409
+ }), e.prevPanesSize = $(i[0]), i[0] === void 0) ? (e.prevReachedMinPanes = 0, l.value[0].size = l.value[0].min, l.value.forEach((a, s) => {
410
+ s > 0 && s <= t && (a.size = a.min, e.prevReachedMinPanes += a.min);
411
+ }), l.value[i[1]].size = 100 - e.prevReachedMinPanes - l.value[0].min - e.prevPanesSize - e.nextPanesSize, null) : n > 100 - e.nextPanesSize - l.value[i[1]].min && (i[1] = Z(t).index, e.nextReachedMinPanes = 0, i[1] > t + 1 && l.value.forEach((a, s) => {
412
+ s > t && s < i[1] && (a.size = a.min, e.nextReachedMinPanes += a.min);
413
+ }), e.nextPanesSize = N(i[1] - 1), i[1] === void 0) ? (e.nextReachedMinPanes = 0, l.value.forEach((a, s) => {
414
+ s < m.value - 1 && s >= t + 1 && (a.size = a.min, e.nextReachedMinPanes += a.min);
415
+ }), l.value[i[0]].size = 100 - e.prevPanesSize - N(i[0] - 1), null) : {
416
+ sums: e,
417
+ panesToResize: i
418
+ };
419
+ }, $ = (e) => l.value.reduce((n, t, i) => n + (i < e ? t.size : 0), 0), N = (e) => l.value.reduce((n, t, i) => n + (i > e + 1 ? t.size : 0), 0), V = (e) => [...l.value].reverse().find((t) => t.index < e && t.size > t.min) || {}, Z = (e) => l.value.find((t) => t.index > e + 1 && t.size > t.min) || {}, ee = () => {
420
+ var n;
421
+ const e = Array.from(((n = x.value) == null ? void 0 : n.children) || []);
422
+ for (const t of e) {
423
+ const i = t.classList.contains("splitpanes__pane"), a = t.classList.contains("splitpanes__splitter");
424
+ !i && !a && (t.remove(), console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."));
425
+ }
426
+ }, F = (e, n, t = !1) => {
427
+ const i = e - 1, a = document.createElement("div");
428
+ a.classList.add("splitpanes__splitter"), t || (a.onmousedown = (s) => b(s, i), typeof window < "u" && "ontouchstart" in window && (a.ontouchstart = (s) => b(s, i)), a.onclick = (s) => A(s, i + 1)), a.ondblclick = (s) => U(s, i + 1), n.parentNode.insertBefore(a, n);
429
+ }, ne = (e) => {
430
+ e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.remove();
431
+ }, C = () => {
432
+ var t;
433
+ const e = Array.from(((t = x.value) == null ? void 0 : t.children) || []);
434
+ for (const i of e) i.className.includes("splitpanes__splitter") && ne(i);
435
+ let n = 0;
436
+ for (const i of e) i.className.includes("splitpanes__pane") && (!n && u.firstSplitter ? F(n, i, !0) : n && F(n, i), n++);
437
+ }, ie = ({ uid: e, ...n }) => {
438
+ const t = M.value[e];
439
+ for (const [i, a] of Object.entries(n)) t[i] = a;
440
+ }, te = (e) => {
441
+ var t;
442
+ let n = -1;
443
+ Array.from(((t = x.value) == null ? void 0 : t.children) || []).some((i) => (i.className.includes("splitpanes__pane") && n++, i.isSameNode(e.el))), l.value.splice(n, 0, {
444
+ ...e,
445
+ index: n
446
+ }), l.value.forEach((i, a) => i.index = a), S.value && nextTick(() => {
447
+ C(), L({ addedPane: l.value[n] }), d("pane-add", { pane: l.value[n] });
448
+ });
449
+ }, ae = (e) => {
450
+ const n = l.value.findIndex((i) => i.id === e);
451
+ l.value[n].el = null;
452
+ const t = l.value.splice(n, 1)[0];
453
+ l.value.forEach((i, a) => i.index = a), nextTick(() => {
454
+ C(), d("pane-remove", { pane: t }), L({ removedPane: { ...t } });
455
+ });
456
+ }, L = (e = {}) => {
457
+ !e.addedPane && !e.removedPane ? le() : l.value.some((n) => n.givenSize !== null || n.min || n.max < 100) ? oe(e) : se(), S.value && d("resized");
458
+ }, se = () => {
459
+ const e = 100 / m.value;
460
+ let n = 0;
461
+ const t = [], i = [];
462
+ for (const a of l.value) a.size = Math.max(Math.min(e, a.max), a.min), n -= a.size, a.size >= a.max && t.push(a.id), a.size <= a.min && i.push(a.id);
463
+ n > .1 && q(n, t, i);
464
+ }, le = () => {
465
+ let e = 100;
466
+ const n = [], t = [];
467
+ let i = 0;
468
+ for (const s of l.value) e -= s.size, s.givenSize !== null && i++, s.size >= s.max && n.push(s.id), s.size <= s.min && t.push(s.id);
469
+ let a = 100;
470
+ if (e > .1) {
471
+ for (const s of l.value) s.givenSize === null && (s.size = Math.max(Math.min(e / (m.value - i), s.max), s.min)), a -= s.size;
472
+ a > .1 && q(a, n, t);
473
+ }
474
+ }, oe = ({ addedPane: e, removedPane: n } = {}) => {
475
+ let t = 100 / m.value, i = 0;
476
+ const a = [], s = [];
477
+ ((e == null ? void 0 : e.givenSize) ?? null) !== null && (t = (100 - e.givenSize) / (m.value - 1));
478
+ for (const o of l.value) i -= o.size, o.size >= o.max && a.push(o.id), o.size <= o.min && s.push(o.id);
479
+ if (!(Math.abs(i) < .1)) {
480
+ for (const o of l.value) (e == null ? void 0 : e.givenSize) !== null && (e == null ? void 0 : e.id) === o.id || (o.size = Math.max(Math.min(t, o.max), o.min)), i -= o.size, o.size >= o.max && a.push(o.id), o.size <= o.min && s.push(o.id);
481
+ i > .1 && q(i, a, s);
482
+ }
483
+ }, q = (e, n, t) => {
484
+ let i;
485
+ e > 0 ? i = e / (m.value - n.length) : i = e / (m.value - t.length), l.value.forEach((a, s) => {
486
+ if (e > 0 && !n.includes(a.id)) {
487
+ const o = Math.max(Math.min(a.size + i, a.max), a.min), v = o - a.size;
488
+ e -= v, a.size = o;
489
+ } else if (!t.includes(a.id)) {
490
+ const o = Math.max(Math.min(a.size + i, a.max), a.min), v = o - a.size;
491
+ e -= v, a.size = o;
492
+ }
493
+ }), Math.abs(e) > .1 && nextTick(() => {
494
+ S.value && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
495
+ });
496
+ }, d = (e, n = void 0, t = !1) => {
497
+ const i = (n == null ? void 0 : n.index) ?? c.value.activeSplitter ?? null;
498
+ y(e, {
499
+ ...n,
500
+ ...i !== null && { index: i },
501
+ ...t && i !== null && {
502
+ prevPane: l.value[i - (u.firstSplitter ? 1 : 0)],
503
+ nextPane: l.value[i + (u.firstSplitter ? 0 : 1)]
504
+ },
505
+ panes: l.value.map((a) => ({
506
+ min: a.min,
507
+ max: a.max,
508
+ size: a.size
509
+ }))
510
+ });
511
+ };
512
+ watch(() => u.firstSplitter, () => C()), onMounted(() => {
513
+ ee(), C(), L(), d("ready"), S.value = !0;
514
+ }), onBeforeUnmount(() => S.value = !1);
515
+ const re = () => {
516
+ var e;
517
+ return h("div", {
518
+ ref: x,
519
+ class: _.value
520
+ }, (e = E.default) == null ? void 0 : e.call(E));
521
+ };
522
+ return provide("panes", l), provide("indexedPanes", M), provide("horizontal", computed(() => u.horizontal)), provide("requestUpdate", ie), provide("onPaneAdd", te), provide("onPaneRemove", ae), provide("onPaneClick", W), (e, n) => (openBlock(), createBlock(resolveDynamicComponent(re)));
523
+ }
524
+ }, ge = {
525
+ __name: "pane",
526
+ props: {
527
+ size: { type: [Number, String] },
528
+ minSize: {
529
+ type: [Number, String],
530
+ default: 0
531
+ },
532
+ maxSize: {
533
+ type: [Number, String],
534
+ default: 100
535
+ }
536
+ },
537
+ setup(D) {
538
+ var b;
539
+ const h$1 = D, y = inject("requestUpdate"), u = inject("onPaneAdd"), E = inject("horizontal"), l = inject("onPaneRemove"), M = inject("onPaneClick"), m = (b = getCurrentInstance()) == null ? void 0 : b.uid, x = inject("indexedPanes"), S = computed(() => x.value[m]), c = ref(null), f = computed(() => {
540
+ const r = isNaN(h$1.size) || h$1.size === void 0 ? 0 : parseFloat(h$1.size);
541
+ return Math.max(Math.min(r, R.value), _.value);
542
+ }), _ = computed(() => {
543
+ const r = parseFloat(h$1.minSize);
544
+ return isNaN(r) ? 0 : r;
545
+ }), R = computed(() => {
546
+ const r = parseFloat(h$1.maxSize);
547
+ return isNaN(r) ? 100 : r;
548
+ }), O = computed(() => {
549
+ var r;
550
+ return `${E.value ? "height" : "width"}: ${(r = S.value) == null ? void 0 : r.size}%`;
551
+ });
552
+ return watch(() => f.value, (r) => y({
553
+ uid: m,
554
+ size: r
555
+ })), watch(() => _.value, (r) => y({
556
+ uid: m,
557
+ min: r
558
+ })), watch(() => R.value, (r) => y({
559
+ uid: m,
560
+ max: r
561
+ })), onMounted(() => {
562
+ u({
563
+ id: m,
564
+ el: c.value,
565
+ min: _.value,
566
+ max: R.value,
567
+ givenSize: h$1.size === void 0 ? null : f.value,
568
+ size: f.value
569
+ });
570
+ }), onBeforeUnmount(() => l(m)), (r, P) => (openBlock(), createElementBlock("div", {
571
+ ref_key: "paneEl",
572
+ ref: c,
573
+ class: "splitpanes__pane",
574
+ onClick: P[0] || (P[0] = (A) => unref(M)(A, r._.uid)),
575
+ style: normalizeStyle(O.value)
576
+ }, [renderSlot(r.$slots, "default")], 4));
577
+ }
578
+ };
579
+ var DEFAULT = 30;
580
+ var SplitPane_default = /* @__PURE__ */ defineComponent({
581
+ __name: "SplitPane",
582
+ props: {
583
+ storageKey: {},
584
+ stateKey: { default: "pubinfo-devtools-panels-state" },
585
+ leftSize: {},
586
+ minSize: {},
587
+ horizontal: { type: Boolean }
588
+ },
589
+ setup(__props) {
590
+ const props = __props;
591
+ const state = useLocalStorage(props.stateKey, {}, { listenToStorageChanges: false });
592
+ const key = props.storageKey;
593
+ if (key && state.value[key] === void 0) state.value[key] = props.leftSize || DEFAULT;
594
+ const size = key ? computed({
595
+ get: () => state.value[key] ?? DEFAULT,
596
+ set: (v) => {
597
+ state.value[key] = v;
598
+ }
599
+ }) : ref(props.leftSize || DEFAULT);
600
+ return (_ctx, _cache) => {
601
+ return openBlock(), createBlock(unref(Pe), {
602
+ horizontal: __props.horizontal,
603
+ class: "h-full of-hidden",
604
+ onResize: _cache[0] || (_cache[0] = ({ prevPane }) => size.value = prevPane.size)
605
+ }, {
606
+ default: withCtx(() => [createVNode(unref(ge), {
607
+ class: "of-auto! h-full",
608
+ size: unref(size),
609
+ "min-size": _ctx.$slots.right ? __props.minSize || 10 : 100
610
+ }, {
611
+ default: withCtx(() => [renderSlot(_ctx.$slots, "left")]),
612
+ _: 3
613
+ }, 8, ["size", "min-size"]), _ctx.$slots.right ? (openBlock(), createBlock(unref(ge), {
614
+ key: 0,
615
+ class: "of-auto! relative h-full",
616
+ "min-size": __props.minSize || 10
617
+ }, {
618
+ default: withCtx(() => [renderSlot(_ctx.$slots, "right")]),
619
+ _: 3
620
+ }, 8, ["min-size"])) : createCommentVNode("", true)]),
621
+ _: 3
622
+ }, 8, ["horizontal"]);
623
+ };
624
+ }
625
+ });
626
+ var highlighterPromise = null;
627
+ function getShikiHighlighter() {
628
+ if (!highlighterPromise) highlighterPromise = (async () => {
629
+ const [{ createHighlighterCore }, { createOnigurumaEngine }] = await Promise.all([__vitePreload(() => import("./core-DZ0_U_pO.js"), [], import.meta.url), __vitePreload(() => import("./engine-oniguruma-Cxk0otvy.js"), [], import.meta.url)]);
630
+ return createHighlighterCore({
631
+ themes: [__vitePreload(() => import("./vitesse-dark-Bz6RXfkV.js"), [], import.meta.url), __vitePreload(() => import("./vitesse-light-NvDlvJl2.js"), [], import.meta.url)],
632
+ langs: [
633
+ __vitePreload(() => import("./javascript-QnJdw8u5.js"), __vite__mapDeps([0,1]), import.meta.url),
634
+ __vitePreload(() => import("./typescript-C5tShSk5.js"), __vite__mapDeps([2,3]), import.meta.url),
635
+ __vitePreload(() => import("./vue-Be3tcD1h.js"), __vite__mapDeps([4,5,6,1,7,3]), import.meta.url),
636
+ __vitePreload(() => import("./json-WgRhEAOB.js"), __vite__mapDeps([8,7]), import.meta.url),
637
+ __vitePreload(() => import("./html-74krLQbR.js"), __vite__mapDeps([9,6,5,1]), import.meta.url),
638
+ __vitePreload(() => import("./css-D-vtiAqw.js"), __vite__mapDeps([10,5]), import.meta.url)
639
+ ],
640
+ engine: createOnigurumaEngine(__vitePreload(() => import("./wasm-D0Echd05.js"), [], import.meta.url))
641
+ });
642
+ })();
643
+ return highlighterPromise;
644
+ }
645
+ async function highlightCode(code, options) {
646
+ const { lang, lightTheme = "vitesse-light", darkTheme = "vitesse-dark", fallbackLang = "typescript" } = options;
647
+ try {
648
+ const highlighter = await getShikiHighlighter();
649
+ const resolvedLang = highlighter.getLoadedLanguages().includes(lang) ? lang : fallbackLang;
650
+ return highlighter.codeToHtml(code, {
651
+ lang: resolvedLang,
652
+ themes: {
653
+ dark: darkTheme,
654
+ light: lightTheme
655
+ }
656
+ });
657
+ } catch (error) {
658
+ console.error("Failed to highlight code:", error);
659
+ return `<pre><code>${code}</code></pre>`;
660
+ }
661
+ }
662
+ var _hoisted_1$9 = ["innerHTML"];
663
+ var _hoisted_2$8 = ["textContent"];
664
+ var CodeBlock_default = /* @__PURE__ */ defineComponent({
665
+ name: "CodeBlock",
666
+ __name: "CodeBlock",
667
+ props: {
668
+ code: {},
669
+ lang: {},
670
+ lines: {
671
+ type: Boolean,
672
+ default: true
673
+ },
674
+ inline: { type: Boolean },
675
+ grammarContextCode: {},
676
+ transformRendered: {}
677
+ },
678
+ emits: ["loaded"],
679
+ setup(__props, { emit: __emit }) {
680
+ const props = __props;
681
+ const emit = __emit;
682
+ const rendered = shallowRef({
683
+ code: "",
684
+ supported: false
685
+ });
686
+ watchEffect(async (onInvalidate) => {
687
+ let cancelled = false;
688
+ onInvalidate(() => {
689
+ cancelled = true;
690
+ });
691
+ if (!props.lang || props.lang === "text") {
692
+ rendered.value = {
693
+ code: props.code,
694
+ supported: false
695
+ };
696
+ return;
697
+ }
698
+ try {
699
+ const highlighter = await getShikiHighlighter();
700
+ const lang = highlighter.getLoadedLanguages().includes(props.lang) ? props.lang : "text";
701
+ if (lang === "text") {
702
+ rendered.value = {
703
+ code: props.code,
704
+ supported: false
705
+ };
706
+ return;
707
+ }
708
+ const html = highlighter.codeToHtml(props.code, {
709
+ lang,
710
+ themes: {
711
+ dark: "vitesse-dark",
712
+ light: "vitesse-light"
713
+ }
714
+ });
715
+ if (cancelled) return;
716
+ rendered.value = {
717
+ code: props.transformRendered ? props.transformRendered(html) : html,
718
+ supported: true
719
+ };
720
+ nextTick(() => emit("loaded"));
721
+ } catch (e) {
722
+ if (!cancelled) rendered.value = {
723
+ code: props.code,
724
+ supported: false
725
+ };
726
+ }
727
+ });
728
+ const classes = computed(() => ["n-code-block shiki", props.lines && !props.inline ? "n-code-block-lines" : ""]);
729
+ return (_ctx, _cache) => {
730
+ return __props.lang && unref(rendered).supported ? (openBlock(), createElementBlock("pre", {
731
+ key: 0,
732
+ class: normalizeClass(unref(classes))
733
+ }, [createBaseVNode("code", { innerHTML: unref(rendered).code }, null, 8, _hoisted_1$9)], 2)) : (openBlock(), createElementBlock("pre", {
734
+ key: 1,
735
+ class: normalizeClass(unref(classes))
736
+ }, [createBaseVNode("code", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.code.split("\n"), (line, _idx) => {
737
+ return openBlock(), createElementBlock(Fragment, { key: _idx }, [createBaseVNode("span", {
738
+ class: "line",
739
+ textContent: toDisplayString(line)
740
+ }, null, 8, _hoisted_2$8), _cache[0] || (_cache[0] = createBaseVNode("br", null, null, -1))], 64);
741
+ }), 128))])], 2));
742
+ };
743
+ }
744
+ });
745
+ var _hoisted_1$8 = { class: "n-badge" };
746
+ var Badge_default = /* @__PURE__ */ defineComponent({
747
+ name: "Badge",
748
+ __name: "Badge",
749
+ setup(__props) {
750
+ return (_ctx, _cache) => {
751
+ return openBlock(), createElementBlock("span", _hoisted_1$8, [renderSlot(_ctx.$slots, "default")]);
752
+ };
753
+ }
754
+ });
755
+ const devtoolsStorageKey = { response: "__pubinfo_devtools_raw_response__" };
756
+ var _hoisted_1$7 = { class: "n-loading n-panel-grids-center" };
757
+ var _hoisted_2$7 = { class: "flex flex-col animate-pulse items-center text-lg" };
758
+ var Loading_default = /* @__PURE__ */ defineComponent({
759
+ name: "Loading",
760
+ __name: "Loading",
761
+ setup(__props) {
762
+ return (_ctx, _cache) => {
763
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [createBaseVNode("div", _hoisted_2$7, [_cache[1] || (_cache[1] = createBaseVNode("div", { class: "i-carbon-circle-dash animate-spin text-4xl op50" }, null, -1)), renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode(" Loading... ", -1))])])]);
764
+ };
765
+ }
766
+ });
767
+ const ServerRouteTabIcons = {
768
+ snippet: "i-ph-file-code",
769
+ headers: "i-ph-file-html",
770
+ cookies: "i-ph-cookie",
771
+ params: "i-ph-cursor-text",
772
+ query: "i-ph-question",
773
+ body: "i-ph-file-text"
774
+ };
775
+ function createDefaultState() {
776
+ return {
777
+ query: [],
778
+ body: [],
779
+ headers: []
780
+ };
781
+ }
782
+ function toRecord(list) {
783
+ if (!list || !list.length) return;
784
+ const formatted = Object.fromEntries(list.filter(({ active, key, value }) => active && key && value !== void 0).map(({ key, value }) => [key, value]));
785
+ return Object.keys(formatted).length ? formatted : void 0;
786
+ }
787
+ const useInputDefaults = createSharedComposable(() => {
788
+ const inputDefaults = useLocalStorage("pubinfo-devtools:input-defaults", createDefaultState(), { deep: true });
789
+ function getDefaults(tab) {
790
+ return inputDefaults.value[tab];
791
+ }
792
+ function setDefaults(tab, value) {
793
+ inputDefaults.value[tab] = value;
794
+ }
795
+ function resetToEmpty() {
796
+ inputDefaults.value = createDefaultState();
797
+ }
798
+ function mergeParsedWithDefaults(parsed, tab) {
799
+ const defaults = toRecord(inputDefaults.value[tab]);
800
+ if (!defaults && !parsed) return;
801
+ return {
802
+ ...defaults || {},
803
+ ...parsed || {}
804
+ };
805
+ }
806
+ return {
807
+ inputDefaults,
808
+ getDefaults,
809
+ setDefaults,
810
+ mergeParsedWithDefaults,
811
+ resetToEmpty
812
+ };
813
+ });
814
+ function createDefaultParamInputs() {
815
+ return {
816
+ query: [{
817
+ active: true,
818
+ key: "",
819
+ value: "",
820
+ type: "string"
821
+ }],
822
+ body: [{
823
+ active: true,
824
+ key: "",
825
+ value: "",
826
+ type: "string"
827
+ }],
828
+ headers: [{
829
+ active: true,
830
+ key: "Content-Type",
831
+ value: "application/json",
832
+ type: "string"
833
+ }]
834
+ };
835
+ }
836
+ function getInputTypeFromSchema(schemaType) {
837
+ switch (schemaType) {
838
+ case "integer":
839
+ case "number": return "number";
840
+ case "boolean": return "boolean";
841
+ case "string":
842
+ default: return "string";
843
+ }
844
+ }
845
+ function parseInputs(inputs = []) {
846
+ const formatted = Object.fromEntries(inputs.filter(({ active, key, value }) => active && key && value !== void 0).map(({ key, value }) => [key, value]));
847
+ return Object.entries(formatted).length ? formatted : void 0;
848
+ }
849
+ function useServerRouteParams(route, options = {}) {
850
+ const paramInputs = ref(createDefaultParamInputs());
851
+ const activeTab = ref();
852
+ const { mergeParsedWithDefaults } = useInputDefaults();
853
+ const currentTabInputs = computed({
854
+ get: () => {
855
+ const tab = activeTab.value;
856
+ if (!tab || !(tab in paramInputs.value)) return [];
857
+ return paramInputs.value[tab] || [];
858
+ },
859
+ set: (value) => {
860
+ const tab = activeTab.value;
861
+ if (tab && tab in paramInputs.value) paramInputs.value[tab] = value;
862
+ }
863
+ });
864
+ const parsedQuery = computed(() => mergeParsedWithDefaults(parseInputs(paramInputs.value.query), "query"));
865
+ const parsedHeader = computed(() => mergeParsedWithDefaults(parseInputs(paramInputs.value.headers), "headers"));
866
+ const parsedBody = computed(() => {
867
+ if (options.hasBody && !options.hasBody.value) return;
868
+ return mergeParsedWithDefaults(parseInputs(paramInputs.value.body), "body");
869
+ });
870
+ const finalPath = computed(() => {
871
+ const routePath = route.value.route;
872
+ const query = parsedQuery.value;
873
+ if (!query) return routePath;
874
+ const search = new URLSearchParams(query).toString();
875
+ return search ? `${routePath}?${search}` : routePath;
876
+ });
877
+ function ensureActiveTab() {
878
+ if (!activeTab.value) activeTab.value = route.value.paramLocation === "body" ? "body" : "query";
879
+ }
880
+ function initializeParamsFromSchema() {
881
+ ensureActiveTab();
882
+ const properties = route.value.paramSchema?.properties;
883
+ if (properties) {
884
+ const targetCategory$1 = (route.value.paramLocation || "query") === "body" ? "body" : "query";
885
+ const existingInputsMap = new Map(paramInputs.value[targetCategory$1].map((input) => [input.key, input]));
886
+ const newInputs = [];
887
+ Object.keys(properties).forEach((key) => {
888
+ const prop = properties[key];
889
+ const existing = existingInputsMap.get(key);
890
+ if (existing) newInputs.push({
891
+ ...existing,
892
+ type: getInputTypeFromSchema(prop.type),
893
+ fromSchema: true
894
+ });
895
+ else newInputs.push({
896
+ active: true,
897
+ key,
898
+ value: "",
899
+ type: getInputTypeFromSchema(prop.type),
900
+ fromSchema: true
901
+ });
902
+ });
903
+ const userInputs = paramInputs.value[targetCategory$1].filter((input) => !input.fromSchema);
904
+ paramInputs.value[targetCategory$1] = [...newInputs, ...userInputs];
905
+ return;
906
+ }
907
+ const targetCategory = (route.value.paramLocation || "query") === "body" ? "body" : "query";
908
+ if (paramInputs.value[targetCategory].length === 0) paramInputs.value[targetCategory] = [{
909
+ active: true,
910
+ key: "",
911
+ value: "",
912
+ type: "string"
913
+ }];
914
+ }
915
+ function resetParamInputs() {
916
+ paramInputs.value = createDefaultParamInputs();
917
+ }
918
+ function syncParamsForRoute() {
919
+ resetParamInputs();
920
+ activeTab.value = route.value.paramLocation === "body" ? "body" : "query";
921
+ initializeParamsFromSchema();
922
+ }
923
+ watch(route, () => {
924
+ syncParamsForRoute();
925
+ }, { immediate: true });
926
+ return {
927
+ paramInputs,
928
+ activeTab,
929
+ currentTabInputs,
930
+ parsedQuery,
931
+ parsedHeader,
932
+ parsedBody,
933
+ finalPath,
934
+ initializeParamsFromSchema,
935
+ resetParamInputs
936
+ };
937
+ }
938
+ var methodNameMap = {
939
+ GET: "Get",
940
+ POST: "Post",
941
+ PUT: "Put",
942
+ PATCH: "Patch",
943
+ DELETE: "Delete",
944
+ HEAD: "Head"
945
+ };
946
+ function normalizeResolvedModulePath(path) {
947
+ if (!path) return;
948
+ if (path.startsWith("/")) return path;
949
+ return `/${path}`;
950
+ }
951
+ var MESSAGE_REQUEST_TYPE = "pubinfo-nightly:devtools-request";
952
+ var MESSAGE_RESPONSE_TYPE = "pubinfo-nightly:devtools-response";
953
+ var pendingHostRequests = /* @__PURE__ */ new Map();
954
+ var messageBridgeInitialised = false;
955
+ function buildModuleSpecifierCandidates(route) {
956
+ const candidates = [];
957
+ const resolvedPath = normalizeResolvedModulePath(route.requestModuleResolvedPath);
958
+ if (resolvedPath) candidates.push(resolvedPath);
959
+ if (route.requestModulePath) candidates.push(route.requestModulePath);
960
+ return candidates.filter(Boolean).filter((value, index, self) => self.indexOf(value) === index);
961
+ }
962
+ function handleHostResponse(event) {
963
+ const data = event.data;
964
+ if (!data || data.type !== MESSAGE_RESPONSE_TYPE || !data.id) return;
965
+ const pending = pendingHostRequests.get(data.id);
966
+ if (!pending) return;
967
+ pendingHostRequests.delete(data.id);
968
+ window.clearTimeout(pending.timer);
969
+ pending.resolve({
970
+ success: Boolean(data.success),
971
+ result: data.result,
972
+ error: data.error
973
+ });
974
+ }
975
+ function ensureMessageBridge() {
976
+ if (typeof window === "undefined" || messageBridgeInitialised) return;
977
+ window.addEventListener("message", handleHostResponse);
978
+ messageBridgeInitialised = true;
979
+ }
980
+ function resolveHostTargets() {
981
+ if (typeof window === "undefined") return [];
982
+ const targets = /* @__PURE__ */ new Set();
983
+ const { parent, opener, top } = window;
984
+ if (parent && parent !== window) targets.add(parent);
985
+ if (opener && opener !== window) targets.add(opener);
986
+ if (top && top !== window) targets.add(top);
987
+ return Array.from(targets);
988
+ }
989
+ async function sendRequestThroughHost(payload) {
990
+ if (typeof window === "undefined") throw new TypeError("Devtools 仅在浏览器环境可用,请在浏览器中使用调试面板。");
991
+ ensureMessageBridge();
992
+ const targets = resolveHostTargets();
993
+ if (!targets.length) throw new TypeError("未找到可通信的宿主应用窗口,请确认 Devtools 以 iframe 方式嵌入到应用中。");
994
+ const id = `pubinfo-request-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
995
+ return new Promise((resolve, reject) => {
996
+ const timer = window.setTimeout(() => {
997
+ pendingHostRequests.delete(id);
998
+ reject(/* @__PURE__ */ new TypeError("等待应用响应超时,请确认应用仍在运行。"));
999
+ }, 15e3);
1000
+ pendingHostRequests.set(id, {
1001
+ resolve: (message) => {
1002
+ window.clearTimeout(timer);
1003
+ resolve(message);
1004
+ },
1005
+ reject: (error) => {
1006
+ window.clearTimeout(timer);
1007
+ pendingHostRequests.delete(id);
1008
+ reject(error);
1009
+ },
1010
+ timer
1011
+ });
1012
+ try {
1013
+ const message = {
1014
+ type: MESSAGE_REQUEST_TYPE,
1015
+ id,
1016
+ payload
1017
+ };
1018
+ const origin = window.location?.origin ?? "*";
1019
+ targets.forEach((target) => {
1020
+ try {
1021
+ target.postMessage(message, origin);
1022
+ } catch {
1023
+ target.postMessage(message, "*");
1024
+ }
1025
+ });
1026
+ } catch (error) {
1027
+ window.clearTimeout(timer);
1028
+ pendingHostRequests.delete(id);
1029
+ reject(error instanceof Error ? error : new Error(String(error)));
1030
+ }
1031
+ });
1032
+ }
1033
+ function toPlainObject(payload) {
1034
+ if (payload === void 0 || payload === null) return payload;
1035
+ try {
1036
+ return JSON.parse(JSON.stringify(payload));
1037
+ } catch {
1038
+ return payload;
1039
+ }
1040
+ }
1041
+ function isHttpLike(payload) {
1042
+ return payload && typeof payload === "object" && ("status" in payload || "headers" in payload);
1043
+ }
1044
+ function useServerRouteRequest({ route, routeMethod, parsedQuery, parsedBody, parsedHeader, cookie, storageKey = devtoolsStorageKey.response }) {
1045
+ const fetching = ref(false);
1046
+ const hasSentRequest = ref(false);
1047
+ const storedResponse = storageKey ? useLocalStorage(storageKey, {}) : ref({});
1048
+ const storedSnapshot = computed(() => {
1049
+ const candidate = storedResponse.value;
1050
+ if (candidate && typeof candidate === "object" && Object.keys(candidate).length > 0) return candidate;
1051
+ });
1052
+ const response = ref(storedSnapshot.value ? toPlainObject(storedSnapshot.value) : void 0);
1053
+ const lastSentAt = ref(null);
1054
+ function resetRequestState(clearPersisted = true) {
1055
+ fetching.value = false;
1056
+ hasSentRequest.value = false;
1057
+ response.value = void 0;
1058
+ lastSentAt.value = null;
1059
+ if (storageKey && clearPersisted) storedResponse.value = {};
1060
+ }
1061
+ let initialized = false;
1062
+ watch(route, () => {
1063
+ if (!initialized) {
1064
+ initialized = true;
1065
+ return;
1066
+ }
1067
+ resetRequestState();
1068
+ }, { immediate: true });
1069
+ watch(response, (value) => {
1070
+ if (!storageKey) return;
1071
+ if (isHttpLike(value)) {
1072
+ storedResponse.value = toPlainObject(value);
1073
+ return;
1074
+ }
1075
+ if (!storedSnapshot.value && value !== void 0) storedResponse.value = toPlainObject(value);
1076
+ });
1077
+ function buildRequestConfig() {
1078
+ const headers = parsedHeader.value ? { ...parsedHeader.value } : {};
1079
+ headers.__devtools__ = headers.__devtools__ ?? "true";
1080
+ const cookieState = cookie.value;
1081
+ if (cookieState.key && cookieState.value) {
1082
+ const cookieString = `${cookieState.key}=${cookieState.value}`;
1083
+ headers.Cookie = headers.Cookie ? `${headers.Cookie}; ${cookieString}` : cookieString;
1084
+ }
1085
+ const query = parsedQuery.value ? { ...parsedQuery.value } : void 0;
1086
+ const config = {
1087
+ headers,
1088
+ meta: { __devtools__: true }
1089
+ };
1090
+ if (query && Object.keys(query).length > 0) config.params = query;
1091
+ return config;
1092
+ }
1093
+ async function sendRequestViaApp() {
1094
+ const method = routeMethod.value.toUpperCase();
1095
+ if (!methodNameMap[method]) throw new Error(`不支持的请求方法:${method}`);
1096
+ const config = buildRequestConfig();
1097
+ const payload = parsedBody.value ? { ...parsedBody.value } : void 0;
1098
+ const args = [route.value.route];
1099
+ if ([
1100
+ "POST",
1101
+ "PUT",
1102
+ "PATCH",
1103
+ "DELETE"
1104
+ ].includes(method)) {
1105
+ args.push(payload);
1106
+ args.push(config);
1107
+ } else args.push(config);
1108
+ const moduleCandidates = buildModuleSpecifierCandidates(route.value);
1109
+ if (!moduleCandidates.length) throw new Error("未能解析请求模块路径,请确认 API 扫描结果包含 requestModulePath。");
1110
+ const hostResponse = await sendRequestThroughHost({
1111
+ moduleCandidates,
1112
+ exportName: route.value.requestClient,
1113
+ method,
1114
+ args
1115
+ });
1116
+ if (!hostResponse.success) {
1117
+ const error = new Error(hostResponse.error?.message ?? "应用执行请求失败");
1118
+ if (hostResponse.error?.stack) error.stack = hostResponse.error.stack;
1119
+ throw error;
1120
+ }
1121
+ return hostResponse.result;
1122
+ }
1123
+ async function sendRequest() {
1124
+ const startTime = Date.now();
1125
+ if (fetching.value) return;
1126
+ hasSentRequest.value = true;
1127
+ fetching.value = true;
1128
+ response.value = void 0;
1129
+ try {
1130
+ response.value = toPlainObject(await sendRequestViaApp());
1131
+ lastSentAt.value = Date.now();
1132
+ } catch (error) {
1133
+ const axiosResponse = error && typeof error === "object" && "response" in error ? error.response : void 0;
1134
+ if (axiosResponse) {
1135
+ response.value = toPlainObject(axiosResponse);
1136
+ lastSentAt.value = Date.now();
1137
+ } else if (error && typeof error === "object" && !(error instanceof Error)) {
1138
+ response.value = toPlainObject(error);
1139
+ lastSentAt.value = Date.now();
1140
+ } else {
1141
+ response.value = toPlainObject({
1142
+ error: true,
1143
+ message: error instanceof Error ? error.message : String(error)
1144
+ });
1145
+ lastSentAt.value = Date.now();
1146
+ }
1147
+ } finally {
1148
+ fetching.value = false;
1149
+ const duration = Date.now() - startTime;
1150
+ if (response.value && typeof response.value === "object") response.value = {
1151
+ ...response.value,
1152
+ duration
1153
+ };
1154
+ else if (response.value !== void 0) response.value = {
1155
+ data: response.value,
1156
+ duration
1157
+ };
1158
+ else response.value = { duration };
1159
+ }
1160
+ }
1161
+ const httpResponse = computed(() => {
1162
+ if (isHttpLike(response.value)) return response.value;
1163
+ const snapshot = storedSnapshot.value;
1164
+ return snapshot && isHttpLike(snapshot) ? snapshot : void 0;
1165
+ });
1166
+ const businessPayload = computed(() => {
1167
+ if (httpResponse.value && "data" in httpResponse.value) return httpResponse.value.data;
1168
+ if (isHttpLike(response.value) && "data" in response.value) return response.value.data;
1169
+ if (response.value !== void 0) {
1170
+ if (response.value && typeof response.value === "object" && "data" in response.value) return response.value.data;
1171
+ return response.value;
1172
+ }
1173
+ const snapshot = storedSnapshot.value;
1174
+ if (snapshot && typeof snapshot === "object" && "data" in snapshot) return snapshot.data;
1175
+ return snapshot;
1176
+ });
1177
+ const responseStatus = computed(() => httpResponse.value?.status);
1178
+ const responseSuccess = computed(() => {
1179
+ const data = businessPayload.value;
1180
+ if (data && typeof data.success === "boolean") return data.success;
1181
+ const status = responseStatus.value;
1182
+ return typeof status === "number" ? status < 400 : void 0;
1183
+ });
1184
+ const responseMessage = computed(() => {
1185
+ const payload = businessPayload.value;
1186
+ if (payload && typeof payload === "object") {
1187
+ const target = payload;
1188
+ return target.hint ?? target.message ?? target.msg ?? (target.data && typeof target.data === "object" && target.data.hint) ?? (target.data && typeof target.data === "object" && target.data.message) ?? (target.data && typeof target.data === "object" && target.data.msg) ?? target.statusText ?? httpResponse.value?.statusText ?? "";
1189
+ }
1190
+ if (typeof payload === "string") return payload;
1191
+ return httpResponse.value?.statusText ?? "";
1192
+ });
1193
+ const responsePreview = computed(() => {
1194
+ const target = httpResponse.value ?? response.value ?? storedSnapshot.value;
1195
+ if (!target) return "";
1196
+ return JSON.stringify(target, null, 2);
1197
+ });
1198
+ const responseLang = computed(() => {
1199
+ const contentType = (httpResponse.value?.headers ?? storedSnapshot.value?.headers ?? response.value?.headers ?? {})?.["content-type"] || "";
1200
+ if (contentType.includes("application/json")) return "json";
1201
+ if (contentType.includes("text/html")) return "html";
1202
+ if (contentType.includes("text/css")) return "css";
1203
+ if (contentType.includes("text/javascript")) return "javascript";
1204
+ if (contentType.includes("image") || contentType.includes("video")) return "media";
1205
+ if (contentType.includes("text/xml") || contentType.includes("application/xml")) return "xml";
1206
+ if (contentType.includes("application/pdf")) return "pdf";
1207
+ try {
1208
+ const raw = httpResponse.value ?? response.value ?? storedSnapshot.value;
1209
+ const payload = raw && typeof raw === "object" && "data" in raw && ("status" in raw || "headers" in raw) ? raw.data : raw;
1210
+ if (payload && typeof payload === "object") return "json";
1211
+ } catch {}
1212
+ return "text";
1213
+ });
1214
+ return {
1215
+ fetching,
1216
+ hasSentRequest,
1217
+ response,
1218
+ lastSentAt,
1219
+ sendRequest,
1220
+ responseStatus,
1221
+ responseSuccess,
1222
+ responseMessage,
1223
+ responsePreview,
1224
+ responseLang,
1225
+ responseContent: computed(() => {
1226
+ if (!response.value && !httpResponse.value && !storedSnapshot.value) return "";
1227
+ const data = businessPayload.value;
1228
+ if (responseLang.value === "json") try {
1229
+ return JSON.stringify(data ?? "", null, 2);
1230
+ } catch {
1231
+ return String(data);
1232
+ }
1233
+ if ((responseLang.value === "media" || responseLang.value === "pdf") && typeof Blob !== "undefined") try {
1234
+ const headersSource = httpResponse.value?.headers ?? storedSnapshot.value?.headers ?? response.value?.headers ?? {};
1235
+ const blob = data instanceof Blob ? data : new Blob([data], { type: headersSource?.["content-type"] });
1236
+ return URL.createObjectURL(blob);
1237
+ } catch {
1238
+ return "";
1239
+ }
1240
+ try {
1241
+ if (data == null) return "";
1242
+ if (typeof data === "string") return data;
1243
+ if (typeof ArrayBuffer !== "undefined" && data instanceof ArrayBuffer) try {
1244
+ return new TextDecoder().decode(new Uint8Array(data));
1245
+ } catch {}
1246
+ if (typeof Uint8Array !== "undefined" && data instanceof Uint8Array) try {
1247
+ return new TextDecoder().decode(data);
1248
+ } catch {}
1249
+ return JSON.stringify(data, null, 2);
1250
+ } catch {
1251
+ return String(data);
1252
+ }
1253
+ }),
1254
+ resetRequestState,
1255
+ storedResponse
1256
+ };
1257
+ }
1258
+ function useServerRouteSnippets({ route, routeMethod, parsedQuery, parsedBody, parsedHeader }) {
1259
+ return computed(() => {
1260
+ const snippets = [];
1261
+ const routeInfo = route.value;
1262
+ if (routeInfo.name && routeInfo.filepath) {
1263
+ const args = [];
1264
+ const method = routeMethod.value.toUpperCase();
1265
+ const query = parsedQuery.value;
1266
+ const body = parsedBody.value;
1267
+ const headers = parsedHeader.value;
1268
+ const hasQuery = query && Object.keys(query).length > 0;
1269
+ const hasBody = body && Object.keys(body).length > 0;
1270
+ const hasCustomHeaders = headers && Object.entries(headers).some(([key, value]) => !(key === "Content-Type" && value === "application/json"));
1271
+ if (method === "GET" && hasQuery) args.push(JSON.stringify(query, null, 2));
1272
+ if ([
1273
+ "POST",
1274
+ "PUT",
1275
+ "PATCH",
1276
+ "DELETE"
1277
+ ].includes(method)) {
1278
+ if (hasQuery && !hasBody) args.push(JSON.stringify(query, null, 2));
1279
+ else if (hasBody) args.push(JSON.stringify(body, null, 2));
1280
+ }
1281
+ if (hasCustomHeaders && headers) {
1282
+ const customHeaders = Object.fromEntries(Object.entries(headers).filter(([key, value]) => !(key === "Content-Type" && value === "application/json")));
1283
+ const headersStr = JSON.stringify({ headers: customHeaders }, null, 2).split("\n").map((line, i) => i === 0 ? line : ` ${line}`).join("\n");
1284
+ args.push(headersStr);
1285
+ }
1286
+ const argsStr = args.length > 0 ? `\n ${args.join(",\n ").split("\n").join("\n ")},\n` : "";
1287
+ snippets.push({
1288
+ name: routeInfo.name,
1289
+ lang: "typescript",
1290
+ code: `import { ${routeInfo.name} } from '${routeInfo.filepath}';
1291
+
1292
+ const { data } = await ${routeInfo.name}(${argsStr});`,
1293
+ filepath: routeInfo.filepath
1294
+ });
1295
+ }
1296
+ return snippets;
1297
+ });
1298
+ }
1299
+ var requestMethodClass = {
1300
+ get: "n-green",
1301
+ post: "n-blue",
1302
+ put: "n-orange",
1303
+ delete: "n-red",
1304
+ patch: "n-purple",
1305
+ head: "n-teal",
1306
+ default: "n-gray"
1307
+ };
1308
+ function getRequestMethodClass(method) {
1309
+ return requestMethodClass[method.toLowerCase()] || requestMethodClass.default;
1310
+ }
1311
+ var _hoisted_1$6 = { class: "flex flex-col" };
1312
+ var _hoisted_2$6 = { class: "flex-1 overflow-auto relative" };
1313
+ var _hoisted_3$4 = { class: "absolute top-0 right-0 z-10" };
1314
+ var _hoisted_4$2 = ["innerHTML"];
1315
+ var CodeSnippets_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
1316
+ __name: "CodeSnippets",
1317
+ props: { codeSnippets: {} },
1318
+ setup(__props) {
1319
+ const props = __props;
1320
+ const activeSnippet = ref(0);
1321
+ const highlightedCode = ref("");
1322
+ const copying = ref(false);
1323
+ const currentSnippet = computed(() => props.codeSnippets[activeSnippet.value]);
1324
+ const processedCode = computed(() => {
1325
+ if (!currentSnippet.value) return "";
1326
+ let code = currentSnippet.value.code;
1327
+ if (currentSnippet.value.filepath) {
1328
+ let importPath = currentSnippet.value.filepath;
1329
+ importPath = importPath.replace(/\.ts$/, "");
1330
+ if (importPath.includes("/src/")) importPath = importPath.replace(/.*\/src\//, "@/");
1331
+ else if (importPath.startsWith("src/")) importPath = importPath.replace(/^src\//, "@/");
1332
+ code = code.replaceAll(currentSnippet.value.filepath, importPath);
1333
+ }
1334
+ return code;
1335
+ });
1336
+ async function highlightCode$1() {
1337
+ if (!currentSnippet.value) return;
1338
+ highlightedCode.value = await highlightCode(processedCode.value, {
1339
+ lang: currentSnippet.value.lang,
1340
+ darkTheme: "vitesse-dark",
1341
+ lightTheme: "vitesse-light",
1342
+ fallbackLang: "typescript"
1343
+ });
1344
+ }
1345
+ async function copyCode() {
1346
+ if (!currentSnippet.value) return;
1347
+ try {
1348
+ await navigator.clipboard.writeText(processedCode.value);
1349
+ copying.value = true;
1350
+ setTimeout(() => {
1351
+ copying.value = false;
1352
+ }, 2e3);
1353
+ } catch (error) {
1354
+ console.error("Failed to copy code:", error);
1355
+ }
1356
+ }
1357
+ watch([currentSnippet], highlightCode$1, { immediate: true });
1358
+ return (_ctx, _cache) => {
1359
+ const _directive_tooltip = resolveDirective("tooltip");
1360
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [createBaseVNode("div", _hoisted_2$6, [createBaseVNode("div", _hoisted_3$4, [withDirectives((openBlock(), createBlock(unref(Button_default), {
1361
+ class: normalizeClass([copying.value ? "n-green" : "n-primary", "px-3 py-1.5"]),
1362
+ onClick: copyCode
1363
+ }, {
1364
+ default: withCtx(() => [createVNode(Icon_default, { icon: copying.value ? "i-ph-check" : "i-ph-copy" }, null, 8, ["icon"])]),
1365
+ _: 1
1366
+ }, 8, ["class"])), [[_directive_tooltip, copying.value ? "已复制!" : "复制代码"]])]), createBaseVNode("div", {
1367
+ class: "code-container",
1368
+ innerHTML: highlightedCode.value
1369
+ }, null, 8, _hoisted_4$2)])]);
1370
+ };
1371
+ }
1372
+ }), [["__scopeId", "data-v-1703382f"]]);
1373
+ var _hoisted_1$5 = ["checked", "disabled"];
1374
+ var _hoisted_2$5 = ["disabled"];
1375
+ var _hoisted_3$3 = { class: "n-checkbox-box n-transition n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base" };
1376
+ var Checkbox_default = /* @__PURE__ */ defineComponent({
1377
+ __name: "Checkbox",
1378
+ props: {
1379
+ modelValue: {
1380
+ type: [Boolean, null],
1381
+ default: false
1382
+ },
1383
+ disabled: {
1384
+ type: Boolean,
1385
+ default: false
1386
+ }
1387
+ },
1388
+ setup(__props, { emit: __emit }) {
1389
+ const checked = useVModel(__props, "modelValue", __emit, { passive: true });
1390
+ return (_ctx, _cache) => {
1391
+ return openBlock(), createElementBlock("label", {
1392
+ class: "n-checkbox select-none items-center hover:n-checkbox-hover n-disabled:n-disabled",
1393
+ checked: unref(checked) || null,
1394
+ disabled: __props.disabled || null
1395
+ }, [
1396
+ withDirectives(createBaseVNode("input", {
1397
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(checked) ? checked.value = $event : null),
1398
+ type: "checkbox",
1399
+ class: "peer absolute op0",
1400
+ disabled: __props.disabled,
1401
+ onKeypress: _cache[1] || (_cache[1] = withKeys(($event) => checked.value = !unref(checked), ["enter"]))
1402
+ }, null, 40, _hoisted_2$5), [[vModelCheckbox, unref(checked)]]),
1403
+ createBaseVNode("span", _hoisted_3$3, [createVNode(Icon_default, { class: "n-checkbox-icon scale-0 transform op0 n-transition n-checked:scale-100 n-checked:op100" })]),
1404
+ createBaseVNode("span", { class: normalizeClass([unref(checked) ? "" : "op50", "n-transition"]) }, [renderSlot(_ctx.$slots, "default")], 2)
1405
+ ], 8, _hoisted_1$5);
1406
+ };
1407
+ }
1408
+ });
1409
+ var _hoisted_1$4 = ["disabled"];
1410
+ var _hoisted_2$4 = {
1411
+ key: 0,
1412
+ value: "",
1413
+ disabled: "",
1414
+ hidden: ""
1415
+ };
1416
+ var Select_default = /* @__PURE__ */ defineComponent({
1417
+ __name: "Select",
1418
+ props: {
1419
+ modelValue: { default: void 0 },
1420
+ placeholder: { default: "" },
1421
+ icon: { default: "" },
1422
+ disabled: {
1423
+ type: Boolean,
1424
+ default: false
1425
+ }
1426
+ },
1427
+ setup(__props, { emit: __emit }) {
1428
+ const input = useVModel(__props, "modelValue", __emit, { passive: true });
1429
+ return (_ctx, _cache) => {
1430
+ const _component_NIcon = resolveComponent("NIcon");
1431
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["n-select flex flex items-center border rounded n-bg-base px-2 py-1 focus-within:border-context focus-within:n-focus-base", __props.disabled ? "border-gray:10" : "n-border-base"]) }, [renderSlot(_ctx.$slots, "icon", {}, () => [__props.icon ? (openBlock(), createBlock(_component_NIcon, {
1432
+ key: 0,
1433
+ icon: __props.icon,
1434
+ class: "mr-0.4em text-1.1em op50"
1435
+ }, null, 8, ["icon"])) : createCommentVNode("", true)]), withDirectives(createBaseVNode("select", {
1436
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(input) ? input.value = $event : null),
1437
+ disabled: __props.disabled,
1438
+ class: normalizeClass(["w-full flex-auto n-bg-base !outline-none", __props.disabled ? "appearance-none" : "cursor-pointer"])
1439
+ }, [__props.placeholder ? (openBlock(), createElementBlock("option", _hoisted_2$4, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$4), [[vModelSelect, unref(input)]])], 2);
1440
+ };
1441
+ }
1442
+ });
1443
+ var _hoisted_1$3 = { class: "flex flex-col gap-4 p-4" };
1444
+ var _hoisted_2$3 = {
1445
+ key: 1,
1446
+ class: "ml-2 flex"
1447
+ };
1448
+ var _hoisted_3$2 = ["value"];
1449
+ var _hoisted_4$1 = {
1450
+ key: 1,
1451
+ class: "w-10 flex items-center justify-center op-30",
1452
+ title: "接口定义的参数不可删除"
1453
+ };
1454
+ var _hoisted_5$1 = {
1455
+ key: 0,
1456
+ flex: "",
1457
+ "gap-4": ""
1458
+ };
1459
+ var ServerRouteInput_default = /* @__PURE__ */ defineComponent({
1460
+ __name: "ServerRouteInput",
1461
+ props: {
1462
+ modelValue: {},
1463
+ keys: { default: () => [] },
1464
+ default: { default: () => ({}) },
1465
+ disabled: {
1466
+ type: Boolean,
1467
+ default: false
1468
+ }
1469
+ },
1470
+ setup(__props, { emit: __emit }) {
1471
+ const props = __props;
1472
+ const params = useVModel(props, "modelValue", __emit, { passive: true });
1473
+ const filteredKeys = computed(() => {
1474
+ return [
1475
+ ...props.keys,
1476
+ "active",
1477
+ "key",
1478
+ "value",
1479
+ "type"
1480
+ ];
1481
+ });
1482
+ const keysObject = computed(() => {
1483
+ const obj = {};
1484
+ for (const key of filteredKeys.value) obj[key] = props.default[key] || "";
1485
+ return obj;
1486
+ });
1487
+ const inputTypes = [
1488
+ "string",
1489
+ "number",
1490
+ "boolean",
1491
+ "file",
1492
+ "date",
1493
+ "time",
1494
+ "datetime-local"
1495
+ ];
1496
+ function onFileInputChange(index, event) {
1497
+ const target = event.target;
1498
+ if (target.files && target.files[0]) {
1499
+ const file = target.files[0];
1500
+ const reader = new FileReader();
1501
+ reader.readAsDataURL(file);
1502
+ reader.onload = () => {
1503
+ params.value[index].value = reader.result;
1504
+ };
1505
+ }
1506
+ }
1507
+ function clearUserAdded() {
1508
+ const list = params.value;
1509
+ for (let i = list.length - 1; i >= 0; i--) if (!list[i]?.fromSchema) list.splice(i, 1);
1510
+ }
1511
+ const hasDeletable = computed(() => params.value?.some((i) => !i?.fromSchema));
1512
+ watch(() => params, (items) => {
1513
+ items.value.forEach((item) => {
1514
+ if (item.value === void 0 || item.value === null) return;
1515
+ if (item.type === "number") {
1516
+ if (typeof item.value !== "number") {
1517
+ const parsed = Number.parseFloat(item.value);
1518
+ item.value = Number.isNaN(parsed) ? void 0 : parsed;
1519
+ }
1520
+ } else if (item.type === "boolean") {
1521
+ if (typeof item.value !== "boolean") item.value = void 0;
1522
+ } else if (item.type === "file") {
1523
+ if (typeof item.value !== "string") item.value = void 0;
1524
+ } else if (item.type === "date") {
1525
+ if (typeof item.value === "string" && !item.value.match(/^\d{4}-\d{2}-\d{2}$/)) item.value = void 0;
1526
+ } else if (item.type === "time") {
1527
+ if (typeof item.value === "string" && !item.value.match(/^\d{2}:\d{2}$/)) item.value = void 0;
1528
+ } else if (item.type === "datetime-local") {
1529
+ if (typeof item.value === "string" && !item.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)) item.value = void 0;
1530
+ } else if (item.type === "string") item.value = String(item.value);
1531
+ });
1532
+ }, {
1533
+ deep: true,
1534
+ immediate: true,
1535
+ flush: "sync"
1536
+ });
1537
+ return (_ctx, _cache) => {
1538
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
1539
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(params), (item, index) => {
1540
+ return openBlock(), createElementBlock("div", {
1541
+ key: index,
1542
+ class: "flex gap-2 justify-around"
1543
+ }, [
1544
+ renderSlot(_ctx.$slots, "input", { item }),
1545
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filteredKeys.value, (key) => {
1546
+ return openBlock(), createElementBlock(Fragment, { key }, [item.type !== null && key === "active" ? (openBlock(), createBlock(Checkbox_default, {
1547
+ key: 0,
1548
+ modelValue: item[key],
1549
+ "onUpdate:modelValue": ($event) => item[key] = $event,
1550
+ class: "n-sm n-primary",
1551
+ disabled: __props.disabled
1552
+ }, null, 8, [
1553
+ "modelValue",
1554
+ "onUpdate:modelValue",
1555
+ "disabled"
1556
+ ])) : createCommentVNode("", true), item.type !== null && key === "key" ? (openBlock(), createBlock(TextInput_default, {
1557
+ key: 1,
1558
+ modelValue: item[key],
1559
+ "onUpdate:modelValue": ($event) => item[key] = $event,
1560
+ placeholder: key,
1561
+ class: normalizeClass(["flex-1 font-mono n-sm n-primary", __props.disabled || item.fromSchema ? "op50" : ""]),
1562
+ disabled: __props.disabled || item.fromSchema
1563
+ }, null, 8, [
1564
+ "modelValue",
1565
+ "onUpdate:modelValue",
1566
+ "placeholder",
1567
+ "disabled",
1568
+ "class"
1569
+ ])) : key === "value" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [item.type === "file" ? (openBlock(), createBlock(TextInput_default, {
1570
+ key: item.value === void 0 ? `file-empty-${index}` : `file-has-${index}`,
1571
+ type: "file",
1572
+ disabled: __props.disabled,
1573
+ class: normalizeClass(__props.disabled ? "op75" : ""),
1574
+ onChange: ($event) => onFileInputChange(index, $event)
1575
+ }, null, 8, [
1576
+ "disabled",
1577
+ "class",
1578
+ "onChange"
1579
+ ])) : item.type === "boolean" ? (openBlock(), createElementBlock("div", _hoisted_2$3, [createVNode(Checkbox_default, {
1580
+ modelValue: item.value,
1581
+ "onUpdate:modelValue": ($event) => item.value = $event,
1582
+ placeholder: "Value",
1583
+ class: "n-green n-lg",
1584
+ disabled: __props.disabled
1585
+ }, null, 8, [
1586
+ "modelValue",
1587
+ "onUpdate:modelValue",
1588
+ "disabled"
1589
+ ])])) : (openBlock(), createBlock(TextInput_default, {
1590
+ key: 2,
1591
+ modelValue: item.value,
1592
+ "onUpdate:modelValue": ($event) => item.value = $event,
1593
+ type: item.type,
1594
+ placeholder: "Value",
1595
+ class: normalizeClass(["flex-1 font-mono n-sm n-primary", __props.disabled ? "op75" : ""]),
1596
+ disabled: __props.disabled
1597
+ }, null, 8, [
1598
+ "modelValue",
1599
+ "onUpdate:modelValue",
1600
+ "type",
1601
+ "disabled",
1602
+ "class"
1603
+ ]))], 64)) : key === "type" ? (openBlock(), createBlock(Select_default, {
1604
+ key: 3,
1605
+ modelValue: item.type,
1606
+ "onUpdate:modelValue": ($event) => item.type = $event,
1607
+ n: "sm green",
1608
+ class: normalizeClass(__props.disabled ? "op75" : ""),
1609
+ disabled: __props.disabled
1610
+ }, {
1611
+ default: withCtx(() => [(openBlock(), createElementBlock(Fragment, null, renderList(inputTypes, (typeItem) => {
1612
+ return createBaseVNode("option", {
1613
+ key: typeItem,
1614
+ value: typeItem
1615
+ }, toDisplayString(typeItem), 9, _hoisted_3$2);
1616
+ }), 64))]),
1617
+ _: 1
1618
+ }, 8, [
1619
+ "modelValue",
1620
+ "onUpdate:modelValue",
1621
+ "class",
1622
+ "disabled"
1623
+ ])) : createCommentVNode("", true)], 64);
1624
+ }), 128)),
1625
+ renderSlot(_ctx.$slots, "input-actions", {
1626
+ item,
1627
+ index
1628
+ }, () => [!item.fromSchema ? (openBlock(), createBlock(unref(Button_default), {
1629
+ key: 0,
1630
+ class: normalizeClass(["n-red w-10 flex justify-center items-center", __props.disabled ? "op0!" : ""]),
1631
+ disabled: __props.disabled,
1632
+ onClick: ($event) => unref(params).splice(index, 1)
1633
+ }, {
1634
+ default: withCtx(() => [createVNode(Icon_default, { icon: "i-ph-trash" })]),
1635
+ _: 1
1636
+ }, 8, [
1637
+ "disabled",
1638
+ "class",
1639
+ "onClick"
1640
+ ])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [createVNode(Icon_default, { icon: "i-ph-lock-simple" })]))])
1641
+ ]);
1642
+ }), 128)),
1643
+ !__props.disabled ? (openBlock(), createElementBlock("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "actions", { params: unref(params) }, () => [
1644
+ createVNode(unref(Button_default), {
1645
+ icon: "i-ph-plus",
1646
+ n: "sm primary",
1647
+ my1: "",
1648
+ "px-3": "",
1649
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(params).push({ ...keysObject.value }))
1650
+ }, {
1651
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" 添加 ", -1)])]),
1652
+ _: 1
1653
+ }),
1654
+ _cache[4] || (_cache[4] = createBaseVNode("div", { "flex-auto": "" }, null, -1)),
1655
+ hasDeletable.value ? (openBlock(), createBlock(unref(Button_default), {
1656
+ key: 0,
1657
+ icon: "i-ph-trash",
1658
+ n: "sm red",
1659
+ my1: "",
1660
+ "px-3": "",
1661
+ onClick: _cache[1] || (_cache[1] = ($event) => clearUserAdded())
1662
+ }, {
1663
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" 删除全部 ", -1)])]),
1664
+ _: 1
1665
+ })) : createCommentVNode("", true)
1666
+ ])])) : createCommentVNode("", true),
1667
+ renderSlot(_ctx.$slots, "default")
1668
+ ]);
1669
+ };
1670
+ }
1671
+ });
1672
+ var _hoisted_1$2 = { class: "size-full flex flex-col" };
1673
+ var _hoisted_2$2 = { class: "n-bg-base flex-none p4 flex flex-col gap-2" };
1674
+ var _hoisted_3$1 = { class: "flex gap-2 items-center" };
1675
+ var _hoisted_4 = { class: "relative w-full" };
1676
+ var _hoisted_5 = { class: "flex gap-2 flex-wrap w-full items-center px-4 pb-2 text-center text-sm border-b n-border-base" };
1677
+ var _hoisted_6 = { class: "hidden md:block" };
1678
+ var _hoisted_7 = { class: "flex gap-2 items-center op50 mb--1" };
1679
+ var _hoisted_8 = {
1680
+ key: 0,
1681
+ class: "border-b n-border-base px-4 py-4 flex flex-col gap-4 font-mono"
1682
+ };
1683
+ var _hoisted_9 = {
1684
+ key: 1,
1685
+ class: "border-b n-border-base px-4 py-4 flex flex-col gap-4 font-mono"
1686
+ };
1687
+ var _hoisted_10 = { class: "flex gap-2 items-center" };
1688
+ var _hoisted_11 = {
1689
+ key: 2,
1690
+ class: "border-b n-border-base relative"
1691
+ };
1692
+ var _hoisted_12 = { class: "border-b n-border-base flex gap-2 items-center px-4 py-2" };
1693
+ var _hoisted_13 = { class: "text-xs op50" };
1694
+ var _hoisted_14 = {
1695
+ key: 6,
1696
+ class: "px-4 pb-4 text-sm op50"
1697
+ };
1698
+ var ServerRouteDetail_default = /* @__PURE__ */ defineComponent({
1699
+ __name: "ServerRouteDetail",
1700
+ props: { route: {} },
1701
+ emits: ["openDefaultInput"],
1702
+ setup(__props, { emit: __emit }) {
1703
+ const props = __props;
1704
+ const cookie = reactive({
1705
+ key: "",
1706
+ value: ""
1707
+ });
1708
+ const routeMethod = computed(() => props.route.method || "GET");
1709
+ const bodyPayloadMethods = [
1710
+ "PATCH",
1711
+ "POST",
1712
+ "PUT",
1713
+ "DELETE"
1714
+ ];
1715
+ const hasBody = computed(() => bodyPayloadMethods.includes(routeMethod.value.toUpperCase()));
1716
+ const [DefineDefaultInputs, UseDefaultInputs] = createReusableTemplate();
1717
+ const routeRef = toRef(props, "route");
1718
+ const { paramInputs, activeTab, currentTabInputs, parsedQuery, parsedHeader, parsedBody } = useServerRouteParams(routeRef, { hasBody });
1719
+ const { inputDefaults } = useInputDefaults();
1720
+ const inputDefaultsRecord = computed(() => inputDefaults.value);
1721
+ const activeDefaults = computed(() => {
1722
+ const tab = activeTab.value;
1723
+ return [
1724
+ "query",
1725
+ "body",
1726
+ "headers"
1727
+ ].includes(tab) ? inputDefaultsRecord.value[tab] : [];
1728
+ });
1729
+ const hasDefaults = computed(() => (activeDefaults.value?.length || 0) > 0);
1730
+ const currentParams = currentTabInputs;
1731
+ function clearParamValues() {
1732
+ [
1733
+ "query",
1734
+ "body",
1735
+ "headers"
1736
+ ].forEach((k) => {
1737
+ paramInputs.value[k] = paramInputs.value[k].map((input) => ({
1738
+ ...input,
1739
+ value: void 0
1740
+ }));
1741
+ });
1742
+ }
1743
+ const tabs = computed(() => {
1744
+ const items = [];
1745
+ items.push({
1746
+ name: "Query",
1747
+ slug: "query",
1748
+ length: paramInputs.value.query.length
1749
+ });
1750
+ if (hasBody.value) items.push({
1751
+ name: "Body",
1752
+ slug: "body",
1753
+ length: paramInputs.value.body.length
1754
+ });
1755
+ items.push({
1756
+ name: "Headers",
1757
+ slug: "headers",
1758
+ length: paramInputs.value.headers.length
1759
+ });
1760
+ items.push({
1761
+ name: "Cookies",
1762
+ slug: "cookies",
1763
+ length: cookie.value.length
1764
+ });
1765
+ items.push({
1766
+ name: "Snippets",
1767
+ slug: "snippet"
1768
+ });
1769
+ return items;
1770
+ });
1771
+ const codeSnippets = useServerRouteSnippets({
1772
+ route: routeRef,
1773
+ routeMethod,
1774
+ parsedQuery,
1775
+ parsedBody,
1776
+ parsedHeader
1777
+ });
1778
+ const { fetching, hasSentRequest, response, sendRequest, responseStatus, responseSuccess, responseLang, responseContent, storedResponse: persistedResponse } = useServerRouteRequest({
1779
+ route: routeRef,
1780
+ routeMethod,
1781
+ parsedQuery,
1782
+ parsedBody,
1783
+ parsedHeader,
1784
+ cookie: computed(() => cookie),
1785
+ storageKey: devtoolsStorageKey.response
1786
+ });
1787
+ const storedResponse = computed(() => persistedResponse.value ?? {});
1788
+ return (_ctx, _cache) => {
1789
+ const _component_PanelGrids = PanelGrids_default;
1790
+ const _component_Badge = Badge_default;
1791
+ const _component_CodeBlock = CodeBlock_default;
1792
+ const _directive_tooltip = resolveDirective("tooltip");
1793
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
1794
+ createBaseVNode("div", _hoisted_2$2, [createBaseVNode("div", _hoisted_3$1, [
1795
+ props.route.method ? (openBlock(), createBlock(unref(Button_default), {
1796
+ key: 0,
1797
+ class: normalizeClass(["n-badge-base n-sm pointer-events-none font-mono op-80", unref(getRequestMethodClass)(unref(routeMethod))]),
1798
+ tabindex: "-1"
1799
+ }, {
1800
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(routeMethod).toUpperCase()), 1)]),
1801
+ _: 1
1802
+ }, 8, ["class"])) : createCommentVNode("", true),
1803
+ createBaseVNode("div", _hoisted_4, [createVNode(TextInput_default, {
1804
+ class: "readonly flex-auto font-mono px-5 py-2 n-sm",
1805
+ disabled: "",
1806
+ "model-value": props.route.route
1807
+ }, null, 8, ["model-value"])]),
1808
+ createVNode(unref(Button_default), {
1809
+ class: "h-full n-primary n-solid bg-context",
1810
+ disabled: unref(fetching),
1811
+ onClick: unref(sendRequest)
1812
+ }, {
1813
+ default: withCtx(() => [!unref(fetching) ? (openBlock(), createBlock(Icon_default, {
1814
+ key: 0,
1815
+ icon: "i-ph-telegram-logo",
1816
+ class: "text-light"
1817
+ })) : (openBlock(), createBlock(Icon_default, {
1818
+ key: 1,
1819
+ icon: "i-eos-icons:loading",
1820
+ class: "text-light animate-spin"
1821
+ }))]),
1822
+ _: 1
1823
+ }, 8, ["disabled", "onClick"])
1824
+ ])]),
1825
+ createBaseVNode("div", _hoisted_5, [
1826
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab) => {
1827
+ return withDirectives((openBlock(), createBlock(unref(Button_default), {
1828
+ key: tab.slug,
1829
+ class: normalizeClass([unref(activeTab) === tab.slug ? "text-primary border-px border-solid border-context n-primary" : "border-transparent shadow-none", "px-4 py-2"]),
1830
+ onClick: ($event) => activeTab.value = tab.slug
1831
+ }, {
1832
+ default: withCtx(() => [createVNode(Icon_default, { icon: unref(ServerRouteTabIcons)[tab.slug] }, null, 8, ["icon"]), createBaseVNode("div", _hoisted_6, toDisplayString(tab.name) + " " + toDisplayString(tab?.length ? `(${tab.length})` : ""), 1)]),
1833
+ _: 2
1834
+ }, 1032, ["class", "onClick"])), [[_directive_tooltip, tab.name]]);
1835
+ }), 128)),
1836
+ _cache[4] || (_cache[4] = createBaseVNode("div", { class: "flex-auto" }, null, -1)),
1837
+ withDirectives(createVNode(unref(Button_default), {
1838
+ n: "orange",
1839
+ class: "p-3",
1840
+ icon: "i-ph-paint-brush-duotone",
1841
+ onClick: clearParamValues
1842
+ }, null, 512), [[_directive_tooltip, "清除输入的请求参数"]])
1843
+ ]),
1844
+ createVNode(unref(DefineDefaultInputs), null, {
1845
+ default: withCtx(() => [createBaseVNode("div", null, [createVNode(ServerRouteInput_default, {
1846
+ modelValue: unref(currentParams),
1847
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentParams) ? currentParams.value = $event : null),
1848
+ default: {
1849
+ active: true,
1850
+ type: "string"
1851
+ },
1852
+ class: "max-h-xs of-auto"
1853
+ }, null, 8, ["modelValue"]), unref(hasDefaults) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createBaseVNode("div", _hoisted_7, [
1854
+ _cache[5] || (_cache[5] = createBaseVNode("div", { class: "w-5 x-divider" }, null, -1)),
1855
+ _cache[6] || (_cache[6] = createBaseVNode("div", { class: "flex-none" }, " 默认值 ", -1)),
1856
+ createVNode(unref(Button_default), {
1857
+ icon: "i-ph-pencil-simple-line",
1858
+ border: false,
1859
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("openDefaultInput"))
1860
+ }),
1861
+ _cache[7] || (_cache[7] = createBaseVNode("div", { class: "x-divider" }, null, -1))
1862
+ ]), createVNode(ServerRouteInput_default, {
1863
+ "model-value": unref(activeDefaults),
1864
+ disabled: ""
1865
+ }, null, 8, ["model-value"])], 64)) : createCommentVNode("", true)])]),
1866
+ _: 1
1867
+ }),
1868
+ unref(activeTab) === "snippet" ? (openBlock(), createElementBlock("div", _hoisted_8, [unref(codeSnippets).length ? (openBlock(), createBlock(CodeSnippets_default, {
1869
+ key: 0,
1870
+ "code-snippets": unref(codeSnippets)
1871
+ }, null, 8, ["code-snippets"])) : createCommentVNode("", true)])) : unref(activeTab) === "cookies" ? (openBlock(), createElementBlock("div", _hoisted_9, [createBaseVNode("div", _hoisted_10, [
1872
+ createVNode(TextInput_default, {
1873
+ modelValue: unref(cookie).key,
1874
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(cookie).key = $event),
1875
+ placeholder: "Key",
1876
+ class: "flex-1 n-primary n-sm"
1877
+ }, null, 8, ["modelValue"]),
1878
+ createVNode(TextInput_default, {
1879
+ modelValue: unref(cookie).value,
1880
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(cookie).value = $event),
1881
+ placeholder: "Value",
1882
+ class: "flex-1 n-primary n-sm"
1883
+ }, null, 8, ["modelValue"]),
1884
+ withDirectives((openBlock(), createBlock(unref(Button_default), {
1885
+ title: "Add",
1886
+ class: "n-primary"
1887
+ }, {
1888
+ default: withCtx(() => [createVNode(Icon_default, { icon: "i-ph-floppy-disk" })]),
1889
+ _: 1
1890
+ })), [[_directive_tooltip, "保存"]])
1891
+ ])])) : (openBlock(), createElementBlock("div", _hoisted_11, [createVNode(unref(UseDefaultInputs))])),
1892
+ !unref(hasSentRequest) ? (openBlock(), createBlock(_component_PanelGrids, { key: 3 }, {
1893
+ default: withCtx(() => [createVNode(unref(Button_default), {
1894
+ n: "primary",
1895
+ disabled: unref(fetching),
1896
+ onClick: unref(sendRequest)
1897
+ }, {
1898
+ default: withCtx(() => [!unref(fetching) ? (openBlock(), createBlock(Icon_default, {
1899
+ key: 0,
1900
+ icon: "i-carbon:send"
1901
+ })) : (openBlock(), createBlock(Icon_default, {
1902
+ key: 1,
1903
+ icon: "i-eos-icons:loading",
1904
+ class: "animate-spin"
1905
+ })), _cache[8] || (_cache[8] = createTextVNode(" 发送请求 ", -1))]),
1906
+ _: 1
1907
+ }, 8, ["disabled", "onClick"])]),
1908
+ _: 1
1909
+ })) : unref(fetching) ? (openBlock(), createBlock(Loading_default, {
1910
+ key: 4,
1911
+ class: "z-10 flex-auto backdrop-blur"
1912
+ }, {
1913
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [createBaseVNode("span", { class: "text-sm" }, "发送中...", -1)])]),
1914
+ _: 1
1915
+ })) : unref(response) ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [createBaseVNode("div", _hoisted_12, [
1916
+ createBaseVNode("div", null, "Response " + toDisplayString(unref(responseSuccess)), 1),
1917
+ unref(responseSuccess) === false ? (openBlock(), createBlock(_component_Badge, {
1918
+ key: 0,
1919
+ class: "n-red"
1920
+ }, {
1921
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [createTextVNode(" Error ", -1)])]),
1922
+ _: 1
1923
+ })) : createCommentVNode("", true),
1924
+ createVNode(_component_Badge, { n: unref(responseSuccess) ? "green" : "orange" }, {
1925
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(responseStatus) ?? unref(storedResponse).status ?? "—"), 1)]),
1926
+ _: 1
1927
+ }, 8, ["n"]),
1928
+ createBaseVNode("code", _hoisted_13, toDisplayString(unref(response)?.headers?.["content-type"] ?? unref(storedResponse).headers?.["content-type"] ?? ""), 1),
1929
+ _cache[11] || (_cache[11] = createBaseVNode("div", { class: "flex-auto" }, null, -1)),
1930
+ _cache[12] || (_cache[12] = createBaseVNode("div", { class: "op50" }, " Request finished in ", -1)),
1931
+ createVNode(_component_Badge, { class: "n-green" }, {
1932
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(response).duration) + " ms ", 1)]),
1933
+ _: 1
1934
+ })
1935
+ ]), createVNode(_component_CodeBlock, {
1936
+ class: "flex-auto overflow-auto py-2",
1937
+ code: unref(responseContent),
1938
+ lang: unref(responseLang)
1939
+ }, null, 8, ["code", "lang"])], 64)) : (openBlock(), createElementBlock("div", _hoisted_14, " 暂无响应输出 "))
1940
+ ]);
1941
+ };
1942
+ }
1943
+ });
1944
+ var _hoisted_1$1 = { class: "min-w-0" };
1945
+ var _hoisted_2$1 = { class: "truncate" };
1946
+ var ServerRouteListItem_default = /* @__PURE__ */ defineComponent({
1947
+ __name: "ServerRouteListItem",
1948
+ props: {
1949
+ item: {},
1950
+ index: { default: 0 },
1951
+ selected: { default: null }
1952
+ },
1953
+ emits: ["select"],
1954
+ setup(__props, { emit: __emit }) {
1955
+ const props = __props;
1956
+ const emit = __emit;
1957
+ const open = ref(true);
1958
+ const isSelected = computed(() => {
1959
+ if (!props.selected || props.item.type !== "route") return false;
1960
+ return props.selected.filepath === props.item.filepath && props.selected.route === props.item.route && props.selected.method === props.item.method;
1961
+ });
1962
+ function handleClick() {
1963
+ if (props.item.type === "collection") open.value = !open.value;
1964
+ else emit("select", props.item);
1965
+ }
1966
+ return (_ctx, _cache) => {
1967
+ const _component_ServerRouteListItem = resolveComponent("ServerRouteListItem", true);
1968
+ const _directive_tooltip = resolveDirective("tooltip");
1969
+ return openBlock(), createElementBlock("div", null, [
1970
+ createBaseVNode("button", {
1971
+ class: normalizeClass(["flex gap-2 w-full items-start px-2 py-1 hover:bg-action transition-colors", { "bg-active": unref(isSelected) }]),
1972
+ style: normalizeStyle({ paddingLeft: `calc(0.5rem + ${__props.index * 1.5}em)` }),
1973
+ onClick: handleClick
1974
+ }, [createBaseVNode("div", { class: normalizeClass([{ "w-12": !__props.item.routes }, "flex-none text-left"]) }, [__props.item.type === "collection" ? (openBlock(), createBlock(Icon_default, {
1975
+ key: 0,
1976
+ icon: "i-carbon:chevron-right",
1977
+ "transform-rotate": unref(open) ? 90 : 0,
1978
+ class: "mb0.5 transition"
1979
+ }, null, 8, ["transform-rotate"])) : (openBlock(), createBlock(Badge_default, {
1980
+ key: 1,
1981
+ class: normalizeClass(unref(getRequestMethodClass)(__props.item.method || "*"))
1982
+ }, {
1983
+ default: withCtx(() => [createTextVNode(toDisplayString((__props.item.method || "*").toUpperCase()), 1)]),
1984
+ _: 1
1985
+ }, 8, ["class"]))], 2), createBaseVNode("div", _hoisted_1$1, [createBaseVNode("div", { class: normalizeClass([{ "flex items-start": __props.item.routes }, "text-sm font-mono"]) }, [__props.item.type === "collection" ? (openBlock(), createBlock(Icon_default, {
1986
+ key: 0,
1987
+ title: `${__props.item.routes?.length || 0} routes`,
1988
+ icon: unref(open) ? "i-catppuccin-folder-api-open" : "i-catppuccin-folder-api",
1989
+ class: "mr1"
1990
+ }, null, 8, ["title", "icon"])) : createCommentVNode("", true), withDirectives((openBlock(), createElementBlock("span", _hoisted_2$1, [createTextVNode(toDisplayString(__props.item.route), 1)])), [[_directive_tooltip, __props.item.description]])], 2)])], 6),
1991
+ _cache[1] || (_cache[1] = createBaseVNode("div", { class: "x-divider" }, null, -1)),
1992
+ unref(open) ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.item.routes, (subItem, subIndex) => {
1993
+ return openBlock(), createBlock(_component_ServerRouteListItem, {
1994
+ key: `${subItem.filepath}-${subIndex}`,
1995
+ item: subItem,
1996
+ index: __props.index + 1,
1997
+ selected: __props.selected,
1998
+ onSelect: _cache[0] || (_cache[0] = ($event) => emit("select", $event))
1999
+ }, null, 8, [
2000
+ "item",
2001
+ "index",
2002
+ "selected"
2003
+ ]);
2004
+ }), 128))]) : createCommentVNode("", true)
2005
+ ]);
2006
+ };
2007
+ }
2008
+ });
2009
+ function groupRoutesByFile(apiResult) {
2010
+ const routes = [];
2011
+ const fileMap = /* @__PURE__ */ new Map();
2012
+ apiResult.modules.forEach((module) => {
2013
+ module.functions.forEach((func) => {
2014
+ const fileKey = func.file;
2015
+ let fileCollection = fileMap.get(fileKey);
2016
+ if (!fileCollection) {
2017
+ fileCollection = {
2018
+ route: (fileKey.split("/").pop() || fileKey).replace(/\.(ts|js)$/, ""),
2019
+ method: "",
2020
+ description: fileKey.replace(/^.*\/src\/api\//, ""),
2021
+ type: "collection",
2022
+ filepath: fileKey,
2023
+ routes: []
2024
+ };
2025
+ fileMap.set(fileKey, fileCollection);
2026
+ routes.push(fileCollection);
2027
+ }
2028
+ fileCollection.routes.push({
2029
+ route: func.url,
2030
+ method: func.method,
2031
+ description: func.description,
2032
+ name: func.name,
2033
+ filepath: func.file,
2034
+ type: "route",
2035
+ paramType: func.paramType,
2036
+ paramLocation: func.paramLocation,
2037
+ returnType: func.returnType,
2038
+ paramSchema: func.paramSchema,
2039
+ returnSchema: func.returnSchema,
2040
+ requestClient: func.requestClient,
2041
+ requestModulePath: func.requestModulePath,
2042
+ requestModuleResolvedPath: func.requestModuleResolvedPath
2043
+ });
2044
+ });
2045
+ });
2046
+ return routes;
2047
+ }
2048
+ function flattenApiToRoutes(apiResult) {
2049
+ const routes = [];
2050
+ apiResult.modules.forEach((module) => {
2051
+ module.functions.forEach((func) => {
2052
+ routes.push({
2053
+ route: func.url,
2054
+ method: func.method,
2055
+ description: func.description,
2056
+ name: func.name,
2057
+ filepath: func.file,
2058
+ type: "route",
2059
+ paramType: func.paramType,
2060
+ paramLocation: func.paramLocation,
2061
+ returnType: func.returnType,
2062
+ paramSchema: func.paramSchema,
2063
+ returnSchema: func.returnSchema,
2064
+ requestClient: func.requestClient,
2065
+ requestModulePath: func.requestModulePath,
2066
+ requestModuleResolvedPath: func.requestModuleResolvedPath
2067
+ });
2068
+ });
2069
+ });
2070
+ return routes;
2071
+ }
2072
+ function calculateApiStats(apiResult) {
2073
+ const stats = {
2074
+ totalModules: apiResult.modules.length,
2075
+ totalApis: 0,
2076
+ totalTypes: 0,
2077
+ byMethod: {}
2078
+ };
2079
+ apiResult.modules.forEach((module) => {
2080
+ stats.totalApis += module.functions.length;
2081
+ stats.totalTypes += module.types.length;
2082
+ module.functions.forEach((func) => {
2083
+ const method = func.method.toUpperCase();
2084
+ stats.byMethod[method] = (stats.byMethod[method] || 0) + 1;
2085
+ });
2086
+ });
2087
+ return stats;
2088
+ }
2089
+ function filterRoutes(routes, searchText) {
2090
+ if (!searchText) return routes;
2091
+ const search = searchText.toLowerCase();
2092
+ return routes.map((route) => {
2093
+ if (route.type === "collection" && route.routes) {
2094
+ const filteredSubRoutes = filterRoutes(route.routes, searchText);
2095
+ if (filteredSubRoutes.length > 0) return {
2096
+ ...route,
2097
+ routes: filteredSubRoutes
2098
+ };
2099
+ return null;
2100
+ }
2101
+ return route.route.toLowerCase().includes(search) || route.method?.toLowerCase().includes(search) || route.description?.toLowerCase().includes(search) || route.name?.toLowerCase().includes(search) ? route : null;
2102
+ }).filter((route) => route !== null);
2103
+ }
2104
+ function sortRoutesByMethod(routes) {
2105
+ const methodOrder = [
2106
+ "GET",
2107
+ "POST",
2108
+ "PUT",
2109
+ "PATCH",
2110
+ "DELETE",
2111
+ "OPTIONS",
2112
+ "HEAD"
2113
+ ];
2114
+ return routes.sort((a, b) => {
2115
+ if (a.type === "collection" && b.type !== "collection") return -1;
2116
+ if (a.type !== "collection" && b.type === "collection") return 1;
2117
+ if (a.type === "collection" && b.type === "collection") return a.route.localeCompare(b.route);
2118
+ const aIndex = methodOrder.indexOf(a.method?.toUpperCase() || "");
2119
+ const bIndex = methodOrder.indexOf(b.method?.toUpperCase() || "");
2120
+ if (aIndex !== bIndex) return aIndex - bIndex;
2121
+ return a.route.localeCompare(b.route);
2122
+ });
2123
+ }
2124
+ var _hoisted_1 = { class: "flex gap-1 text-sm" };
2125
+ var _hoisted_2 = {
2126
+ key: 0,
2127
+ class: "op50"
2128
+ };
2129
+ var _hoisted_3 = { class: "op50" };
2130
+ var server_router_default = /* @__PURE__ */ defineComponent({
2131
+ name: "ServerRouterPage",
2132
+ __name: "server-router",
2133
+ setup(__props) {
2134
+ const search = ref("");
2135
+ const isGrouped = ref(true);
2136
+ const inputDefaultsDrawer = ref(false);
2137
+ const selectedRoute = ref(null);
2138
+ const { inputDefaults, resetToEmpty } = useInputDefaults();
2139
+ const inputDefaultsRecord = computed(() => inputDefaults.value);
2140
+ const defaultTabs = [
2141
+ "query",
2142
+ "body",
2143
+ "headers"
2144
+ ];
2145
+ function toTitle(s) {
2146
+ return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
2147
+ }
2148
+ apiListFetch.execute();
2149
+ function handleRouteClick(item) {
2150
+ if (item.type === "route") selectedRoute.value = item;
2151
+ }
2152
+ const routeList = computed(() => {
2153
+ const data = apiListFetch.data.value;
2154
+ if (!data || !data.modules) return [];
2155
+ return sortRoutesByMethod(isGrouped.value ? groupRoutesByFile(data) : flattenApiToRoutes(data));
2156
+ });
2157
+ const filteredRoutes = computed(() => {
2158
+ return filterRoutes(routeList.value, search.value);
2159
+ });
2160
+ const stats = computed(() => {
2161
+ const data = apiListFetch.data.value;
2162
+ if (!data) return {
2163
+ totalModules: 0,
2164
+ totalApis: 0,
2165
+ totalTypes: 0,
2166
+ byMethod: {}
2167
+ };
2168
+ return calculateApiStats(data);
2169
+ });
2170
+ const matchedCount = computed(() => {
2171
+ if (!search.value) return stats.value.totalApis;
2172
+ let count = 0;
2173
+ const countRoutes = (routes) => {
2174
+ routes.forEach((route) => {
2175
+ if (route.type === "route") count++;
2176
+ if (route.routes) countRoutes(route.routes);
2177
+ });
2178
+ };
2179
+ countRoutes(filteredRoutes.value);
2180
+ return count;
2181
+ });
2182
+ return (_ctx, _cache) => {
2183
+ const _component_SectionBlock = SectionBlock_default;
2184
+ const _directive_tooltip = resolveDirective("tooltip");
2185
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(SplitPane_default, {
2186
+ "storage-key": "server-router",
2187
+ "left-size": 26,
2188
+ "min-size": 26
2189
+ }, {
2190
+ left: withCtx(() => [createVNode(Navbar_default, {
2191
+ search: unref(search),
2192
+ "onUpdate:search": _cache[2] || (_cache[2] = ($event) => isRef(search) ? search.value = $event : null),
2193
+ class: "pb-2"
2194
+ }, {
2195
+ actions: withCtx(() => [withDirectives(createVNode(unref(Button_default), {
2196
+ icon: unref(isGrouped) ? "i-ph-tree-view" : "i-ph-list-bullets",
2197
+ border: false,
2198
+ onClick: _cache[0] || (_cache[0] = ($event) => isGrouped.value = !unref(isGrouped))
2199
+ }, null, 8, ["icon"]), [[_directive_tooltip, unref(isGrouped) ? "树形视图" : "列表视图"]]), withDirectives(createVNode(unref(Button_default), {
2200
+ icon: "i-ph-circles-three-plus",
2201
+ border: false,
2202
+ onClick: _cache[1] || (_cache[1] = ($event) => inputDefaultsDrawer.value = !unref(inputDefaultsDrawer))
2203
+ }, null, 512), [[_directive_tooltip, `默认值`]])]),
2204
+ default: withCtx(() => [createBaseVNode("div", _hoisted_1, [unref(search) ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(matchedCount)) + " 个匹配 · ", 1)) : createCommentVNode("", true), createBaseVNode("span", _hoisted_3, toDisplayString(unref(stats).totalApis) + " 个 api 接口", 1)])]),
2205
+ _: 1
2206
+ }, 8, ["search"]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredRoutes), (item, index) => {
2207
+ return openBlock(), createBlock(ServerRouteListItem_default, {
2208
+ key: `${item.filepath}-${index}`,
2209
+ item,
2210
+ selected: unref(selectedRoute),
2211
+ onSelect: handleRouteClick
2212
+ }, null, 8, ["item", "selected"]);
2213
+ }), 128))]),
2214
+ right: withCtx(() => [(openBlock(), createBlock(KeepAlive, { max: 10 }, [unref(selectedRoute) ? (openBlock(), createBlock(ServerRouteDetail_default, {
2215
+ key: 0,
2216
+ route: unref(selectedRoute),
2217
+ onOpenDefaultInput: _cache[3] || (_cache[3] = ($event) => inputDefaultsDrawer.value = true)
2218
+ }, null, 8, ["route"])) : createCommentVNode("", true)], 1024)), !unref(selectedRoute) ? (openBlock(), createBlock(PanelGrids_default, { key: 0 }, {
2219
+ default: withCtx(() => [createVNode(Card_default, { class: "px6 py2" }, {
2220
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [createBaseVNode("span", { class: "op75 cursor-default" }, "选择一个 api 开始调试", -1)])]),
2221
+ _: 1
2222
+ })]),
2223
+ _: 1
2224
+ })) : createCommentVNode("", true)]),
2225
+ _: 1
2226
+ }), createVNode(Drawer_default, {
2227
+ modelValue: unref(inputDefaultsDrawer),
2228
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(inputDefaultsDrawer) ? inputDefaultsDrawer.value = $event : null),
2229
+ "auto-close": "",
2230
+ class: "max-w-xl min-w-xl",
2231
+ onClose: _cache[5] || (_cache[5] = ($event) => inputDefaultsDrawer.value = false)
2232
+ }, {
2233
+ default: withCtx(() => [createBaseVNode("div", null, [_cache[7] || (_cache[7] = createBaseVNode("div", { class: "p-4 border-b n-border-base" }, [
2234
+ createBaseVNode("span", { class: "text-lg" }, "设置默认值"),
2235
+ createBaseVNode("br"),
2236
+ createBaseVNode("span", { class: "dark:text-white text-black op50" }, "已合并为 DevTools 中每个请求的默认设置。")
2237
+ ], -1)), (openBlock(), createElementBlock(Fragment, null, renderList(defaultTabs, (tab) => {
2238
+ return createVNode(_component_SectionBlock, {
2239
+ key: tab,
2240
+ text: `${toTitle(tab)} ${unref(inputDefaultsRecord)[tab]?.length ? `(${unref(inputDefaultsRecord)[tab].length})` : ""}`,
2241
+ padding: false,
2242
+ icon: unref(ServerRouteTabIcons)[tab]
2243
+ }, {
2244
+ default: withCtx(() => [createVNode(ServerRouteInput_default, {
2245
+ modelValue: unref(inputDefaultsRecord)[tab],
2246
+ "onUpdate:modelValue": ($event) => unref(inputDefaultsRecord)[tab] = $event,
2247
+ py0: "",
2248
+ default: {
2249
+ active: true,
2250
+ type: "string"
2251
+ }
2252
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])]),
2253
+ _: 2
2254
+ }, 1032, ["text", "icon"]);
2255
+ }), 64))])]),
2256
+ _: 1
2257
+ }, 8, ["modelValue"])], 64);
2258
+ };
2259
+ }
2260
+ });
2261
+ export { server_router_default as default };