@pubinfo-pr/devtools 0.171.2 → 0.171.3

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 (369) hide show
  1. package/dist/client/assets/Navbar-Dn_FwmwT.js +218 -0
  2. package/dist/client/assets/PanelGrids-Dr3Hj3fq.js +9 -0
  3. package/dist/client/assets/SelectTabs-DGbhp-SJ.js +171 -0
  4. package/dist/client/assets/component-BYcFX5o9.js +468 -0
  5. package/dist/client/assets/core-Deo0dKjJ.js +6012 -0
  6. package/dist/client/assets/css-D-vtiAqw.js +2 -0
  7. package/dist/client/assets/css-DbgpCiOq.js +2 -0
  8. package/dist/client/assets/engine-oniguruma-BR9-eBKQ.js +392 -0
  9. package/dist/client/assets/fetch-X85SI-zj.js +1112 -0
  10. package/dist/client/assets/html-C5tHi8hG.js +2 -0
  11. package/dist/client/assets/html-mHHj5Mh3.js +9 -0
  12. package/dist/client/assets/import-8bGFSBml.js +375 -0
  13. package/dist/client/assets/{index-r9fa78NA.css → index-C1hERR5y.css} +1 -1
  14. package/dist/client/assets/{index-BCCYVO0H.js → index-C74Jw2V-.js} +3461 -1728
  15. package/dist/client/assets/javascript-CZLwsMB1.js +2 -0
  16. package/dist/client/assets/javascript-DIagQh28.js +2 -0
  17. package/dist/client/assets/json-CzPoZe0r.js +2 -0
  18. package/dist/client/assets/json-WgRhEAOB.js +2 -0
  19. package/dist/client/assets/pages-Dj7OCD93.js +300 -0
  20. package/dist/client/assets/{server-router-6GvTqPc1.css → server-router-B1AB70as.css} +2 -2
  21. package/dist/client/assets/server-router-Byd0xUzV.js +2049 -0
  22. package/dist/client/assets/typescript-CzrZyZmM.js +2 -0
  23. package/dist/client/assets/typescript-DkhbmgdN.js +2 -0
  24. package/dist/client/assets/vue-Co3JBzx2.js +27 -0
  25. package/dist/client/assets/wasm-D0Echd05.js +5 -0
  26. package/dist/client/import.svg +1 -0
  27. package/dist/client/index.html +2 -2
  28. package/dist/dirs.mjs +3 -0
  29. package/dist/{index.js → index.mjs} +518 -170
  30. package/dist/panel/{index.js → index.mjs} +39 -3
  31. package/package.json +17 -17
  32. package/dist/client/assets/Navbar-f6u8nv1A.js +0 -190
  33. package/dist/client/assets/PanelGrids-B1uPlpXo.js +0 -8
  34. package/dist/client/assets/abap-BneqOAQn.js +0 -3
  35. package/dist/client/assets/actionscript-3-JJevXHHI.js +0 -3
  36. package/dist/client/assets/ada-Sz8xeSJ2.js +0 -3
  37. package/dist/client/assets/andromeeda-B43VcKOE.js +0 -2
  38. package/dist/client/assets/angular-html-C_XNpd6d.js +0 -5
  39. package/dist/client/assets/angular-html-xcXDdDxt.js +0 -23
  40. package/dist/client/assets/angular-ts-DD9ACpiD.js +0 -24
  41. package/dist/client/assets/apache-CH7oaL9w.js +0 -3
  42. package/dist/client/assets/apex-BpA7UqIt.js +0 -3
  43. package/dist/client/assets/apl-DmHUHJpj.js +0 -16
  44. package/dist/client/assets/applescript-CINTpQFD.js +0 -3
  45. package/dist/client/assets/ara-C4GBn5cG.js +0 -3
  46. package/dist/client/assets/asciidoc-CRs92jJ9.js +0 -3
  47. package/dist/client/assets/asm-Dcn9XRtC.js +0 -3
  48. package/dist/client/assets/astro-DDh1X0zj.js +0 -17
  49. package/dist/client/assets/aurora-x-Blua-2Ng.js +0 -2
  50. package/dist/client/assets/awk-i3TwHhsk.js +0 -3
  51. package/dist/client/assets/ayu-dark-rqcwfyq7.js +0 -2
  52. package/dist/client/assets/ballerina-XubCZIu_.js +0 -3
  53. package/dist/client/assets/bat-CJDZmMbE.js +0 -3
  54. package/dist/client/assets/beancount-Bz84L4pZ.js +0 -3
  55. package/dist/client/assets/berry-CPchONJa.js +0 -3
  56. package/dist/client/assets/bibtex-DVvKgGnw.js +0 -3
  57. package/dist/client/assets/bicep-AnktATo6.js +0 -3
  58. package/dist/client/assets/blade-DSiefmOm.js +0 -20
  59. package/dist/client/assets/bsl-B5rPHHQR.js +0 -4
  60. package/dist/client/assets/c-vo15i6HS.js +0 -3
  61. package/dist/client/assets/c-z_CBvR-7.js +0 -2
  62. package/dist/client/assets/cadence-ClJ3N6y1.js +0 -3
  63. package/dist/client/assets/cairo-CibIWXXr.js +0 -4
  64. package/dist/client/assets/catppuccin-frappe-DZStY-Pp.js +0 -2
  65. package/dist/client/assets/catppuccin-latte-DN5l0gng.js +0 -2
  66. package/dist/client/assets/catppuccin-macchiato-CQ07VMBV.js +0 -2
  67. package/dist/client/assets/catppuccin-mocha-BZQavwvR.js +0 -2
  68. package/dist/client/assets/clarity-2rxwVrD_.js +0 -3
  69. package/dist/client/assets/clojure-C0jiC_f1.js +0 -3
  70. package/dist/client/assets/cmake-es1DOjpX.js +0 -3
  71. package/dist/client/assets/cmake-hgeKAf6L.js +0 -2
  72. package/dist/client/assets/cobol-D4I6b-S-.js +0 -11
  73. package/dist/client/assets/codeowners-DQKqJDHd.js +0 -3
  74. package/dist/client/assets/codeql-Dz54F1mo.js +0 -3
  75. package/dist/client/assets/coffee-De9Ahhbk.js +0 -4
  76. package/dist/client/assets/common-lisp-DMXHEDsU.js +0 -3
  77. package/dist/client/assets/component-CAiGJCHL.js +0 -517
  78. package/dist/client/assets/coq-B3EyCE2_.js +0 -3
  79. package/dist/client/assets/cpp-BZS_uuBN.js +0 -6
  80. package/dist/client/assets/cpp-DQfrxaSK.js +0 -19
  81. package/dist/client/assets/crystal-DPw2ul3_.js +0 -17
  82. package/dist/client/assets/csharp-9SPrJBrf.js +0 -3
  83. package/dist/client/assets/csharp-C36TKsxo.js +0 -2
  84. package/dist/client/assets/css-BIIpc795.js +0 -3
  85. package/dist/client/assets/css-DR-9FJvj.js +0 -2
  86. package/dist/client/assets/csv-De8OeUXw.js +0 -3
  87. package/dist/client/assets/cue-bqy7mysW.js +0 -3
  88. package/dist/client/assets/cypher-CnGGPPF8.js +0 -3
  89. package/dist/client/assets/d-_v-0qIMo.js +0 -3
  90. package/dist/client/assets/dark-plus-B5VW4UtG.js +0 -2
  91. package/dist/client/assets/dart-D7mvjjnO.js +0 -3
  92. package/dist/client/assets/dax-id_v9k01.js +0 -3
  93. package/dist/client/assets/desktop-C63sB2uB.js +0 -3
  94. package/dist/client/assets/diff-B5GyjU4M.js +0 -3
  95. package/dist/client/assets/diff-DaXl9_BL.js +0 -2
  96. package/dist/client/assets/docker-5gOQFWt6.js +0 -3
  97. package/dist/client/assets/dotenv-CBz9ZAVs.js +0 -3
  98. package/dist/client/assets/dracula-CVkeaATE.js +0 -2
  99. package/dist/client/assets/dracula-soft-CMoFpNDM.js +0 -2
  100. package/dist/client/assets/dream-maker-DA2xoZVW.js +0 -3
  101. package/dist/client/assets/edge-Rvj64lc9.js +0 -13
  102. package/dist/client/assets/elixir-CoeM723j.js +0 -6
  103. package/dist/client/assets/elm-Bd7OM9qn.js +0 -5
  104. package/dist/client/assets/emacs-lisp-BegAz5NS.js +0 -3
  105. package/dist/client/assets/erb-MtET9AJK.js +0 -26
  106. package/dist/client/assets/erlang-C2LMbUyn.js +0 -4
  107. package/dist/client/assets/everforest-dark-7_cjN5Ls.js +0 -2
  108. package/dist/client/assets/everforest-light-CZ9uP19Z.js +0 -2
  109. package/dist/client/assets/fennel-CD-2iDIW.js +0 -3
  110. package/dist/client/assets/fetch-Vqmvg8bB.js +0 -969
  111. package/dist/client/assets/fish-Dg2ABucE.js +0 -3
  112. package/dist/client/assets/fluent-DVPJ3-hM.js +0 -3
  113. package/dist/client/assets/fortran-fixed-form-2tZ26fHw.js +0 -4
  114. package/dist/client/assets/fortran-free-form-1RD0EiW1.js +0 -3
  115. package/dist/client/assets/fortran-free-form-DHi82dZv.js +0 -2
  116. package/dist/client/assets/fsharp-BLIM__N6.js +0 -4
  117. package/dist/client/assets/gdresource-BqLhMx8o.js +0 -9
  118. package/dist/client/assets/gdscript-Bf4AGzTd.js +0 -2
  119. package/dist/client/assets/gdscript-Ct_7YOkG.js +0 -3
  120. package/dist/client/assets/gdshader-D8eohhwr.js +0 -2
  121. package/dist/client/assets/gdshader-DirlFY6X.js +0 -3
  122. package/dist/client/assets/genie-AuuHiNUM.js +0 -3
  123. package/dist/client/assets/gherkin-DFKTJFbA.js +0 -3
  124. package/dist/client/assets/git-commit-CuACZQ6M.js +0 -4
  125. package/dist/client/assets/git-rebase-BpEGiwgf.js +0 -4
  126. package/dist/client/assets/github-dark-CPRAlY9A.js +0 -2
  127. package/dist/client/assets/github-dark-default-CZbASOwg.js +0 -2
  128. package/dist/client/assets/github-dark-dimmed-DhBVNpZK.js +0 -2
  129. package/dist/client/assets/github-dark-high-contrast-Sr2JvhDL.js +0 -2
  130. package/dist/client/assets/github-light-default-CcwDY4o-.js +0 -2
  131. package/dist/client/assets/github-light-high-contrast-DiYFdlG4.js +0 -2
  132. package/dist/client/assets/github-light-nsZZ__b4.js +0 -2
  133. package/dist/client/assets/gleam-BHyqnKuN.js +0 -3
  134. package/dist/client/assets/glimmer-js-BYOiNDSp.js +0 -13
  135. package/dist/client/assets/glimmer-ts-DQ3A-M4A.js +0 -13
  136. package/dist/client/assets/glsl-B38FqIrO.js +0 -4
  137. package/dist/client/assets/glsl-xv19v6C3.js +0 -3
  138. package/dist/client/assets/gnuplot-BLvFISGO.js +0 -3
  139. package/dist/client/assets/go-C3PtlDL7.js +0 -2
  140. package/dist/client/assets/go-DdZjW6By.js +0 -3
  141. package/dist/client/assets/graphql-DazeCgwe.js +0 -13
  142. package/dist/client/assets/graphql-v1D07dEi.js +0 -6
  143. package/dist/client/assets/groovy-cVQ6ZwgN.js +0 -3
  144. package/dist/client/assets/gruvbox-dark-hard-BAs6lRWB.js +0 -2
  145. package/dist/client/assets/gruvbox-dark-medium-3GYOc_7i.js +0 -2
  146. package/dist/client/assets/gruvbox-dark-soft-CLjRrw1t.js +0 -2
  147. package/dist/client/assets/gruvbox-light-hard-B5pDyJmT.js +0 -2
  148. package/dist/client/assets/gruvbox-light-medium-Czo7iHvp.js +0 -2
  149. package/dist/client/assets/gruvbox-light-soft-MdVOuSwf.js +0 -2
  150. package/dist/client/assets/hack-AkEaSIiG.js +0 -11
  151. package/dist/client/assets/haml-12DF4L6t.js +0 -4
  152. package/dist/client/assets/haml-D7SdiIb2.js +0 -9
  153. package/dist/client/assets/handlebars-BF5SsGSc.js +0 -13
  154. package/dist/client/assets/haskell-Btp_MfgK.js +0 -3
  155. package/dist/client/assets/haxe-BRg8mBSK.js +0 -3
  156. package/dist/client/assets/haxe-qVl2C22S.js +0 -2
  157. package/dist/client/assets/hcl-CApdjmWo.js +0 -3
  158. package/dist/client/assets/hjson-B8yyLN8N.js +0 -3
  159. package/dist/client/assets/hlsl-7q7KfwR3.js +0 -2
  160. package/dist/client/assets/hlsl-DWQGecR0.js +0 -3
  161. package/dist/client/assets/houston-Dq9ylkJH.js +0 -2
  162. package/dist/client/assets/html-CygGKEU-.js +0 -9
  163. package/dist/client/assets/html-XPHP1ctB.js +0 -4
  164. package/dist/client/assets/html-derivative-BRUyLBYr.js +0 -5
  165. package/dist/client/assets/html-derivative-CDHXe1rc.js +0 -4
  166. package/dist/client/assets/http-BTiGLdVM.js +0 -18
  167. package/dist/client/assets/hxml-eH6B7Ggs.js +0 -4
  168. package/dist/client/assets/hy-BeCIpdlw.js +0 -3
  169. package/dist/client/assets/imba-DpPztiU8.js +0 -3
  170. package/dist/client/assets/ini-DebGZPuX.js +0 -3
  171. package/dist/client/assets/java-CSuGW7pk.js +0 -3
  172. package/dist/client/assets/java-JqMAxu8h.js +0 -2
  173. package/dist/client/assets/javascript-D8V2UVzz.js +0 -3
  174. package/dist/client/assets/javascript-LJ6D4L7Q.js +0 -2
  175. package/dist/client/assets/jinja-DPlrL6lm.js +0 -8
  176. package/dist/client/assets/jison-0ZlyxLzz.js +0 -4
  177. package/dist/client/assets/json-DiZTWJxw.js +0 -2
  178. package/dist/client/assets/json-N1bXK1S4.js +0 -3
  179. package/dist/client/assets/json5-BJHJ0To6.js +0 -3
  180. package/dist/client/assets/jsonc-BRhkMZMN.js +0 -3
  181. package/dist/client/assets/jsonl-Dqt2JMW8.js +0 -3
  182. package/dist/client/assets/jsonnet-f3ibr2Yq.js +0 -3
  183. package/dist/client/assets/jssm-Cnr_fb09.js +0 -3
  184. package/dist/client/assets/jsx-BcRPVPD9.js +0 -3
  185. package/dist/client/assets/jsx-kOdHP25g.js +0 -2
  186. package/dist/client/assets/julia-BSZQ7UdI.js +0 -18
  187. package/dist/client/assets/kanagawa-dragon-BV9Zk8qt.js +0 -2
  188. package/dist/client/assets/kanagawa-lotus-Axn-Auo6.js +0 -2
  189. package/dist/client/assets/kanagawa-wave-DUnLhLrF.js +0 -2
  190. package/dist/client/assets/kotlin-B35H-nQ1.js +0 -3
  191. package/dist/client/assets/kusto-JpEPj3V4.js +0 -3
  192. package/dist/client/assets/laserwave-DiD8Onb6.js +0 -2
  193. package/dist/client/assets/latex-eg89ZWIS.js +0 -5
  194. package/dist/client/assets/lean-CI_7uWok.js +0 -3
  195. package/dist/client/assets/less-DYcvZ1vs.js +0 -3
  196. package/dist/client/assets/less-DyvK2mij.js +0 -2
  197. package/dist/client/assets/light-plus-m_bgcHIo.js +0 -2
  198. package/dist/client/assets/liquid-ChIPyGY6.js +0 -13
  199. package/dist/client/assets/llvm-ClGsJD4P.js +0 -3
  200. package/dist/client/assets/log-BUigt4UI.js +0 -3
  201. package/dist/client/assets/logo-BCINIXU4.js +0 -3
  202. package/dist/client/assets/lua-DE8lfN39.js +0 -4
  203. package/dist/client/assets/lua-DmTtkYij.js +0 -3
  204. package/dist/client/assets/luau-BZzhLdC_.js +0 -3
  205. package/dist/client/assets/make-kRm5bKuA.js +0 -3
  206. package/dist/client/assets/markdown-6PLSK6_0.js +0 -3
  207. package/dist/client/assets/markdown-mlSUc649.js +0 -2
  208. package/dist/client/assets/marko-DgW77q7w.js +0 -13
  209. package/dist/client/assets/material-theme-darker-C4z_i_mu.js +0 -2
  210. package/dist/client/assets/material-theme-kKgGr_7i.js +0 -2
  211. package/dist/client/assets/material-theme-lighter-DbQ48hUl.js +0 -2
  212. package/dist/client/assets/material-theme-ocean-CpswQGq-.js +0 -2
  213. package/dist/client/assets/material-theme-palenight-B9YdP00v.js +0 -2
  214. package/dist/client/assets/matlab-DFqu3muE.js +0 -3
  215. package/dist/client/assets/mdc-D-3CUGp6.js +0 -14
  216. package/dist/client/assets/mdx-CDUtDhJ1.js +0 -3
  217. package/dist/client/assets/mermaid-J0yr3y0m.js +0 -3
  218. package/dist/client/assets/min-dark-fcEqhRpI.js +0 -2
  219. package/dist/client/assets/min-light-DWVresoN.js +0 -2
  220. package/dist/client/assets/mipsasm-5ppLD5jH.js +0 -3
  221. package/dist/client/assets/mojo-Bk5yI3fr.js +0 -3
  222. package/dist/client/assets/monokai-BN_TBhb9.js +0 -2
  223. package/dist/client/assets/move-XM2padQY.js +0 -3
  224. package/dist/client/assets/narrat-C6VnUWXS.js +0 -3
  225. package/dist/client/assets/nextflow-sVcVU_R2.js +0 -3
  226. package/dist/client/assets/nginx-CtF2jNry.js +0 -5
  227. package/dist/client/assets/night-owl-B29_KAmr.js +0 -2
  228. package/dist/client/assets/nim-TErUbZAu.js +0 -20
  229. package/dist/client/assets/nix-YSTOikLh.js +0 -3
  230. package/dist/client/assets/nord-DH5uOgoE.js +0 -2
  231. package/dist/client/assets/nushell-stskKkpE.js +0 -3
  232. package/dist/client/assets/objective-c-BNhcDvrR.js +0 -3
  233. package/dist/client/assets/objective-cpp-H1Owc-ej.js +0 -3
  234. package/dist/client/assets/ocaml-BDFFD8DR.js +0 -3
  235. package/dist/client/assets/one-dark-pro-Hhca3JzB.js +0 -2
  236. package/dist/client/assets/one-light-CkAyoF0j.js +0 -2
  237. package/dist/client/assets/pages-Bx84dNCY.js +0 -239
  238. package/dist/client/assets/pascal-datMNmKx.js +0 -3
  239. package/dist/client/assets/perl-BBy5Zwm3.js +0 -16
  240. package/dist/client/assets/php-BxmWfIjG.js +0 -17
  241. package/dist/client/assets/php-Dwoa08mV.js +0 -9
  242. package/dist/client/assets/plastic-1ETRJ1D-.js +0 -2
  243. package/dist/client/assets/plsql-DdbZbPNj.js +0 -3
  244. package/dist/client/assets/po-C6c1vTCK.js +0 -3
  245. package/dist/client/assets/poimandres-CnlY1rVk.js +0 -2
  246. package/dist/client/assets/polar-2mcakGk2.js +0 -3
  247. package/dist/client/assets/postcss-DRXKdNvs.js +0 -3
  248. package/dist/client/assets/postcss-mk7NO3GE.js +0 -2
  249. package/dist/client/assets/powerquery-Bskx_J2g.js +0 -3
  250. package/dist/client/assets/powershell-BDMMRQG8.js +0 -3
  251. package/dist/client/assets/prisma-B9kjRwd3.js +0 -3
  252. package/dist/client/assets/prolog-krySb6Vx.js +0 -3
  253. package/dist/client/assets/proto-BaKE0120.js +0 -3
  254. package/dist/client/assets/pug-_0lXH97N.js +0 -11
  255. package/dist/client/assets/puppet-Do5i4j8B.js +0 -3
  256. package/dist/client/assets/purescript-BRN1yDPC.js +0 -3
  257. package/dist/client/assets/python-CSI6xDEM.js +0 -3
  258. package/dist/client/assets/python-wZG5a_HU.js +0 -2
  259. package/dist/client/assets/qml-BbSTJdwY.js +0 -4
  260. package/dist/client/assets/qmldir-CH4NwF2P.js +0 -3
  261. package/dist/client/assets/qss-Dy8PrTp1.js +0 -3
  262. package/dist/client/assets/r-B4QMIUOL.js +0 -3
  263. package/dist/client/assets/r-C_0je1kM.js +0 -2
  264. package/dist/client/assets/racket-wuRvcgGp.js +0 -3
  265. package/dist/client/assets/raku-DsVSEccV.js +0 -3
  266. package/dist/client/assets/razor-B-gWLra0.js +0 -11
  267. package/dist/client/assets/red-CSHNpN1R.js +0 -2
  268. package/dist/client/assets/reg-DYEGF8g9.js +0 -3
  269. package/dist/client/assets/regexp-BV7LsrGP.js +0 -2
  270. package/dist/client/assets/regexp-BYt9QUJK.js +0 -3
  271. package/dist/client/assets/rel-B2-IkXcx.js +0 -3
  272. package/dist/client/assets/riscv-DVzb-nnG.js +0 -3
  273. package/dist/client/assets/rose-pine-CpIPLGs4.js +0 -2
  274. package/dist/client/assets/rose-pine-dawn-BruRtD0n.js +0 -2
  275. package/dist/client/assets/rose-pine-moon-CuLUPl8L.js +0 -2
  276. package/dist/client/assets/rst-vq3PUEe9.js +0 -35
  277. package/dist/client/assets/ruby-Py1CEke6.js +0 -29
  278. package/dist/client/assets/ruby-djifmDsY.js +0 -20
  279. package/dist/client/assets/rust-DIxn70Bc.js +0 -3
  280. package/dist/client/assets/sas-Crv05x8i.js +0 -4
  281. package/dist/client/assets/sass-PfnQUa_g.js +0 -3
  282. package/dist/client/assets/scala-BBzrXTKG.js +0 -3
  283. package/dist/client/assets/scheme-YR9NA8ZM.js +0 -3
  284. package/dist/client/assets/scss-Cl-VEz3E.js +0 -3
  285. package/dist/client/assets/scss-Cw2rR0Nw.js +0 -4
  286. package/dist/client/assets/sdbl-ZdJzdy9k.js +0 -2
  287. package/dist/client/assets/sdbl-t_ZuHY19.js +0 -3
  288. package/dist/client/assets/server-router-DLDLUF9W.js +0 -8698
  289. package/dist/client/assets/shaderlab-BhQ9G_fS.js +0 -4
  290. package/dist/client/assets/shellscript-3NHz9REQ.js +0 -2
  291. package/dist/client/assets/shellscript-DudglamS.js +0 -3
  292. package/dist/client/assets/shellsession-GL5OwgNh.js +0 -4
  293. package/dist/client/assets/slack-dark-D6KJ2ZHk.js +0 -2
  294. package/dist/client/assets/slack-ochin-CgGPHUxy.js +0 -2
  295. package/dist/client/assets/smalltalk-9xhKYkIL.js +0 -3
  296. package/dist/client/assets/snazzy-light-CYNZ3aPZ.js +0 -2
  297. package/dist/client/assets/solarized-dark-C-DYAQzw.js +0 -2
  298. package/dist/client/assets/solarized-light-klFMqjBj.js +0 -2
  299. package/dist/client/assets/solidity-Ozd5FRLq.js +0 -3
  300. package/dist/client/assets/soy-DWTMTRvm.js +0 -6
  301. package/dist/client/assets/sparql-Bhv-NULD.js +0 -4
  302. package/dist/client/assets/splunk-BeKRTE5f.js +0 -3
  303. package/dist/client/assets/sql-BNXsYZV2.js +0 -3
  304. package/dist/client/assets/sql-D9X2mMUX.js +0 -2
  305. package/dist/client/assets/ssh-config-CrEKc8er.js +0 -3
  306. package/dist/client/assets/stata-BlmwGy5v.js +0 -4
  307. package/dist/client/assets/stylus-BwRZfacm.js +0 -3
  308. package/dist/client/assets/stylus-CltJUoH-.js +0 -2
  309. package/dist/client/assets/svelte-Cz0fJMJu.js +0 -13
  310. package/dist/client/assets/swift-BCxbwyiK.js +0 -3
  311. package/dist/client/assets/synthwave-84-DrmUwzTK.js +0 -2
  312. package/dist/client/assets/system-verilog-BxAPtrDd.js +0 -3
  313. package/dist/client/assets/systemd-BUuSsiDV.js +0 -3
  314. package/dist/client/assets/talonscript-Cuu-B8IR.js +0 -3
  315. package/dist/client/assets/tasl-i94Nm9X2.js +0 -3
  316. package/dist/client/assets/tcl-JtwPeyJe.js +0 -3
  317. package/dist/client/assets/templ-DJEM4Dsn.js +0 -11
  318. package/dist/client/assets/terraform-H_gFhmGE.js +0 -3
  319. package/dist/client/assets/tex-V5JgLFQ3.js +0 -4
  320. package/dist/client/assets/tex-k6SW7rO1.js +0 -3
  321. package/dist/client/assets/tokyo-night-DJ3fbRL-.js +0 -2
  322. package/dist/client/assets/toml-Czn4TMmG.js +0 -3
  323. package/dist/client/assets/ts-tags-DftD3xuW.js +0 -49
  324. package/dist/client/assets/tsv-D7JVv6cM.js +0 -3
  325. package/dist/client/assets/tsx-B7G7qOdJ.js +0 -2
  326. package/dist/client/assets/tsx-CSxn0co8.js +0 -3
  327. package/dist/client/assets/turtle-Bg9WlzE1.js +0 -2
  328. package/dist/client/assets/turtle-gL243zka.js +0 -3
  329. package/dist/client/assets/twig-BH71GbCE.js +0 -34
  330. package/dist/client/assets/typescript-D838FC1-.js +0 -2
  331. package/dist/client/assets/typescript-Dx74cANe.js +0 -3
  332. package/dist/client/assets/typespec-ChNe-9Bn.js +0 -3
  333. package/dist/client/assets/typst-lzp37gIG.js +0 -3
  334. package/dist/client/assets/v-pJSB2935.js +0 -3
  335. package/dist/client/assets/vala-DQwyfTuQ.js +0 -3
  336. package/dist/client/assets/vb-DG-y450E.js +0 -3
  337. package/dist/client/assets/verilog-CGyXGbfs.js +0 -3
  338. package/dist/client/assets/vesper-onTZvQE4.js +0 -2
  339. package/dist/client/assets/vhdl-Bmc1tQry.js +0 -3
  340. package/dist/client/assets/viml-HNAopjhZ.js +0 -3
  341. package/dist/client/assets/vitesse-black-Dpu_nmGn.js +0 -2
  342. package/dist/client/assets/vue-CtiaKG90.js +0 -29
  343. package/dist/client/assets/vue-TeT-q0PM.js +0 -8
  344. package/dist/client/assets/vue-html-Dn0drGR_.js +0 -14
  345. package/dist/client/assets/vue-vine-Cl9MyVkQ.js +0 -23
  346. package/dist/client/assets/vyper-BcdH-HiN.js +0 -3
  347. package/dist/client/assets/wasm-B7JigFSi.js +0 -3
  348. package/dist/client/assets/wasm-CGqR8-aw.js +0 -5
  349. package/dist/client/assets/wenyan-BTFknrNi.js +0 -3
  350. package/dist/client/assets/wgsl-BPUHKtQI.js +0 -3
  351. package/dist/client/assets/wikitext-DUrIafj7.js +0 -3
  352. package/dist/client/assets/wit-CQC-whBg.js +0 -3
  353. package/dist/client/assets/wolfram-DNZpEQsI.js +0 -3
  354. package/dist/client/assets/xml-CbEHzi2l.js +0 -3
  355. package/dist/client/assets/xml-DNc0do_Y.js +0 -4
  356. package/dist/client/assets/xsl-HF12enVp.js +0 -5
  357. package/dist/client/assets/yaml-C44YtPPc.js +0 -2
  358. package/dist/client/assets/yaml-QnybJTzt.js +0 -3
  359. package/dist/client/assets/zenscript-CK7CgSxa.js +0 -3
  360. package/dist/client/assets/zig-CHGlMKvF.js +0 -3
  361. package/dist/dirs.js +0 -3
  362. /package/dist/client/assets/{vitesse-dark-COIKPj8_.js → vitesse-dark-Bz6RXfkV.js} +0 -0
  363. /package/dist/client/assets/{vitesse-light-BGqXUuET.js → vitesse-light-NvDlvJl2.js} +0 -0
  364. /package/dist/{constants.d.ts → constants.d.mts} +0 -0
  365. /package/dist/{constants.js → constants.mjs} +0 -0
  366. /package/dist/{dirs.d.ts → dirs.d.mts} +0 -0
  367. /package/dist/{dirs2.js → dirs2.mjs} +0 -0
  368. /package/dist/{index.d.ts → index.d.mts} +0 -0
  369. /package/dist/panel/{index.d.ts → index.d.mts} +0 -0
@@ -0,0 +1,2049 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./javascript-DIagQh28.js","./javascript-CZLwsMB1.js","./typescript-CzrZyZmM.js","./typescript-DkhbmgdN.js","./vue-Co3JBzx2.js","./css-DbgpCiOq.js","./html-mHHj5Mh3.js","./json-CzPoZe0r.js","./json-WgRhEAOB.js","./html-C5tHi8hG.js","./css-D-vtiAqw.js"])))=>i.map(i=>d[i]);
2
+ import { A as renderList, B as withDirectives, D as onMounted, E as onBeforeUnmount, I as useSlots, J as ref, K as reactive, L as watch, M as resolveComponent, N as resolveDirective, O as openBlock, P as resolveDynamicComponent, Q as toRef, R as watchEffect, S as inject, T as nextTick, W as isRef, X as shallowRef, _ as createTextVNode, b as getCurrentInstance, c as withKeys, d as computed, et as unref, f as createBaseVNode, h as createElementBlock, i as vModelCheckbox, j as renderSlot, k as provide, l as Fragment, m as createCommentVNode, nt as normalizeStyle, p as createBlock, r as Transition, rt as toDisplayString, s as vModelSelect, t as __vitePreload, tt as normalizeClass, u as KeepAlive, v as createVNode, w as mergeProps, x as h, y as defineComponent, z as withCtx } from "./index-C74Jw2V-.js";
3
+ import { a as Icon_default, i as SectionBlock_default, n as TextInput_default, r as Button_default, t as Navbar_default } from "./Navbar-Dn_FwmwT.js";
4
+ import { c as createReusableTemplate, d as useElementSize, f as useLocalStorage, h as createSharedComposable, l as onClickOutside, o as Badge_default, p as useVModel, s as _plugin_vue_export_helper_default, t as apiListFetch } from "./fetch-X85SI-zj.js";
5
+ import { t as PanelGrids_default } from "./PanelGrids-Dr3Hj3fq.js";
6
+ var _sfc_main = {};
7
+ var _hoisted_1$10 = { class: "n-card n-card-base" };
8
+ function _sfc_render(_ctx, _cache) {
9
+ return openBlock(), createElementBlock("div", _hoisted_1$10, [renderSlot(_ctx.$slots, "default")]);
10
+ }
11
+ var Card_default = /* @__PURE__ */ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
12
+ var _hoisted_1$9 = ["border"];
13
+ var _hoisted_2$9 = { class: "relative h-full w-full of-auto" };
14
+ var Drawer_default = /* @__PURE__ */ defineComponent({
15
+ __name: "Drawer",
16
+ props: {
17
+ modelValue: { type: Boolean },
18
+ top: {},
19
+ left: {},
20
+ autoClose: { type: Boolean },
21
+ transition: { default: "right" }
22
+ },
23
+ emits: ["close"],
24
+ setup(__props, { emit: __emit }) {
25
+ const props = __props;
26
+ const emit = __emit;
27
+ const el = ref();
28
+ const { height } = useElementSize(() => props.top, void 0, { box: "border-box" });
29
+ const width = typeof props.left === "string" && props.left.startsWith("#") ? document.querySelector(props.left)?.getBoundingClientRect().width : useElementSize(() => props.left, void 0, { box: "border-box" }).width;
30
+ onClickOutside(el, () => {
31
+ if (props.modelValue && props.autoClose) emit("close");
32
+ }, { ignore: [
33
+ "a",
34
+ "button",
35
+ "summary",
36
+ "[role=\"dialog\"]"
37
+ ] });
38
+ const transitionType = {
39
+ right: {
40
+ "enter-from-class": "transform translate-x-1/1",
41
+ "leave-to-class": "transform translate-x-1/1"
42
+ },
43
+ top: {
44
+ "enter-from-class": "transform translate-y--1/1",
45
+ "leave-to-class": "transform translate-y--1/1"
46
+ },
47
+ bottom: {
48
+ "enter-from-class": "transform translate-y-1/1",
49
+ "leave-to-class": "transform translate-y-1/1"
50
+ }
51
+ };
52
+ return (_ctx, _cache) => {
53
+ return openBlock(), createBlock(Transition, mergeProps(transitionType[__props.transition], {
54
+ "enter-active-class": "duration-200 ease-in",
55
+ "enter-to-class": "opacity-100",
56
+ "leave-active-class": "duration-200 ease-out",
57
+ "leave-from-class": "opacity-100"
58
+ }), {
59
+ default: withCtx(() => [__props.modelValue ? (openBlock(), createElementBlock("div", mergeProps({
60
+ key: 0,
61
+ ref_key: "el",
62
+ ref: el,
63
+ border: `${__props.transition === "right" ? "l" : __props.transition === "bottom" ? "t" : "b"} border`,
64
+ 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"],
65
+ style: {
66
+ top: __props.transition === "bottom" ? "auto" : `${unref(height)}px`,
67
+ left: __props.transition === "right" && !unref(width) ? "auto" : `${unref(width)}px`
68
+ }
69
+ }, _ctx.$attrs), [createVNode(unref(Button_default), {
70
+ class: "absolute right-2 top-2 z-20 text-xl",
71
+ icon: "i-ph-x-bold",
72
+ border: false,
73
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
74
+ }), createBaseVNode("div", _hoisted_2$9, [renderSlot(_ctx.$slots, "default")])], 16, _hoisted_1$9)) : createCommentVNode("", true)]),
75
+ _: 3
76
+ }, 16);
77
+ };
78
+ }
79
+ });
80
+ var Pe = {
81
+ __name: "splitpanes",
82
+ props: {
83
+ horizontal: {
84
+ type: Boolean,
85
+ default: !1
86
+ },
87
+ pushOtherPanes: {
88
+ type: Boolean,
89
+ default: !0
90
+ },
91
+ maximizePanes: {
92
+ type: Boolean,
93
+ default: !0
94
+ },
95
+ rtl: {
96
+ type: Boolean,
97
+ default: !1
98
+ },
99
+ firstSplitter: {
100
+ type: Boolean,
101
+ default: !1
102
+ }
103
+ },
104
+ emits: [
105
+ "ready",
106
+ "resize",
107
+ "resized",
108
+ "pane-click",
109
+ "pane-maximize",
110
+ "pane-add",
111
+ "pane-remove",
112
+ "splitter-click",
113
+ "splitter-dblclick"
114
+ ],
115
+ setup(D, { emit: h$1 }) {
116
+ 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({
117
+ mouseDown: !1,
118
+ dragging: !1,
119
+ activeSplitter: null,
120
+ cursorOffset: 0
121
+ }), f = ref({
122
+ splitter: null,
123
+ timeoutId: null
124
+ }), _ = computed(() => ({
125
+ [`splitpanes splitpanes--${u.horizontal ? "horizontal" : "vertical"}`]: !0,
126
+ "splitpanes--dragging": c.value.dragging
127
+ })), R = () => {
128
+ document.addEventListener("mousemove", r, { passive: !1 }), document.addEventListener("mouseup", P), "ontouchstart" in window && (document.addEventListener("touchmove", r, { passive: !1 }), document.addEventListener("touchend", P));
129
+ }, O = () => {
130
+ document.removeEventListener("mousemove", r, { passive: !1 }), document.removeEventListener("mouseup", P), "ontouchstart" in window && (document.removeEventListener("touchmove", r, { passive: !1 }), document.removeEventListener("touchend", P));
131
+ }, b = (e, n) => {
132
+ const t = e.target.closest(".splitpanes__splitter");
133
+ if (t) {
134
+ const { left: i, top: a } = t.getBoundingClientRect(), { clientX: s, clientY: o } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
135
+ c.value.cursorOffset = u.horizontal ? o - a : s - i;
136
+ }
137
+ R(), c.value.mouseDown = !0, c.value.activeSplitter = n;
138
+ }, r = (e) => {
139
+ c.value.mouseDown && (e.preventDefault(), c.value.dragging = !0, requestAnimationFrame(() => {
140
+ K(I(e)), d("resize", { event: e }, !0);
141
+ }));
142
+ }, P = (e) => {
143
+ c.value.dragging && (window.getSelection().removeAllRanges(), d("resized", { event: e }, !0)), c.value.mouseDown = !1, c.value.activeSplitter = null, setTimeout(() => {
144
+ c.value.dragging = !1, O();
145
+ }, 100);
146
+ }, A = (e, n) => {
147
+ "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", {
148
+ event: e,
149
+ index: n
150
+ }, !0);
151
+ }, U = (e, n) => {
152
+ if (d("splitter-dblclick", {
153
+ event: e,
154
+ index: n
155
+ }, !0), u.maximizePanes) {
156
+ let t = 0;
157
+ 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", {
158
+ event: e,
159
+ index: n,
160
+ pane: l.value[n]
161
+ }), d("resized", {
162
+ event: e,
163
+ index: n
164
+ }, !0);
165
+ }
166
+ }, W = (e, n) => {
167
+ d("pane-click", {
168
+ event: e,
169
+ index: M.value[n].index,
170
+ pane: M.value[n]
171
+ });
172
+ }, I = (e) => {
173
+ const n = x.value.getBoundingClientRect(), { clientX: t, clientY: i } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
174
+ return {
175
+ x: t - (u.horizontal ? 0 : c.value.cursorOffset) - n.left,
176
+ y: i - (u.horizontal ? c.value.cursorOffset : 0) - n.top
177
+ };
178
+ }, J = (e) => {
179
+ e = e[u.horizontal ? "y" : "x"];
180
+ const n = x.value[u.horizontal ? "clientHeight" : "clientWidth"];
181
+ return u.rtl && !u.horizontal && (e = n - e), e * 100 / n;
182
+ }, K = (e) => {
183
+ const n = c.value.activeSplitter;
184
+ let t = {
185
+ prevPanesSize: $(n),
186
+ nextPanesSize: N(n),
187
+ prevReachedMinPanes: 0,
188
+ nextReachedMinPanes: 0
189
+ };
190
+ const i = 0 + (u.pushOtherPanes ? 0 : t.prevPanesSize), a = 100 - (u.pushOtherPanes ? 0 : t.nextPanesSize), s = Math.max(Math.min(J(e), a), i);
191
+ let o = [n, n + 1], v = l.value[o[0]] || null, p = l.value[o[1]] || null;
192
+ const H = v.max < 100 && s >= v.max + t.prevPanesSize, ue = p.max < 100 && s <= 100 - (p.max + N(n + 1));
193
+ if (H || ue) {
194
+ 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);
195
+ return;
196
+ }
197
+ if (u.pushOtherPanes) {
198
+ const j = Q(t, s);
199
+ if (!j) return;
200
+ ({sums: t, panesToResize: o} = j), v = l.value[o[0]] || null, p = l.value[o[1]] || null;
201
+ }
202
+ 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));
203
+ }, Q = (e, n) => {
204
+ const t = c.value.activeSplitter, i = [t, t + 1];
205
+ 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) => {
206
+ s > i[0] && s <= t && (a.size = a.min, e.prevReachedMinPanes += a.min);
207
+ }), e.prevPanesSize = $(i[0]), i[0] === void 0) ? (e.prevReachedMinPanes = 0, l.value[0].size = l.value[0].min, l.value.forEach((a, s) => {
208
+ s > 0 && s <= t && (a.size = a.min, e.prevReachedMinPanes += a.min);
209
+ }), 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) => {
210
+ s > t && s < i[1] && (a.size = a.min, e.nextReachedMinPanes += a.min);
211
+ }), e.nextPanesSize = N(i[1] - 1), i[1] === void 0) ? (e.nextReachedMinPanes = 0, l.value.forEach((a, s) => {
212
+ s < m.value - 1 && s >= t + 1 && (a.size = a.min, e.nextReachedMinPanes += a.min);
213
+ }), l.value[i[0]].size = 100 - e.prevPanesSize - N(i[0] - 1), null) : {
214
+ sums: e,
215
+ panesToResize: i
216
+ };
217
+ }, $ = (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 = () => {
218
+ var n;
219
+ const e = Array.from(((n = x.value) == null ? void 0 : n.children) || []);
220
+ for (const t of e) {
221
+ const i = t.classList.contains("splitpanes__pane"), a = t.classList.contains("splitpanes__splitter");
222
+ !i && !a && (t.remove(), console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."));
223
+ }
224
+ }, F = (e, n, t = !1) => {
225
+ const i = e - 1, a = document.createElement("div");
226
+ 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);
227
+ }, ne = (e) => {
228
+ e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.remove();
229
+ }, C = () => {
230
+ var t;
231
+ const e = Array.from(((t = x.value) == null ? void 0 : t.children) || []);
232
+ for (const i of e) i.className.includes("splitpanes__splitter") && ne(i);
233
+ let n = 0;
234
+ for (const i of e) i.className.includes("splitpanes__pane") && (!n && u.firstSplitter ? F(n, i, !0) : n && F(n, i), n++);
235
+ }, ie = ({ uid: e, ...n }) => {
236
+ const t = M.value[e];
237
+ for (const [i, a] of Object.entries(n)) t[i] = a;
238
+ }, te = (e) => {
239
+ var t;
240
+ let n = -1;
241
+ 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, {
242
+ ...e,
243
+ index: n
244
+ }), l.value.forEach((i, a) => i.index = a), S.value && nextTick(() => {
245
+ C(), L({ addedPane: l.value[n] }), d("pane-add", { pane: l.value[n] });
246
+ });
247
+ }, ae = (e) => {
248
+ const n = l.value.findIndex((i) => i.id === e);
249
+ l.value[n].el = null;
250
+ const t = l.value.splice(n, 1)[0];
251
+ l.value.forEach((i, a) => i.index = a), nextTick(() => {
252
+ C(), d("pane-remove", { pane: t }), L({ removedPane: { ...t } });
253
+ });
254
+ }, L = (e = {}) => {
255
+ !e.addedPane && !e.removedPane ? le() : l.value.some((n) => n.givenSize !== null || n.min || n.max < 100) ? oe(e) : se(), S.value && d("resized");
256
+ }, se = () => {
257
+ const e = 100 / m.value;
258
+ let n = 0;
259
+ const t = [], i = [];
260
+ 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);
261
+ n > .1 && q(n, t, i);
262
+ }, le = () => {
263
+ let e = 100;
264
+ const n = [], t = [];
265
+ let i = 0;
266
+ 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);
267
+ let a = 100;
268
+ if (e > .1) {
269
+ 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;
270
+ a > .1 && q(a, n, t);
271
+ }
272
+ }, oe = ({ addedPane: e, removedPane: n } = {}) => {
273
+ let t = 100 / m.value, i = 0;
274
+ const a = [], s = [];
275
+ ((e == null ? void 0 : e.givenSize) ?? null) !== null && (t = (100 - e.givenSize) / (m.value - 1));
276
+ 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);
277
+ if (!(Math.abs(i) < .1)) {
278
+ 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);
279
+ i > .1 && q(i, a, s);
280
+ }
281
+ }, q = (e, n, t) => {
282
+ let i;
283
+ e > 0 ? i = e / (m.value - n.length) : i = e / (m.value - t.length), l.value.forEach((a, s) => {
284
+ if (e > 0 && !n.includes(a.id)) {
285
+ const o = Math.max(Math.min(a.size + i, a.max), a.min), v = o - a.size;
286
+ e -= v, a.size = o;
287
+ } else if (!t.includes(a.id)) {
288
+ const o = Math.max(Math.min(a.size + i, a.max), a.min), v = o - a.size;
289
+ e -= v, a.size = o;
290
+ }
291
+ }), Math.abs(e) > .1 && nextTick(() => {
292
+ S.value && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
293
+ });
294
+ }, d = (e, n = void 0, t = !1) => {
295
+ const i = (n == null ? void 0 : n.index) ?? c.value.activeSplitter ?? null;
296
+ y(e, {
297
+ ...n,
298
+ ...i !== null && { index: i },
299
+ ...t && i !== null && {
300
+ prevPane: l.value[i - (u.firstSplitter ? 1 : 0)],
301
+ nextPane: l.value[i + (u.firstSplitter ? 0 : 1)]
302
+ },
303
+ panes: l.value.map((a) => ({
304
+ min: a.min,
305
+ max: a.max,
306
+ size: a.size
307
+ }))
308
+ });
309
+ };
310
+ watch(() => u.firstSplitter, () => C()), onMounted(() => {
311
+ ee(), C(), L(), d("ready"), S.value = !0;
312
+ }), onBeforeUnmount(() => S.value = !1);
313
+ const re = () => {
314
+ var e;
315
+ return h("div", {
316
+ ref: x,
317
+ class: _.value
318
+ }, (e = E.default) == null ? void 0 : e.call(E));
319
+ };
320
+ 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)));
321
+ }
322
+ }, ge = {
323
+ __name: "pane",
324
+ props: {
325
+ size: { type: [Number, String] },
326
+ minSize: {
327
+ type: [Number, String],
328
+ default: 0
329
+ },
330
+ maxSize: {
331
+ type: [Number, String],
332
+ default: 100
333
+ }
334
+ },
335
+ setup(D) {
336
+ var b;
337
+ 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(() => {
338
+ const r = isNaN(h$1.size) || h$1.size === void 0 ? 0 : parseFloat(h$1.size);
339
+ return Math.max(Math.min(r, R.value), _.value);
340
+ }), _ = computed(() => {
341
+ const r = parseFloat(h$1.minSize);
342
+ return isNaN(r) ? 0 : r;
343
+ }), R = computed(() => {
344
+ const r = parseFloat(h$1.maxSize);
345
+ return isNaN(r) ? 100 : r;
346
+ }), O = computed(() => {
347
+ var r;
348
+ return `${E.value ? "height" : "width"}: ${(r = S.value) == null ? void 0 : r.size}%`;
349
+ });
350
+ return watch(() => f.value, (r) => y({
351
+ uid: m,
352
+ size: r
353
+ })), watch(() => _.value, (r) => y({
354
+ uid: m,
355
+ min: r
356
+ })), watch(() => R.value, (r) => y({
357
+ uid: m,
358
+ max: r
359
+ })), onMounted(() => {
360
+ u({
361
+ id: m,
362
+ el: c.value,
363
+ min: _.value,
364
+ max: R.value,
365
+ givenSize: h$1.size === void 0 ? null : f.value,
366
+ size: f.value
367
+ });
368
+ }), onBeforeUnmount(() => l(m)), (r, P) => (openBlock(), createElementBlock("div", {
369
+ ref_key: "paneEl",
370
+ ref: c,
371
+ class: "splitpanes__pane",
372
+ onClick: P[0] || (P[0] = (A) => unref(M)(A, r._.uid)),
373
+ style: normalizeStyle(O.value)
374
+ }, [renderSlot(r.$slots, "default")], 4));
375
+ }
376
+ };
377
+ var DEFAULT = 30;
378
+ var SplitPane_default = /* @__PURE__ */ defineComponent({
379
+ __name: "SplitPane",
380
+ props: {
381
+ storageKey: {},
382
+ stateKey: { default: "pubinfo-devtools-panels-state" },
383
+ leftSize: {},
384
+ minSize: {},
385
+ horizontal: { type: Boolean }
386
+ },
387
+ setup(__props) {
388
+ const props = __props;
389
+ const state = useLocalStorage(props.stateKey, {}, { listenToStorageChanges: false });
390
+ const key = props.storageKey;
391
+ if (key && state.value[key] === void 0) state.value[key] = props.leftSize || DEFAULT;
392
+ const size = key ? computed({
393
+ get: () => state.value[key] ?? DEFAULT,
394
+ set: (v) => {
395
+ state.value[key] = v;
396
+ }
397
+ }) : ref(props.leftSize || DEFAULT);
398
+ return (_ctx, _cache) => {
399
+ return openBlock(), createBlock(unref(Pe), {
400
+ horizontal: __props.horizontal,
401
+ class: "h-full of-hidden",
402
+ onResize: _cache[0] || (_cache[0] = ({ prevPane }) => size.value = prevPane.size)
403
+ }, {
404
+ default: withCtx(() => [createVNode(unref(ge), {
405
+ class: "of-auto! h-full",
406
+ size: unref(size),
407
+ "min-size": _ctx.$slots.right ? __props.minSize || 10 : 100
408
+ }, {
409
+ default: withCtx(() => [renderSlot(_ctx.$slots, "left")]),
410
+ _: 3
411
+ }, 8, ["size", "min-size"]), _ctx.$slots.right ? (openBlock(), createBlock(unref(ge), {
412
+ key: 0,
413
+ class: "of-auto! relative h-full",
414
+ "min-size": __props.minSize || 10
415
+ }, {
416
+ default: withCtx(() => [renderSlot(_ctx.$slots, "right")]),
417
+ _: 3
418
+ }, 8, ["min-size"])) : createCommentVNode("", true)]),
419
+ _: 3
420
+ }, 8, ["horizontal"]);
421
+ };
422
+ }
423
+ });
424
+ var highlighterPromise = null;
425
+ function getShikiHighlighter() {
426
+ if (!highlighterPromise) highlighterPromise = (async () => {
427
+ const [{ createHighlighterCore }, { createOnigurumaEngine }] = await Promise.all([__vitePreload(() => import("./core-Deo0dKjJ.js"), [], import.meta.url), __vitePreload(() => import("./engine-oniguruma-BR9-eBKQ.js"), [], import.meta.url)]);
428
+ return createHighlighterCore({
429
+ themes: [__vitePreload(() => import("./vitesse-dark-Bz6RXfkV.js"), [], import.meta.url), __vitePreload(() => import("./vitesse-light-NvDlvJl2.js"), [], import.meta.url)],
430
+ langs: [
431
+ __vitePreload(() => import("./javascript-DIagQh28.js"), __vite__mapDeps([0,1]), import.meta.url),
432
+ __vitePreload(() => import("./typescript-CzrZyZmM.js"), __vite__mapDeps([2,3]), import.meta.url),
433
+ __vitePreload(() => import("./vue-Co3JBzx2.js"), __vite__mapDeps([4,5,6,1,7,3]), import.meta.url),
434
+ __vitePreload(() => import("./json-WgRhEAOB.js"), __vite__mapDeps([8,7]), import.meta.url),
435
+ __vitePreload(() => import("./html-C5tHi8hG.js"), __vite__mapDeps([9,6,5,1]), import.meta.url),
436
+ __vitePreload(() => import("./css-D-vtiAqw.js"), __vite__mapDeps([10,5]), import.meta.url)
437
+ ],
438
+ engine: createOnigurumaEngine(__vitePreload(() => import("./wasm-D0Echd05.js"), [], import.meta.url))
439
+ });
440
+ })();
441
+ return highlighterPromise;
442
+ }
443
+ async function highlightCode(code, options) {
444
+ const { lang, lightTheme = "vitesse-light", darkTheme = "vitesse-dark", fallbackLang = "typescript" } = options;
445
+ try {
446
+ const highlighter = await getShikiHighlighter();
447
+ const resolvedLang = highlighter.getLoadedLanguages().includes(lang) ? lang : fallbackLang;
448
+ return highlighter.codeToHtml(code, {
449
+ lang: resolvedLang,
450
+ themes: {
451
+ dark: darkTheme,
452
+ light: lightTheme
453
+ }
454
+ });
455
+ } catch (error) {
456
+ console.error("Failed to highlight code:", error);
457
+ return `<pre><code>${code}</code></pre>`;
458
+ }
459
+ }
460
+ var _hoisted_1$8 = ["innerHTML"];
461
+ var _hoisted_2$8 = ["textContent"];
462
+ var CodeBlock_default = /* @__PURE__ */ defineComponent({
463
+ name: "CodeBlock",
464
+ __name: "CodeBlock",
465
+ props: {
466
+ code: {},
467
+ lang: {},
468
+ lines: {
469
+ type: Boolean,
470
+ default: true
471
+ },
472
+ inline: { type: Boolean },
473
+ grammarContextCode: {},
474
+ transformRendered: {}
475
+ },
476
+ emits: ["loaded"],
477
+ setup(__props, { emit: __emit }) {
478
+ const props = __props;
479
+ const emit = __emit;
480
+ const rendered = shallowRef({
481
+ code: "",
482
+ supported: false
483
+ });
484
+ watchEffect(async (onInvalidate) => {
485
+ let cancelled = false;
486
+ onInvalidate(() => {
487
+ cancelled = true;
488
+ });
489
+ if (!props.lang || props.lang === "text") {
490
+ rendered.value = {
491
+ code: props.code,
492
+ supported: false
493
+ };
494
+ return;
495
+ }
496
+ try {
497
+ const highlighter = await getShikiHighlighter();
498
+ const lang = highlighter.getLoadedLanguages().includes(props.lang) ? props.lang : "text";
499
+ if (lang === "text") {
500
+ rendered.value = {
501
+ code: props.code,
502
+ supported: false
503
+ };
504
+ return;
505
+ }
506
+ const html = highlighter.codeToHtml(props.code, {
507
+ lang,
508
+ themes: {
509
+ dark: "vitesse-dark",
510
+ light: "vitesse-light"
511
+ }
512
+ });
513
+ if (cancelled) return;
514
+ rendered.value = {
515
+ code: props.transformRendered ? props.transformRendered(html) : html,
516
+ supported: true
517
+ };
518
+ nextTick(() => emit("loaded"));
519
+ } catch (e) {
520
+ if (!cancelled) rendered.value = {
521
+ code: props.code,
522
+ supported: false
523
+ };
524
+ }
525
+ });
526
+ const classes = computed(() => ["n-code-block shiki", props.lines && !props.inline ? "n-code-block-lines" : ""]);
527
+ return (_ctx, _cache) => {
528
+ return __props.lang && unref(rendered).supported ? (openBlock(), createElementBlock("pre", {
529
+ key: 0,
530
+ class: normalizeClass(unref(classes))
531
+ }, [createBaseVNode("code", { innerHTML: unref(rendered).code }, null, 8, _hoisted_1$8)], 2)) : (openBlock(), createElementBlock("pre", {
532
+ key: 1,
533
+ class: normalizeClass(unref(classes))
534
+ }, [createBaseVNode("code", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.code.split("\n"), (line, _idx) => {
535
+ return openBlock(), createElementBlock(Fragment, { key: _idx }, [createBaseVNode("span", {
536
+ class: "line",
537
+ textContent: toDisplayString(line)
538
+ }, null, 8, _hoisted_2$8), _cache[0] || (_cache[0] = createBaseVNode("br", null, null, -1))], 64);
539
+ }), 128))])], 2));
540
+ };
541
+ }
542
+ });
543
+ const devtoolsStorageKey = { response: "__pubinfo_devtools_raw_response__" };
544
+ var _hoisted_1$7 = { class: "n-loading n-panel-grids-center" };
545
+ var _hoisted_2$7 = { class: "flex flex-col animate-pulse items-center text-lg" };
546
+ var Loading_default = /* @__PURE__ */ defineComponent({
547
+ name: "Loading",
548
+ __name: "Loading",
549
+ setup(__props) {
550
+ return (_ctx, _cache) => {
551
+ 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))])])]);
552
+ };
553
+ }
554
+ });
555
+ const ServerRouteTabIcons = {
556
+ snippet: "i-ph-file-code",
557
+ headers: "i-ph-file-html",
558
+ cookies: "i-ph-cookie",
559
+ params: "i-ph-cursor-text",
560
+ query: "i-ph-question",
561
+ body: "i-ph-file-text"
562
+ };
563
+ function createDefaultState() {
564
+ return {
565
+ query: [],
566
+ body: [],
567
+ headers: []
568
+ };
569
+ }
570
+ function toRecord(list) {
571
+ if (!list || !list.length) return;
572
+ const formatted = Object.fromEntries(list.filter(({ active, key, value }) => active && key && value !== void 0).map(({ key, value }) => [key, value]));
573
+ return Object.keys(formatted).length ? formatted : void 0;
574
+ }
575
+ const useInputDefaults = createSharedComposable(() => {
576
+ const inputDefaults = useLocalStorage("pubinfo-devtools:input-defaults", createDefaultState(), { deep: true });
577
+ function getDefaults(tab) {
578
+ return inputDefaults.value[tab];
579
+ }
580
+ function setDefaults(tab, value) {
581
+ inputDefaults.value[tab] = value;
582
+ }
583
+ function resetToEmpty() {
584
+ inputDefaults.value = createDefaultState();
585
+ }
586
+ function mergeParsedWithDefaults(parsed, tab) {
587
+ const defaults = toRecord(inputDefaults.value[tab]);
588
+ if (!defaults && !parsed) return;
589
+ return {
590
+ ...defaults || {},
591
+ ...parsed || {}
592
+ };
593
+ }
594
+ return {
595
+ inputDefaults,
596
+ getDefaults,
597
+ setDefaults,
598
+ mergeParsedWithDefaults,
599
+ resetToEmpty
600
+ };
601
+ });
602
+ function createDefaultParamInputs() {
603
+ return {
604
+ query: [{
605
+ active: true,
606
+ key: "",
607
+ value: "",
608
+ type: "string"
609
+ }],
610
+ body: [{
611
+ active: true,
612
+ key: "",
613
+ value: "",
614
+ type: "string"
615
+ }],
616
+ headers: [{
617
+ active: true,
618
+ key: "Content-Type",
619
+ value: "application/json",
620
+ type: "string"
621
+ }]
622
+ };
623
+ }
624
+ function getInputTypeFromSchema(schemaType) {
625
+ switch (schemaType) {
626
+ case "integer":
627
+ case "number": return "number";
628
+ case "boolean": return "boolean";
629
+ case "string":
630
+ default: return "string";
631
+ }
632
+ }
633
+ function parseInputs(inputs = []) {
634
+ const formatted = Object.fromEntries(inputs.filter(({ active, key, value }) => active && key && value !== void 0).map(({ key, value }) => [key, value]));
635
+ return Object.entries(formatted).length ? formatted : void 0;
636
+ }
637
+ function useServerRouteParams(route, options = {}) {
638
+ const paramInputs = ref(createDefaultParamInputs());
639
+ const activeTab = ref();
640
+ const { mergeParsedWithDefaults } = useInputDefaults();
641
+ const currentTabInputs = computed({
642
+ get: () => {
643
+ const tab = activeTab.value;
644
+ if (!tab || !(tab in paramInputs.value)) return [];
645
+ return paramInputs.value[tab] || [];
646
+ },
647
+ set: (value) => {
648
+ const tab = activeTab.value;
649
+ if (tab && tab in paramInputs.value) paramInputs.value[tab] = value;
650
+ }
651
+ });
652
+ const parsedQuery = computed(() => mergeParsedWithDefaults(parseInputs(paramInputs.value.query), "query"));
653
+ const parsedHeader = computed(() => mergeParsedWithDefaults(parseInputs(paramInputs.value.headers), "headers"));
654
+ const parsedBody = computed(() => {
655
+ if (options.hasBody && !options.hasBody.value) return;
656
+ return mergeParsedWithDefaults(parseInputs(paramInputs.value.body), "body");
657
+ });
658
+ const finalPath = computed(() => {
659
+ const routePath = route.value.route;
660
+ const query = parsedQuery.value;
661
+ if (!query) return routePath;
662
+ const search = new URLSearchParams(query).toString();
663
+ return search ? `${routePath}?${search}` : routePath;
664
+ });
665
+ function ensureActiveTab() {
666
+ if (!activeTab.value) activeTab.value = route.value.paramLocation === "body" ? "body" : "query";
667
+ }
668
+ function initializeParamsFromSchema() {
669
+ ensureActiveTab();
670
+ const properties = route.value.paramSchema?.properties;
671
+ if (properties) {
672
+ const targetCategory$1 = (route.value.paramLocation || "query") === "body" ? "body" : "query";
673
+ const existingInputsMap = new Map(paramInputs.value[targetCategory$1].map((input) => [input.key, input]));
674
+ const newInputs = [];
675
+ Object.keys(properties).forEach((key) => {
676
+ const prop = properties[key];
677
+ const existing = existingInputsMap.get(key);
678
+ if (existing) newInputs.push({
679
+ ...existing,
680
+ type: getInputTypeFromSchema(prop.type),
681
+ fromSchema: true
682
+ });
683
+ else newInputs.push({
684
+ active: true,
685
+ key,
686
+ value: "",
687
+ type: getInputTypeFromSchema(prop.type),
688
+ fromSchema: true
689
+ });
690
+ });
691
+ const userInputs = paramInputs.value[targetCategory$1].filter((input) => !input.fromSchema);
692
+ paramInputs.value[targetCategory$1] = [...newInputs, ...userInputs];
693
+ return;
694
+ }
695
+ const targetCategory = (route.value.paramLocation || "query") === "body" ? "body" : "query";
696
+ if (paramInputs.value[targetCategory].length === 0) paramInputs.value[targetCategory] = [{
697
+ active: true,
698
+ key: "",
699
+ value: "",
700
+ type: "string"
701
+ }];
702
+ }
703
+ function resetParamInputs() {
704
+ paramInputs.value = createDefaultParamInputs();
705
+ }
706
+ function syncParamsForRoute() {
707
+ resetParamInputs();
708
+ activeTab.value = route.value.paramLocation === "body" ? "body" : "query";
709
+ initializeParamsFromSchema();
710
+ }
711
+ watch(route, () => {
712
+ syncParamsForRoute();
713
+ }, { immediate: true });
714
+ return {
715
+ paramInputs,
716
+ activeTab,
717
+ currentTabInputs,
718
+ parsedQuery,
719
+ parsedHeader,
720
+ parsedBody,
721
+ finalPath,
722
+ initializeParamsFromSchema,
723
+ resetParamInputs
724
+ };
725
+ }
726
+ var methodNameMap = {
727
+ GET: "Get",
728
+ POST: "Post",
729
+ PUT: "Put",
730
+ PATCH: "Patch",
731
+ DELETE: "Delete",
732
+ HEAD: "Head"
733
+ };
734
+ function normalizeResolvedModulePath(path) {
735
+ if (!path) return;
736
+ if (path.startsWith("/")) return path;
737
+ return `/${path}`;
738
+ }
739
+ var MESSAGE_REQUEST_TYPE = "pubinfo-pr:devtools-request";
740
+ var MESSAGE_RESPONSE_TYPE = "pubinfo-pr:devtools-response";
741
+ var pendingHostRequests = /* @__PURE__ */ new Map();
742
+ var messageBridgeInitialised = false;
743
+ function buildModuleSpecifierCandidates(route) {
744
+ const candidates = [];
745
+ const resolvedPath = normalizeResolvedModulePath(route.requestModuleResolvedPath);
746
+ if (resolvedPath) candidates.push(resolvedPath);
747
+ if (route.requestModulePath) candidates.push(route.requestModulePath);
748
+ return candidates.filter(Boolean).filter((value, index, self) => self.indexOf(value) === index);
749
+ }
750
+ function handleHostResponse(event) {
751
+ const data = event.data;
752
+ if (!data || data.type !== MESSAGE_RESPONSE_TYPE || !data.id) return;
753
+ const pending = pendingHostRequests.get(data.id);
754
+ if (!pending) return;
755
+ pendingHostRequests.delete(data.id);
756
+ window.clearTimeout(pending.timer);
757
+ pending.resolve({
758
+ success: Boolean(data.success),
759
+ result: data.result,
760
+ error: data.error
761
+ });
762
+ }
763
+ function ensureMessageBridge() {
764
+ if (typeof window === "undefined" || messageBridgeInitialised) return;
765
+ window.addEventListener("message", handleHostResponse);
766
+ messageBridgeInitialised = true;
767
+ }
768
+ function resolveHostTargets() {
769
+ if (typeof window === "undefined") return [];
770
+ const targets = /* @__PURE__ */ new Set();
771
+ const { parent, opener, top } = window;
772
+ if (parent && parent !== window) targets.add(parent);
773
+ if (opener && opener !== window) targets.add(opener);
774
+ if (top && top !== window) targets.add(top);
775
+ return Array.from(targets);
776
+ }
777
+ async function sendRequestThroughHost(payload) {
778
+ if (typeof window === "undefined") throw new TypeError("Devtools 仅在浏览器环境可用,请在浏览器中使用调试面板。");
779
+ ensureMessageBridge();
780
+ const targets = resolveHostTargets();
781
+ if (!targets.length) throw new TypeError("未找到可通信的宿主应用窗口,请确认 Devtools 以 iframe 方式嵌入到应用中。");
782
+ const id = `pubinfo-request-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
783
+ return new Promise((resolve, reject) => {
784
+ const timer = window.setTimeout(() => {
785
+ pendingHostRequests.delete(id);
786
+ reject(/* @__PURE__ */ new TypeError("等待应用响应超时,请确认应用仍在运行。"));
787
+ }, 15e3);
788
+ pendingHostRequests.set(id, {
789
+ resolve: (message) => {
790
+ window.clearTimeout(timer);
791
+ resolve(message);
792
+ },
793
+ reject: (error) => {
794
+ window.clearTimeout(timer);
795
+ pendingHostRequests.delete(id);
796
+ reject(error);
797
+ },
798
+ timer
799
+ });
800
+ try {
801
+ const message = {
802
+ type: MESSAGE_REQUEST_TYPE,
803
+ id,
804
+ payload
805
+ };
806
+ const origin = window.location?.origin ?? "*";
807
+ targets.forEach((target) => {
808
+ try {
809
+ target.postMessage(message, origin);
810
+ } catch {
811
+ target.postMessage(message, "*");
812
+ }
813
+ });
814
+ } catch (error) {
815
+ window.clearTimeout(timer);
816
+ pendingHostRequests.delete(id);
817
+ reject(error instanceof Error ? error : new Error(String(error)));
818
+ }
819
+ });
820
+ }
821
+ function toPlainObject(payload) {
822
+ if (payload === void 0 || payload === null) return payload;
823
+ try {
824
+ return JSON.parse(JSON.stringify(payload));
825
+ } catch {
826
+ return payload;
827
+ }
828
+ }
829
+ function isHttpLike(payload) {
830
+ return payload && typeof payload === "object" && ("status" in payload || "headers" in payload);
831
+ }
832
+ function useServerRouteRequest({ route, routeMethod, parsedQuery, parsedBody, parsedHeader, cookie, storageKey = devtoolsStorageKey.response }) {
833
+ const fetching = ref(false);
834
+ const hasSentRequest = ref(false);
835
+ const storedResponse = storageKey ? useLocalStorage(storageKey, {}) : ref({});
836
+ const storedSnapshot = computed(() => {
837
+ const candidate = storedResponse.value;
838
+ if (candidate && typeof candidate === "object" && Object.keys(candidate).length > 0) return candidate;
839
+ });
840
+ const response = ref(storedSnapshot.value ? toPlainObject(storedSnapshot.value) : void 0);
841
+ const lastSentAt = ref(null);
842
+ function resetRequestState(clearPersisted = true) {
843
+ fetching.value = false;
844
+ hasSentRequest.value = false;
845
+ response.value = void 0;
846
+ lastSentAt.value = null;
847
+ if (storageKey && clearPersisted) storedResponse.value = {};
848
+ }
849
+ let initialized = false;
850
+ watch(route, () => {
851
+ if (!initialized) {
852
+ initialized = true;
853
+ return;
854
+ }
855
+ resetRequestState();
856
+ }, { immediate: true });
857
+ watch(response, (value) => {
858
+ if (!storageKey) return;
859
+ if (isHttpLike(value)) {
860
+ storedResponse.value = toPlainObject(value);
861
+ return;
862
+ }
863
+ if (!storedSnapshot.value && value !== void 0) storedResponse.value = toPlainObject(value);
864
+ });
865
+ function buildRequestConfig() {
866
+ const headers = parsedHeader.value ? { ...parsedHeader.value } : {};
867
+ headers.__devtools__ = headers.__devtools__ ?? "true";
868
+ const cookieState = cookie.value;
869
+ if (cookieState.key && cookieState.value) {
870
+ const cookieString = `${cookieState.key}=${cookieState.value}`;
871
+ headers.Cookie = headers.Cookie ? `${headers.Cookie}; ${cookieString}` : cookieString;
872
+ }
873
+ const query = parsedQuery.value ? { ...parsedQuery.value } : void 0;
874
+ const config = {
875
+ headers,
876
+ meta: { __devtools__: true }
877
+ };
878
+ if (query && Object.keys(query).length > 0) config.params = query;
879
+ return config;
880
+ }
881
+ async function sendRequestViaApp() {
882
+ const method = routeMethod.value.toUpperCase();
883
+ if (!methodNameMap[method]) throw new Error(`不支持的请求方法:${method}`);
884
+ const config = buildRequestConfig();
885
+ const payload = parsedBody.value ? { ...parsedBody.value } : void 0;
886
+ const args = [route.value.route];
887
+ if ([
888
+ "POST",
889
+ "PUT",
890
+ "PATCH",
891
+ "DELETE"
892
+ ].includes(method)) {
893
+ args.push(payload);
894
+ args.push(config);
895
+ } else args.push(config);
896
+ const moduleCandidates = buildModuleSpecifierCandidates(route.value);
897
+ if (!moduleCandidates.length) throw new Error("未能解析请求模块路径,请确认 API 扫描结果包含 requestModulePath。");
898
+ const hostResponse = await sendRequestThroughHost({
899
+ moduleCandidates,
900
+ exportName: route.value.requestClient,
901
+ method,
902
+ args
903
+ });
904
+ if (!hostResponse.success) {
905
+ const error = new Error(hostResponse.error?.message ?? "应用执行请求失败");
906
+ if (hostResponse.error?.stack) error.stack = hostResponse.error.stack;
907
+ throw error;
908
+ }
909
+ return hostResponse.result;
910
+ }
911
+ async function sendRequest() {
912
+ const startTime = Date.now();
913
+ if (fetching.value) return;
914
+ hasSentRequest.value = true;
915
+ fetching.value = true;
916
+ response.value = void 0;
917
+ try {
918
+ response.value = toPlainObject(await sendRequestViaApp());
919
+ lastSentAt.value = Date.now();
920
+ } catch (error) {
921
+ const axiosResponse = error && typeof error === "object" && "response" in error ? error.response : void 0;
922
+ if (axiosResponse) {
923
+ response.value = toPlainObject(axiosResponse);
924
+ lastSentAt.value = Date.now();
925
+ } else if (error && typeof error === "object" && !(error instanceof Error)) {
926
+ response.value = toPlainObject(error);
927
+ lastSentAt.value = Date.now();
928
+ } else {
929
+ response.value = toPlainObject({
930
+ error: true,
931
+ message: error instanceof Error ? error.message : String(error)
932
+ });
933
+ lastSentAt.value = Date.now();
934
+ }
935
+ } finally {
936
+ fetching.value = false;
937
+ const duration = Date.now() - startTime;
938
+ if (response.value && typeof response.value === "object") response.value = {
939
+ ...response.value,
940
+ duration
941
+ };
942
+ else if (response.value !== void 0) response.value = {
943
+ data: response.value,
944
+ duration
945
+ };
946
+ else response.value = { duration };
947
+ }
948
+ }
949
+ const httpResponse = computed(() => {
950
+ if (isHttpLike(response.value)) return response.value;
951
+ const snapshot = storedSnapshot.value;
952
+ return snapshot && isHttpLike(snapshot) ? snapshot : void 0;
953
+ });
954
+ const businessPayload = computed(() => {
955
+ if (httpResponse.value && "data" in httpResponse.value) return httpResponse.value.data;
956
+ if (isHttpLike(response.value) && "data" in response.value) return response.value.data;
957
+ if (response.value !== void 0) {
958
+ if (response.value && typeof response.value === "object" && "data" in response.value) return response.value.data;
959
+ return response.value;
960
+ }
961
+ const snapshot = storedSnapshot.value;
962
+ if (snapshot && typeof snapshot === "object" && "data" in snapshot) return snapshot.data;
963
+ return snapshot;
964
+ });
965
+ const responseStatus = computed(() => httpResponse.value?.status);
966
+ const responseSuccess = computed(() => {
967
+ const data = businessPayload.value;
968
+ if (data && typeof data.success === "boolean") return data.success;
969
+ const status = responseStatus.value;
970
+ return typeof status === "number" ? status < 400 : void 0;
971
+ });
972
+ const responseMessage = computed(() => {
973
+ const payload = businessPayload.value;
974
+ if (payload && typeof payload === "object") {
975
+ const target = payload;
976
+ 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 ?? "";
977
+ }
978
+ if (typeof payload === "string") return payload;
979
+ return httpResponse.value?.statusText ?? "";
980
+ });
981
+ const responsePreview = computed(() => {
982
+ const target = httpResponse.value ?? response.value ?? storedSnapshot.value;
983
+ if (!target) return "";
984
+ return JSON.stringify(target, null, 2);
985
+ });
986
+ const responseLang = computed(() => {
987
+ const contentType = (httpResponse.value?.headers ?? storedSnapshot.value?.headers ?? response.value?.headers ?? {})?.["content-type"] || "";
988
+ if (contentType.includes("application/json")) return "json";
989
+ if (contentType.includes("text/html")) return "html";
990
+ if (contentType.includes("text/css")) return "css";
991
+ if (contentType.includes("text/javascript")) return "javascript";
992
+ if (contentType.includes("image") || contentType.includes("video")) return "media";
993
+ if (contentType.includes("text/xml") || contentType.includes("application/xml")) return "xml";
994
+ if (contentType.includes("application/pdf")) return "pdf";
995
+ try {
996
+ const raw = httpResponse.value ?? response.value ?? storedSnapshot.value;
997
+ const payload = raw && typeof raw === "object" && "data" in raw && ("status" in raw || "headers" in raw) ? raw.data : raw;
998
+ if (payload && typeof payload === "object") return "json";
999
+ } catch {}
1000
+ return "text";
1001
+ });
1002
+ return {
1003
+ fetching,
1004
+ hasSentRequest,
1005
+ response,
1006
+ lastSentAt,
1007
+ sendRequest,
1008
+ responseStatus,
1009
+ responseSuccess,
1010
+ responseMessage,
1011
+ responsePreview,
1012
+ responseLang,
1013
+ responseContent: computed(() => {
1014
+ if (!response.value && !httpResponse.value && !storedSnapshot.value) return "";
1015
+ const data = businessPayload.value;
1016
+ if (responseLang.value === "json") try {
1017
+ return JSON.stringify(data ?? "", null, 2);
1018
+ } catch {
1019
+ return String(data);
1020
+ }
1021
+ if ((responseLang.value === "media" || responseLang.value === "pdf") && typeof Blob !== "undefined") try {
1022
+ const headersSource = httpResponse.value?.headers ?? storedSnapshot.value?.headers ?? response.value?.headers ?? {};
1023
+ const blob = data instanceof Blob ? data : new Blob([data], { type: headersSource?.["content-type"] });
1024
+ return URL.createObjectURL(blob);
1025
+ } catch {
1026
+ return "";
1027
+ }
1028
+ try {
1029
+ if (data == null) return "";
1030
+ if (typeof data === "string") return data;
1031
+ if (typeof ArrayBuffer !== "undefined" && data instanceof ArrayBuffer) try {
1032
+ return new TextDecoder().decode(new Uint8Array(data));
1033
+ } catch {}
1034
+ if (typeof Uint8Array !== "undefined" && data instanceof Uint8Array) try {
1035
+ return new TextDecoder().decode(data);
1036
+ } catch {}
1037
+ return JSON.stringify(data, null, 2);
1038
+ } catch {
1039
+ return String(data);
1040
+ }
1041
+ }),
1042
+ resetRequestState,
1043
+ storedResponse
1044
+ };
1045
+ }
1046
+ function useServerRouteSnippets({ route, routeMethod, parsedQuery, parsedBody, parsedHeader }) {
1047
+ return computed(() => {
1048
+ const snippets = [];
1049
+ const routeInfo = route.value;
1050
+ if (routeInfo.name && routeInfo.filepath) {
1051
+ const args = [];
1052
+ const method = routeMethod.value.toUpperCase();
1053
+ const query = parsedQuery.value;
1054
+ const body = parsedBody.value;
1055
+ const headers = parsedHeader.value;
1056
+ const hasQuery = query && Object.keys(query).length > 0;
1057
+ const hasBody = body && Object.keys(body).length > 0;
1058
+ const hasCustomHeaders = headers && Object.entries(headers).some(([key, value]) => !(key === "Content-Type" && value === "application/json"));
1059
+ if (method === "GET" && hasQuery) args.push(JSON.stringify(query, null, 2));
1060
+ if ([
1061
+ "POST",
1062
+ "PUT",
1063
+ "PATCH",
1064
+ "DELETE"
1065
+ ].includes(method)) {
1066
+ if (hasQuery && !hasBody) args.push(JSON.stringify(query, null, 2));
1067
+ else if (hasBody) args.push(JSON.stringify(body, null, 2));
1068
+ }
1069
+ if (hasCustomHeaders && headers) {
1070
+ const customHeaders = Object.fromEntries(Object.entries(headers).filter(([key, value]) => !(key === "Content-Type" && value === "application/json")));
1071
+ const headersStr = JSON.stringify({ headers: customHeaders }, null, 2).split("\n").map((line, i) => i === 0 ? line : ` ${line}`).join("\n");
1072
+ args.push(headersStr);
1073
+ }
1074
+ const argsStr = args.length > 0 ? `\n ${args.join(",\n ").split("\n").join("\n ")},\n` : "";
1075
+ snippets.push({
1076
+ name: routeInfo.name,
1077
+ lang: "typescript",
1078
+ code: `import { ${routeInfo.name} } from '${routeInfo.filepath}';
1079
+
1080
+ const { data } = await ${routeInfo.name}(${argsStr});`,
1081
+ filepath: routeInfo.filepath
1082
+ });
1083
+ }
1084
+ return snippets;
1085
+ });
1086
+ }
1087
+ var requestMethodClass = {
1088
+ get: "n-green",
1089
+ post: "n-blue",
1090
+ put: "n-orange",
1091
+ delete: "n-red",
1092
+ patch: "n-purple",
1093
+ head: "n-teal",
1094
+ default: "n-gray"
1095
+ };
1096
+ function getRequestMethodClass(method) {
1097
+ return requestMethodClass[method.toLowerCase()] || requestMethodClass.default;
1098
+ }
1099
+ var _hoisted_1$6 = { class: "flex flex-col" };
1100
+ var _hoisted_2$6 = { class: "flex-1 overflow-auto relative" };
1101
+ var _hoisted_3$4 = { class: "absolute top-0 right-0 z-10" };
1102
+ var _hoisted_4$2 = ["innerHTML"];
1103
+ var CodeSnippets_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
1104
+ __name: "CodeSnippets",
1105
+ props: { codeSnippets: {} },
1106
+ setup(__props) {
1107
+ const props = __props;
1108
+ const activeSnippet = ref(0);
1109
+ const highlightedCode = ref("");
1110
+ const copying = ref(false);
1111
+ const currentSnippet = computed(() => props.codeSnippets[activeSnippet.value]);
1112
+ const processedCode = computed(() => {
1113
+ if (!currentSnippet.value) return "";
1114
+ let code = currentSnippet.value.code;
1115
+ if (currentSnippet.value.filepath) {
1116
+ let importPath = currentSnippet.value.filepath;
1117
+ importPath = importPath.replace(/\.ts$/, "");
1118
+ if (importPath.includes("/src/")) importPath = importPath.replace(/.*\/src\//, "@/");
1119
+ else if (importPath.startsWith("src/")) importPath = importPath.replace(/^src\//, "@/");
1120
+ code = code.replaceAll(currentSnippet.value.filepath, importPath);
1121
+ }
1122
+ return code;
1123
+ });
1124
+ async function highlightCode$1() {
1125
+ if (!currentSnippet.value) return;
1126
+ highlightedCode.value = await highlightCode(processedCode.value, {
1127
+ lang: currentSnippet.value.lang,
1128
+ darkTheme: "vitesse-dark",
1129
+ lightTheme: "vitesse-light",
1130
+ fallbackLang: "typescript"
1131
+ });
1132
+ }
1133
+ async function copyCode() {
1134
+ if (!currentSnippet.value) return;
1135
+ try {
1136
+ await navigator.clipboard.writeText(processedCode.value);
1137
+ copying.value = true;
1138
+ setTimeout(() => {
1139
+ copying.value = false;
1140
+ }, 2e3);
1141
+ } catch (error) {
1142
+ console.error("Failed to copy code:", error);
1143
+ }
1144
+ }
1145
+ watch([currentSnippet], highlightCode$1, { immediate: true });
1146
+ return (_ctx, _cache) => {
1147
+ const _directive_tooltip = resolveDirective("tooltip");
1148
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [createBaseVNode("div", _hoisted_2$6, [createBaseVNode("div", _hoisted_3$4, [withDirectives((openBlock(), createBlock(unref(Button_default), {
1149
+ class: normalizeClass([copying.value ? "n-green" : "n-primary", "px-3 py-1.5"]),
1150
+ onClick: copyCode
1151
+ }, {
1152
+ default: withCtx(() => [createVNode(Icon_default, { icon: copying.value ? "i-ph-check" : "i-ph-copy" }, null, 8, ["icon"])]),
1153
+ _: 1
1154
+ }, 8, ["class"])), [[_directive_tooltip, copying.value ? "已复制!" : "复制代码"]])]), createBaseVNode("div", {
1155
+ class: "code-container",
1156
+ innerHTML: highlightedCode.value
1157
+ }, null, 8, _hoisted_4$2)])]);
1158
+ };
1159
+ }
1160
+ }), [["__scopeId", "data-v-1703382f"]]);
1161
+ var _hoisted_1$5 = ["checked", "disabled"];
1162
+ var _hoisted_2$5 = ["disabled"];
1163
+ 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" };
1164
+ var Checkbox_default = /* @__PURE__ */ defineComponent({
1165
+ __name: "Checkbox",
1166
+ props: {
1167
+ modelValue: {
1168
+ type: [Boolean, null],
1169
+ default: false
1170
+ },
1171
+ disabled: {
1172
+ type: Boolean,
1173
+ default: false
1174
+ }
1175
+ },
1176
+ setup(__props, { emit: __emit }) {
1177
+ const checked = useVModel(__props, "modelValue", __emit, { passive: true });
1178
+ return (_ctx, _cache) => {
1179
+ return openBlock(), createElementBlock("label", {
1180
+ class: "n-checkbox select-none items-center hover:n-checkbox-hover n-disabled:n-disabled",
1181
+ checked: unref(checked) || null,
1182
+ disabled: __props.disabled || null
1183
+ }, [
1184
+ withDirectives(createBaseVNode("input", {
1185
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(checked) ? checked.value = $event : null),
1186
+ type: "checkbox",
1187
+ class: "peer absolute op0",
1188
+ disabled: __props.disabled,
1189
+ onKeypress: _cache[1] || (_cache[1] = withKeys(($event) => checked.value = !unref(checked), ["enter"]))
1190
+ }, null, 40, _hoisted_2$5), [[vModelCheckbox, unref(checked)]]),
1191
+ 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" })]),
1192
+ createBaseVNode("span", { class: normalizeClass([unref(checked) ? "" : "op50", "n-transition"]) }, [renderSlot(_ctx.$slots, "default")], 2)
1193
+ ], 8, _hoisted_1$5);
1194
+ };
1195
+ }
1196
+ });
1197
+ var _hoisted_1$4 = ["disabled"];
1198
+ var _hoisted_2$4 = {
1199
+ key: 0,
1200
+ value: "",
1201
+ disabled: "",
1202
+ hidden: ""
1203
+ };
1204
+ var Select_default = /* @__PURE__ */ defineComponent({
1205
+ __name: "Select",
1206
+ props: {
1207
+ modelValue: { default: void 0 },
1208
+ placeholder: { default: "" },
1209
+ icon: { default: "" },
1210
+ disabled: {
1211
+ type: Boolean,
1212
+ default: false
1213
+ }
1214
+ },
1215
+ setup(__props, { emit: __emit }) {
1216
+ const input = useVModel(__props, "modelValue", __emit, { passive: true });
1217
+ return (_ctx, _cache) => {
1218
+ const _component_NIcon = resolveComponent("NIcon");
1219
+ 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, {
1220
+ key: 0,
1221
+ icon: __props.icon,
1222
+ class: "mr-0.4em text-1.1em op50"
1223
+ }, null, 8, ["icon"])) : createCommentVNode("", true)]), withDirectives(createBaseVNode("select", {
1224
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(input) ? input.value = $event : null),
1225
+ disabled: __props.disabled,
1226
+ class: normalizeClass(["w-full flex-auto n-bg-base !outline-none", __props.disabled ? "appearance-none" : "cursor-pointer"])
1227
+ }, [__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);
1228
+ };
1229
+ }
1230
+ });
1231
+ var _hoisted_1$3 = { class: "flex flex-col gap-4 p-4" };
1232
+ var _hoisted_2$3 = {
1233
+ key: 1,
1234
+ class: "ml-2 flex"
1235
+ };
1236
+ var _hoisted_3$2 = ["value"];
1237
+ var _hoisted_4$1 = {
1238
+ key: 1,
1239
+ class: "w-10 flex items-center justify-center op-30",
1240
+ title: "接口定义的参数不可删除"
1241
+ };
1242
+ var _hoisted_5$1 = {
1243
+ key: 0,
1244
+ flex: "",
1245
+ "gap-4": ""
1246
+ };
1247
+ var ServerRouteInput_default = /* @__PURE__ */ defineComponent({
1248
+ __name: "ServerRouteInput",
1249
+ props: {
1250
+ modelValue: {},
1251
+ keys: { default: () => [] },
1252
+ default: { default: () => ({}) },
1253
+ disabled: {
1254
+ type: Boolean,
1255
+ default: false
1256
+ }
1257
+ },
1258
+ setup(__props, { emit: __emit }) {
1259
+ const props = __props;
1260
+ const params = useVModel(props, "modelValue", __emit, { passive: true });
1261
+ const filteredKeys = computed(() => {
1262
+ return [
1263
+ ...props.keys,
1264
+ "active",
1265
+ "key",
1266
+ "value",
1267
+ "type"
1268
+ ];
1269
+ });
1270
+ const keysObject = computed(() => {
1271
+ const obj = {};
1272
+ for (const key of filteredKeys.value) obj[key] = props.default[key] || "";
1273
+ return obj;
1274
+ });
1275
+ const inputTypes = [
1276
+ "string",
1277
+ "number",
1278
+ "boolean",
1279
+ "file",
1280
+ "date",
1281
+ "time",
1282
+ "datetime-local"
1283
+ ];
1284
+ function onFileInputChange(index, event) {
1285
+ const target = event.target;
1286
+ if (target.files && target.files[0]) {
1287
+ const file = target.files[0];
1288
+ const reader = new FileReader();
1289
+ reader.readAsDataURL(file);
1290
+ reader.onload = () => {
1291
+ params.value[index].value = reader.result;
1292
+ };
1293
+ }
1294
+ }
1295
+ function clearUserAdded() {
1296
+ const list = params.value;
1297
+ for (let i = list.length - 1; i >= 0; i--) if (!list[i]?.fromSchema) list.splice(i, 1);
1298
+ }
1299
+ const hasDeletable = computed(() => params.value?.some((i) => !i?.fromSchema));
1300
+ watch(() => params, (items) => {
1301
+ items.value.forEach((item) => {
1302
+ if (item.value === void 0 || item.value === null) return;
1303
+ if (item.type === "number") {
1304
+ if (typeof item.value !== "number") {
1305
+ const parsed = Number.parseFloat(item.value);
1306
+ item.value = Number.isNaN(parsed) ? void 0 : parsed;
1307
+ }
1308
+ } else if (item.type === "boolean") {
1309
+ if (typeof item.value !== "boolean") item.value = void 0;
1310
+ } else if (item.type === "file") {
1311
+ if (typeof item.value !== "string") item.value = void 0;
1312
+ } else if (item.type === "date") {
1313
+ if (typeof item.value === "string" && !item.value.match(/^\d{4}-\d{2}-\d{2}$/)) item.value = void 0;
1314
+ } else if (item.type === "time") {
1315
+ if (typeof item.value === "string" && !item.value.match(/^\d{2}:\d{2}$/)) item.value = void 0;
1316
+ } else if (item.type === "datetime-local") {
1317
+ if (typeof item.value === "string" && !item.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)) item.value = void 0;
1318
+ } else if (item.type === "string") item.value = String(item.value);
1319
+ });
1320
+ }, {
1321
+ deep: true,
1322
+ immediate: true,
1323
+ flush: "sync"
1324
+ });
1325
+ return (_ctx, _cache) => {
1326
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
1327
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(params), (item, index) => {
1328
+ return openBlock(), createElementBlock("div", {
1329
+ key: index,
1330
+ class: "flex gap-2 justify-around"
1331
+ }, [
1332
+ renderSlot(_ctx.$slots, "input", { item }),
1333
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filteredKeys.value, (key) => {
1334
+ return openBlock(), createElementBlock(Fragment, { key }, [item.type !== null && key === "active" ? (openBlock(), createBlock(Checkbox_default, {
1335
+ key: 0,
1336
+ modelValue: item[key],
1337
+ "onUpdate:modelValue": ($event) => item[key] = $event,
1338
+ class: "n-sm n-primary",
1339
+ disabled: __props.disabled
1340
+ }, null, 8, [
1341
+ "modelValue",
1342
+ "onUpdate:modelValue",
1343
+ "disabled"
1344
+ ])) : createCommentVNode("", true), item.type !== null && key === "key" ? (openBlock(), createBlock(TextInput_default, {
1345
+ key: 1,
1346
+ modelValue: item[key],
1347
+ "onUpdate:modelValue": ($event) => item[key] = $event,
1348
+ placeholder: key,
1349
+ class: normalizeClass(["flex-1 font-mono n-sm n-primary", __props.disabled || item.fromSchema ? "op50" : ""]),
1350
+ disabled: __props.disabled || item.fromSchema
1351
+ }, null, 8, [
1352
+ "modelValue",
1353
+ "onUpdate:modelValue",
1354
+ "placeholder",
1355
+ "disabled",
1356
+ "class"
1357
+ ])) : key === "value" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [item.type === "file" ? (openBlock(), createBlock(TextInput_default, {
1358
+ key: item.value === void 0 ? `file-empty-${index}` : `file-has-${index}`,
1359
+ type: "file",
1360
+ disabled: __props.disabled,
1361
+ class: normalizeClass(__props.disabled ? "op75" : ""),
1362
+ onChange: ($event) => onFileInputChange(index, $event)
1363
+ }, null, 8, [
1364
+ "disabled",
1365
+ "class",
1366
+ "onChange"
1367
+ ])) : item.type === "boolean" ? (openBlock(), createElementBlock("div", _hoisted_2$3, [createVNode(Checkbox_default, {
1368
+ modelValue: item.value,
1369
+ "onUpdate:modelValue": ($event) => item.value = $event,
1370
+ placeholder: "Value",
1371
+ class: "n-green n-lg",
1372
+ disabled: __props.disabled
1373
+ }, null, 8, [
1374
+ "modelValue",
1375
+ "onUpdate:modelValue",
1376
+ "disabled"
1377
+ ])])) : (openBlock(), createBlock(TextInput_default, {
1378
+ key: 2,
1379
+ modelValue: item.value,
1380
+ "onUpdate:modelValue": ($event) => item.value = $event,
1381
+ type: item.type,
1382
+ placeholder: "Value",
1383
+ class: normalizeClass(["flex-1 font-mono n-sm n-primary", __props.disabled ? "op75" : ""]),
1384
+ disabled: __props.disabled
1385
+ }, null, 8, [
1386
+ "modelValue",
1387
+ "onUpdate:modelValue",
1388
+ "type",
1389
+ "disabled",
1390
+ "class"
1391
+ ]))], 64)) : key === "type" ? (openBlock(), createBlock(Select_default, {
1392
+ key: 3,
1393
+ modelValue: item.type,
1394
+ "onUpdate:modelValue": ($event) => item.type = $event,
1395
+ n: "sm green",
1396
+ class: normalizeClass(__props.disabled ? "op75" : ""),
1397
+ disabled: __props.disabled
1398
+ }, {
1399
+ default: withCtx(() => [(openBlock(), createElementBlock(Fragment, null, renderList(inputTypes, (typeItem) => {
1400
+ return createBaseVNode("option", {
1401
+ key: typeItem,
1402
+ value: typeItem
1403
+ }, toDisplayString(typeItem), 9, _hoisted_3$2);
1404
+ }), 64))]),
1405
+ _: 1
1406
+ }, 8, [
1407
+ "modelValue",
1408
+ "onUpdate:modelValue",
1409
+ "class",
1410
+ "disabled"
1411
+ ])) : createCommentVNode("", true)], 64);
1412
+ }), 128)),
1413
+ renderSlot(_ctx.$slots, "input-actions", {
1414
+ item,
1415
+ index
1416
+ }, () => [!item.fromSchema ? (openBlock(), createBlock(unref(Button_default), {
1417
+ key: 0,
1418
+ class: normalizeClass(["n-red w-10 flex justify-center items-center", __props.disabled ? "op0!" : ""]),
1419
+ disabled: __props.disabled,
1420
+ onClick: ($event) => unref(params).splice(index, 1)
1421
+ }, {
1422
+ default: withCtx(() => [createVNode(Icon_default, { icon: "i-ph-trash" })]),
1423
+ _: 1
1424
+ }, 8, [
1425
+ "disabled",
1426
+ "class",
1427
+ "onClick"
1428
+ ])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [createVNode(Icon_default, { icon: "i-ph-lock-simple" })]))])
1429
+ ]);
1430
+ }), 128)),
1431
+ !__props.disabled ? (openBlock(), createElementBlock("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "actions", { params: unref(params) }, () => [
1432
+ createVNode(unref(Button_default), {
1433
+ icon: "i-ph-plus",
1434
+ n: "sm primary",
1435
+ my1: "",
1436
+ "px-3": "",
1437
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(params).push({ ...keysObject.value }))
1438
+ }, {
1439
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" 添加 ", -1)])]),
1440
+ _: 1
1441
+ }),
1442
+ _cache[4] || (_cache[4] = createBaseVNode("div", { "flex-auto": "" }, null, -1)),
1443
+ hasDeletable.value ? (openBlock(), createBlock(unref(Button_default), {
1444
+ key: 0,
1445
+ icon: "i-ph-trash",
1446
+ n: "sm red",
1447
+ my1: "",
1448
+ "px-3": "",
1449
+ onClick: _cache[1] || (_cache[1] = ($event) => clearUserAdded())
1450
+ }, {
1451
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" 删除全部 ", -1)])]),
1452
+ _: 1
1453
+ })) : createCommentVNode("", true)
1454
+ ])])) : createCommentVNode("", true),
1455
+ renderSlot(_ctx.$slots, "default")
1456
+ ]);
1457
+ };
1458
+ }
1459
+ });
1460
+ var _hoisted_1$2 = { class: "size-full flex flex-col" };
1461
+ var _hoisted_2$2 = { class: "n-bg-base flex-none p4 flex flex-col gap-2" };
1462
+ var _hoisted_3$1 = { class: "flex gap-2 items-center" };
1463
+ var _hoisted_4 = { class: "relative w-full" };
1464
+ 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" };
1465
+ var _hoisted_6 = { class: "hidden md:block" };
1466
+ var _hoisted_7 = { class: "flex gap-2 items-center op50 mb--1" };
1467
+ var _hoisted_8 = {
1468
+ key: 0,
1469
+ class: "border-b n-border-base px-4 py-4 flex flex-col gap-4 font-mono"
1470
+ };
1471
+ var _hoisted_9 = {
1472
+ key: 1,
1473
+ class: "border-b n-border-base px-4 py-4 flex flex-col gap-4 font-mono"
1474
+ };
1475
+ var _hoisted_10 = { class: "flex gap-2 items-center" };
1476
+ var _hoisted_11 = {
1477
+ key: 2,
1478
+ class: "border-b n-border-base relative"
1479
+ };
1480
+ var _hoisted_12 = { class: "border-b n-border-base flex gap-2 items-center px-4 py-2" };
1481
+ var _hoisted_13 = { class: "text-xs op50" };
1482
+ var _hoisted_14 = {
1483
+ key: 6,
1484
+ class: "px-4 pb-4 text-sm op50"
1485
+ };
1486
+ var ServerRouteDetail_default = /* @__PURE__ */ defineComponent({
1487
+ __name: "ServerRouteDetail",
1488
+ props: { route: {} },
1489
+ emits: ["openDefaultInput"],
1490
+ setup(__props, { emit: __emit }) {
1491
+ const props = __props;
1492
+ const cookie = reactive({
1493
+ key: "",
1494
+ value: ""
1495
+ });
1496
+ const routeMethod = computed(() => props.route.method || "GET");
1497
+ const bodyPayloadMethods = [
1498
+ "PATCH",
1499
+ "POST",
1500
+ "PUT",
1501
+ "DELETE"
1502
+ ];
1503
+ const hasBody = computed(() => bodyPayloadMethods.includes(routeMethod.value.toUpperCase()));
1504
+ const [DefineDefaultInputs, UseDefaultInputs] = createReusableTemplate();
1505
+ const routeRef = toRef(props, "route");
1506
+ const { paramInputs, activeTab, currentTabInputs, parsedQuery, parsedHeader, parsedBody } = useServerRouteParams(routeRef, { hasBody });
1507
+ const { inputDefaults } = useInputDefaults();
1508
+ const inputDefaultsRecord = computed(() => inputDefaults.value);
1509
+ const activeDefaults = computed(() => {
1510
+ const tab = activeTab.value;
1511
+ return [
1512
+ "query",
1513
+ "body",
1514
+ "headers"
1515
+ ].includes(tab) ? inputDefaultsRecord.value[tab] : [];
1516
+ });
1517
+ const hasDefaults = computed(() => (activeDefaults.value?.length || 0) > 0);
1518
+ const currentParams = currentTabInputs;
1519
+ function clearParamValues() {
1520
+ [
1521
+ "query",
1522
+ "body",
1523
+ "headers"
1524
+ ].forEach((k) => {
1525
+ paramInputs.value[k] = paramInputs.value[k].map((input) => ({
1526
+ ...input,
1527
+ value: void 0
1528
+ }));
1529
+ });
1530
+ }
1531
+ const tabs = computed(() => {
1532
+ const items = [];
1533
+ items.push({
1534
+ name: "Query",
1535
+ slug: "query",
1536
+ length: paramInputs.value.query.length
1537
+ });
1538
+ if (hasBody.value) items.push({
1539
+ name: "Body",
1540
+ slug: "body",
1541
+ length: paramInputs.value.body.length
1542
+ });
1543
+ items.push({
1544
+ name: "Headers",
1545
+ slug: "headers",
1546
+ length: paramInputs.value.headers.length
1547
+ });
1548
+ items.push({
1549
+ name: "Cookies",
1550
+ slug: "cookies",
1551
+ length: cookie.value.length
1552
+ });
1553
+ items.push({
1554
+ name: "Snippets",
1555
+ slug: "snippet"
1556
+ });
1557
+ return items;
1558
+ });
1559
+ const codeSnippets = useServerRouteSnippets({
1560
+ route: routeRef,
1561
+ routeMethod,
1562
+ parsedQuery,
1563
+ parsedBody,
1564
+ parsedHeader
1565
+ });
1566
+ const { fetching, hasSentRequest, response, sendRequest, responseStatus, responseSuccess, responseLang, responseContent, storedResponse: persistedResponse } = useServerRouteRequest({
1567
+ route: routeRef,
1568
+ routeMethod,
1569
+ parsedQuery,
1570
+ parsedBody,
1571
+ parsedHeader,
1572
+ cookie: computed(() => cookie),
1573
+ storageKey: devtoolsStorageKey.response
1574
+ });
1575
+ const storedResponse = computed(() => persistedResponse.value ?? {});
1576
+ return (_ctx, _cache) => {
1577
+ const _component_PanelGrids = PanelGrids_default;
1578
+ const _component_Badge = Badge_default;
1579
+ const _component_CodeBlock = CodeBlock_default;
1580
+ const _directive_tooltip = resolveDirective("tooltip");
1581
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
1582
+ createBaseVNode("div", _hoisted_2$2, [createBaseVNode("div", _hoisted_3$1, [
1583
+ props.route.method ? (openBlock(), createBlock(unref(Button_default), {
1584
+ key: 0,
1585
+ class: normalizeClass(["n-badge-base n-sm pointer-events-none font-mono op-80", unref(getRequestMethodClass)(unref(routeMethod))]),
1586
+ tabindex: "-1"
1587
+ }, {
1588
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(routeMethod).toUpperCase()), 1)]),
1589
+ _: 1
1590
+ }, 8, ["class"])) : createCommentVNode("", true),
1591
+ createBaseVNode("div", _hoisted_4, [createVNode(TextInput_default, {
1592
+ class: "readonly flex-auto font-mono px-5 py-2 n-sm",
1593
+ disabled: "",
1594
+ "model-value": props.route.route
1595
+ }, null, 8, ["model-value"])]),
1596
+ createVNode(unref(Button_default), {
1597
+ class: "h-full n-primary n-solid bg-context",
1598
+ disabled: unref(fetching),
1599
+ onClick: unref(sendRequest)
1600
+ }, {
1601
+ default: withCtx(() => [!unref(fetching) ? (openBlock(), createBlock(Icon_default, {
1602
+ key: 0,
1603
+ icon: "i-ph-telegram-logo",
1604
+ class: "text-light"
1605
+ })) : (openBlock(), createBlock(Icon_default, {
1606
+ key: 1,
1607
+ icon: "i-eos-icons:loading",
1608
+ class: "text-light animate-spin"
1609
+ }))]),
1610
+ _: 1
1611
+ }, 8, ["disabled", "onClick"])
1612
+ ])]),
1613
+ createBaseVNode("div", _hoisted_5, [
1614
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab) => {
1615
+ return withDirectives((openBlock(), createBlock(unref(Button_default), {
1616
+ key: tab.slug,
1617
+ class: normalizeClass([unref(activeTab) === tab.slug ? "text-primary border-px border-solid border-context n-primary" : "border-transparent shadow-none", "px-4 py-2"]),
1618
+ onClick: ($event) => activeTab.value = tab.slug
1619
+ }, {
1620
+ 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)]),
1621
+ _: 2
1622
+ }, 1032, ["class", "onClick"])), [[_directive_tooltip, tab.name]]);
1623
+ }), 128)),
1624
+ _cache[4] || (_cache[4] = createBaseVNode("div", { class: "flex-auto" }, null, -1)),
1625
+ withDirectives(createVNode(unref(Button_default), {
1626
+ n: "orange",
1627
+ class: "p-3",
1628
+ icon: "i-ph-paint-brush-duotone",
1629
+ onClick: clearParamValues
1630
+ }, null, 512), [[_directive_tooltip, "清除输入的请求参数"]])
1631
+ ]),
1632
+ createVNode(unref(DefineDefaultInputs), null, {
1633
+ default: withCtx(() => [createBaseVNode("div", null, [createVNode(ServerRouteInput_default, {
1634
+ modelValue: unref(currentParams),
1635
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentParams) ? currentParams.value = $event : null),
1636
+ default: {
1637
+ active: true,
1638
+ type: "string"
1639
+ },
1640
+ class: "max-h-xs of-auto"
1641
+ }, null, 8, ["modelValue"]), unref(hasDefaults) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createBaseVNode("div", _hoisted_7, [
1642
+ _cache[5] || (_cache[5] = createBaseVNode("div", { class: "w-5 x-divider" }, null, -1)),
1643
+ _cache[6] || (_cache[6] = createBaseVNode("div", { class: "flex-none" }, " 默认值 ", -1)),
1644
+ createVNode(unref(Button_default), {
1645
+ icon: "i-ph-pencil-simple-line",
1646
+ border: false,
1647
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("openDefaultInput"))
1648
+ }),
1649
+ _cache[7] || (_cache[7] = createBaseVNode("div", { class: "x-divider" }, null, -1))
1650
+ ]), createVNode(ServerRouteInput_default, {
1651
+ "model-value": unref(activeDefaults),
1652
+ disabled: ""
1653
+ }, null, 8, ["model-value"])], 64)) : createCommentVNode("", true)])]),
1654
+ _: 1
1655
+ }),
1656
+ unref(activeTab) === "snippet" ? (openBlock(), createElementBlock("div", _hoisted_8, [unref(codeSnippets).length ? (openBlock(), createBlock(CodeSnippets_default, {
1657
+ key: 0,
1658
+ "code-snippets": unref(codeSnippets)
1659
+ }, null, 8, ["code-snippets"])) : createCommentVNode("", true)])) : unref(activeTab) === "cookies" ? (openBlock(), createElementBlock("div", _hoisted_9, [createBaseVNode("div", _hoisted_10, [
1660
+ createVNode(TextInput_default, {
1661
+ modelValue: unref(cookie).key,
1662
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(cookie).key = $event),
1663
+ placeholder: "Key",
1664
+ class: "flex-1 n-primary n-sm"
1665
+ }, null, 8, ["modelValue"]),
1666
+ createVNode(TextInput_default, {
1667
+ modelValue: unref(cookie).value,
1668
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(cookie).value = $event),
1669
+ placeholder: "Value",
1670
+ class: "flex-1 n-primary n-sm"
1671
+ }, null, 8, ["modelValue"]),
1672
+ withDirectives((openBlock(), createBlock(unref(Button_default), {
1673
+ title: "Add",
1674
+ class: "n-primary"
1675
+ }, {
1676
+ default: withCtx(() => [createVNode(Icon_default, { icon: "i-ph-floppy-disk" })]),
1677
+ _: 1
1678
+ })), [[_directive_tooltip, "保存"]])
1679
+ ])])) : (openBlock(), createElementBlock("div", _hoisted_11, [createVNode(unref(UseDefaultInputs))])),
1680
+ !unref(hasSentRequest) ? (openBlock(), createBlock(_component_PanelGrids, { key: 3 }, {
1681
+ default: withCtx(() => [createVNode(unref(Button_default), {
1682
+ n: "primary",
1683
+ disabled: unref(fetching),
1684
+ onClick: unref(sendRequest)
1685
+ }, {
1686
+ default: withCtx(() => [!unref(fetching) ? (openBlock(), createBlock(Icon_default, {
1687
+ key: 0,
1688
+ icon: "i-carbon:send"
1689
+ })) : (openBlock(), createBlock(Icon_default, {
1690
+ key: 1,
1691
+ icon: "i-eos-icons:loading",
1692
+ class: "animate-spin"
1693
+ })), _cache[8] || (_cache[8] = createTextVNode(" 发送请求 ", -1))]),
1694
+ _: 1
1695
+ }, 8, ["disabled", "onClick"])]),
1696
+ _: 1
1697
+ })) : unref(fetching) ? (openBlock(), createBlock(Loading_default, {
1698
+ key: 4,
1699
+ class: "z-10 flex-auto backdrop-blur"
1700
+ }, {
1701
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [createBaseVNode("span", { class: "text-sm" }, "发送中...", -1)])]),
1702
+ _: 1
1703
+ })) : unref(response) ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [createBaseVNode("div", _hoisted_12, [
1704
+ createBaseVNode("div", null, "Response " + toDisplayString(unref(responseSuccess)), 1),
1705
+ unref(responseSuccess) === false ? (openBlock(), createBlock(_component_Badge, {
1706
+ key: 0,
1707
+ class: "n-red"
1708
+ }, {
1709
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [createTextVNode(" Error ", -1)])]),
1710
+ _: 1
1711
+ })) : createCommentVNode("", true),
1712
+ createVNode(_component_Badge, { n: unref(responseSuccess) ? "green" : "orange" }, {
1713
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(responseStatus) ?? unref(storedResponse).status ?? "—"), 1)]),
1714
+ _: 1
1715
+ }, 8, ["n"]),
1716
+ createBaseVNode("code", _hoisted_13, toDisplayString(unref(response)?.headers?.["content-type"] ?? unref(storedResponse).headers?.["content-type"] ?? ""), 1),
1717
+ _cache[11] || (_cache[11] = createBaseVNode("div", { class: "flex-auto" }, null, -1)),
1718
+ _cache[12] || (_cache[12] = createBaseVNode("div", { class: "op50" }, " Request finished in ", -1)),
1719
+ createVNode(_component_Badge, { class: "n-green" }, {
1720
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(response).duration) + " ms ", 1)]),
1721
+ _: 1
1722
+ })
1723
+ ]), createVNode(_component_CodeBlock, {
1724
+ class: "flex-auto overflow-auto py-2",
1725
+ code: unref(responseContent),
1726
+ lang: unref(responseLang)
1727
+ }, null, 8, ["code", "lang"])], 64)) : (openBlock(), createElementBlock("div", _hoisted_14, " 暂无响应输出 "))
1728
+ ]);
1729
+ };
1730
+ }
1731
+ });
1732
+ var _hoisted_1$1 = { class: "min-w-0" };
1733
+ var _hoisted_2$1 = { class: "truncate" };
1734
+ var ServerRouteListItem_default = /* @__PURE__ */ defineComponent({
1735
+ __name: "ServerRouteListItem",
1736
+ props: {
1737
+ item: {},
1738
+ index: { default: 0 },
1739
+ selected: { default: null }
1740
+ },
1741
+ emits: ["select"],
1742
+ setup(__props, { emit: __emit }) {
1743
+ const props = __props;
1744
+ const emit = __emit;
1745
+ const open = ref(true);
1746
+ const isSelected = computed(() => {
1747
+ if (!props.selected || props.item.type !== "route") return false;
1748
+ return props.selected.filepath === props.item.filepath && props.selected.route === props.item.route && props.selected.method === props.item.method;
1749
+ });
1750
+ function handleClick() {
1751
+ if (props.item.type === "collection") open.value = !open.value;
1752
+ else emit("select", props.item);
1753
+ }
1754
+ return (_ctx, _cache) => {
1755
+ const _component_ServerRouteListItem = resolveComponent("ServerRouteListItem", true);
1756
+ const _directive_tooltip = resolveDirective("tooltip");
1757
+ return openBlock(), createElementBlock("div", null, [
1758
+ createBaseVNode("button", {
1759
+ class: normalizeClass(["flex gap-2 w-full items-start px-2 py-1 hover:bg-action transition-colors", { "bg-active": unref(isSelected) }]),
1760
+ style: normalizeStyle({ paddingLeft: `calc(0.5rem + ${__props.index * 1.5}em)` }),
1761
+ onClick: handleClick
1762
+ }, [createBaseVNode("div", { class: normalizeClass([{ "w-12": !__props.item.routes }, "flex-none text-left"]) }, [__props.item.type === "collection" ? (openBlock(), createBlock(Icon_default, {
1763
+ key: 0,
1764
+ icon: "i-carbon:chevron-right",
1765
+ "transform-rotate": unref(open) ? 90 : 0,
1766
+ class: "mb0.5 transition"
1767
+ }, null, 8, ["transform-rotate"])) : (openBlock(), createBlock(Badge_default, {
1768
+ key: 1,
1769
+ class: normalizeClass(unref(getRequestMethodClass)(__props.item.method || "*"))
1770
+ }, {
1771
+ default: withCtx(() => [createTextVNode(toDisplayString((__props.item.method || "*").toUpperCase()), 1)]),
1772
+ _: 1
1773
+ }, 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, {
1774
+ key: 0,
1775
+ title: `${__props.item.routes?.length || 0} routes`,
1776
+ icon: unref(open) ? "i-catppuccin-folder-api-open" : "i-catppuccin-folder-api",
1777
+ class: "mr1"
1778
+ }, 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),
1779
+ _cache[1] || (_cache[1] = createBaseVNode("div", { class: "x-divider" }, null, -1)),
1780
+ unref(open) ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.item.routes, (subItem, subIndex) => {
1781
+ return openBlock(), createBlock(_component_ServerRouteListItem, {
1782
+ key: `${subItem.filepath}-${subIndex}`,
1783
+ item: subItem,
1784
+ index: __props.index + 1,
1785
+ selected: __props.selected,
1786
+ onSelect: _cache[0] || (_cache[0] = ($event) => emit("select", $event))
1787
+ }, null, 8, [
1788
+ "item",
1789
+ "index",
1790
+ "selected"
1791
+ ]);
1792
+ }), 128))]) : createCommentVNode("", true)
1793
+ ]);
1794
+ };
1795
+ }
1796
+ });
1797
+ function groupRoutesByFile(apiResult) {
1798
+ const routes = [];
1799
+ const fileMap = /* @__PURE__ */ new Map();
1800
+ apiResult.modules.forEach((module) => {
1801
+ module.functions.forEach((func) => {
1802
+ const fileKey = func.file;
1803
+ let fileCollection = fileMap.get(fileKey);
1804
+ if (!fileCollection) {
1805
+ fileCollection = {
1806
+ route: (fileKey.split("/").pop() || fileKey).replace(/\.(ts|js)$/, ""),
1807
+ method: "",
1808
+ description: fileKey.replace(/^.*\/src\/api\//, ""),
1809
+ type: "collection",
1810
+ filepath: fileKey,
1811
+ routes: []
1812
+ };
1813
+ fileMap.set(fileKey, fileCollection);
1814
+ routes.push(fileCollection);
1815
+ }
1816
+ fileCollection.routes.push({
1817
+ route: func.url,
1818
+ method: func.method,
1819
+ description: func.description,
1820
+ name: func.name,
1821
+ filepath: func.file,
1822
+ type: "route",
1823
+ paramType: func.paramType,
1824
+ paramLocation: func.paramLocation,
1825
+ returnType: func.returnType,
1826
+ paramSchema: func.paramSchema,
1827
+ returnSchema: func.returnSchema,
1828
+ requestClient: func.requestClient,
1829
+ requestModulePath: func.requestModulePath,
1830
+ requestModuleResolvedPath: func.requestModuleResolvedPath
1831
+ });
1832
+ });
1833
+ });
1834
+ return routes;
1835
+ }
1836
+ function flattenApiToRoutes(apiResult) {
1837
+ const routes = [];
1838
+ apiResult.modules.forEach((module) => {
1839
+ module.functions.forEach((func) => {
1840
+ routes.push({
1841
+ route: func.url,
1842
+ method: func.method,
1843
+ description: func.description,
1844
+ name: func.name,
1845
+ filepath: func.file,
1846
+ type: "route",
1847
+ paramType: func.paramType,
1848
+ paramLocation: func.paramLocation,
1849
+ returnType: func.returnType,
1850
+ paramSchema: func.paramSchema,
1851
+ returnSchema: func.returnSchema,
1852
+ requestClient: func.requestClient,
1853
+ requestModulePath: func.requestModulePath,
1854
+ requestModuleResolvedPath: func.requestModuleResolvedPath
1855
+ });
1856
+ });
1857
+ });
1858
+ return routes;
1859
+ }
1860
+ function calculateApiStats(apiResult) {
1861
+ const stats = {
1862
+ totalModules: apiResult.modules.length,
1863
+ totalApis: 0,
1864
+ totalTypes: 0,
1865
+ byMethod: {}
1866
+ };
1867
+ apiResult.modules.forEach((module) => {
1868
+ stats.totalApis += module.functions.length;
1869
+ stats.totalTypes += module.types.length;
1870
+ module.functions.forEach((func) => {
1871
+ const method = func.method.toUpperCase();
1872
+ stats.byMethod[method] = (stats.byMethod[method] || 0) + 1;
1873
+ });
1874
+ });
1875
+ return stats;
1876
+ }
1877
+ function filterRoutes(routes, searchText) {
1878
+ if (!searchText) return routes;
1879
+ const search = searchText.toLowerCase();
1880
+ return routes.map((route) => {
1881
+ if (route.type === "collection" && route.routes) {
1882
+ const filteredSubRoutes = filterRoutes(route.routes, searchText);
1883
+ if (filteredSubRoutes.length > 0) return {
1884
+ ...route,
1885
+ routes: filteredSubRoutes
1886
+ };
1887
+ return null;
1888
+ }
1889
+ return route.route.toLowerCase().includes(search) || route.method?.toLowerCase().includes(search) || route.description?.toLowerCase().includes(search) || route.name?.toLowerCase().includes(search) ? route : null;
1890
+ }).filter((route) => route !== null);
1891
+ }
1892
+ function sortRoutesByMethod(routes) {
1893
+ const methodOrder = [
1894
+ "GET",
1895
+ "POST",
1896
+ "PUT",
1897
+ "PATCH",
1898
+ "DELETE",
1899
+ "OPTIONS",
1900
+ "HEAD"
1901
+ ];
1902
+ return routes.sort((a, b) => {
1903
+ if (a.type === "collection" && b.type !== "collection") return -1;
1904
+ if (a.type !== "collection" && b.type === "collection") return 1;
1905
+ if (a.type === "collection" && b.type === "collection") return a.route.localeCompare(b.route);
1906
+ const aIndex = methodOrder.indexOf(a.method?.toUpperCase() || "");
1907
+ const bIndex = methodOrder.indexOf(b.method?.toUpperCase() || "");
1908
+ if (aIndex !== bIndex) return aIndex - bIndex;
1909
+ return a.route.localeCompare(b.route);
1910
+ });
1911
+ }
1912
+ var _hoisted_1 = { class: "flex gap-1 text-sm" };
1913
+ var _hoisted_2 = {
1914
+ key: 0,
1915
+ class: "op50"
1916
+ };
1917
+ var _hoisted_3 = { class: "op50" };
1918
+ var server_router_default = /* @__PURE__ */ defineComponent({
1919
+ name: "ServerRouterPage",
1920
+ __name: "server-router",
1921
+ setup(__props) {
1922
+ const search = ref("");
1923
+ const isGrouped = ref(true);
1924
+ const inputDefaultsDrawer = ref(false);
1925
+ const selectedRoute = ref(null);
1926
+ const { inputDefaults, resetToEmpty } = useInputDefaults();
1927
+ const inputDefaultsRecord = computed(() => inputDefaults.value);
1928
+ const defaultTabs = [
1929
+ "query",
1930
+ "body",
1931
+ "headers"
1932
+ ];
1933
+ function toTitle(s) {
1934
+ return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
1935
+ }
1936
+ apiListFetch.execute();
1937
+ function handleRouteClick(item) {
1938
+ if (item.type === "route") selectedRoute.value = item;
1939
+ }
1940
+ const routeList = computed(() => {
1941
+ const data = apiListFetch.data.value;
1942
+ if (!data || !data.modules) return [];
1943
+ return sortRoutesByMethod(isGrouped.value ? groupRoutesByFile(data) : flattenApiToRoutes(data));
1944
+ });
1945
+ const filteredRoutes = computed(() => {
1946
+ return filterRoutes(routeList.value, search.value);
1947
+ });
1948
+ const stats = computed(() => {
1949
+ const data = apiListFetch.data.value;
1950
+ if (!data) return {
1951
+ totalModules: 0,
1952
+ totalApis: 0,
1953
+ totalTypes: 0,
1954
+ byMethod: {}
1955
+ };
1956
+ return calculateApiStats(data);
1957
+ });
1958
+ const matchedCount = computed(() => {
1959
+ if (!search.value) return stats.value.totalApis;
1960
+ let count = 0;
1961
+ const countRoutes = (routes) => {
1962
+ routes.forEach((route) => {
1963
+ if (route.type === "route") count++;
1964
+ if (route.routes) countRoutes(route.routes);
1965
+ });
1966
+ };
1967
+ countRoutes(filteredRoutes.value);
1968
+ return count;
1969
+ });
1970
+ return (_ctx, _cache) => {
1971
+ const _component_SectionBlock = SectionBlock_default;
1972
+ const _directive_tooltip = resolveDirective("tooltip");
1973
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(SplitPane_default, {
1974
+ "storage-key": "server-router",
1975
+ "left-size": 26,
1976
+ "min-size": 26
1977
+ }, {
1978
+ left: withCtx(() => [createVNode(Navbar_default, {
1979
+ search: unref(search),
1980
+ "onUpdate:search": _cache[2] || (_cache[2] = ($event) => isRef(search) ? search.value = $event : null),
1981
+ class: "pb-2"
1982
+ }, {
1983
+ actions: withCtx(() => [withDirectives(createVNode(unref(Button_default), {
1984
+ icon: unref(isGrouped) ? "i-ph-tree-view" : "i-ph-list-bullets",
1985
+ border: false,
1986
+ onClick: _cache[0] || (_cache[0] = ($event) => isGrouped.value = !unref(isGrouped))
1987
+ }, null, 8, ["icon"]), [[_directive_tooltip, unref(isGrouped) ? "树形视图" : "列表视图"]]), withDirectives(createVNode(unref(Button_default), {
1988
+ icon: "i-ph-circles-three-plus",
1989
+ border: false,
1990
+ onClick: _cache[1] || (_cache[1] = ($event) => inputDefaultsDrawer.value = !unref(inputDefaultsDrawer))
1991
+ }, null, 512), [[_directive_tooltip, `默认值`]])]),
1992
+ 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)])]),
1993
+ _: 1
1994
+ }, 8, ["search"]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredRoutes), (item, index) => {
1995
+ return openBlock(), createBlock(ServerRouteListItem_default, {
1996
+ key: `${item.filepath}-${index}`,
1997
+ item,
1998
+ selected: unref(selectedRoute),
1999
+ onSelect: handleRouteClick
2000
+ }, null, 8, ["item", "selected"]);
2001
+ }), 128))]),
2002
+ right: withCtx(() => [(openBlock(), createBlock(KeepAlive, { max: 10 }, [unref(selectedRoute) ? (openBlock(), createBlock(ServerRouteDetail_default, {
2003
+ key: 0,
2004
+ route: unref(selectedRoute),
2005
+ onOpenDefaultInput: _cache[3] || (_cache[3] = ($event) => inputDefaultsDrawer.value = true)
2006
+ }, null, 8, ["route"])) : createCommentVNode("", true)], 1024)), !unref(selectedRoute) ? (openBlock(), createBlock(PanelGrids_default, { key: 0 }, {
2007
+ default: withCtx(() => [createVNode(Card_default, { class: "px6 py2" }, {
2008
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [createBaseVNode("span", { class: "op75 cursor-default" }, "选择一个 api 开始调试", -1)])]),
2009
+ _: 1
2010
+ })]),
2011
+ _: 1
2012
+ })) : createCommentVNode("", true)]),
2013
+ _: 1
2014
+ }), createVNode(Drawer_default, {
2015
+ modelValue: unref(inputDefaultsDrawer),
2016
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(inputDefaultsDrawer) ? inputDefaultsDrawer.value = $event : null),
2017
+ "auto-close": "",
2018
+ class: "max-w-xl min-w-xl",
2019
+ onClose: _cache[5] || (_cache[5] = ($event) => inputDefaultsDrawer.value = false)
2020
+ }, {
2021
+ default: withCtx(() => [createBaseVNode("div", null, [_cache[7] || (_cache[7] = createBaseVNode("div", { class: "p-4 border-b n-border-base" }, [
2022
+ createBaseVNode("span", { class: "text-lg" }, "设置默认值"),
2023
+ createBaseVNode("br"),
2024
+ createBaseVNode("span", { class: "dark:text-white text-black op50" }, "已合并为 DevTools 中每个请求的默认设置。")
2025
+ ], -1)), (openBlock(), createElementBlock(Fragment, null, renderList(defaultTabs, (tab) => {
2026
+ return createVNode(_component_SectionBlock, {
2027
+ key: tab,
2028
+ text: `${toTitle(tab)} ${unref(inputDefaultsRecord)[tab]?.length ? `(${unref(inputDefaultsRecord)[tab].length})` : ""}`,
2029
+ padding: false,
2030
+ icon: unref(ServerRouteTabIcons)[tab]
2031
+ }, {
2032
+ default: withCtx(() => [createVNode(ServerRouteInput_default, {
2033
+ modelValue: unref(inputDefaultsRecord)[tab],
2034
+ "onUpdate:modelValue": ($event) => unref(inputDefaultsRecord)[tab] = $event,
2035
+ py0: "",
2036
+ default: {
2037
+ active: true,
2038
+ type: "string"
2039
+ }
2040
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])]),
2041
+ _: 2
2042
+ }, 1032, ["text", "icon"]);
2043
+ }), 64))])]),
2044
+ _: 1
2045
+ }, 8, ["modelValue"])], 64);
2046
+ };
2047
+ }
2048
+ });
2049
+ export { server_router_default as default };