vitepress-openapi 0.2.10 → 0.2.11

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 (195) hide show
  1. package/dist/OAJSONEditor-BTGtvci-.js +36528 -0
  2. package/dist/OAJSONEditor-DMDZUFqm.cjs +3859 -0
  3. package/dist/{angular-html-CW1rj3uY.js → angular-html-BQID9WhU.js} +2 -2
  4. package/dist/{angular-html-9C0z-SLY.cjs → angular-html-DNIOHlGh.cjs} +1 -1
  5. package/dist/{angular-ts-mPv4HwYZ.js → angular-ts-CDXMy72c.js} +2 -2
  6. package/dist/{angular-ts-DbwmQ_7d.cjs → angular-ts-TtL5PHiu.cjs} +1 -1
  7. package/dist/{apl-eQdB3PpW.cjs → apl-CHXP_PuI.cjs} +1 -1
  8. package/dist/{apl-B5ZmCr35.js → apl-aiTHik1p.js} +5 -5
  9. package/dist/{astro-CM9Z6ANX.js → astro-Bk0EGHbZ.js} +5 -5
  10. package/dist/{astro-HhXWiqIA.cjs → astro-Bs6LKdLd.cjs} +1 -1
  11. package/dist/{blade-JajcDFoh.cjs → blade-Cv7NuX7S.cjs} +1 -1
  12. package/dist/{blade-BbaEXel2.js → blade-dcNVF1Xb.js} +7 -7
  13. package/dist/{c-C1-DO9YE.js → c-COk7hDJA.js} +1 -1
  14. package/dist/{c-Bj7dnvXD.cjs → c-CZCz03tk.cjs} +1 -1
  15. package/dist/{chapel-BNOH_ZrL.js → chapel-BHO5Jgs1.js} +1 -1
  16. package/dist/{chapel-BN6g3eE8.cjs → chapel-Bj11wkLP.cjs} +1 -1
  17. package/dist/classPrivateFieldGet2-B5R_onup.js +22 -0
  18. package/dist/classPrivateFieldGet2-Bglvjmhn.cjs +1 -0
  19. package/dist/{cobol-BgxKhyCv.cjs → cobol-B2PKMb5_.cjs} +1 -1
  20. package/dist/{cobol-CKBH7GfD.js → cobol-D29hA4_9.js} +2 -2
  21. package/dist/{coffee-SILQVDCE.js → coffee-DBMuDZbT.js} +1 -1
  22. package/dist/{coffee-C7l0xOrD.cjs → coffee-TE_xgObZ.cjs} +1 -1
  23. package/dist/core-BPyqqKDB.cjs +12 -0
  24. package/dist/core-CEXh5eq0.js +4924 -0
  25. package/dist/{cpp-BlEoy55C.js → cpp-BSp0ExOJ.js} +3 -3
  26. package/dist/{cpp-BRnhGWPj.cjs → cpp-Drml9yi6.cjs} +1 -1
  27. package/dist/{crystal-TOC2d_1v.js → crystal-BxHtn_X1.js} +6 -6
  28. package/dist/{crystal-Ba2X2QUX.cjs → crystal-T6SYXb8o.cjs} +1 -1
  29. package/dist/{css-BzCmrrfz.js → css-B4-pOoLE.js} +1 -1
  30. package/dist/{css-DwAz9Pjn.cjs → css-oMq01QVM.cjs} +1 -1
  31. package/dist/dist-8gEJqHbm.cjs +145 -0
  32. package/dist/dist-BdFVNebX.js +3184 -0
  33. package/dist/{edge-DyJcz27i.cjs → edge-BPRyfS4T.cjs} +1 -1
  34. package/dist/{edge-BDg5VzpV.js → edge-CH9qUYIG.js} +3 -3
  35. package/dist/{elixir-BHz2KhQu.cjs → elixir-CYNNAueU.cjs} +1 -1
  36. package/dist/{elixir-BzDCz4UH.js → elixir-IMwLX-5a.js} +1 -1
  37. package/dist/{elm-DoAGeaf_.js → elm-8i0ndpf8.js} +1 -1
  38. package/dist/{elm-CY9z_JCT.cjs → elm-CsSGOCo2.cjs} +1 -1
  39. package/dist/engine-javascript-B8eiD8I_.js +2446 -0
  40. package/dist/engine-javascript-BA-lwMk1.cjs +141 -0
  41. package/dist/{erb-DaIUVjt9.js → erb-B3JdRKLz.js} +2 -2
  42. package/dist/{erb-DN2MJHn3.cjs → erb-CCijh5g_.cjs} +1 -1
  43. package/dist/{git-rebase-BVojUTC8.cjs → git-rebase-CqTcx364.cjs} +1 -1
  44. package/dist/{git-rebase-8pjy4fqK.js → git-rebase-s4xgRin3.js} +1 -1
  45. package/dist/{glimmer-js-ByU2UZIA.js → glimmer-js-BRlqJZKJ.js} +4 -4
  46. package/dist/{glimmer-js-Dt8MM2fQ.cjs → glimmer-js-BmyOid01.cjs} +1 -1
  47. package/dist/{glimmer-ts-CEC_6Qd3.cjs → glimmer-ts-Cr-avsOb.cjs} +1 -1
  48. package/dist/{glimmer-ts-DaRJKOPS.js → glimmer-ts-_bCiLZ83.js} +4 -4
  49. package/dist/{glsl-B_0Mq6To.cjs → glsl-CjCNYdIn.cjs} +1 -1
  50. package/dist/{glsl-DO2w2Ik-.js → glsl-DEotYDrM.js} +2 -2
  51. package/dist/{graphql-D1WJND44.cjs → graphql-DAvjEaGE.cjs} +1 -1
  52. package/dist/{graphql-DXbz5Omg.js → graphql-Eb9BjU5l.js} +5 -5
  53. package/dist/{hack-BlSDwC0z.cjs → hack-BzUM5t5Z.cjs} +1 -1
  54. package/dist/{hack-D34BZTSC.js → hack-qsr2p76N.js} +2 -2
  55. package/dist/{haml-Dt5MpFE9.cjs → haml-BRTyh0NA.cjs} +1 -1
  56. package/dist/{haml-BRknWCT7.js → haml-C9NgGuR7.js} +3 -3
  57. package/dist/{handlebars-9ppD0m7C.cjs → handlebars-B3AlHew8.cjs} +1 -1
  58. package/dist/{handlebars-BRspYj6G.js → handlebars-DKLGUOgk.js} +4 -4
  59. package/dist/{html-BU1zY3Jp.cjs → html-CXX4v0hN.cjs} +1 -1
  60. package/dist/{html-CMRq88ww.js → html-b1x-0Sjo.js} +3 -3
  61. package/dist/{html-derivative-D7LwmusG.cjs → html-derivative-D4EoT0cZ.cjs} +1 -1
  62. package/dist/{html-derivative-BrFXBPOJ.js → html-derivative-D5RWFbq-.js} +1 -1
  63. package/dist/{http-CwR8DNhu.cjs → http-CL9xVX7f.cjs} +1 -1
  64. package/dist/{http-B5LG-yWC.js → http-Cu3ENe5f.js} +4 -4
  65. package/dist/{hurl-B1GvAf8k.cjs → hurl-CWH_45Jf.cjs} +1 -1
  66. package/dist/{hurl-wtqYtxyo.js → hurl-n9N1IzC8.js} +2 -2
  67. package/dist/{java-B8fWOsDG.cjs → java-DopTp571.cjs} +1 -1
  68. package/dist/{java-B4SaXsau.js → java-DsOZx36s.js} +1 -1
  69. package/dist/{javascript-BBx3tGbJ.js → javascript-BeZuSKue.js} +1 -1
  70. package/dist/{javascript-VrrJ04H7.cjs → javascript-BoVqPY81.cjs} +1 -1
  71. package/dist/{jinja-BkYZGd40.js → jinja-BZOrYxA1.js} +1 -1
  72. package/dist/{jinja-CkJfL3dp.cjs → jinja-C3xeiIjm.cjs} +1 -1
  73. package/dist/{jison-CiLUBliq.cjs → jison-BswhHWc-.cjs} +1 -1
  74. package/dist/{jison-C4L8qAyA.js → jison-CJd90rxW.js} +1 -1
  75. package/dist/js-yaml-BP7bOeG0.cjs +28 -0
  76. package/dist/js-yaml-Bd7r_XRf.js +1311 -0
  77. package/dist/{json-Bp2tbsW1.js → json-BYngJnVq.js} +1 -1
  78. package/dist/{json-D3DciEq1.cjs → json-eIjfv80J.cjs} +1 -1
  79. package/dist/{jsx-B_Y6H1Mp.js → jsx-DD3WDGak.js} +1 -1
  80. package/dist/{jsx-DQaEsgGs.cjs → jsx-rnl1r2fp.cjs} +1 -1
  81. package/dist/{julia-Dc5JrGFN.js → julia-BbEQUnh9.js} +4 -4
  82. package/dist/{julia-DH-aextI.cjs → julia-CQHqjN9U.cjs} +1 -1
  83. package/dist/{just-L67PN1Uc.cjs → just-BtQy4COc.cjs} +1 -1
  84. package/dist/{just--rdnVJkn.js → just-CC-2RAnt.js} +5 -5
  85. package/dist/{latex-BYkatXlR.js → latex-DI79tfSU.js} +1 -1
  86. package/dist/{latex-DKzGMDlD.cjs → latex-Dc8GmMF-.cjs} +1 -1
  87. package/dist/lib-Bm75kWfF.js +27 -0
  88. package/dist/lib-jITBAUlk.cjs +1 -0
  89. package/dist/{liquid-BIvrZoOi.cjs → liquid-BaVa8jbp.cjs} +1 -1
  90. package/dist/{liquid-BQZ084XB.js → liquid-CQgClb2e.js} +4 -4
  91. package/dist/{lua-3QPa8W-M.js → lua-Aa6xlS3m.js} +2 -2
  92. package/dist/{lua-jbPUNPQN.cjs → lua-CMQuF1NW.cjs} +1 -1
  93. package/dist/{marko-DTymm-Xt.js → marko-CnoSbnyW.js} +3 -3
  94. package/dist/{marko-DH2FDJVi.cjs → marko-a44Rx8oD.cjs} +1 -1
  95. package/dist/{mdc-BgDnCF09.cjs → mdc-DDEndBZK.cjs} +1 -1
  96. package/dist/{mdc-BJascUlE.js → mdc-yfhLFlW0.js} +2 -2
  97. package/dist/{nginx-D_gIjk1c.cjs → nginx-D1dqVYm1.cjs} +1 -1
  98. package/dist/{nginx-3tiv8u2V.js → nginx-DlNKblVY.js} +1 -1
  99. package/dist/{nim-LQ8-6E6B.cjs → nim-BD5WfdQE.cjs} +1 -1
  100. package/dist/{nim-BVrlAKS0.js → nim-DF1HAFuL.js} +6 -6
  101. package/dist/{org-BFJf-e_S.js → org-BxOhd5H8.js} +26 -26
  102. package/dist/{org-DQ-Vd8YY.cjs → org-D39t4cfx.cjs} +1 -1
  103. package/dist/{perl-KJFFDyul.cjs → perl-BvvR-UBE.cjs} +1 -1
  104. package/dist/{perl-D4z5Iu0X.js → perl-ChFS9GSw.js} +5 -5
  105. package/dist/{php-D7CN11Vh.cjs → php-99Ucsqtp.cjs} +1 -1
  106. package/dist/{php-DXJK24g0.js → php-BlFx1-Cw.js} +6 -6
  107. package/dist/{pug-ChxFEl92.js → pug-DoeArbRk.js} +3 -3
  108. package/dist/{pug-DMpsCZkW.cjs → pug-DsD7dGZV.cjs} +1 -1
  109. package/dist/{qml-B8gGaJm0.cjs → qml-BmSeqgID.cjs} +1 -1
  110. package/dist/{qml-BRxjovis.js → qml-Cud5ERAo.js} +1 -1
  111. package/dist/{r-BgoFf1ZB.js → r-BUvWMIiI.js} +1 -1
  112. package/dist/{r-uXN9C_n5.cjs → r-kc1tv3cq.cjs} +1 -1
  113. package/dist/{razor-CGDVSdG5.js → razor-B9XjYQDL.js} +1 -1
  114. package/dist/{razor-tBRWbTeh.cjs → razor-csAIEUlG.cjs} +1 -1
  115. package/dist/{regexp-CNMHS6k4.js → regexp-BgOYBevC.js} +1 -1
  116. package/dist/{regexp-8S_97zWV.cjs → regexp-btboojP2.cjs} +1 -1
  117. package/dist/{rst-1xt-aBNB.cjs → rst-Cp5naB83.cjs} +1 -1
  118. package/dist/{rst-DPz6kXU9.js → rst-DlKl41_0.js} +6 -6
  119. package/dist/{ruby-C7ICjErH.js → ruby-BF0WTTH3.js} +12 -12
  120. package/dist/{ruby-wisDyjQe.cjs → ruby-CkdMUJEH.cjs} +1 -1
  121. package/dist/{sas-CwNeBf6W.cjs → sas-14QiNRYQ.cjs} +1 -1
  122. package/dist/{sas-BbrqtORA.js → sas-C6FSUZ8u.js} +1 -1
  123. package/dist/{scss-D_ULJoO6.cjs → scss-BtbTbZQd.cjs} +1 -1
  124. package/dist/{scss-BbIN9GY7.js → scss-CCWZPu2R.js} +2 -2
  125. package/dist/{shellscript-BKOBitlL.cjs → shellscript-DPLlmD_A.cjs} +1 -1
  126. package/dist/{shellscript-CCUj_44n.js → shellscript-DZCVULM8.js} +1 -1
  127. package/dist/{shellsession-Du8yRV76.js → shellsession-BN3RSO1C.js} +1 -1
  128. package/dist/{shellsession-DNR4eLoG.cjs → shellsession-BqWcPKhV.cjs} +1 -1
  129. package/dist/{soy-GdzY-Mv1.cjs → soy-CABMyeew.cjs} +1 -1
  130. package/dist/{soy-ZEl6DKSa.js → soy-Du5nNttL.js} +1 -1
  131. package/dist/{sql-C7EzXxFy.js → sql-CYkpqzkZ.js} +1 -1
  132. package/dist/{sql-CHjHiyDi.cjs → sql-HyLtRgmm.cjs} +1 -1
  133. package/dist/{stata-FwAAoJQl.cjs → stata-C2nzzUtY.cjs} +1 -1
  134. package/dist/{stata-DE-nQXRr.js → stata-CTsPxspI.js} +1 -1
  135. package/dist/{surrealql-D6TEktB8.cjs → surrealql-Czd_jpdF.cjs} +1 -1
  136. package/dist/{surrealql-C9gPXNXx.js → surrealql-Do7t2lbF.js} +1 -1
  137. package/dist/{svelte-By2RvWwP.js → svelte-BsAqSY0W.js} +3 -3
  138. package/dist/{svelte-Bmv6_lIz.cjs → svelte-DCXhqWK2.cjs} +1 -1
  139. package/dist/{templ-Ds996O4o.js → templ-CiuTNFNN.js} +2 -2
  140. package/dist/{templ-C7RiHTfw.cjs → templ-CizIGDIX.cjs} +1 -1
  141. package/dist/{tex-Dw7Ay8Ut.js → tex-BQ--pZc4.js} +2 -2
  142. package/dist/{tex-DXDFN6Ui.cjs → tex-CZcUsj1k.cjs} +1 -1
  143. package/dist/{ts-tags-D5UgzHMk.cjs → ts-tags-Cj-sekFe.cjs} +1 -1
  144. package/dist/{ts-tags-DHX1jw76.js → ts-tags-_na8tAcU.js} +7 -7
  145. package/dist/{tsx-lbxmz0z3.js → tsx-Be52Rwki.js} +1 -1
  146. package/dist/{tsx-DZUHQ6F0.cjs → tsx-CrwGvZn1.cjs} +1 -1
  147. package/dist/{twig-DIOHbBlx.cjs → twig-CBOETUN2.cjs} +1 -1
  148. package/dist/{twig-B6ULrIm_.js → twig-CqrXvA-X.js} +5 -5
  149. package/dist/types/src/components/Common/OAJSONEditorAsync.d.ts +4 -0
  150. package/dist/types/src/components/Common/OALoadError.vue.d.ts +13 -0
  151. package/dist/types/src/components/Playground/OAPlaygroundParameterInput.vue.d.ts +2 -2
  152. package/dist/types/src/components/Playground/OAPlaygroundSecurityInput.vue.d.ts +2 -2
  153. package/dist/types/src/components/ui/select-with-custom-option/SelectWithCustomOption.vue.d.ts +2 -2
  154. package/dist/types/src/lib/utils/vHydratableHtml.d.ts +13 -0
  155. package/dist/{typescript-TPcOw_OF.cjs → typescript-DdVmgSX4.cjs} +1 -1
  156. package/dist/{typescript-z9xA3p3l.js → typescript-ED10Lubp.js} +1 -1
  157. package/dist/{typst-Gn-Njx36.js → typst-Bx5HBJWo.js} +29 -29
  158. package/dist/{typst-BS7hKepS.cjs → typst-D7Y713mB.cjs} +1 -1
  159. package/dist/useOpenapi-BEqmTxjl.cjs +50 -0
  160. package/dist/{useOpenapi-DaLjivRh.js → useOpenapi-DbIj-ke3.js} +1947 -5112
  161. package/dist/vitepress-openapi.client.cjs.js +5 -4041
  162. package/dist/vitepress-openapi.client.es.js +6147 -50952
  163. package/dist/vitepress-openapi.css +1 -1
  164. package/dist/vitepress-openapi.node.cjs.js +1 -1
  165. package/dist/vitepress-openapi.node.es.js +1 -1
  166. package/dist/{vue-DsBCt_qn.js → vue-Cjtnfpir.js} +6 -6
  167. package/dist/{vue-html-AXTx9UKx.js → vue-html-BzsnfhsM.js} +1 -1
  168. package/dist/{vue-html-CzxTAYWX.cjs → vue-html-_YQvkRyf.cjs} +1 -1
  169. package/dist/{vue-Bu0iwAjS.cjs → vue-kHo8rCXT.cjs} +1 -1
  170. package/dist/{vue-vine-B7dphuhu.js → vue-vine-COYWN94q.js} +3 -3
  171. package/dist/{vue-vine-CxFGofPC.cjs → vue-vine-DTEBBIT8.cjs} +1 -1
  172. package/dist/{xml-B11l1AZx.js → xml-B8H1TJZQ.js} +2 -2
  173. package/dist/{xml-Ck4C7_Cv.cjs → xml-CTTlGNVY.cjs} +1 -1
  174. package/dist/{xsl-YCtJy4fp.cjs → xsl-C_9xxcnq.cjs} +1 -1
  175. package/dist/{xsl-1UpUfcja.js → xsl-cP3lHVuQ.js} +1 -1
  176. package/dist/{yaml-BcaXAU4E.cjs → yaml-2duz-WDn.cjs} +1 -1
  177. package/dist/{yaml-BkLRBEYn.js → yaml-DEgccW2V.js} +1 -1
  178. package/package.json +1 -1
  179. package/src/components/Common/Highlight/OAShiki.vue +7 -4
  180. package/src/components/Common/OAJSONEditorAsync.ts +30 -0
  181. package/src/components/Common/OALoadError.vue +26 -0
  182. package/src/components/Common/OAMarkdown.vue +2 -1
  183. package/src/components/Feature/OADownloadSpec.vue +38 -23
  184. package/src/components/Playground/OAPlaygroundBodyInput.vue +1 -1
  185. package/src/components/Playground/OAPlaygroundParameterInput.vue +1 -1
  186. package/src/components/Sample/OACodeSamples.vue +24 -9
  187. package/src/composables/useShiki.ts +9 -3
  188. package/src/lib/codeSamples/generateCodeSample.ts +3 -2
  189. package/src/lib/utils/vHydratableHtml.ts +32 -0
  190. package/src/locales/en.json +4 -1
  191. package/src/locales/es.json +4 -1
  192. package/src/locales/ja.json +4 -1
  193. package/src/locales/pt-BR.json +4 -1
  194. package/src/locales/zh.json +4 -1
  195. package/dist/useOpenapi-D_IvjhM7.cjs +0 -194
@@ -0,0 +1,3184 @@
1
+ import { T as e } from "./useOpenapi-DbIj-ke3.js";
2
+ ((e) => Object.entries(e))({
3
+ c: ["libcurl"],
4
+ clojure: ["clj_http"],
5
+ csharp: ["httpclient", "restsharp"],
6
+ dart: ["http"],
7
+ fsharp: ["httpclient"],
8
+ go: ["native"],
9
+ http: ["http1.1"],
10
+ java: [
11
+ "asynchttp",
12
+ "nethttp",
13
+ "okhttp",
14
+ "unirest"
15
+ ],
16
+ js: [
17
+ "axios",
18
+ "fetch",
19
+ "jquery",
20
+ "ofetch",
21
+ "xhr"
22
+ ],
23
+ julia: ["http"],
24
+ kotlin: ["okhttp"],
25
+ node: [
26
+ "axios",
27
+ "fetch",
28
+ "ofetch",
29
+ "undici"
30
+ ],
31
+ objc: ["nsurlsession"],
32
+ ocaml: ["cohttp"],
33
+ php: [
34
+ "curl",
35
+ "guzzle",
36
+ "laravel"
37
+ ],
38
+ powershell: ["restmethod", "webrequest"],
39
+ python: [
40
+ "python3",
41
+ "requests",
42
+ "aiohttp",
43
+ "httpx_sync",
44
+ "httpx_async"
45
+ ],
46
+ r: ["httr2"],
47
+ ruby: ["native"],
48
+ rust: ["reqwest"],
49
+ shell: [
50
+ "curl",
51
+ "httpie",
52
+ "wget"
53
+ ],
54
+ swift: ["nsurlsession"]
55
+ }).flatMap(([e, t]) => t.map((t) => `${e}/${t}`));
56
+ //#endregion
57
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/c/libcurl/libcurl.js
58
+ var t = (e) => (e || "GET").toUpperCase(), n = (e) => e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n", "\\n").replaceAll("\r", "\\r").replaceAll(" ", "\\t"), r = (e) => {
59
+ if (!e) return "";
60
+ try {
61
+ let t = new URL(e), n = t.pathname === "/" && !e.endsWith("/") && !e.includes("?") && !e.includes("#") ? "" : t.pathname;
62
+ return `${t.protocol}//${t.host}${n}${t.search}${t.hash}`;
63
+ } catch {
64
+ return e;
65
+ }
66
+ }, i = (e, t) => {
67
+ let n = t != null && t.length ? t.map((e) => `${e.name}=${e.value}`).join("&") : "";
68
+ return n ? e ? `${e}${e.includes("?") ? "&" : "?"}${n}` : `?${n}` : e;
69
+ }, a = (e) => e != null && e.length ? e.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; ") : null, o = (e) => e != null && e.length ? e.map((e) => {
70
+ var t;
71
+ return new URLSearchParams([[e.name, (t = e.value) == null ? "" : t]]).toString();
72
+ }).join("&") : null, s = (e) => {
73
+ if (e === void 0) return "";
74
+ try {
75
+ return JSON.stringify(JSON.parse(e), null, 2);
76
+ } catch {
77
+ return e;
78
+ }
79
+ }, c = (e) => {
80
+ let t = e.split("\n");
81
+ return t.length <= 1 ? [` curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "${n(e)}");`] : [" curl_easy_setopt(curl, CURLOPT_POSTFIELDS,", ...t.map((e, r) => {
82
+ let i = r === t.length - 1;
83
+ return ` "${n(e)}${i ? "" : "\\n"}"${i ? ");" : ""}`;
84
+ })];
85
+ }, l = {
86
+ target: "c",
87
+ client: "libcurl",
88
+ title: "Libcurl",
89
+ generate(e, l) {
90
+ var u, d, f, p, m, h;
91
+ if (!e) return "";
92
+ let g = t(e.method), _ = i(r((u = e.url) == null ? "" : u), e.queryString), v = !!((d = e.headers) != null && d.length), y = !!((f = e.cookies) != null && f.length), b = e.postData, x = (b == null ? void 0 : b.mimeType) === "multipart/form-data" && !!((p = b.params) != null && p.length), ee = (m = e.headers) == null ? [] : m, S = ee.some((e) => e.name.toLowerCase() === "accept-encoding" && /gzip|deflate/.test(e.value)), C = [
93
+ "#include <curl/curl.h>",
94
+ "",
95
+ "int main(void) {",
96
+ " curl_global_init(CURL_GLOBAL_DEFAULT);",
97
+ " CURL *curl = curl_easy_init();",
98
+ " if (!curl) {",
99
+ " curl_global_cleanup();",
100
+ " return 1;",
101
+ " }",
102
+ "",
103
+ ` curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "${n(g)}");`,
104
+ ` curl_easy_setopt(curl, CURLOPT_URL, "${n(_)}");`
105
+ ];
106
+ if (l != null && (h = l.auth) != null && h.username && l.auth.password && C.push(` curl_easy_setopt(curl, CURLOPT_USERPWD, "${n(`${l.auth.username}:${l.auth.password}`)}");`), v && (C.push("", " struct curl_slist *headers = NULL;"), ee.forEach((e) => {
107
+ C.push(` headers = curl_slist_append(headers, "${n(`${e.name}: ${e.value}`)}");`);
108
+ }), C.push(" curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);")), y) {
109
+ let t = a(e.cookies);
110
+ t && C.push("", ` curl_easy_setopt(curl, CURLOPT_COOKIE, "${n(t)}");`);
111
+ }
112
+ if (S && C.push("", " curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, \"\");"), b) {
113
+ var w;
114
+ if (x && b.params) C.push("", " curl_mime *mime = curl_mime_init(curl);"), b.params.forEach((e) => {
115
+ if (C.push("", " {", " curl_mimepart *part = curl_mime_addpart(mime);"), e.name && C.push(` curl_mime_name(part, "${n(e.name)}");`), e.fileName !== void 0) C.push(` curl_mime_filedata(part, "${n(e.fileName)}");`);
116
+ else {
117
+ var t;
118
+ C.push(` curl_mime_data(part, "${n((t = e.value) == null ? "" : t)}", CURL_ZERO_TERMINATED);`);
119
+ }
120
+ e.contentType && C.push(` curl_mime_type(part, "${n(e.contentType)}");`), C.push(" }");
121
+ }), C.push("", " curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);");
122
+ else if (b.mimeType === "application/x-www-form-urlencoded" && (w = b.params) != null && w.length) {
123
+ let e = o(b.params);
124
+ e !== null && C.push("", ` curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "${n(e)}");`);
125
+ } else if (b.mimeType === "application/json" && b.text !== void 0) C.push("", ...c(s(b.text)));
126
+ else if (b.text !== void 0) {
127
+ let e = b.mimeType === "application/octet-stream" ? b.text : s(b.text);
128
+ C.push("", ...c(e));
129
+ }
130
+ }
131
+ return C.push("", " CURLcode res = curl_easy_perform(curl);"), C.push(" curl_easy_cleanup(curl);"), x && C.push(" curl_mime_free(mime);"), v && C.push(" curl_slist_free_all(headers);"), C.push(" curl_global_cleanup();", "", " return (int)res;", "}"), C.join("\n");
132
+ }
133
+ };
134
+ //#endregion
135
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/libs/http.js
136
+ function u(e) {
137
+ return {
138
+ ...e,
139
+ method: (e.method || "GET").toUpperCase()
140
+ };
141
+ }
142
+ function d(e) {
143
+ return e != null && e.length ? `?${e.map((e) => `${e.name}=${e.value}`).join("&")}` : "";
144
+ }
145
+ var f = (e) => (e || "GET").toUpperCase(), p = (e) => {
146
+ if (!e) return "";
147
+ try {
148
+ let t = new URL(e);
149
+ return t.pathname === "/" ? `${t.origin}${t.search}${t.hash}` : t.toString();
150
+ } catch {
151
+ return e;
152
+ }
153
+ }, m = (e, t) => {
154
+ let n = d(t);
155
+ return n ? e ? `${e}${e.includes("?") ? "&" : "?"}${n.slice(1)}` : n : e;
156
+ }, h = (e, t) => {
157
+ let n = /* @__PURE__ */ new Map();
158
+ if (e == null || e.forEach((e) => {
159
+ if (e.name) {
160
+ var t;
161
+ n.set(e.name, (t = e.value) == null ? "" : t);
162
+ }
163
+ }), t != null && t.length) {
164
+ let e = t.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; ");
165
+ n.set("Cookie", e);
166
+ }
167
+ return Array.from(n.entries()).map(([e, t]) => ({
168
+ name: e,
169
+ value: t
170
+ }));
171
+ }, g = (e, t, n) => {
172
+ let r = e[t];
173
+ r === void 0 ? e[t] = n : Array.isArray(r) ? r.push(n) : e[t] = [r, n];
174
+ };
175
+ function _(e = []) {
176
+ return e.reduce((e, { name: t, value: n }) => (g(e, t, n), e), {});
177
+ }
178
+ function v(e, t) {
179
+ return `${e}${t}`;
180
+ }
181
+ function y(e) {
182
+ let t = {};
183
+ if (e.headers) for (let n of e.headers) n.value && !/[; ]/.test(n.name) && (t[n.name] = n.value);
184
+ return e.cookies && e.cookies.length > 0 && (t.Cookie = e.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; ")), t;
185
+ }
186
+ //#endregion
187
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/clojure/clj_http/clj_http.js
188
+ var b = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, "\\\""), x = class {
189
+ constructor(t) {
190
+ e(this, "name", void 0), this.name = t;
191
+ }
192
+ toString() {
193
+ return `:${this.name}`;
194
+ }
195
+ }, ee = class {
196
+ constructor(t) {
197
+ e(this, "path", void 0), this.path = t;
198
+ }
199
+ toString() {
200
+ return `(clojure.java.io/file "${b(this.path)}")`;
201
+ }
202
+ }, S = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !(e instanceof x) && !(e instanceof ee) && Object.keys(e).length === 0, C = (e) => {
203
+ for (let t of Object.keys(e)) S(e[t]) && delete e[t];
204
+ return e;
205
+ }, w = (e, t) => t.replace(/\n/g, `\n${" ".repeat(e)}`), te = (e) => e == null ? "nil" : e instanceof x || e instanceof ee ? e.toString() : typeof e == "string" ? `"${b(e)}"` : Array.isArray(e) ? `[${w(1, e.reduce((e, t) => `${e} ${te(t)}`, "").trim())}]` : typeof e == "object" ? `{${w(1, Object.keys(e).reduce((t, n) => `${t}:${n} ${w(n.length + 2, te(e[n]))}\n `, "").trim())}}` : String(e), T = (e, t) => Object.keys(e).find((e) => e.toLowerCase() === t.toLowerCase()), ne = (e, t) => {
206
+ let n = T(e, t);
207
+ n && delete e[n];
208
+ }, E = [
209
+ "get",
210
+ "post",
211
+ "put",
212
+ "delete",
213
+ "patch",
214
+ "head",
215
+ "options"
216
+ ], re = {
217
+ target: "clojure",
218
+ client: "clj_http",
219
+ title: "clj-http",
220
+ generate(e, t) {
221
+ var n, r, i, a, o, s;
222
+ let c = f(e == null ? void 0 : e.method).toLowerCase();
223
+ if (!E.includes(c)) return "Method not supported";
224
+ let l = new URL((n = e == null ? void 0 : e.url) == null ? "" : n), u = l.pathname === "/" ? l.origin : l.toString(), d = _([...Array.from(l.searchParams.entries()).map(([e, t]) => ({
225
+ name: e,
226
+ value: t
227
+ })), ...(r = e == null ? void 0 : e.queryString) == null ? [] : r]);
228
+ if (Object.keys(d).length > 0) {
229
+ var p;
230
+ u = (p = u.split("?")[0]) == null ? u : p;
231
+ }
232
+ let m = ((i = e == null ? void 0 : e.headers) == null ? [] : i).reduce((e, t) => {
233
+ var n;
234
+ return e[t.name] = (n = t.value) == null ? "" : n, e;
235
+ }, {});
236
+ e != null && (a = e.cookies) != null && a.length && (m.Cookie = e.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; "));
237
+ let h = {
238
+ headers: m,
239
+ "query-params": d
240
+ };
241
+ t != null && (o = t.auth) != null && o.username && t != null && (s = t.auth) != null && s.password && (h["basic-auth"] = [t.auth.username, t.auth.password]);
242
+ let g = e == null ? void 0 : e.postData;
243
+ switch (g == null ? void 0 : g.mimeType) {
244
+ case "application/json":
245
+ if (h["content-type"] = new x("json"), g.text) try {
246
+ h["form-params"] = JSON.parse(g.text);
247
+ } catch {
248
+ h.body = g.text;
249
+ }
250
+ ne(m, "content-type");
251
+ break;
252
+ case "application/x-www-form-urlencoded":
253
+ var v;
254
+ h["form-params"] = ((v = g.params) == null ? [] : v).reduce((e, t) => (t.name && t.value !== void 0 && (e[t.name] = t.value), e), {}), ne(m, "content-type");
255
+ break;
256
+ case "multipart/form-data":
257
+ g.params && (h.multipart = g.params.map((e) => typeof e.fileName == "string" && !e.value ? {
258
+ name: e.name,
259
+ content: new ee(e.fileName)
260
+ } : {
261
+ name: e.name,
262
+ content: e.value
263
+ })), ne(m, "content-type");
264
+ break;
265
+ default: g != null && g.text && (h.body = g.text, ne(m, "content-type"));
266
+ }
267
+ let y = T(m, "accept");
268
+ y && m[y] === "application/json" && (h.accept = new x("json"), delete m[y]);
269
+ let re = C(h), ie = "(require '[clj-http.client :as client])\n", D = b(u);
270
+ return S(re) ? `${ie}\n(client/${c} "${D}")` : `${ie}\n(client/${c} "${D}" ${w(11 + c.length + D.length, te(re))})`;
271
+ }
272
+ };
273
+ typeof TextDecoder == "function" && new TextDecoder("utf-8", { ignoreBOM: !0 });
274
+ var ie = typeof TextEncoder == "function" ? new TextEncoder() : void 0, D = Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");
275
+ ((e) => {
276
+ let t = {};
277
+ return e.forEach((e, n) => t[e] = n), t;
278
+ })(D);
279
+ var O = String.fromCharCode.bind(String);
280
+ typeof Uint8Array.from == "function" && Uint8Array.from.bind(Uint8Array);
281
+ var ae = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), oe = typeof btoa == "function" ? (e) => btoa(e) : (e) => {
282
+ let t, n, r, i, a = "", o = e.length % 3;
283
+ for (let o = 0; o < e.length;) {
284
+ if ((n = e.charCodeAt(o++)) > 255 || (r = e.charCodeAt(o++)) > 255 || (i = e.charCodeAt(o++)) > 255) throw TypeError("invalid character found");
285
+ t = n << 16 | r << 8 | i, a += D[t >> 18 & 63] + D[t >> 12 & 63] + D[t >> 6 & 63] + D[t & 63];
286
+ }
287
+ return o ? a.slice(0, o - 3) + "===".substring(o) : a;
288
+ }, se = typeof Uint8Array.prototype.toBase64 == "function" ? (e) => e.toBase64() : (e) => {
289
+ let t = 4096, n = [];
290
+ for (let r = 0, i = e.length; r < i; r += t) n.push(O.apply(null, e.subarray(r, r + t)));
291
+ return oe(n.join(""));
292
+ }, ce = (e) => {
293
+ if (e.length < 2) {
294
+ var t = e.charCodeAt(0);
295
+ return t < 128 ? e : t < 2048 ? O(192 | t >>> 6) + O(128 | t & 63) : O(224 | t >>> 12 & 15) + O(128 | t >>> 6 & 63) + O(128 | t & 63);
296
+ }
297
+ var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
298
+ return O(240 | t >>> 18 & 7) + O(128 | t >>> 12 & 63) + O(128 | t >>> 6 & 63) + O(128 | t & 63);
299
+ }, le = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g, ue = (e) => e.replace(le, ce), de = ie ? (e) => se(ie.encode(e)) : (e) => oe(ue(e)), fe = (e, t = !1) => t ? ae(de(e)) : de(e);
300
+ Uint8Array.fromBase64;
301
+ //#endregion
302
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/csharp/httpclient/httpclient.js
303
+ var pe = {
304
+ target: "csharp",
305
+ client: "httpclient",
306
+ title: "HttpClient",
307
+ generate(e, t) {
308
+ let n = {
309
+ method: "GET",
310
+ url: "",
311
+ ...e
312
+ };
313
+ n.method = n.method.toUpperCase();
314
+ let r = d(n.queryString), i = `${n.url}${r}`, a = [];
315
+ a.push("using var client = new HttpClient();"), a.push("");
316
+ let o = me(n.method);
317
+ return a.push(`var request = new HttpRequestMessage(${o}, "${i}");`), he(a, n, t), ge(a, n), a.push(""), a.push("using var response = await client.SendAsync(request);"), a.join("\n");
318
+ }
319
+ };
320
+ function me(e) {
321
+ switch (e) {
322
+ case "GET": return "HttpMethod.Get";
323
+ case "POST": return "HttpMethod.Post";
324
+ case "PUT": return "HttpMethod.Put";
325
+ case "DELETE": return "HttpMethod.Delete";
326
+ case "PATCH": return "HttpMethod.Patch";
327
+ case "HEAD": return "HttpMethod.Head";
328
+ case "OPTIONS": return "HttpMethod.Options";
329
+ default: return `new HttpMethod("${e}")`;
330
+ }
331
+ }
332
+ function he(e, t, n) {
333
+ var r, i;
334
+ let a = t.headers || [], o = t.cookies || [], s = a.find((e) => e.name.toLowerCase() === "authorization");
335
+ if (s) {
336
+ let [t, n] = s.value.split(" ", 2);
337
+ t && n && e.push(`request.Headers.Authorization = new AuthenticationHeaderValue("${t}", "${n}");`);
338
+ } else if (n != null && (r = n.auth) != null && r.username && n != null && (i = n.auth) != null && i.password) {
339
+ let t = fe(`${n.auth.username}:${n.auth.password}`);
340
+ e.push(`request.Headers.Authorization = new AuthenticationHeaderValue("Basic", "${t}");`);
341
+ }
342
+ let c = /* @__PURE__ */ new Map();
343
+ for (let e of a) {
344
+ let t = e.name, n = e.value;
345
+ t.toLowerCase() !== "authorization" && c.set(t, n);
346
+ }
347
+ for (let [n, r] of c) if (n.toLowerCase() === "accept" && ve(r)) e.push(`request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("${r}"));`);
348
+ else if (n.toLowerCase() === "content-type" && t.postData) continue;
349
+ else e.push(`request.Headers.TryAddWithoutValidation("${n}", "${r}");`);
350
+ if (o.length > 0) {
351
+ let t = o.map((e) => `${e.name}=${e.value}`).join("; ");
352
+ e.push(`request.Headers.TryAddWithoutValidation("Cookie", "${t}");`);
353
+ }
354
+ }
355
+ function ge(e, t) {
356
+ if (!t.postData) return;
357
+ let { mimeType: n, text: r, params: i } = t.postData;
358
+ if (n === "application/json" && r) try {
359
+ let t = JSON.parse(r), n = _e(JSON.stringify(t, null, 2));
360
+ e.push("request.Content = new StringContent("), e.push(`${n},`), e.push("System.Text.Encoding.UTF8, \"application/json\");");
361
+ } catch {
362
+ let t = _e(r);
363
+ e.push("request.Content = new StringContent("), e.push(`${t},`), e.push("System.Text.Encoding.UTF8, \"application/json\");");
364
+ }
365
+ else if (n === "application/x-www-form-urlencoded" && i) {
366
+ let t = i.map((e) => e.name);
367
+ if (t.length !== new Set(t).size) {
368
+ e.push("var formParams = new List<KeyValuePair<string, string>>"), e.push("{");
369
+ for (let t of i) e.push(` new("${t.name}", "${t.value}"),`);
370
+ e.push("};"), e.push("request.Content = new FormUrlEncodedContent(formParams);");
371
+ } else {
372
+ e.push("var formParams = new Dictionary<string, string>"), e.push("{");
373
+ for (let t of i) e.push(` ["${t.name}"] = "${t.value}",`);
374
+ e.push("};"), e.push("request.Content = new FormUrlEncodedContent(formParams);");
375
+ }
376
+ } else if (n === "multipart/form-data" && i) {
377
+ e.push("var content = new MultipartFormDataContent();");
378
+ let t = 0;
379
+ for (let n of i) if (n.fileName !== void 0) {
380
+ if (n.contentType) {
381
+ let r = `fileContent${t++}`;
382
+ e.push(`var ${r} = new StreamContent(File.OpenRead("${k(n.fileName)}"));`), e.push(`${r}.Headers.ContentType = new MediaTypeHeaderValue("${n.contentType}");`), e.push(`content.Add(${r}, "${k(n.name)}", "${k(n.fileName)}");`);
383
+ } else e.push(`content.Add(new StreamContent(File.OpenRead("${k(n.fileName)}")), "${k(n.name)}", "${k(n.fileName)}");`);
384
+ } else if (n.contentType) {
385
+ var a;
386
+ let r = `stringContent${t++}`;
387
+ e.push(`var ${r} = new StringContent("${k((a = n.value) == null ? "" : a)}");`), e.push(`${r}.Headers.ContentType = new MediaTypeHeaderValue("${n.contentType}");`), e.push(`content.Add(${r}, "${k(n.name)}");`);
388
+ } else {
389
+ var o;
390
+ e.push(`content.Add(new StringContent("${k((o = n.value) == null ? "" : o)}"), "${k(n.name)}");`);
391
+ }
392
+ e.push("request.Content = content;");
393
+ } else if (n === "application/octet-stream" && r) e.push("var content = new ByteArrayContent(System.Text.Encoding.UTF8.GetBytes(\"" + r.replace(/"/g, "\\\"") + "\"));"), e.push("content.Headers.ContentType = new MediaTypeHeaderValue(\"application/octet-stream\");"), e.push("request.Content = content;");
394
+ else if (r) {
395
+ let t = _e(r);
396
+ e.push("request.Content = new StringContent("), e.push(`${t},`), e.push(`System.Text.Encoding.UTF8, "${n}");`);
397
+ }
398
+ }
399
+ function _e(e) {
400
+ let t = 3;
401
+ for (; e.includes("\"".repeat(t));) t++;
402
+ let n = "\"".repeat(t);
403
+ return `${n}\n${e}\n${n}`;
404
+ }
405
+ function k(e) {
406
+ return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
407
+ }
408
+ function ve(e) {
409
+ return /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-\^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-\^_]*(\s*;\s*[a-zA-Z0-9][a-zA-Z0-9!#$&\-\^_]*=.*)?$/.test(e);
410
+ }
411
+ //#endregion
412
+ //#region node_modules/.pnpm/@scalar+helpers@0.11.2/node_modules/@scalar/helpers/dist/http/mime-type.js
413
+ var ye = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/, be = (e) => `"${e.replaceAll(/(["\\])/g, "\\$1")}"`, xe = (e) => {
414
+ let t = e.indexOf("=");
415
+ if (t === -1) return null;
416
+ let n = e.slice(0, t).trim().toLowerCase();
417
+ if (!n || !ye.test(n)) return null;
418
+ let r = e.slice(t + 1).trim();
419
+ return r ? r.startsWith("\"") && r.endsWith("\"") && r.length >= 2 ? [n, r.slice(1, -1).replaceAll(/\\(["\\])/g, "$1")] : [n, r] : null;
420
+ }, Se = (e) => {
421
+ let [t = "", n = ""] = e.split("/", 2), r = t.trim().toLowerCase(), i = n.trim().toLowerCase();
422
+ if (!r || !i || !ye.test(r) || !ye.test(i)) throw Error(`Invalid MIME type: "${e}"`);
423
+ return {
424
+ essence: `${r}/${i}`,
425
+ type: r,
426
+ subtype: i
427
+ };
428
+ }, Ce = (e = "text/plain") => {
429
+ let [t = "", ...n] = e.split(";"), r;
430
+ try {
431
+ r = Se(t);
432
+ } catch {
433
+ r = Se("text/plain");
434
+ }
435
+ let { essence: i, type: a, subtype: o } = r, s = /* @__PURE__ */ new Map();
436
+ return n.forEach((e) => {
437
+ let t = xe(e);
438
+ if (!t) return;
439
+ let [n, r] = t;
440
+ s.set(n, r);
441
+ }), {
442
+ essence: i,
443
+ type: a,
444
+ subtype: o,
445
+ parameters: s,
446
+ toString: () => {
447
+ let e = Array.from(s.entries()).map(([e, t]) => `${e}=${ye.test(t) ? t : be(t)}`);
448
+ return e.length ? `${i}; ${e.join("; ")}` : i;
449
+ }
450
+ };
451
+ }, we = (e) => {
452
+ if (!e) return !1;
453
+ let { subtype: t } = Ce(e);
454
+ return t === "json" || t.endsWith("+json");
455
+ }, Te = (e) => `Method.${e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()}`, A = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"), Ee = (e) => {
456
+ let t = 3;
457
+ for (; e.includes("\"".repeat(t));) t++;
458
+ let n = "\"".repeat(t);
459
+ return `${n}\n${e}\n${n}`;
460
+ }, De = {
461
+ target: "csharp",
462
+ client: "restsharp",
463
+ title: "RestSharp",
464
+ generate(e, t) {
465
+ var n, r, i;
466
+ let a = {
467
+ method: "GET",
468
+ url: "",
469
+ ...e
470
+ };
471
+ a.method = a.method.toUpperCase();
472
+ let o = m(a.url, a.queryString), s = "";
473
+ try {
474
+ s = new URL(o).host;
475
+ } catch {}
476
+ let c = [];
477
+ c.push(`var client = new RestClient("${A(o)}");`), c.push(`var request = new RestRequest("", ${Te(a.method)});`);
478
+ let { username: l, password: u } = (n = t == null ? void 0 : t.auth) == null ? {} : n, d = !!(l && u);
479
+ if (d) {
480
+ let e = fe(`${l}:${u}`);
481
+ c.push(`request.AddHeader("Authorization", "Basic ${e}");`);
482
+ }
483
+ if ((r = a.headers) == null || r.forEach((e) => {
484
+ d && e.name.toLowerCase() === "authorization" || c.push(`request.AddHeader("${A(e.name)}", "${A(e.value)}");`);
485
+ }), (i = a.cookies) == null || i.forEach((e) => {
486
+ c.push(`request.AddCookie("${A(e.name)}", "${A(e.value)}", "/", "${A(s)}");`);
487
+ }), a.postData) {
488
+ let { mimeType: e, text: t, params: n } = a.postData, r = e ? Ce(e).essence : void 0;
489
+ if (we(e)) {
490
+ if (t) {
491
+ let e = t;
492
+ try {
493
+ e = JSON.stringify(JSON.parse(t), null, 2);
494
+ } catch {}
495
+ c.push(`request.AddStringBody(${Ee(e)}, ContentType.Json);`);
496
+ }
497
+ } else r === "application/x-www-form-urlencoded" && n ? n.forEach((e) => {
498
+ var t;
499
+ c.push(`request.AddParameter("${A(e.name)}", "${A((t = e.value) == null ? "" : t)}");`);
500
+ }) : r === "multipart/form-data" && n ? n.forEach((e) => {
501
+ if (e.fileName !== void 0) e.contentType ? c.push(`request.AddFile("${A(e.name)}", "${A(e.fileName)}", "${A(e.contentType)}");`) : c.push(`request.AddFile("${A(e.name)}", "${A(e.fileName)}");`);
502
+ else {
503
+ var t;
504
+ c.push(`request.AddParameter("${A(e.name)}", "${A((t = e.value) == null ? "" : t)}");`);
505
+ }
506
+ }) : r === "application/octet-stream" && t ? c.push(`request.AddParameter("application/octet-stream", "${A(t)}", ParameterType.RequestBody);`) : t && c.push(`request.AddParameter("${A(e == null ? "" : e)}", "${A(t)}", ParameterType.RequestBody);`);
507
+ }
508
+ return c.push("var response = await client.ExecuteAsync(request);"), c.join("\n");
509
+ }
510
+ }, Oe = {
511
+ target: "dart",
512
+ client: "http",
513
+ title: "Http",
514
+ generate(e, t) {
515
+ var n, r;
516
+ let i = {
517
+ method: "GET",
518
+ ...e
519
+ };
520
+ i.method = i.method.toUpperCase();
521
+ let a = "import 'package:http/http.dart' as http;\n\nvoid main() async {\n", o = "", s = "";
522
+ i.cookies && i.cookies.length > 0 && (s = i.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; "), o = ` "Cookie": "${s}",\n`);
523
+ let c = ((n = i.headers) == null ? void 0 : n.reduce((e, t) => (t.value && !/[; ]/.test(t.name) && (e[t.name] = t.value), e), {})) || {};
524
+ if (t != null && t.auth) {
525
+ let { username: e, password: n } = t.auth;
526
+ e && n && (c.Authorization = `'Basic ' + base64Encode(utf8.encode('${`${e}:${n}`}'))`);
527
+ }
528
+ if (o && (c.Cookie = s), Object.keys(c).length > 0) {
529
+ a += " final headers = <String,String>{\n";
530
+ for (let [e, t] of Object.entries(c)) t.includes("utf8.encode") ? a += ` '${e}': ${t},\n` : a += ` '${e}': '${t}',\n`;
531
+ a += " };\n\n";
532
+ }
533
+ let l = (r = i.queryString) != null && r.length ? "?" + i.queryString.map((e) => `${e.name}=${e.value}`).join("&") : "", u = `${i.url}${l}`, d = "";
534
+ if (i.postData) {
535
+ if (i.postData.mimeType === "application/json") d = ` final body = r'${i.postData.text}';\n\n`;
536
+ else if (i.postData.mimeType === "application/x-www-form-urlencoded") {
537
+ var f;
538
+ d = ` final body = '${((f = i.postData.params) == null ? void 0 : f.map((e) => {
539
+ var t;
540
+ return `${encodeURIComponent(e.name)}=${encodeURIComponent((t = e.value) == null ? "" : t)}`;
541
+ }).join("&")) || ""}';\n\n`;
542
+ } else if (i.postData.mimeType === "multipart/form-data") {
543
+ d = " final body = <String,String>{\n";
544
+ for (let e of i.postData.params || []) {
545
+ let t = e.value || "", n = e.fileName || "";
546
+ d += ` '${e.name}': '${n || t}',\n`;
547
+ }
548
+ d += " };\n\n";
549
+ } else i.postData.mimeType === "application/octet-stream" && (d = ` final body = '${i.postData.text}';\n\n`);
550
+ }
551
+ d && (a += d);
552
+ let p = i.method.toLowerCase(), m = Object.keys(c).length > 0 ? ", headers: headers" : "";
553
+ return a += ` final response = await http.${p}(Uri.parse('${u}')${m}${d ? ", body: body" : ""});\n`, a += " print(response.body);\n", a += "}", a;
554
+ }
555
+ }, ke = {
556
+ target: "fsharp",
557
+ client: "httpclient",
558
+ title: "HttpClient",
559
+ generate: (e, t) => {
560
+ if (!e) return "";
561
+ let n = je(e.url, e.queryString), r = "";
562
+ return r += Me(e.method, n), e.headers && e.headers.length > 0 && (r += Ne(e.headers)), e.postData && (r += Fe(e.postData)), e.cookies && e.cookies.length > 0 && e.url ? (r += Pe(e.cookies, e.url), r += "let client = new HttpClient(handler)\n") : r += "let client = new HttpClient()\n", r += "let! result = client.SendAsync(httpRequestMessage)\n", r;
563
+ }
564
+ };
565
+ function Ae(e) {
566
+ return !e || e.length === 0 ? "" : "?" + e.map((e) => `${e.name}=${e.value}`).join("&");
567
+ }
568
+ function je(e, t) {
569
+ return e ? !t || t.length === 0 ? e : e + Ae(t) : "";
570
+ }
571
+ function Me(e, t) {
572
+ return `let httpRequestMessage = new HttpRequestMessage(
573
+ HttpMethod("${e}"),
574
+ new Uri("${j(t)}")
575
+ )\n\n`;
576
+ }
577
+ function Ne(e) {
578
+ let t = "";
579
+ for (let i of e) {
580
+ var n, r;
581
+ t += `httpRequestMessage.Headers.Add("${j((n = i.name) == null ? "" : n)}", "${j((r = i.value) == null ? "" : r)}")\n`;
582
+ }
583
+ return t += "\n", t;
584
+ }
585
+ function Pe(e, t) {
586
+ let n = "let cookieContainer = CookieContainer()\n";
587
+ for (let a of e) {
588
+ var r, i;
589
+ n += `cookieContainer.Add(Uri("${j(t)}"), Cookie("${j((r = a.name) == null ? "" : r)}", "${j((i = a.value) == null ? "" : i)}"))\n`;
590
+ }
591
+ return n += "use handler = new HttpClientHandler()\n", n += "handler.CookieContainer <- cookieContainer\n\n", n;
592
+ }
593
+ function Fe(e) {
594
+ if (!e) return "";
595
+ let t = "";
596
+ switch (e.mimeType) {
597
+ case "multipart/form-data":
598
+ t += Le(e);
599
+ break;
600
+ case "application/x-www-form-urlencoded":
601
+ t += ze(e);
602
+ break;
603
+ case "application/json":
604
+ t += Re(e);
605
+ break;
606
+ default: t += Ie(e, e.mimeType);
607
+ }
608
+ return t += "httpRequestMessage.Content <- content\n\n", t;
609
+ }
610
+ function Ie(e, t) {
611
+ var n;
612
+ let r = `let content = new StringContent("${j((n = e.text) == null ? "" : n)}", Encoding.UTF8, "${j(t == null ? "" : t)}")\n`;
613
+ return r += `content.Headers.ContentType <- MediaTypeHeaderValue("${j(t == null ? "" : t)}")\n`, r;
614
+ }
615
+ function Le(e) {
616
+ let t = "let content = new MultipartFormDataContent()\n", n = 0, r = 0;
617
+ for (let s of e.params) if (s.value === "BINARY") {
618
+ var i;
619
+ let e = j((i = s.fileName) == null ? "" : i);
620
+ t += `let fileStreamContent_${n} = new StreamContent(File.OpenRead("${e}"))\n`, s.contentType && (t += `fileStreamContent_${n}.Headers.ContentType <- MediaTypeHeaderValue("${j(s.contentType)}")\n`), t += `content.Add(fileStreamContent_${n}, "${e}", "${e}")\n`, n++;
621
+ } else {
622
+ var a, o;
623
+ let e = j((a = s.name) == null ? "" : a), n = j((o = s.value) == null ? "" : o);
624
+ s.contentType ? (t += `let stringContent_${r} = new StringContent("${n}")\n`, t += `stringContent_${r}.Headers.ContentType <- MediaTypeHeaderValue("${j(s.contentType)}")\n`, t += `content.Add(stringContent_${r}, "${e}")\n`, r++) : t += `content.Add(new StringContent("${n}"), "${e}")\n`;
625
+ }
626
+ return t;
627
+ }
628
+ function Re(e) {
629
+ let t;
630
+ try {
631
+ var n;
632
+ t = JSON.stringify(JSON.parse((n = e.text) == null ? "{}" : n), null, 2);
633
+ } catch {
634
+ var r;
635
+ t = (r = e.text) == null ? "{}" : r;
636
+ }
637
+ return `let content = new StringContent("""${t}""", Encoding.UTF8, "application/json")\n`;
638
+ }
639
+ function ze(e) {
640
+ let t = "let formUrlEncodedContentDictionary = new Dictionary<string, string>()\n";
641
+ for (let i of e.params) {
642
+ var n, r;
643
+ t += `formUrlEncodedContentDictionary.Add("${j((n = i.name) == null ? "" : n)}", "${j((r = i.value) == null ? "" : r)}")\n`;
644
+ }
645
+ return t += "let content = new FormUrlEncodedContent(formUrlEncodedContentDictionary)\n", t;
646
+ }
647
+ function j(e) {
648
+ return e == null ? "" : e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
649
+ }
650
+ //#endregion
651
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/go/native/native.js
652
+ var Be = (e) => e.includes(" ") ? e : M(e), M = (e) => JSON.stringify(e), Ve = (e) => {
653
+ if (e === void 0) return "";
654
+ try {
655
+ return JSON.stringify(JSON.parse(e), null, 2);
656
+ } catch {
657
+ return e;
658
+ }
659
+ }, He = (e) => !e.includes("`"), Ue = (e, t = !1) => t && He(e) ? `\`${e}\`` : M(e), We = (e) => {
660
+ var t, n, r;
661
+ let i = /* @__PURE__ */ new Set();
662
+ if (!e) return {
663
+ imports: i,
664
+ setupLines: [],
665
+ requestBody: "nil",
666
+ needsMultipartContentTypeHeader: !1
667
+ };
668
+ if (e.mimeType === "application/x-www-form-urlencoded" && (t = e.params) != null && t.length) return i.add("neturl \"net/url\""), i.add("strings"), {
669
+ imports: i,
670
+ setupLines: ["postData := neturl.Values{}", ...e.params.map((e) => {
671
+ var t;
672
+ return `postData.Set(${M(e.name)}, ${M((t = e.value) == null ? "" : t)})`;
673
+ })],
674
+ requestBody: "strings.NewReader(postData.Encode())",
675
+ needsMultipartContentTypeHeader: !1
676
+ };
677
+ if (e.mimeType === "multipart/form-data" && (n = e.params) != null && n.length) {
678
+ i.add("bytes"), i.add("mime/multipart");
679
+ let t = ["payload := &bytes.Buffer{}", "writer := multipart.NewWriter(payload)"], n = e.params.some((e) => e.fileName !== void 0), r = !1, a = !1;
680
+ return n && (i.add("os"), i.add("io")), e.params.forEach((e) => {
681
+ if (t.push(""), e.fileName !== void 0) t.push(`part, _ ${r ? "=" : ":="} writer.CreateFormFile(${M(e.name)}, ${M(e.fileName)})`), t.push(""), t.push(`f, _ ${a ? "=" : ":="} os.Open(${M(e.fileName)})`), t.push("defer f.Close()"), t.push(""), t.push("_, _ = io.Copy(part, f)"), r = !0, a = !0;
682
+ else {
683
+ var n;
684
+ t.push(`_ = writer.WriteField(${M(e.name)}, ${M((n = e.value) == null ? "" : n)})`);
685
+ }
686
+ }), t.push("writer.Close()"), {
687
+ imports: i,
688
+ setupLines: t,
689
+ requestBody: "payload",
690
+ needsMultipartContentTypeHeader: !0
691
+ };
692
+ }
693
+ return i.add("strings"), {
694
+ imports: i,
695
+ setupLines: [`payload := strings.NewReader(${Ue(e.mimeType === "application/json" ? Ve(e.text) : (r = e.text) == null ? "" : r, e.mimeType === "application/json")})`],
696
+ requestBody: "payload",
697
+ needsMultipartContentTypeHeader: !1
698
+ };
699
+ }, Ge = (e) => Array.from(/* @__PURE__ */ new Set([
700
+ "fmt",
701
+ "io",
702
+ "net/http",
703
+ ...e
704
+ ])).sort(), Ke = {
705
+ target: "go",
706
+ client: "native",
707
+ title: "NewRequest",
708
+ generate(e, t) {
709
+ var n, r, i, a;
710
+ if (!e) return "";
711
+ let o = f(e.method), s = p(m((n = e.url) == null ? "" : n, e.queryString)), c = h(e.headers, e.cookies), l = We(e.postData), u = [
712
+ "package main",
713
+ "",
714
+ "import (",
715
+ ...Ge(l.imports).map((e) => `\t${Be(e)}`),
716
+ ")",
717
+ "",
718
+ "func main() {",
719
+ `\trequestUrl := ${M(s)}`,
720
+ "",
721
+ ...l.setupLines.map((e) => e ? `\t${e}` : "")
722
+ ];
723
+ return l.setupLines.length && u.push(""), u.push(`\treq, _ := http.NewRequest(${M(o)}, requestUrl, ${l.requestBody})`), u.push(""), l.needsMultipartContentTypeHeader && u.push(" req.Header.Set(\"Content-Type\", writer.FormDataContentType())"), t != null && (r = t.auth) != null && r.username && t != null && (i = t.auth) != null && i.password && u.push(`\treq.SetBasicAuth(${M(t.auth.username)}, ${M(t.auth.password)})`), c.forEach((e) => {
724
+ u.push(`\treq.Header.Add(${M(e.name)}, ${M(e.value)})`);
725
+ }), (l.needsMultipartContentTypeHeader || c.length || t != null && (a = t.auth) != null && a.username && t.auth.password) && u.push(""), u.push(" res, _ := http.DefaultClient.Do(req)"), u.push(""), u.push(" defer res.Body.Close()"), u.push(" body, _ := io.ReadAll(res.Body)"), u.push(""), u.push(" fmt.Println(res)"), u.push(" fmt.Println(string(body))"), u.push(""), u.push("}"), u.join("\n");
726
+ }
727
+ }, qe = {
728
+ target: "http",
729
+ client: "http1.1",
730
+ title: "HTTP/1.1",
731
+ generate(e) {
732
+ let t = {
733
+ method: "GET",
734
+ headers: [],
735
+ queryString: [],
736
+ ...e
737
+ };
738
+ t.method = t.method.toUpperCase();
739
+ let n, r;
740
+ try {
741
+ n = new URL(t.url || "http://"), r = n.pathname + (n.search || "");
742
+ } catch {
743
+ r = t.url || "/";
744
+ }
745
+ let i = (n == null ? void 0 : n.hostname) || "UNKNOWN_HOSTNAME", a = `${t.method} ${r} HTTP/1.1\r\n`;
746
+ if (t.queryString.length) {
747
+ let e = t.queryString.map((e) => `${e.name}=${e.value}`).join("&");
748
+ a = `${t.method} ${r}?${e} HTTP/1.1\r\n`;
749
+ }
750
+ let o = /* @__PURE__ */ new Map();
751
+ if (o.set("Host", i), t.headers.forEach((e) => {
752
+ o.has(e.name) ? o.set(e.name, `${o.get(e.name)}, ${e.value}`) : o.set(e.name, e.value);
753
+ }), t.queryString.length) {
754
+ let e = t.queryString.map((e) => `${e.name}=${e.value}`).join("&");
755
+ a = `${t.method} ${r}?${e} HTTP/1.1\r\n`;
756
+ }
757
+ let s = "";
758
+ if (t.postData) {
759
+ if (t.postData.mimeType === "application/json" && t.postData.text) o.set("Content-Type", "application/json"), s = t.postData.text;
760
+ else if (t.postData.mimeType === "application/octet-stream" && t.postData.text) o.set("Content-Type", "application/octet-stream"), s = t.postData.text;
761
+ else if (t.postData.mimeType === "application/x-www-form-urlencoded" && t.postData.params) {
762
+ let e = t.postData.params.map((e) => {
763
+ var t;
764
+ return `${encodeURIComponent(e.name)}=${encodeURIComponent((t = e.value) == null ? "" : t)}`;
765
+ }).join("&");
766
+ o.set("Content-Type", "application/x-www-form-urlencoded"), s = e;
767
+ } else if (t.postData.mimeType === "multipart/form-data" && t.postData.params) {
768
+ let e = "----WebKitFormBoundary7MA4YWxkTrZu0gW";
769
+ o.set("Content-Type", `multipart/form-data; boundary=${e}`), s = t.postData.params.map((t) => {
770
+ var n;
771
+ let r = t.contentType ? `Content-Type: ${t.contentType}\r\n` : "";
772
+ return t.fileName ? `--${e}\r\nContent-Disposition: form-data; name="${t.name}"; filename="${t.fileName}"\r\n${r}\r\n` : `--${e}\r\nContent-Disposition: form-data; name="${t.name}"\r\n${r}\r\n${(n = t.value) == null ? "" : n}\r\n`;
773
+ }).join("") + `--${e}--\r\n`;
774
+ }
775
+ }
776
+ return o.forEach((e, t) => {
777
+ a += `${t}: ${e}\r\n`;
778
+ }), a += `\r\n${s}`, a;
779
+ }
780
+ }, Je = "", Ye = "\n", N = class {
781
+ constructor({ indent: t, join: n } = {}) {
782
+ e(this, "postProcessors", void 0), e(this, "code", void 0), e(this, "indentationCharacter", void 0), e(this, "lineJoin", void 0), e(this, "indentLine", void 0), e(this, "unshift", void 0), e(this, "push", void 0), e(this, "blank", void 0), e(this, "join", void 0), e(this, "addPostProcessor", void 0), this.postProcessors = [], this.code = [], this.indentationCharacter = Je, this.lineJoin = Ye, this.indentLine = (e, t = 0) => `${this.indentationCharacter.repeat(t)}${e}`, this.unshift = (e, t) => {
783
+ let n = this.indentLine(e, t);
784
+ this.code.unshift(n);
785
+ }, this.push = (e, t) => {
786
+ let n = this.indentLine(e, t);
787
+ this.code.push(n);
788
+ }, this.blank = () => {
789
+ this.code.push("");
790
+ }, this.join = () => {
791
+ let e = this.code.join(this.lineJoin);
792
+ return this.postProcessors.reduce((e, t) => t(e), e);
793
+ }, this.addPostProcessor = (e) => {
794
+ this.postProcessors = [...this.postProcessors, e];
795
+ }, this.indentationCharacter = t || Je, this.lineJoin = n == null ? Ye : n;
796
+ }
797
+ };
798
+ //#endregion
799
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/httpsnippet-lite/helpers/escape.js
800
+ function Xe(e, t = {}) {
801
+ let { delimiter: n = "\"", escapeChar: r = "\\", escapeNewlines: i = !0 } = t;
802
+ return [...e.toString()].map((e) => e === "\b" ? `${r}b` : e === " " ? `${r}t` : e === "\n" ? i ? `${r}n` : e : e === "\f" ? `${r}f` : e === "\r" ? i ? `${r}r` : e : e === r ? r + r : e === n ? r + n : e < " " || e > "~" ? JSON.stringify(e).slice(1, -1) : e).join("");
803
+ }
804
+ var Ze = (e) => Xe(e, { delimiter: "'" }), P = (e) => Xe(e, { delimiter: "\"" }), Qe = {
805
+ info: {
806
+ key: "asynchttp",
807
+ title: "AsyncHttp",
808
+ link: "https://github.com/AsyncHttpClient/async-http-client",
809
+ description: "Asynchronous Http and WebSocket Client library for Java"
810
+ },
811
+ convert: ({ method: e, allHeaders: t, postData: n, fullUrl: r }, i) => {
812
+ let { blank: a, push: o, join: s } = new N({ indent: {
813
+ indent: " ",
814
+ ...i
815
+ }.indent });
816
+ return o("AsyncHttpClient client = new DefaultAsyncHttpClient();"), o(`client.prepare("${e.toUpperCase()}", "${r}")`), Object.keys(t).forEach((e) => {
817
+ o(`.setHeader("${e}", "${P(t[e])}")`, 1);
818
+ }), n != null && n.text && o(`.setBody(${JSON.stringify(n.text)})`, 1), o(".execute()", 1), o(".toCompletableFuture()", 1), o(".thenAccept(System.out::println)", 1), o(".join();", 1), a(), o("client.close();"), s();
819
+ }
820
+ };
821
+ //#endregion
822
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/utils/convertWithHttpSnippetLite.js
823
+ function F(e, t) {
824
+ var n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, v, y, b;
825
+ let x = new URL((n = t == null ? void 0 : t.url) == null ? "" : n), ee = x.pathname === "/" ? x.origin : x.toString(), S = {
826
+ method: (r = t == null ? void 0 : t.method) == null ? "GET" : r,
827
+ url: ee,
828
+ httpVersion: "HTTP/1.1",
829
+ cookies: [],
830
+ headers: (i = t == null ? void 0 : t.headers) == null ? [] : i,
831
+ headersSize: -1,
832
+ bodySize: -1,
833
+ queryString: Array.from(x.searchParams.entries()).map(([e, t]) => ({
834
+ name: e,
835
+ value: t
836
+ })),
837
+ postData: t == null ? void 0 : t.postData
838
+ }, C = ((a = S == null ? void 0 : S.headers) == null ? [] : a).reduce((e, t) => ({
839
+ ...e,
840
+ [t.name]: t.value
841
+ }), {}), w = _(S.queryString), te = ((o = S.cookies) == null ? [] : o).reduce((e, t) => ({
842
+ ...e,
843
+ [t.name]: t.value
844
+ }), {}), T = new URL(S.url), ne = {
845
+ protocol: T.protocol,
846
+ hostname: T.hostname,
847
+ host: T.hostname,
848
+ port: T.port,
849
+ pathname: T.pathname.split("/").map((e) => encodeURIComponent(decodeURIComponent(e))).join("/") + T.search,
850
+ path: T.pathname.split("/").map((e) => encodeURIComponent(decodeURIComponent(e))).join("/") + T.search,
851
+ search: T.search,
852
+ hash: T.hash,
853
+ href: T.href,
854
+ origin: T.origin,
855
+ password: T.password,
856
+ searchParams: T.searchParams,
857
+ username: T.username,
858
+ toString: T.toString,
859
+ toJSON: () => T.toJSON()
860
+ }, E = {
861
+ url: S.url,
862
+ uriObj: ne,
863
+ method: (s = (c = S.method) == null ? void 0 : c.toLocaleUpperCase()) == null ? "GET" : s,
864
+ httpVersion: S.httpVersion,
865
+ cookies: (l = S.cookies) == null ? [] : l,
866
+ headers: (u = S.headers) == null ? [] : u,
867
+ headersSize: (d = S.headersSize) == null ? 0 : d,
868
+ headersObj: C == null ? {} : C,
869
+ bodySize: (f = S.bodySize) == null ? 0 : f,
870
+ queryString: (p = S.queryString) == null ? [] : p,
871
+ postData: S.postData ? {
872
+ mimeType: (m = S.postData.mimeType) == null ? "application/json" : m,
873
+ text: (h = S.postData.text) == null ? "" : h,
874
+ params: (g = S.postData.params) == null ? [] : g,
875
+ paramsObj: (v = (y = S.postData.params) == null ? void 0 : y.reduce((e, t) => (t.name && t.value !== void 0 && (e[t.name] = t.value), e), {})) == null ? {} : v
876
+ } : void 0,
877
+ allHeaders: C == null ? {} : C,
878
+ fullUrl: S.url,
879
+ queryObj: w == null ? {} : w,
880
+ cookiesObj: te == null ? {} : te
881
+ };
882
+ if (((b = E.postData) == null ? void 0 : b.mimeType) === "application/json" && E.postData.text) try {
883
+ E.postData.jsonObj = JSON.parse(E.postData.text);
884
+ } catch (e) {
885
+ console.error("Error parsing JSON:", e);
886
+ }
887
+ return typeof e.convert == "function" ? e.convert(E) : "";
888
+ }
889
+ //#endregion
890
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/java/asynchttp/asynchttp.js
891
+ var $e = {
892
+ target: "java",
893
+ client: "asynchttp",
894
+ title: "AsyncHttp",
895
+ generate(e) {
896
+ return F(Qe, e);
897
+ }
898
+ }, et = {
899
+ info: {
900
+ key: "nethttp",
901
+ title: "java.net.http",
902
+ link: "https://openjdk.java.net/groups/net/httpclient/intro.html",
903
+ description: "Java Standardized HTTP Client API"
904
+ },
905
+ convert: ({ allHeaders: e, fullUrl: t, method: n, postData: r }, i) => {
906
+ let { push: a, join: o } = new N({ indent: {
907
+ indent: " ",
908
+ ...i
909
+ }.indent });
910
+ return a("HttpRequest request = HttpRequest.newBuilder()"), a(`.uri(URI.create("${t}"))`, 2), Object.keys(e).forEach((t) => {
911
+ a(`.header("${t}", "${P(e[t])}")`, 2);
912
+ }), r != null && r.text ? a(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(r.text)}))`, 2) : a(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), a(".build();", 2), a("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"), a("System.out.println(response.body());"), o();
913
+ }
914
+ }, tt = {
915
+ target: "java",
916
+ client: "nethttp",
917
+ title: "java.net.http",
918
+ generate(e) {
919
+ return F(et, e);
920
+ }
921
+ }, nt = {
922
+ info: {
923
+ key: "okhttp",
924
+ title: "OkHttp",
925
+ link: "http://square.github.io/okhttp/",
926
+ description: "An HTTP Request Client Library"
927
+ },
928
+ convert: ({ postData: e, method: t, fullUrl: n, allHeaders: r }, i) => {
929
+ let { push: a, blank: o, join: s } = new N({ indent: {
930
+ indent: " ",
931
+ ...i
932
+ }.indent });
933
+ return a("OkHttpClient client = new OkHttpClient();"), o(), e != null && (e.mimeType === "application/x-www-form-urlencoded" && e.params ? (a("FormBody formBody = new FormBody.Builder()"), e.params.forEach((e) => {
934
+ a(`.addEncoded("${e.name}", "${e.value}")`, 1);
935
+ }), a(".build();", 1), o()) : e.mimeType === "multipart/form-data" && e.params ? (a("MultipartBody body = new MultipartBody.Builder()"), a(".setType(MultipartBody.FORM)", 1), e.params.forEach((e) => {
936
+ e.fileName === void 0 ? e.value !== void 0 && a(`.addFormDataPart("${e.name}", "${e.value}")`, 1) : a(`.addFormDataPart("${e.name}", "${e.fileName}", RequestBody.create(MediaType.parse("application/octet-stream"), new File("${e.fileName}")))`, 1);
937
+ }), a(".build();", 1), o()) : (a(`MediaType mediaType = MediaType.parse("${e.mimeType}");`), a(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`))), a("Request request = new Request.Builder()"), a(`.url("${n}")`, 1), [
938
+ "GET",
939
+ "POST",
940
+ "PUT",
941
+ "DELETE",
942
+ "PATCH",
943
+ "HEAD"
944
+ ].includes(t.toUpperCase()) ? [
945
+ "POST",
946
+ "PUT",
947
+ "DELETE",
948
+ "PATCH"
949
+ ].includes(t.toUpperCase()) ? e != null && (e.text || e.params) ? a(`.${t.toLowerCase()}(body)`, 1) : a(`.${t.toLowerCase()}(null)`, 1) : a(`.${t.toLowerCase()}()`, 1) : e != null && e.text ? a(`.method("${t.toUpperCase()}", body)`, 1) : a(`.method("${t.toUpperCase()}", null)`, 1), Object.keys(r).forEach((e) => {
950
+ a(`.addHeader("${e}", "${P(r[e])}")`, 1);
951
+ }), a(".build();", 1), o(), a("Response response = client.newCall(request).execute();"), s();
952
+ }
953
+ }, rt = {
954
+ target: "java",
955
+ client: "okhttp",
956
+ title: "OkHttp",
957
+ generate(e) {
958
+ return F(nt, e);
959
+ }
960
+ }, it = {
961
+ info: {
962
+ key: "unirest",
963
+ title: "Unirest",
964
+ link: "http://unirest.io/java.html",
965
+ description: "Lightweight HTTP Request Client Library"
966
+ },
967
+ convert: ({ method: e, allHeaders: t, postData: n, fullUrl: r }, i) => {
968
+ let { join: a, push: o } = new N({ indent: {
969
+ indent: " ",
970
+ ...i
971
+ }.indent });
972
+ return [
973
+ "GET",
974
+ "POST",
975
+ "PUT",
976
+ "DELETE",
977
+ "PATCH",
978
+ "HEAD",
979
+ "OPTIONS"
980
+ ].includes(e.toUpperCase()) ? o(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${r}")`) : o(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${r}")`), Object.keys(t).forEach((e) => {
981
+ o(`.header("${e}", "${P(t[e])}")`, 1);
982
+ }), n != null && n.text && o(`.body(${JSON.stringify(n.text)})`, 1), o(".asString();", 1), a();
983
+ }
984
+ }, at = {
985
+ target: "java",
986
+ client: "unirest",
987
+ title: "Unirest",
988
+ generate(e) {
989
+ return F(it, e);
990
+ }
991
+ };
992
+ //#endregion
993
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/libs/javascript.js
994
+ function ot(e) {
995
+ return !/^[$A-Z_][0-9A-Z_$]*$/i.test(e);
996
+ }
997
+ function st(e) {
998
+ return e.replaceAll("\\", "\\\\").replaceAll("\n", "\\n").replaceAll("\r", "\\r").replaceAll("'", "\\'");
999
+ }
1000
+ var I = class {
1001
+ constructor(t) {
1002
+ e(this, "value", void 0), this.value = t;
1003
+ }
1004
+ };
1005
+ function L(e, t = 0) {
1006
+ let n = [], r = " ".repeat(t), i = " ".repeat(t + 2);
1007
+ if (Object.keys(e).length === 0) return "{}";
1008
+ for (let [r, a] of Object.entries(e)) {
1009
+ let e = ot(r) ? `'${st(r)}'` : r;
1010
+ if (a instanceof I) {
1011
+ let t = a.value.split("\n"), r = `${a.value}`;
1012
+ t.length > 1 && (r = t.map((e, t) => t === 0 ? e : `${i}${e}`).join("\n")), n.push(`${i}${e}: ${r}`);
1013
+ } else if (Array.isArray(a)) {
1014
+ let r = a.map((e) => typeof e == "string" ? `'${e}'` : e && typeof e == "object" ? L(e) : JSON.stringify(e));
1015
+ if (r.some((e) => e.includes("\n"))) {
1016
+ let a = r.map((e) => ct(e, t + 4)).join(",\n");
1017
+ n.push(`${i}${e}: [\n${a}\n${i}]`);
1018
+ } else n.push(`${i}${e}: [${r.join(", ")}]`);
1019
+ } else if (a && typeof a == "object") n.push(`${i}${e}: ${L(a, t + 2)}`);
1020
+ else if (typeof a == "string") {
1021
+ let t = `'${a}'`;
1022
+ n.push(`${i}${e}: ${t}`);
1023
+ } else n.push(`${i}${e}: ${a}`);
1024
+ }
1025
+ return `{\n${n.join(",\n")}\n${r}}`;
1026
+ }
1027
+ function ct(e, t) {
1028
+ let n = " ".repeat(t);
1029
+ return e.split("\n").map((e) => `${n}${e}`).join("\n");
1030
+ }
1031
+ //#endregion
1032
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/shared/axios.js
1033
+ var R = (e) => e.replaceAll("\\", "\\\\").replaceAll("\n", "\\n").replaceAll("\r", "\\r").replaceAll("'", "\\'"), lt = (e) => typeof e == "string" ? R(e) : Array.isArray(e) ? e.map((e) => lt(e)) : e && typeof e == "object" && !(e instanceof I) ? Object.entries(e).reduce((e, [t, n]) => (e[t] = lt(n), e), {}) : e, ut = (e, t, n) => {
1034
+ if (n === "") {
1035
+ e[t] = n;
1036
+ return;
1037
+ }
1038
+ g(e, t, n);
1039
+ }, dt = (e) => {
1040
+ var t, n;
1041
+ let r = {};
1042
+ return e == null || (t = e.headers) == null || t.forEach((e) => {
1043
+ ut(r, e.name, e.value);
1044
+ }), e != null && (n = e.cookies) != null && n.length && ut(r, "Cookie", e.cookies.map((e) => `${e.name}=${e.value}`).join("; ")), Object.keys(r).length ? r : void 0;
1045
+ }, ft = (e) => {
1046
+ var t, n;
1047
+ let r = [], i = e == null ? void 0 : e.postData;
1048
+ if (!i) return { setup: r };
1049
+ if (i.mimeType === "application/json") {
1050
+ if (!i.text) return { setup: r };
1051
+ try {
1052
+ return {
1053
+ setup: r,
1054
+ data: JSON.parse(i.text)
1055
+ };
1056
+ } catch {
1057
+ return {
1058
+ setup: r,
1059
+ data: i.text
1060
+ };
1061
+ }
1062
+ }
1063
+ return i.mimeType === "application/x-www-form-urlencoded" && (t = i.params) != null && t.length ? (r.push("const encodedParams = new URLSearchParams()"), i.params.forEach((e) => {
1064
+ var t;
1065
+ let n = R(e.name), i = R((t = e.value) == null ? "" : t);
1066
+ r.push(`encodedParams.append('${n}', '${i}')`);
1067
+ }), {
1068
+ setup: r,
1069
+ data: new I("encodedParams")
1070
+ }) : i.mimeType === "multipart/form-data" && (n = i.params) != null && n.length ? (r.push("const formData = new FormData()"), i.params.forEach((e) => {
1071
+ var t;
1072
+ let n = R(e.name);
1073
+ if (e.fileName !== void 0) {
1074
+ let t = R(e.fileName), i = e.contentType ? `, { type: '${R(e.contentType)}' }` : "";
1075
+ r.push(`formData.append('${n}', new Blob([]${i}), '${t}')`);
1076
+ return;
1077
+ }
1078
+ if (e.contentType) {
1079
+ var i;
1080
+ let t = R(e.contentType), a = R((i = e.value) == null ? "" : i);
1081
+ r.push(`formData.append('${n}', new Blob(['${a}'], { type: '${t}' }))`);
1082
+ return;
1083
+ }
1084
+ let a = R((t = e.value) == null ? "" : t);
1085
+ r.push(`formData.append('${n}', '${a}')`);
1086
+ }), {
1087
+ setup: r,
1088
+ data: new I("formData")
1089
+ }) : i.text ? {
1090
+ setup: r,
1091
+ data: i.text
1092
+ } : { setup: r };
1093
+ }, pt = (e) => ({
1094
+ target: e,
1095
+ client: "axios",
1096
+ title: "Axios",
1097
+ generate(e, t) {
1098
+ var n, r, i;
1099
+ let a = {
1100
+ method: "GET",
1101
+ ...e
1102
+ };
1103
+ a.method = a.method.toUpperCase();
1104
+ let o = {
1105
+ method: a.method,
1106
+ url: R((n = a.url) == null ? "" : n)
1107
+ }, s = _(a.queryString);
1108
+ Object.keys(s).length && (o.params = lt(s));
1109
+ let c = dt(a);
1110
+ c && (o.headers = lt(c)), t != null && (r = t.auth) != null && r.username && t != null && (i = t.auth) != null && i.password && (o.auth = {
1111
+ username: R(t.auth.username),
1112
+ password: R(t.auth.password)
1113
+ });
1114
+ let { setup: l, data: u } = ft(a);
1115
+ return u !== void 0 && (o.data = u instanceof I ? u : lt(u)), `import axios from 'axios'
1116
+
1117
+ ${l.length ? `${l.join("\n")}\n\n` : ""}const options = ${L(o)}
1118
+
1119
+ try {
1120
+ const { data } = await axios.request(options)
1121
+ console.log(data)
1122
+ } catch (error) {
1123
+ console.error(error)
1124
+ }`;
1125
+ }
1126
+ }), mt = pt("js"), ht = {
1127
+ target: "js",
1128
+ client: "fetch",
1129
+ title: "Fetch",
1130
+ generate(e) {
1131
+ var t, n;
1132
+ let r = {
1133
+ method: "GET",
1134
+ ...e
1135
+ }, i = "";
1136
+ r.method = r.method.toUpperCase();
1137
+ let a = { method: r.method === "GET" ? void 0 : r.method }, o = d(r.queryString);
1138
+ if ((t = r.headers) != null && t.length && (a.headers = {}, r.headers.forEach((e) => {
1139
+ a.headers[e.name] = e.value;
1140
+ })), (n = r.cookies) != null && n.length && (a.headers = a.headers || {}, r.cookies.forEach((e) => {
1141
+ a.headers["Set-Cookie"] = a.headers["Set-Cookie"] ? `${a.headers["Set-Cookie"]}; ${e.name}=${e.value}` : `${e.name}=${e.value}`;
1142
+ })), Object.keys(a).forEach((e) => {
1143
+ a[e] === void 0 && delete a[e];
1144
+ }), r.postData) {
1145
+ let { mimeType: e, text: t, params: n } = r.postData;
1146
+ if (e === "application/json" && t) try {
1147
+ a.body = new I(`JSON.stringify(${L(JSON.parse(t))})`);
1148
+ } catch {
1149
+ a.body = t;
1150
+ }
1151
+ else e === "multipart/form-data" && n ? (i = "const formData = new FormData()\n", n.forEach((e) => {
1152
+ e.fileName === void 0 ? e.value !== void 0 && (i += `formData.append('${e.name}', '${e.value}')\n`) : i += `formData.append('${e.name}', new Blob([]), '${e.fileName}')\n`;
1153
+ }), i += "\n", a.body = new I("formData")) : a.body = e === "application/x-www-form-urlencoded" && n ? new I(`new URLSearchParams(${L(Object.fromEntries(n.map((e) => [e.name, e.value])))})`) : r.postData.text;
1154
+ }
1155
+ let s = Object.keys(a).length ? `, ${L(a)}` : "";
1156
+ return `${i}fetch('${r.url}${o}'${s})`;
1157
+ }
1158
+ }, { toString: gt } = Object.prototype;
1159
+ function _t(e) {
1160
+ return gt.call(e) === "[object RegExp]";
1161
+ }
1162
+ //#endregion
1163
+ //#region node_modules/.pnpm/is-obj@3.0.0/node_modules/is-obj/index.js
1164
+ function vt(e) {
1165
+ let t = typeof e;
1166
+ return e !== null && (t === "object" || t === "function");
1167
+ }
1168
+ //#endregion
1169
+ //#region node_modules/.pnpm/get-own-enumerable-keys@1.0.0/node_modules/get-own-enumerable-keys/index.js
1170
+ var { propertyIsEnumerable: yt } = Object.prototype;
1171
+ function bt(e) {
1172
+ return [...Object.keys(e), ...Object.getOwnPropertySymbols(e).filter((t) => yt.call(e, t))];
1173
+ }
1174
+ //#endregion
1175
+ //#region node_modules/.pnpm/reserved-identifiers@1.2.0/node_modules/reserved-identifiers/index.js
1176
+ var xt = /* @__PURE__ */ "await.break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.import.in.instanceof.new.null.return.super.switch.this.throw.true.try.typeof.var.void.while.with.yield.implements.interface.let.package.private.protected.public.static.arguments.eval".split("."), St = [
1177
+ "globalThis",
1178
+ "Infinity",
1179
+ "NaN",
1180
+ "undefined"
1181
+ ];
1182
+ function Ct({ includeGlobalProperties: e = !1 } = {}) {
1183
+ return /* @__PURE__ */ new Set([...xt, ...e ? St : []]);
1184
+ }
1185
+ //#endregion
1186
+ //#region node_modules/.pnpm/identifier-regex@1.1.0/node_modules/identifier-regex/index.js
1187
+ var wt = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u, Tt = "(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])", Et = `(?!(?:${[...Ct({ includeGlobalProperties: !0 })].join("|")})(?![$_\\p{ID_Continue}]))`, Dt = /* @__PURE__ */ new Map();
1188
+ function Ot({ exact: e = !0, checkReserved: t = !0 } = {}) {
1189
+ let n = `${e}${t}`, r = Dt.get(n);
1190
+ if (!r) {
1191
+ let i = `${Tt}${t ? Et : ""}${wt.source}`;
1192
+ r = new RegExp(e ? `^${i}$` : i, "u"), Dt.set(n, r);
1193
+ }
1194
+ return r;
1195
+ }
1196
+ //#endregion
1197
+ //#region node_modules/.pnpm/function-timeout@1.0.2/node_modules/function-timeout/browser.js
1198
+ function kt(e) {
1199
+ let t = (...t) => e(...t);
1200
+ return Object.defineProperty(t, "name", {
1201
+ value: `functionTimeout(${e.name || "<anonymous>"})`,
1202
+ configurable: !0
1203
+ }), t;
1204
+ }
1205
+ function At() {
1206
+ return !1;
1207
+ }
1208
+ //#endregion
1209
+ //#region node_modules/.pnpm/web-worker@1.5.0/node_modules/web-worker/src/browser/index.js
1210
+ var jt = typeof Worker < "u" ? Worker : void 0, Mt = class extends Error {
1211
+ constructor(e) {
1212
+ super(e), this.name = "TimeoutError";
1213
+ }
1214
+ }, Nt = class extends Error {
1215
+ constructor(e) {
1216
+ super(), this.name = "AbortError", this.message = e;
1217
+ }
1218
+ }, Pt = (e) => globalThis.DOMException === void 0 ? new Nt(e) : new DOMException(e), Ft = (e) => {
1219
+ let t = e.reason === void 0 ? Pt("This operation was aborted.") : e.reason;
1220
+ return t instanceof Error ? t : Pt(t);
1221
+ };
1222
+ function It(e, t) {
1223
+ let { milliseconds: n, fallback: r, message: i, customTimers: a = {
1224
+ setTimeout,
1225
+ clearTimeout
1226
+ } } = t, o, s, c = new Promise((c, l) => {
1227
+ if (typeof n != "number" || Math.sign(n) !== 1) throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);
1228
+ if (t.signal) {
1229
+ let { signal: e } = t;
1230
+ e.aborted && l(Ft(e)), s = () => {
1231
+ l(Ft(e));
1232
+ }, e.addEventListener("abort", s, { once: !0 });
1233
+ }
1234
+ if (n === Infinity) {
1235
+ e.then(c, l);
1236
+ return;
1237
+ }
1238
+ let u = new Mt();
1239
+ o = a.setTimeout.call(void 0, () => {
1240
+ if (r) {
1241
+ try {
1242
+ c(r());
1243
+ } catch (e) {
1244
+ l(e);
1245
+ }
1246
+ return;
1247
+ }
1248
+ typeof e.cancel == "function" && e.cancel(), i === !1 ? c() : i instanceof Error ? l(i) : (u.message = i == null ? `Promise timed out after ${n} milliseconds` : i, l(u));
1249
+ }, n), (async () => {
1250
+ try {
1251
+ c(await e);
1252
+ } catch (e) {
1253
+ l(e);
1254
+ }
1255
+ })();
1256
+ }).finally(() => {
1257
+ c.clear(), s && t.signal && t.signal.removeEventListener("abort", s);
1258
+ });
1259
+ return c.clear = () => {
1260
+ a.clearTimeout.call(void 0, o), o = void 0;
1261
+ }, c;
1262
+ }
1263
+ //#endregion
1264
+ //#region node_modules/.pnpm/p-event@6.0.1/node_modules/p-event/index.js
1265
+ var Lt = (e) => {
1266
+ let t = e.addEventListener || e.on || e.addListener, n = e.removeEventListener || e.off || e.removeListener;
1267
+ if (!t || !n) throw TypeError("Emitter is not compatible");
1268
+ return {
1269
+ addListener: t.bind(e),
1270
+ removeListener: n.bind(e)
1271
+ };
1272
+ };
1273
+ function Rt(e, t, n) {
1274
+ let r, i = new Promise((i, a) => {
1275
+ var o;
1276
+ if (n = {
1277
+ rejectionEvents: ["error"],
1278
+ multiArgs: !1,
1279
+ resolveImmediately: !1,
1280
+ ...n
1281
+ }, !(n.count >= 0 && (n.count === Infinity || Number.isInteger(n.count)))) throw TypeError("The `count` option should be at least 0 or more");
1282
+ (o = n.signal) == null || o.throwIfAborted();
1283
+ let s = [t].flat(), c = [], { addListener: l, removeListener: u } = Lt(e), d = (...e) => {
1284
+ let t = n.multiArgs ? e : e[0];
1285
+ n.filter && !n.filter(t) || (c.push(t), n.count === c.length && (r(), i(c)));
1286
+ }, f = (e) => {
1287
+ r(), a(e);
1288
+ };
1289
+ r = () => {
1290
+ for (let e of s) u(e, d);
1291
+ for (let e of n.rejectionEvents) u(e, f);
1292
+ };
1293
+ for (let e of s) l(e, d);
1294
+ for (let e of n.rejectionEvents) l(e, f);
1295
+ n.signal && n.signal.addEventListener("abort", () => {
1296
+ f(n.signal.reason);
1297
+ }, { once: !0 }), n.resolveImmediately && i(c);
1298
+ });
1299
+ if (i.cancel = r, typeof n.timeout == "number") {
1300
+ let e = It(i, { milliseconds: n.timeout });
1301
+ return e.cancel = r, e;
1302
+ }
1303
+ return i;
1304
+ }
1305
+ function zt(e, t, n) {
1306
+ typeof n == "function" && (n = { filter: n }), n = {
1307
+ ...n,
1308
+ count: 1,
1309
+ resolveImmediately: !1
1310
+ };
1311
+ let r = Rt(e, t, n), i = r.then((e) => e[0]);
1312
+ return i.cancel = r.cancel, i;
1313
+ }
1314
+ //#endregion
1315
+ //#region node_modules/.pnpm/make-asynchronous@1.1.0/node_modules/make-asynchronous/index.js
1316
+ var Bt, Vt = !!((Bt = globalThis.process) != null && (Bt = Bt.versions) != null && Bt.node), Ht = (e) => new globalThis.Blob([e], { type: "text/javascript" }), Ut = (e) => `data:text/javascript;base64,${globalThis.Buffer.from(e).toString("base64")}`;
1317
+ function Wt(e) {
1318
+ let t, n;
1319
+ return Vt ? n = new jt(Ut(e), { type: "module" }) : (t = URL.createObjectURL(Ht(e)), n = new jt(t, { type: "module" })), {
1320
+ worker: n,
1321
+ cleanup: () => {
1322
+ t && URL.revokeObjectURL(t), n == null || n.terminate();
1323
+ }
1324
+ };
1325
+ }
1326
+ var Gt = (e) => `
1327
+ globalThis.onmessage = async ({data: arguments_}) => {
1328
+ try {
1329
+ const output = await (${e.toString()})(...arguments_);
1330
+ globalThis.postMessage({output});
1331
+ } catch (error) {
1332
+ globalThis.postMessage({error});
1333
+ }
1334
+ };
1335
+ `;
1336
+ function Kt(e) {
1337
+ let t = Gt(e), n = () => Wt(t);
1338
+ async function r({ worker: e, arguments_: t }) {
1339
+ let n = zt(e, "message", { rejectionEvents: ["error", "messageerror"] });
1340
+ e.postMessage(t);
1341
+ let { data: { output: r, error: i } } = await n;
1342
+ if (i) throw i;
1343
+ return r;
1344
+ }
1345
+ let i = async (...e) => {
1346
+ let { worker: t, cleanup: i } = n();
1347
+ try {
1348
+ return await r({
1349
+ arguments_: e,
1350
+ worker: t
1351
+ });
1352
+ } finally {
1353
+ i();
1354
+ }
1355
+ };
1356
+ return i.withSignal = (e) => async (...t) => {
1357
+ e.throwIfAborted();
1358
+ let { worker: i, cleanup: a } = n(), o = zt(e, [], { rejectionEvents: ["abort"] });
1359
+ try {
1360
+ return await Promise.race([r({
1361
+ arguments_: t,
1362
+ worker: i
1363
+ }), o]);
1364
+ } catch (t) {
1365
+ throw e.throwIfAborted(), t;
1366
+ } finally {
1367
+ o.cancel(), a();
1368
+ }
1369
+ }, i;
1370
+ }
1371
+ var qt = (e) => `
1372
+ const nothing = Symbol('nothing');
1373
+ let iterator = nothing;
1374
+
1375
+ globalThis.onmessage = async ({data: arguments_}) => {
1376
+ try {
1377
+ if (iterator === nothing) {
1378
+ iterator = await (${e.toString()})(...arguments_);
1379
+ }
1380
+
1381
+ const output = await iterator.next();
1382
+ globalThis.postMessage({output});
1383
+ } catch (error) {
1384
+ globalThis.postMessage({error});
1385
+ }
1386
+ };
1387
+ `;
1388
+ function Jt(e) {
1389
+ let t = qt(e), n = () => Wt(t), r = (...e) => ({ async *[Symbol.asyncIterator]() {
1390
+ let { worker: t, cleanup: r } = n();
1391
+ try {
1392
+ let n = !0;
1393
+ for (;;) {
1394
+ let r = zt(t, "message", { rejectionEvents: ["error", "messageerror"] });
1395
+ t.postMessage(n ? e : void 0), n = !1;
1396
+ let { data: { output: i, error: a } } = await r;
1397
+ if (a) throw a;
1398
+ let { value: o, done: s } = i;
1399
+ if (s) break;
1400
+ yield o;
1401
+ }
1402
+ } finally {
1403
+ r();
1404
+ }
1405
+ } });
1406
+ return r.withSignal = (e) => (...t) => ({ async *[Symbol.asyncIterator]() {
1407
+ e.throwIfAborted();
1408
+ let { worker: r, cleanup: i } = n(), a = zt(e, [], { rejectionEvents: ["abort"] });
1409
+ try {
1410
+ let e = !0;
1411
+ for (;;) {
1412
+ let n = Promise.race([zt(r, "message", { rejectionEvents: ["error", "messageerror"] }), a]);
1413
+ r.postMessage(e ? t : void 0), e = !1;
1414
+ let { data: { output: i, error: o } } = await n;
1415
+ if (o) throw o;
1416
+ let { value: s, done: c } = i;
1417
+ if (c) break;
1418
+ yield s;
1419
+ }
1420
+ } catch (t) {
1421
+ throw e.throwIfAborted(), t;
1422
+ } finally {
1423
+ a.cancel(), i();
1424
+ }
1425
+ } }), r;
1426
+ }
1427
+ //#endregion
1428
+ //#region node_modules/.pnpm/super-regex@1.1.0/node_modules/super-regex/index.js
1429
+ var Yt = {}, Xt = (e) => {
1430
+ if (e === void 0 || Number.isNaN(e)) return;
1431
+ let t = Math.max(1, Math.trunc(Math.abs(e)));
1432
+ if (Number.isFinite(t)) return t;
1433
+ };
1434
+ function Zt(e, t, { timeout: n, throwOnTimeout: r } = {}) {
1435
+ try {
1436
+ return kt(() => structuredClone(e).test(t), {
1437
+ timeout: Xt(n),
1438
+ context: Yt
1439
+ })();
1440
+ } catch (e) {
1441
+ if (At(e) && !r) return !1;
1442
+ throw e;
1443
+ }
1444
+ }
1445
+ Kt((e, t, n) => new RegExp(e, t).test(n)), Kt((e, t, n) => {
1446
+ var r;
1447
+ let i = new RegExp(e, t).exec(n);
1448
+ if (i !== null) return {
1449
+ match: i[0],
1450
+ index: i.index,
1451
+ groups: i.slice(1),
1452
+ namedGroups: (r = i.groups) == null ? {} : r,
1453
+ input: i.input
1454
+ };
1455
+ }), Jt(function* (e, t, n) {
1456
+ let r = new RegExp(e, t), i = n.matchAll(r);
1457
+ for (let e of i) {
1458
+ var a;
1459
+ yield {
1460
+ match: e[0],
1461
+ index: e.index,
1462
+ groups: e.slice(1),
1463
+ namedGroups: (a = e.groups) == null ? {} : a,
1464
+ input: e.input
1465
+ };
1466
+ }
1467
+ });
1468
+ //#endregion
1469
+ //#region node_modules/.pnpm/is-identifier@1.1.0/node_modules/is-identifier/index.js
1470
+ function Qt(e, { checkReserved: t = !0 } = {}) {
1471
+ if (typeof e != "string") throw TypeError(`Expected a string, got \`${typeof e}\`.`);
1472
+ return e.length > 1e5 ? !1 : Zt(Ot({ checkReserved: t }), e, { timeout: 1e3 });
1473
+ }
1474
+ //#endregion
1475
+ //#region node_modules/.pnpm/stringify-object@6.0.0/node_modules/stringify-object/index.js
1476
+ var $t = {
1477
+ "\n": String.raw`\n`,
1478
+ "\r": String.raw`\r`,
1479
+ " ": String.raw`\t`,
1480
+ "\b": String.raw`\b`,
1481
+ "\f": String.raw`\f`,
1482
+ "\v": String.raw`\v`,
1483
+ "\0": String.raw`\0`
1484
+ };
1485
+ function en(e, t, n) {
1486
+ let r = [];
1487
+ return (function e(t, n = {}, i = "") {
1488
+ let a = n.indent || " ", o;
1489
+ o = n.inlineCharacterLimit === void 0 ? {
1490
+ newline: "\n",
1491
+ newlineOrSpace: "\n",
1492
+ pad: i,
1493
+ indent: i + a
1494
+ } : {
1495
+ newline: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
1496
+ newlineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
1497
+ pad: "@@__STRINGIFY_OBJECT_PAD__@@",
1498
+ indent: "@@__STRINGIFY_OBJECT_INDENT__@@"
1499
+ };
1500
+ let s = (e) => {
1501
+ if (n.inlineCharacterLimit === void 0) return e;
1502
+ let t = e.replaceAll(o.newline, "").replaceAll(o.newlineOrSpace, " ").replaceAll(o.pad, "").replaceAll(o.indent, "");
1503
+ return t.length <= n.inlineCharacterLimit ? t : e.replaceAll(o.newline, "\n").replaceAll(o.newlineOrSpace, "\n").replaceAll(o.pad, i).replaceAll(o.indent, i + a);
1504
+ };
1505
+ if (r.includes(t)) return "\"[Circular]\"";
1506
+ let c = typeof t;
1507
+ if (t == null || c === "number" || c === "boolean" || c === "function" || _t(t)) return String(t);
1508
+ if (c === "bigint") return String(t) + "n";
1509
+ if (c === "symbol") {
1510
+ let { description: r } = t;
1511
+ if (r === void 0) return "Symbol()";
1512
+ if (r != null && r.startsWith("Symbol.") && Symbol[r.slice(7)] === t) return r;
1513
+ let i = Symbol.keyFor(t);
1514
+ return i === void 0 ? `Symbol(${e(r, n)})` : `Symbol.for(${e(i, n)})`;
1515
+ }
1516
+ if (t instanceof Date) return Number.isNaN(t.getTime()) ? "new Date('Invalid Date')" : `new Date('${t.toISOString()}')`;
1517
+ if (t instanceof Map || t instanceof Set) {
1518
+ let c = t instanceof Map, l = c ? "Map" : "Set";
1519
+ if (t.size === 0) return `new ${l}()`;
1520
+ r.push(t);
1521
+ let u = [...t].map((t) => {
1522
+ if (c) {
1523
+ let [r, s] = t;
1524
+ return o.indent + `[${e(r, n, i + a)}, ${e(s, n, i + a)}]`;
1525
+ }
1526
+ return o.indent + e(t, n, i + a);
1527
+ }).join("," + o.newlineOrSpace);
1528
+ return r.pop(), s(`new ${l}([${o.newline}${u}${o.newline}${o.pad}])`);
1529
+ }
1530
+ if (Array.isArray(t)) {
1531
+ if (t.length === 0) return "[]";
1532
+ r.push(t);
1533
+ let c = t.map((r, s) => {
1534
+ let c = e(r, n, i + a);
1535
+ return n.transform && (c = n.transform(t, s, c)), o.indent + c;
1536
+ }).join("," + o.newlineOrSpace);
1537
+ return r.pop(), s(`[${o.newline}${c}${o.newline}${o.pad}]`);
1538
+ }
1539
+ if (vt(t)) {
1540
+ let c = bt(t);
1541
+ if (n.filter && (c = c.filter((e) => n.filter(t, e))), c.length === 0) return "{}";
1542
+ r.push(t);
1543
+ let l = c.map((r) => {
1544
+ let s = typeof r == "symbol", c;
1545
+ c = s ? `[${e(r, n)}]` : Qt(r) ? r : e(r, n);
1546
+ let l = e(t[r], n, i + a);
1547
+ return n.transform && (l = n.transform(t, r, l)), o.indent + c + ": " + l;
1548
+ }).join("," + o.newlineOrSpace);
1549
+ return r.pop(), s(`{${o.newline}${l}${o.newline}${o.pad}}`);
1550
+ }
1551
+ let l = String(t).replaceAll("\\", "\\\\").replaceAll(/[\u0000-\u001F\u007F]/g, (e) => {
1552
+ var t;
1553
+ return (t = $t[e]) == null ? `\\u${e.codePointAt(0).toString(16).padStart(4, "0")}` : t;
1554
+ });
1555
+ return n.singleQuotes === !1 ? `"${l.replaceAll("\"", String.raw`\"`)}"` : `'${l.replaceAll("'", String.raw`\'`)}'`;
1556
+ })(e, t, n);
1557
+ }
1558
+ //#endregion
1559
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/httpsnippet-lite/helpers/headers.js
1560
+ var tn = (e, t) => Object.keys(e).find((e) => e.toLowerCase() === t.toLowerCase()), nn = (e, t) => {
1561
+ let n = tn(e, t);
1562
+ if (n) return e[n];
1563
+ }, rn = (e, t) => !!tn(e, t), an = {
1564
+ info: {
1565
+ key: "jquery",
1566
+ title: "jQuery",
1567
+ link: "http://api.jquery.com/jquery.ajax/",
1568
+ description: "Perform an asynchronous HTTP (Ajax) requests with jQuery"
1569
+ },
1570
+ convert: ({ fullUrl: e, method: t, allHeaders: n, postData: r }, i) => {
1571
+ let a, o = {
1572
+ indent: " ",
1573
+ ...i
1574
+ }, { blank: s, push: c, join: l } = new N({ indent: o.indent }), u = {
1575
+ async: !0,
1576
+ crossDomain: !0,
1577
+ url: e,
1578
+ method: t,
1579
+ headers: n
1580
+ };
1581
+ switch (r == null ? void 0 : r.mimeType) {
1582
+ case "application/x-www-form-urlencoded":
1583
+ u.data = r != null && r.paramsObj ? r.paramsObj : r.text;
1584
+ break;
1585
+ case "application/json":
1586
+ u.processData = !1, u.data = r.text;
1587
+ break;
1588
+ case "multipart/form-data":
1589
+ if (!(r != null && r.params)) break;
1590
+ if (c("const form = new FormData();"), r.params.forEach((e) => {
1591
+ c(`form.append('${e.name}', '${e.value || e.fileName || ""}');`);
1592
+ }), u.processData = !1, u.contentType = !1, u.mimeType = "multipart/form-data", u.data = "[form]", rn(n, "content-type") && (a = nn(n, "content-type")) != null && a.includes("boundary")) {
1593
+ let e = tn(n, "content-type");
1594
+ e && delete u.headers[e];
1595
+ }
1596
+ s();
1597
+ break;
1598
+ default: r != null && r.text && (u.data = r.text);
1599
+ }
1600
+ return c(`const settings = ${en(u, { indent: o.indent }).replace("'[form]'", "form")};`), s(), c("$.ajax(settings).done(function (response) {"), c("console.log(response);", 1), c("});"), l();
1601
+ }
1602
+ }, on = {
1603
+ target: "js",
1604
+ client: "jquery",
1605
+ title: "jQuery",
1606
+ generate(e) {
1607
+ return F(an, e);
1608
+ }
1609
+ }, sn = {
1610
+ target: "js",
1611
+ client: "ofetch",
1612
+ title: "ofetch",
1613
+ generate(e) {
1614
+ var t, n, r;
1615
+ let i = {
1616
+ method: "GET",
1617
+ ...e
1618
+ };
1619
+ i.method = i.method.toUpperCase();
1620
+ let a = { method: i.method === "GET" ? void 0 : i.method };
1621
+ (t = i.queryString) != null && t.length && (a.query = _(i.queryString)), (n = i.headers) != null && n.length && (a.headers = {}, i.headers.forEach((e) => {
1622
+ a.headers[e.name] = e.value;
1623
+ })), (r = i.cookies) != null && r.length && (a.headers = a.headers || {}, i.cookies.forEach((e) => {
1624
+ a.headers["Set-Cookie"] = a.headers["Set-Cookie"] ? `${a.headers["Set-Cookie"]}; ${e.name}=${e.value}` : `${e.name}=${e.value}`;
1625
+ })), Object.keys(a).forEach((e) => {
1626
+ a[e] === void 0 && delete a[e];
1627
+ }), i.postData && (a.body = i.postData.text, i.postData.mimeType === "application/json" && (a.body = JSON.parse(a.body)));
1628
+ let o = Object.keys(a).length ? `, ${L(a)}` : "";
1629
+ return `import { ofetch } from 'ofetch'
1630
+
1631
+ ofetch('${i.url}'${o})`;
1632
+ }
1633
+ }, cn = {
1634
+ info: {
1635
+ key: "xhr",
1636
+ title: "XMLHttpRequest",
1637
+ link: "https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",
1638
+ description: "W3C Standard API that provides scripted client functionality"
1639
+ },
1640
+ convert: ({ postData: e, allHeaders: t, method: n, fullUrl: r }, i) => {
1641
+ let a, o = {
1642
+ indent: " ",
1643
+ cors: !0,
1644
+ ...i
1645
+ }, { blank: s, push: c, join: l } = new N({ indent: o.indent });
1646
+ switch (e == null ? void 0 : e.mimeType) {
1647
+ case "application/json":
1648
+ c(`const data = JSON.stringify(${en(e == null ? void 0 : e.jsonObj, { indent: o.indent })});`), s();
1649
+ break;
1650
+ case "multipart/form-data":
1651
+ if (!(e != null && e.params)) break;
1652
+ if (c("const data = new FormData();"), e.params.forEach((e) => {
1653
+ c(`data.append('${e.name}', '${e.value || e.fileName || ""}');`);
1654
+ }), rn(t, "content-type") && (a = nn(t, "content-type")) != null && a.includes("boundary")) {
1655
+ let e = tn(t, "content-type");
1656
+ e && delete t[e];
1657
+ }
1658
+ s();
1659
+ break;
1660
+ default: c(`const data = ${e != null && e.text ? `'${e.text}'` : "null"};`), s();
1661
+ }
1662
+ return c("const xhr = new XMLHttpRequest();"), o.cors && c("xhr.withCredentials = true;"), s(), c("xhr.addEventListener('readystatechange', function () {"), c("if (this.readyState === this.DONE) {", 1), c("console.log(this.responseText);", 2), c("}", 1), c("});"), s(), c(`xhr.open('${n}', '${r}');`), Object.keys(t).forEach((e) => {
1663
+ c(`xhr.setRequestHeader('${e}', '${Ze(t[e])}');`);
1664
+ }), s(), c("xhr.send(data);"), l();
1665
+ }
1666
+ }, ln = {
1667
+ target: "js",
1668
+ client: "xhr",
1669
+ title: "XHR",
1670
+ generate(e) {
1671
+ return F(cn, e);
1672
+ }
1673
+ }, un = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\$/g, "\\$").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"), z = (e) => `"${un(e)}"`, dn = (e, t) => `${" ".repeat(e * 4)}${t}`, fn = (e, t, n, r) => {
1674
+ if (e.length === 0) return `${t}${n}`;
1675
+ let [i] = e;
1676
+ return e.length === 1 && i && !i.includes("\n") ? `${t}${i}${n}` : `${t}\n${e.map((e) => dn(r + 1, e)).join(",\n")}\n${dn(r, n)}`;
1677
+ }, pn = (e, t) => fn(e.map(({ name: e, value: t }) => `${z(e)} => ${z(t)}`), "[", "]", t), mn = (e, t) => fn(e.map(({ name: e, value: t }) => `${z(e)} => ${z(t)}`), "Dict(", ")", t), hn = (e, t) => e == null ? "nothing" : typeof e == "boolean" ? e ? "true" : "false" : typeof e == "number" ? Number.isFinite(e) ? String(e) : "nothing" : typeof e == "string" ? z(e) : Array.isArray(e) ? fn(e.map((e) => hn(e, t + 1)), "[", "]", t) : typeof e == "object" ? fn(Object.entries(e).map(([e, n]) => `${z(e)} => ${hn(n, t + 1)}`), "Dict(", ")", t) : z(String(e)), gn = [
1678
+ "POST",
1679
+ "PUT",
1680
+ "PATCH",
1681
+ "DELETE",
1682
+ "QUERY"
1683
+ ], _n = [
1684
+ "GET",
1685
+ "HEAD",
1686
+ "OPTIONS"
1687
+ ], B = 1, vn = (e) => {
1688
+ let t = z(e.name);
1689
+ if (e.fileName === void 0) {
1690
+ var n;
1691
+ return `${t} => ${z((n = e.value) == null ? "" : n)}`;
1692
+ }
1693
+ let r = z(e.fileName), i = [r, `open(${r})`];
1694
+ return e.contentType && i.push(z(e.contentType)), `${t} => HTTP.Multipart(${i.join(", ")})`;
1695
+ }, yn = (e) => {
1696
+ if (!e) return;
1697
+ let { mimeType: t, text: n, params: r } = e;
1698
+ if (t === "application/json" && n) try {
1699
+ return {
1700
+ value: `JSON.json(${hn(JSON.parse(n), B)})`,
1701
+ packages: ["JSON"],
1702
+ omitContentType: !1
1703
+ };
1704
+ } catch {}
1705
+ if (t === "multipart/form-data" && r != null && r.length) return {
1706
+ value: fn(r.map(vn), "HTTP.Form([", "])", B),
1707
+ packages: [],
1708
+ omitContentType: !0
1709
+ };
1710
+ if (t === "application/x-www-form-urlencoded" && r != null && r.length) return {
1711
+ value: mn(r.map((e) => {
1712
+ var t;
1713
+ return {
1714
+ name: e.name,
1715
+ value: (t = e.value) == null ? "" : t
1716
+ };
1717
+ }), B),
1718
+ packages: [],
1719
+ omitContentType: !1
1720
+ };
1721
+ if (n) return {
1722
+ value: z(n),
1723
+ packages: [],
1724
+ omitContentType: !1
1725
+ };
1726
+ }, bn = (e, t, n, r) => {
1727
+ let i = [...t, ...n];
1728
+ if (n.length === 0 && r.length === 0) return [`response = ${e}(${i.join(", ")})`];
1729
+ let a = [`response = ${e}(`];
1730
+ return i.forEach((e, t) => {
1731
+ let n = t === i.length - 1 ? r.length ? ";" : "" : ",";
1732
+ a.push(`${dn(B, e)}${n}`);
1733
+ }), r.forEach((e, t) => {
1734
+ a.push(`${dn(B, e)}${t === r.length - 1 ? "" : ","}`);
1735
+ }), a.push(")"), a;
1736
+ }, xn = {
1737
+ target: "julia",
1738
+ client: "http",
1739
+ title: "HTTP.jl",
1740
+ generate(e, t) {
1741
+ var n, r, i, a, o, s;
1742
+ let c = {
1743
+ url: "https://example.com",
1744
+ ...e
1745
+ }, l = f(c.method), u = yn(c.postData), d = /* @__PURE__ */ new Map();
1746
+ for (let e of (n = c.headers) == null ? [] : n) {
1747
+ var p;
1748
+ !e.name || u != null && u.omitContentType && e.name.toLowerCase() === "content-type" || d.set(e.name, (p = e.value) == null ? "" : p);
1749
+ }
1750
+ let m = [...gn, ..._n].includes(l) ? l.toLowerCase() : void 0, h = m ? `HTTP.${m}` : "HTTP.request", g = z(c.url), _ = m ? [g] : [z(l), g], v = [], y = [];
1751
+ if (d.size && v.push(pn([...d].map(([e, t]) => ({
1752
+ name: e,
1753
+ value: t
1754
+ })), B)), u && (_n.includes(l) || d.size === 0 ? y.push(`body = ${u.value}`) : v.push(u.value)), (r = c.queryString) != null && r.length && y.push(`query = ${pn(c.queryString, B)}`), (i = c.cookies) != null && i.length && y.push(`cookies = ${mn(c.cookies, B)}`), t != null && (a = t.auth) != null && a.username && t != null && (o = t.auth) != null && o.password) {
1755
+ let { username: e, password: n } = t.auth;
1756
+ y.push(`basicauth = (${z(e)}, ${z(n)})`);
1757
+ }
1758
+ return [
1759
+ ...["HTTP", ...(s = u == null ? void 0 : u.packages) == null ? [] : s].map((e) => `using ${e}`),
1760
+ "",
1761
+ ...bn(h, _, v, y),
1762
+ "",
1763
+ "println(String(response.body))"
1764
+ ].join("\n");
1765
+ }
1766
+ }, Sn = [
1767
+ "GET",
1768
+ "POST",
1769
+ "PUT",
1770
+ "DELETE",
1771
+ "PATCH",
1772
+ "HEAD"
1773
+ ], Cn = [
1774
+ "POST",
1775
+ "PUT",
1776
+ "DELETE",
1777
+ "PATCH"
1778
+ ], V = (e) => `"${P(e)}"`, wn = {
1779
+ target: "kotlin",
1780
+ client: "okhttp",
1781
+ title: "OkHttp",
1782
+ generate(e, t) {
1783
+ var n, r, i;
1784
+ let a = f(e == null ? void 0 : e.method), o = p(m((n = e == null ? void 0 : e.url) == null ? "" : n, e == null ? void 0 : e.queryString)), s = e == null ? void 0 : e.postData, c = ["val client = OkHttpClient()", ""], l = !1;
1785
+ if ((s == null ? void 0 : s.mimeType) === "application/x-www-form-urlencoded" && s.params) c.push("val body = FormBody.Builder()"), s.params.forEach((e) => {
1786
+ var t, n;
1787
+ c.push(` .addEncoded(${V((t = e.name) == null ? "" : t)}, ${V((n = e.value) == null ? "" : n)})`);
1788
+ }), c.push(" .build()", ""), l = !0;
1789
+ else if ((s == null ? void 0 : s.mimeType) === "multipart/form-data" && s.params) c.push("val body = MultipartBody.Builder()", " .setType(MultipartBody.FORM)"), s.params.forEach((e) => {
1790
+ if (e.fileName !== void 0) {
1791
+ var t;
1792
+ c.push(` .addFormDataPart(${V((t = e.name) == null ? "" : t)}, ${V(e.fileName)}, RequestBody.create(MediaType.parse("application/octet-stream"), File(${V(e.fileName)})))`);
1793
+ } else if (e.value !== void 0) {
1794
+ var n;
1795
+ c.push(` .addFormDataPart(${V((n = e.name) == null ? "" : n)}, ${V(e.value)})`);
1796
+ }
1797
+ }), c.push(" .build()", ""), l = !0;
1798
+ else if (s) {
1799
+ var u, d;
1800
+ c.push(`val mediaType = MediaType.parse(${V((u = s.mimeType) == null ? "" : u)})`), c.push(`val body = RequestBody.create(mediaType, ${JSON.stringify((d = s.text) == null ? "" : d)})`), l = !0;
1801
+ }
1802
+ c.push("val request = Request.Builder()", ` .url(${V(o)})`);
1803
+ let g = l ? "body" : "null";
1804
+ return Sn.includes(a) ? Cn.includes(a) ? c.push(` .${a.toLowerCase()}(${g})`) : c.push(` .${a.toLowerCase()}()`) : c.push(` .method(${V(a)}, ${g})`), t != null && (r = t.auth) != null && r.username && t != null && (i = t.auth) != null && i.password && c.push(` .addHeader("Authorization", Credentials.basic(${V(t.auth.username)}, ${V(t.auth.password)}))`), h(e == null ? void 0 : e.headers, e == null ? void 0 : e.cookies).forEach((e) => {
1805
+ c.push(` .addHeader(${V(e.name)}, ${V(e.value)})`);
1806
+ }), c.push(" .build()", "", "val response = client.newCall(request).execute()"), c.join("\n");
1807
+ }
1808
+ }, Tn = pt("node"), En = {
1809
+ target: "node",
1810
+ client: "fetch",
1811
+ title: "Fetch",
1812
+ generate(e) {
1813
+ var t, n;
1814
+ let r = {
1815
+ method: "GET",
1816
+ ...e
1817
+ }, i = "";
1818
+ r.method = r.method.toUpperCase();
1819
+ let a = { method: r.method === "GET" ? void 0 : r.method }, o = d(r.queryString);
1820
+ if ((t = r.headers) != null && t.length && (a.headers = {}, r.headers.forEach((e) => {
1821
+ a.headers[e.name] = e.value;
1822
+ })), (n = r.cookies) != null && n.length && (a.headers = a.headers || {}, r.cookies.forEach((e) => {
1823
+ a.headers["Set-Cookie"] = a.headers["Set-Cookie"] ? `${a.headers["Set-Cookie"]}; ${e.name}=${e.value}` : `${e.name}=${e.value}`;
1824
+ })), Object.keys(a).forEach((e) => {
1825
+ a[e] === void 0 && delete a[e];
1826
+ }), r.postData) {
1827
+ let { mimeType: e, text: t, params: n } = r.postData, o = !1;
1828
+ if (e === "application/json" && t) try {
1829
+ a.body = new I(`JSON.stringify(${L(JSON.parse(t))})`);
1830
+ } catch {
1831
+ a.body = t;
1832
+ }
1833
+ else e === "multipart/form-data" && n ? (i = "const formData = new FormData()\n", n.forEach((e) => {
1834
+ e.fileName === void 0 ? e.value !== void 0 && (i += `formData.append('${e.name}', '${e.value}')\n`) : (o || (i = `import fs from 'node:fs'\n\n${i}`, o = !0), i += `formData.append('${e.name}', new Blob([fs.readFileSync('${e.fileName}')]), '${e.fileName}')\n`);
1835
+ }), i += "\n", a.body = new I("formData")) : a.body = e === "application/x-www-form-urlencoded" && n ? new I(`new URLSearchParams(${L(Object.fromEntries(n.map((e) => [e.name, e.value])))})`) : r.postData.text;
1836
+ }
1837
+ let s = Object.keys(a).length ? `, ${L(a)}` : "";
1838
+ return `${i}fetch('${r.url}${o}'${s})`;
1839
+ }
1840
+ }, Dn = {
1841
+ target: "node",
1842
+ client: "ofetch",
1843
+ title: "ofetch",
1844
+ generate(e) {
1845
+ var t, n, r;
1846
+ let i = {
1847
+ method: "GET",
1848
+ ...e
1849
+ };
1850
+ i.method = i.method.toUpperCase();
1851
+ let a = { method: i.method === "GET" ? void 0 : i.method };
1852
+ (t = i.queryString) != null && t.length && (a.query = _(i.queryString)), (n = i.headers) != null && n.length && (a.headers = {}, i.headers.forEach((e) => {
1853
+ a.headers[e.name] = e.value;
1854
+ })), (r = i.cookies) != null && r.length && (a.headers = a.headers || {}, i.cookies.forEach((e) => {
1855
+ a.headers["Set-Cookie"] = a.headers["Set-Cookie"] ? `${a.headers["Set-Cookie"]}; ${e.name}=${e.value}` : `${e.name}=${e.value}`;
1856
+ })), Object.keys(a).forEach((e) => {
1857
+ a[e] === void 0 && delete a[e];
1858
+ }), i.postData && (a.body = i.postData.text, i.postData.mimeType === "application/json" && (a.body = JSON.parse(a.body)));
1859
+ let o = Object.keys(a).length ? `, ${L(a)}` : "";
1860
+ return `import { ofetch } from 'ofetch'
1861
+
1862
+ ofetch('${i.url}'${o})`;
1863
+ }
1864
+ }, On = {
1865
+ target: "node",
1866
+ client: "undici",
1867
+ title: "undici",
1868
+ generate(e) {
1869
+ var t, n;
1870
+ let r = {
1871
+ method: "GET",
1872
+ ...e
1873
+ };
1874
+ r.method = r.method.toUpperCase();
1875
+ let i = { method: r.method === "GET" ? void 0 : r.method }, a = d(r.queryString);
1876
+ (t = r.headers) != null && t.length && (i.headers = {}, r.headers.forEach((e) => {
1877
+ i.headers[e.name] = e.value;
1878
+ })), (n = r.cookies) != null && n.length && (i.headers = i.headers || {}, r.cookies.forEach((e) => {
1879
+ i.headers["Set-Cookie"] = i.headers["Set-Cookie"] ? `${i.headers["Set-Cookie"]}; ${e.name}=${e.value}` : `${e.name}=${e.value}`;
1880
+ })), Object.keys(i).forEach((e) => {
1881
+ i[e] === void 0 && delete i[e];
1882
+ }), r.postData && (i.body = r.postData.text, r.postData.mimeType === "application/json" && (i.body = new I(`JSON.stringify(${L(JSON.parse(i.body))})`)));
1883
+ let o = Object.keys(i).length ? `, ${L(i)}` : "";
1884
+ return `import { request } from 'undici'
1885
+
1886
+ const { statusCode, body } = await request('${r.url}${a}'${o})`;
1887
+ }
1888
+ }, kn = "---011000010111000001101001", H = (e) => `@"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t")}"`, An = (e, t) => {
1889
+ let n = t === void 0 ? ", " : `,\n ${" ".repeat(t)}`;
1890
+ switch (Object.prototype.toString.call(e)) {
1891
+ case "[object Number]": return `@${e}`;
1892
+ case "[object Array]": return `@[ ${e.map((e) => An(e)).join(n)} ]`;
1893
+ case "[object Object]": return `@{ ${Object.entries(e).map(([e, t]) => `@"${e}": ${An(t)}`).join(n)} }`;
1894
+ case "[object Boolean]": return e ? "@YES" : "@NO";
1895
+ default: return e == null ? "[NSNull null]" : H(e.toString());
1896
+ }
1897
+ }, jn = (e, t, n) => {
1898
+ let r = `${e} *${t} = `;
1899
+ return `${r}${An(n, r.length)};`;
1900
+ }, Mn = {
1901
+ target: "objc",
1902
+ client: "nsurlsession",
1903
+ title: "NSURLSession",
1904
+ generate(e, t) {
1905
+ var n, r, i;
1906
+ if (!e) return "";
1907
+ let a = f(e.method), o = p(m((n = e.url) == null ? "" : n, e.queryString)), s = h(e.headers, e.cookies), c = ["#import <Foundation/Foundation.h>"], l = s.length > 0;
1908
+ if (l) {
1909
+ let e = Object.fromEntries(s.map((e) => [e.name, e.value]));
1910
+ c.push("", jn("NSDictionary", "headers", e));
1911
+ }
1912
+ let u = !1;
1913
+ if (e.postData) {
1914
+ let { mimeType: t, text: n, params: r } = e.postData;
1915
+ if (t === "application/json" && n !== void 0) try {
1916
+ let e = JSON.parse(n);
1917
+ c.push("", jn("NSDictionary", "parameters", e)), c.push("", "NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"), u = !0;
1918
+ } catch {
1919
+ c.push("", `NSData *postData = [${H(n)} dataUsingEncoding:NSUTF8StringEncoding];`), u = !0;
1920
+ }
1921
+ else if (t === "application/x-www-form-urlencoded" && r != null && r.length) {
1922
+ var d;
1923
+ u = !0;
1924
+ let [e, ...t] = r;
1925
+ c.push("", `NSMutableData *postData = [[NSMutableData alloc] initWithData:[${H(`${encodeURIComponent(e.name)}=${encodeURIComponent((d = e.value) == null ? "" : d)}`)} dataUsingEncoding:NSUTF8StringEncoding]];`), t.forEach((e) => {
1926
+ var t;
1927
+ c.push(`[postData appendData:[${H(`&${encodeURIComponent(e.name)}=${encodeURIComponent((t = e.value) == null ? "" : t)}`)} dataUsingEncoding:NSUTF8StringEncoding]];`);
1928
+ });
1929
+ } else t === "multipart/form-data" && r != null && r.length ? (u = !0, c.push("", jn("NSArray", "parameters", r), `NSString *boundary = @"${kn}";`, "", "NSError *error;", "NSMutableString *body = [NSMutableString string];", "for (NSDictionary *param in parameters) {", " [body appendFormat:@\"--%@\\r\\n\", boundary];", " if (param[@\"fileName\"]) {", " [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"; filename=\\\"%@\\\"\\r\\n\", param[@\"name\"], param[@\"fileName\"]];", " [body appendFormat:@\"Content-Type: %@\\r\\n\\r\\n\", param[@\"contentType\"]];", " [body appendFormat:@\"%@\", [NSString stringWithContentsOfFile:param[@\"fileName\"] encoding:NSUTF8StringEncoding error:&error]];", " if (error) {", " NSLog(@\"%@\", error);", " }", " } else {", " [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"\\r\\n\\r\\n\", param[@\"name\"]];", " [body appendFormat:@\"%@\", param[@\"value\"]];", " }", "}", "[body appendFormat:@\"\\r\\n--%@--\\r\\n\", boundary];", "NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];")) : t === "application/octet-stream" ? (u = !0, c.push("", `NSData *postData = [${H(n == null ? "" : n)} dataUsingEncoding:NSUTF8StringEncoding];`)) : n !== void 0 && (u = !0, c.push("", `NSData *postData = [${H(n)} dataUsingEncoding:NSUTF8StringEncoding];`));
1930
+ }
1931
+ if (c.push("", `NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:${H(o)}]`, " cachePolicy:NSURLRequestUseProtocolCachePolicy", " timeoutInterval:10.0];", `[request setHTTPMethod:@"${a}"];`), l && c.push("[request setAllHTTPHeaderFields:headers];"), u && c.push("[request setHTTPBody:postData];"), t != null && (r = t.auth) != null && r.username && t != null && (i = t.auth) != null && i.password) {
1932
+ let e = H(`${t.auth.username}:${t.auth.password}`);
1933
+ c.push(`NSData *authData = [${e} dataUsingEncoding:NSUTF8StringEncoding];`, "NSString *authValue = [NSString stringWithFormat:@\"Basic %@\", [authData base64EncodedStringWithOptions:0]];", "[request setValue:authValue forHTTPHeaderField:@\"Authorization\"];");
1934
+ }
1935
+ return c.push("", "NSURLSession *session = [NSURLSession sharedSession];", "NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request", "completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {", " if (error) {", " NSLog(@\"%@\", error);", " } else {", " NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;", " NSLog(@\"%@\", httpResponse);", " }", "}];", "[dataTask resume];"), c.join("\n");
1936
+ }
1937
+ }, Nn = {
1938
+ info: {
1939
+ key: "cohttp",
1940
+ title: "CoHTTP",
1941
+ link: "https://github.com/mirage/ocaml-cohttp",
1942
+ description: "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml"
1943
+ },
1944
+ convert: ({ fullUrl: e, allHeaders: t, postData: n, method: r }, i) => {
1945
+ let a = {
1946
+ indent: " ",
1947
+ ...i
1948
+ }, o = [
1949
+ "get",
1950
+ "post",
1951
+ "head",
1952
+ "delete",
1953
+ "patch",
1954
+ "put",
1955
+ "options"
1956
+ ], { push: s, blank: c, join: l } = new N({ indent: a.indent });
1957
+ s("open Cohttp_lwt_unix"), s("open Cohttp"), s("open Lwt"), c(), s(`let uri = Uri.of_string "${e}" in`);
1958
+ let u = Object.keys(t);
1959
+ return u.length === 1 ? s(`let headers = Header.add (Header.init ()) "${u[0]}" "${P(t[u[0]])}" in`) : u.length > 1 && (s("let headers = Header.add_list (Header.init ()) ["), u.forEach((e) => {
1960
+ s(`("${e}", "${P(t[e])}");`, 1);
1961
+ }), s("] in")), n != null && n.text && s(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(n.text)} in`), c(), s(`Client.call ${u.length ? "~headers " : ""}${n != null && n.text ? "~body " : ""}${o.includes(r.toLowerCase()) ? `\`${r.toUpperCase()}` : `(Code.method_of_string "${r}")`} uri`), s(">>= fun (res, body_stream) ->"), s("(* Do stuff with the result *)", 1), l();
1962
+ }
1963
+ }, Pn = {
1964
+ target: "ocaml",
1965
+ client: "cohttp",
1966
+ title: "Cohttp",
1967
+ generate(e) {
1968
+ return F(Nn, e);
1969
+ }
1970
+ };
1971
+ //#endregion
1972
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/libs/php.js
1973
+ function U(e) {
1974
+ return " ".repeat(e * 2);
1975
+ }
1976
+ var Fn = class {
1977
+ constructor(t) {
1978
+ e(this, "value", void 0), this.value = t;
1979
+ }
1980
+ };
1981
+ function W(e, t = 0) {
1982
+ if (e == null) return "null";
1983
+ if (e instanceof Fn) {
1984
+ let n = e.value.split("\n");
1985
+ if (n.length > 1) {
1986
+ let e = U(t + 1);
1987
+ return n.map((t, n) => n === 0 ? t : `${e}${t}`).join("\n");
1988
+ }
1989
+ return e.value;
1990
+ }
1991
+ if (typeof e == "string") return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
1992
+ if (typeof e == "number" || typeof e == "boolean") return String(e);
1993
+ if (Array.isArray(e)) {
1994
+ if (e.length === 0) return "[]";
1995
+ let n = e.map((e) => W(e, t + 1)).join(",\n" + U(t + 1));
1996
+ return `[\n${U(t + 1)}${n}\n${U(t)}]`;
1997
+ }
1998
+ if (typeof e == "object") {
1999
+ let n = Object.entries(e);
2000
+ if (n.length === 0) return "[]";
2001
+ let r = n.map(([e, n]) => `'${e}' => ${W(n, t + 1)}`).join(",\n" + U(t + 1));
2002
+ return `[\n${U(t + 1)}${r}\n${U(t)}]`;
2003
+ }
2004
+ return "null";
2005
+ }
2006
+ //#endregion
2007
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/php/curl/curl.js
2008
+ var In = {
2009
+ target: "php",
2010
+ client: "curl",
2011
+ title: "cURL",
2012
+ generate(e, t) {
2013
+ var n, r, i, a;
2014
+ let o = {
2015
+ method: "GET",
2016
+ ...e
2017
+ };
2018
+ o.method = o.method.toUpperCase();
2019
+ let s = [], c = !1, l = (n = o.queryString) != null && n.length ? "?" + o.queryString.map((e) => `${e.name}=${e.value}`).join("&") : "", u = `${o.url}${l}`;
2020
+ s.push(`$ch = curl_init("${u}");`), s.push(""), o.method === "POST" ? s.push("curl_setopt($ch, CURLOPT_POST, true);") : o.method !== "GET" && s.push(`curl_setopt($ch, CURLOPT_CUSTOMREQUEST, '${o.method}');`), t != null && (r = t.auth) != null && r.username && t != null && (i = t.auth) != null && i.password && s.push(`curl_setopt($ch, CURLOPT_USERPWD, '${t.auth.username}:${t.auth.password}');`);
2021
+ let d = [...o.headers || []], f = () => d.some((e) => e.name.toLowerCase() === "content-type");
2022
+ if (o.postData && (o.postData.mimeType === "application/x-www-form-urlencoded" && o.postData.params && !f() ? d.push({
2023
+ name: "Content-Type",
2024
+ value: "application/x-www-form-urlencoded"
2025
+ }) : o.postData.mimeType === "application/octet-stream" && !f() && d.push({
2026
+ name: "Content-Type",
2027
+ value: "application/octet-stream"
2028
+ })), d.length) {
2029
+ let e = d.map((e) => `'${e.name}: ${e.value}'`);
2030
+ s.push(`curl_setopt($ch, CURLOPT_HTTPHEADER, [${e.join(", ")}]);`);
2031
+ let t = d.find((e) => e.name.toLowerCase() === "accept-encoding");
2032
+ t && /gzip|deflate/.test(t.value) && s.push("curl_setopt($ch, CURLOPT_ENCODING, '');");
2033
+ }
2034
+ if ((a = o.cookies) != null && a.length) {
2035
+ let e = o.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; ");
2036
+ s.push(`curl_setopt($ch, CURLOPT_COOKIE, '${e}');`);
2037
+ }
2038
+ if (o.postData) {
2039
+ if (o.postData.mimeType === "application/json") {
2040
+ if (o.postData.text) try {
2041
+ let e = W(JSON.parse(o.postData.text));
2042
+ s.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(${e}));`);
2043
+ } catch {
2044
+ s.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${o.postData.text}');`);
2045
+ }
2046
+ } else if (o.postData.mimeType === "multipart/form-data" && o.postData.params) c = !0, s.push("$mime = curl_mime_init($ch);"), o.postData.params.forEach((e, t) => {
2047
+ let n = `$part${t}`;
2048
+ s.push(`${n} = curl_mime_addpart($mime);`), s.push(`curl_mime_name(${n}, '${e.name}');`), e.fileName === void 0 ? e.value !== void 0 && s.push(`curl_mime_data(${n}, '${e.value}');`) : s.push(`curl_mime_filedata(${n}, '${e.fileName}');`), e.contentType && s.push(`curl_mime_type(${n}, '${e.contentType}');`);
2049
+ }), s.push("curl_setopt($ch, CURLOPT_MIMEPOST, $mime);");
2050
+ else if (o.postData.mimeType === "application/x-www-form-urlencoded" && o.postData.params) {
2051
+ let e = o.postData.params.map((e) => `${encodeURIComponent(e.name)}=${e.value ? encodeURIComponent(e.value) : ""}`).join("&");
2052
+ s.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${e}');`);
2053
+ } else if (o.postData.mimeType === "application/octet-stream") s.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${o.postData.text || ""}');`);
2054
+ else if (o.postData.text) try {
2055
+ let e = W(JSON.parse(o.postData.text));
2056
+ s.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(${e}));`);
2057
+ } catch {
2058
+ s.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${o.postData.text}');`);
2059
+ }
2060
+ }
2061
+ return s.push(""), s.push("curl_exec($ch);"), c && s.push("curl_mime_free($mime);"), s.push(""), s.push("curl_close($ch);"), s.join("\n").replace(/\n\n\n/g, "\n\n");
2062
+ }
2063
+ }, Ln = {
2064
+ target: "php",
2065
+ client: "guzzle",
2066
+ title: "Guzzle",
2067
+ generate(e, t) {
2068
+ var n;
2069
+ if (!e) return "";
2070
+ let r = {}, i = (e.method || "GET").toUpperCase(), a = e.url || "";
2071
+ if (e.headers && Array.isArray(e.headers) && e.headers.length > 0) {
2072
+ let t = {};
2073
+ e.headers.forEach((e) => {
2074
+ t[e.name] === void 0 ? t[e.name] = e.value : Array.isArray(t[e.name]) ? t[e.name].push(e.value) : t[e.name] = [t[e.name], e.value];
2075
+ }), r.headers = t;
2076
+ }
2077
+ if (e.queryString && e.queryString.length > 0 && (r.query = _(e.queryString)), e.cookies && e.cookies.length > 0) {
2078
+ let t = {};
2079
+ e.cookies.forEach((e) => {
2080
+ t[e.name] = e.value;
2081
+ }), r.cookies = t;
2082
+ }
2083
+ if (t != null && (n = t.auth) != null && n.username && t.auth.password && (r.auth = [t.auth.username, t.auth.password]), e.postData) {
2084
+ if (e.postData.mimeType === "application/json") try {
2085
+ r.json = JSON.parse(e.postData.text || "{}");
2086
+ } catch {
2087
+ r.body = e.postData.text;
2088
+ }
2089
+ else if (e.postData.mimeType === "multipart/form-data") {
2090
+ if (e.postData.params) r.multipart = e.postData.params.map((e) => {
2091
+ let t = {
2092
+ name: e.name,
2093
+ contents: e.fileName ? new Fn(`fopen('${e.fileName}', 'r')`) : e.value || ""
2094
+ };
2095
+ return e.contentType && (t.headers = { "Content-Type": e.contentType }), t;
2096
+ });
2097
+ else if (e.postData.text) try {
2098
+ r.form_params = JSON.parse(e.postData.text);
2099
+ } catch {
2100
+ r.body = e.postData.text;
2101
+ }
2102
+ } else if (e.postData.mimeType === "application/x-www-form-urlencoded") {
2103
+ if (e.postData.params) {
2104
+ let t = {};
2105
+ e.postData.params.forEach((e) => {
2106
+ t[e.name] = e.value || "";
2107
+ }), r.form_params = t;
2108
+ }
2109
+ } else r.body = e.postData.text;
2110
+ }
2111
+ e.headers && Array.isArray(e.headers) && e.headers.some((e) => e.name === "Accept-Encoding" && e.value.includes("gzip")) && (r.decode_content = !0);
2112
+ let o = "$client = new GuzzleHttp\\Client();\n\n";
2113
+ if (Object.keys(r).length > 0) {
2114
+ let e = W(r);
2115
+ o += `$response = $client->request('${i}', '${a}', ${e});`;
2116
+ } else o += `$response = $client->request('${i}', '${a}');`;
2117
+ return o;
2118
+ }
2119
+ }, Rn = (e) => e.replace(/\\/g, "\\\\").replace(/'/g, "\\'"), G = (e) => `'${Rn(e)}'`, zn = Rn, K = (e) => Array.isArray(e) ? e.map((e) => K(e)) : e && typeof e == "object" ? Object.entries(e).reduce((e, [t, n]) => (e[zn(t)] = K(n), e), {}) : e, Bn = (e) => {
2120
+ if (!e) return "localhost";
2121
+ try {
2122
+ return new URL(e).hostname || "localhost";
2123
+ } catch {
2124
+ return "localhost";
2125
+ }
2126
+ }, Vn = {
2127
+ target: "php",
2128
+ client: "laravel",
2129
+ title: "Laravel HTTP Client",
2130
+ generate(e, t) {
2131
+ var n, r, i, a;
2132
+ let o = {
2133
+ method: "GET",
2134
+ ...e
2135
+ };
2136
+ o.method = o.method.toUpperCase();
2137
+ let s = d(o.queryString), c = `${(n = o.url) == null ? "" : n}${s}`, l = [];
2138
+ if (t != null && (r = t.auth) != null && r.username && t.auth.password && l.push(`withBasicAuth(${G(t.auth.username)}, ${G(t.auth.password)})`), (i = o.headers) != null && i.length) {
2139
+ let e = {};
2140
+ o.headers.forEach((t) => {
2141
+ g(e, t.name, t.value);
2142
+ }), l.push(`withHeaders(${W(K(e))})`);
2143
+ }
2144
+ if ((a = o.cookies) != null && a.length) {
2145
+ var u;
2146
+ let e = {};
2147
+ o.cookies.forEach((t) => {
2148
+ g(e, t.name, t.value);
2149
+ }), l.push(`withCookies(${W(K(e))}, ${G(Bn((u = o.url) == null ? "" : u))})`);
2150
+ }
2151
+ let f;
2152
+ if (o.postData) {
2153
+ if (o.postData.mimeType === "application/json") {
2154
+ if (o.postData.text) try {
2155
+ f = JSON.parse(o.postData.text);
2156
+ } catch {
2157
+ l.push(`withBody(${G(o.postData.text)}, 'application/json')`);
2158
+ }
2159
+ } else if (o.postData.mimeType === "application/x-www-form-urlencoded" && o.postData.params) {
2160
+ let e = {};
2161
+ o.postData.params.forEach((t) => {
2162
+ var n;
2163
+ g(e, t.name, (n = t.value) == null ? "" : n);
2164
+ }), l.push("asForm()"), f = e;
2165
+ } else if (o.postData.mimeType === "multipart/form-data" && o.postData.params) {
2166
+ let e = {};
2167
+ o.postData.params.forEach((t) => {
2168
+ if (t.fileName !== void 0) {
2169
+ let e = [
2170
+ G(t.name),
2171
+ `file_get_contents(${G(t.fileName)})`,
2172
+ G(t.fileName)
2173
+ ];
2174
+ t.contentType && e.push(W(K({ "Content-Type": t.contentType }))), l.push(`attach(${e.join(", ")})`);
2175
+ } else if (t.contentType) {
2176
+ var n;
2177
+ l.push(`attach(${G(t.name)}, ${G((n = t.value) == null ? "" : n)}, null, ${W(K({ "Content-Type": t.contentType }))})`);
2178
+ } else {
2179
+ var r;
2180
+ g(e, t.name, (r = t.value) == null ? "" : r);
2181
+ }
2182
+ }), Object.keys(e).length > 0 && (f = e);
2183
+ } else if (o.postData.mimeType === "application/octet-stream") {
2184
+ var p;
2185
+ l.push(`withBody(${G((p = o.postData.text) == null ? "" : p)}, 'application/octet-stream')`);
2186
+ } else if (o.postData.text) try {
2187
+ f = JSON.parse(o.postData.text);
2188
+ } catch {
2189
+ l.push(`withBody(${G(o.postData.text)}, ${G(o.postData.mimeType || "text/plain")})`);
2190
+ }
2191
+ }
2192
+ let m = o.method.toLowerCase(), h = [
2193
+ "delete",
2194
+ "get",
2195
+ "head",
2196
+ "patch",
2197
+ "post",
2198
+ "put"
2199
+ ].includes(m) ? f !== void 0 && m !== "head" ? `${m}(${G(c)}, ${W(K(f), 1)})` : `${m}(${G(c)})` : f === void 0 ? `send(${G(o.method)}, ${G(c)})` : `send(${G(o.method)}, ${G(c)}, ${W(K(f), 1)})`;
2200
+ return `use Illuminate\\Support\\Facades\\Http;\n\n$response = ${l.length > 0 ? [
2201
+ `Http::${l[0]}`,
2202
+ ...l.slice(1).map((e) => ` ->${e}`),
2203
+ ` ->${h}`
2204
+ ].join("\n") : `Http::${h}`};`;
2205
+ }
2206
+ }, Hn = (e) => ({ method: t, headersObj: n, cookies: r, uriObj: i, fullUrl: a, postData: o, allHeaders: s }) => {
2207
+ let { push: c, join: l } = new N();
2208
+ if (![
2209
+ "GET",
2210
+ "POST",
2211
+ "PUT",
2212
+ "DELETE",
2213
+ "PATCH",
2214
+ "HEAD",
2215
+ "OPTIONS"
2216
+ ].includes(t.toUpperCase())) return "Method not supported";
2217
+ let u = [], d = Object.keys(n);
2218
+ return d.length && (c("$headers=@{}"), d.forEach((e) => {
2219
+ e !== "connection" && c(`$headers.Add("${e}", "${Xe(n[e], { escapeChar: "`" })}")`);
2220
+ }), u.push("-Headers $headers")), r.length && (c("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), r.forEach((e) => {
2221
+ c("$cookie = New-Object System.Net.Cookie"), c(`$cookie.Name = '${e.name}'`), c(`$cookie.Value = '${e.value}'`), c(`$cookie.Domain = '${i.host}'`), c("$session.Cookies.Add($cookie)");
2222
+ }), u.push("-WebSession $session")), o != null && o.text && (u.push(`-ContentType '${Xe(nn(s, "content-type"), {
2223
+ delimiter: "'",
2224
+ escapeChar: "`"
2225
+ })}'`), u.push(`-Body '${o.text}'`)), c(`$response = ${e} -Uri '${a}' -Method ${t} ${u.join(" ")}`), l();
2226
+ }, Un = {
2227
+ info: {
2228
+ key: "restmethod",
2229
+ title: "Invoke-RestMethod",
2230
+ link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",
2231
+ description: "Powershell Invoke-RestMethod client"
2232
+ },
2233
+ convert: Hn("Invoke-RestMethod")
2234
+ }, Wn = {
2235
+ target: "powershell",
2236
+ client: "restmethod",
2237
+ title: "Invoke-RestMethod",
2238
+ generate(e) {
2239
+ return F(Un, e);
2240
+ }
2241
+ }, Gn = {
2242
+ info: {
2243
+ key: "webrequest",
2244
+ title: "Invoke-WebRequest",
2245
+ link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",
2246
+ description: "Powershell Invoke-WebRequest client"
2247
+ },
2248
+ convert: Hn("Invoke-WebRequest")
2249
+ }, Kn = {
2250
+ target: "powershell",
2251
+ client: "webrequest",
2252
+ title: "Invoke-WebRequest",
2253
+ generate(e) {
2254
+ return F(Gn, e);
2255
+ }
2256
+ };
2257
+ function qn(e) {
2258
+ let t = [
2259
+ ["true", "True"],
2260
+ ["false", "False"],
2261
+ ["null", "None"]
2262
+ ], n = e;
2263
+ for (let [e, r] of t) {
2264
+ let t = [`(: )${e}(?=,|\\n)`, `^( +)${e}(?=,|\\n)`];
2265
+ for (let e of t) n = n.replace(new RegExp(e, "gm"), `$1${r}`);
2266
+ }
2267
+ return n;
2268
+ }
2269
+ function q(e, t = 4) {
2270
+ return qn(JSON.stringify(e, null, 2).split("\n").map((e, n) => n === 0 ? e : " ".repeat(t) + e).join("\n"));
2271
+ }
2272
+ function Jn(e, t, n) {
2273
+ var r, i, a, o, s;
2274
+ let c = {
2275
+ url: "https://example.com",
2276
+ method: "get",
2277
+ ...t
2278
+ }, l = c.method.toLowerCase(), u = {};
2279
+ if ((r = c.headers) != null && r.length && (u.headers = c.headers.reduce((e, t) => (t.name in e || (e[t.name] = t.value), e), {})), (i = c.queryString) != null && i.length && (u.params = _(c.queryString)), (a = c.cookies) != null && a.length && (u.cookies = Object.fromEntries(c.cookies.map((e) => [e.name, e.value]))), n != null && (o = n.auth) != null && o.username && n != null && (s = n.auth) != null && s.password && (u.auth = [n.auth.username, n.auth.password]), c.postData) {
2280
+ let { mimeType: e, text: t, params: n } = c.postData;
2281
+ if (e === "application/json" && t) try {
2282
+ u.json = JSON.parse(t);
2283
+ } catch {
2284
+ u.data = t;
2285
+ }
2286
+ else if (e === "application/octet-stream" && t) u.data = t;
2287
+ else if (e === "multipart/form-data" && n) {
2288
+ let e = [], t = {};
2289
+ n.forEach((n) => {
2290
+ if (n.fileName !== void 0) {
2291
+ let t = JSON.stringify(n.name), r = JSON.stringify(n.fileName), i = `open(${r}, "rb")`;
2292
+ if (n.contentType) {
2293
+ let a = JSON.stringify(n.contentType);
2294
+ e.push(`(${t}, (${r}, ${i}, ${a}))`);
2295
+ } else e.push(`(${t}, ${i})`);
2296
+ } else if (n.value !== void 0) {
2297
+ if (n.contentType) {
2298
+ let t = JSON.stringify(n.name), r = JSON.stringify(n.value), i = JSON.stringify(n.contentType);
2299
+ e.push(`(${t}, (None, ${r}, ${i}))`);
2300
+ } else g(t, n.name, n.value);
2301
+ }
2302
+ }), e.length && (u.files = e), Object.keys(t).length && (u.data = t);
2303
+ } else if (e === "application/x-www-form-urlencoded" && n) {
2304
+ let e = {};
2305
+ n.forEach((t) => {
2306
+ var n;
2307
+ g(e, t.name, (n = t.value) == null ? "" : n);
2308
+ }), u.data = e;
2309
+ }
2310
+ }
2311
+ let d = [], f = `"${c.url}"`;
2312
+ c.url.length > 40 ? d.push(f) : d.push("");
2313
+ for (let [e, t] of Object.entries(u)) {
2314
+ var p;
2315
+ if (e === "auth") d.push(`${e}=(${qn(JSON.stringify(t[0]))}, ${qn(JSON.stringify(t[1]))})`);
2316
+ else if (e === "files") {
2317
+ let n = "[\n" + t.map((e) => ` ${e}`).join(",\n") + "\n ]";
2318
+ d.push(`${e}=${n}`);
2319
+ } else if (e === "json") {
2320
+ let n = q(t);
2321
+ d.push(`${e}=${n}`);
2322
+ } else if (e === "data" && ((p = c.postData) == null ? void 0 : p.mimeType) === "application/octet-stream") d.push(`${e}=b"${t}"`);
2323
+ else {
2324
+ let n = q(t);
2325
+ d.push(`${e}=${n}`);
2326
+ }
2327
+ }
2328
+ return c.url.length > 40 ? `${e}.${l}(\n ${d.join(",\n ")}\n)` : d.length <= 1 ? `${e}.${l}(${f})` : `${e}.${l}(${f}${d.length > 1 ? "," : ""}\n ${d.slice(1).join(",\n ")}\n)`;
2329
+ }
2330
+ //#endregion
2331
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/python/aiohttp/aiohttp.js
2332
+ var Yn = (e, t = " ") => e.split("\n").map((e) => e.trim() === "" ? e : `${t}${e}`).join("\n"), Xn = (e, t, n, r) => {
2333
+ let i = JSON.stringify(n);
2334
+ return n.length > 40 ? `${e}.${t}(\n ${[i, ...r].join(",\n ")}\n)` : r.length === 0 ? `${e}.${t}(${i})` : `${e}.${t}(${i},\n ${r.join(",\n ")}\n)`;
2335
+ }, Zn = {
2336
+ target: "python",
2337
+ client: "aiohttp",
2338
+ title: "aiohttp",
2339
+ generate(e, t) {
2340
+ var n, r, i, a, o, s, c, l;
2341
+ let u = {
2342
+ url: "https://example.com",
2343
+ method: "get",
2344
+ ...e
2345
+ }, d = (n = (r = u.method) == null ? void 0 : r.toLowerCase()) == null ? "get" : n, f = [], p = [], m = [];
2346
+ if ((i = u.headers) != null && i.length) {
2347
+ let e = u.headers.reduce((e, t) => (t.name in e || (e[t.name] = t.value), e), {});
2348
+ f.push(`headers=${q(e)}`);
2349
+ }
2350
+ if ((a = u.queryString) != null && a.length && f.push(`params=${q(_(u.queryString))}`), (o = u.cookies) != null && o.length) {
2351
+ let e = Object.fromEntries(u.cookies.map((e) => [e.name, e.value]));
2352
+ p.push(`cookies=${q(e)}`);
2353
+ }
2354
+ if (t != null && (s = t.auth) != null && s.username && t != null && (c = t.auth) != null && c.password && p.push(`auth=aiohttp.BasicAuth(${JSON.stringify(t.auth.username)}, ${JSON.stringify(t.auth.password)})`), u.postData) {
2355
+ let { mimeType: e, text: t, params: n } = u.postData;
2356
+ if (e === "application/json" && t) try {
2357
+ f.push(`json=${q(JSON.parse(t))}`);
2358
+ } catch {
2359
+ f.push(`data=${JSON.stringify(t)}`);
2360
+ }
2361
+ else if (e === "application/octet-stream" && t) f.push(`data=b"${t}"`);
2362
+ else if (e === "multipart/form-data" && n) m.push("data = aiohttp.FormData()"), n.forEach((e) => {
2363
+ var t;
2364
+ if (e.fileName !== void 0) {
2365
+ let t = [
2366
+ JSON.stringify(e.name),
2367
+ `open(${JSON.stringify(e.fileName)}, "rb")`,
2368
+ `filename=${JSON.stringify(e.fileName)}`
2369
+ ];
2370
+ e.contentType && t.push(`content_type=${JSON.stringify(e.contentType)}`), m.push(`data.add_field(${t.join(", ")})`);
2371
+ return;
2372
+ }
2373
+ if (e.contentType) {
2374
+ var n;
2375
+ m.push(`data.add_field(${JSON.stringify(e.name)}, ${JSON.stringify((n = e.value) == null ? "" : n)}, content_type=${JSON.stringify(e.contentType)})`);
2376
+ return;
2377
+ }
2378
+ m.push(`data.add_field(${JSON.stringify(e.name)}, ${JSON.stringify((t = e.value) == null ? "" : t)})`);
2379
+ }), f.push("data=data");
2380
+ else if (e === "application/x-www-form-urlencoded" && n) {
2381
+ let e = {};
2382
+ n.forEach((t) => {
2383
+ var n;
2384
+ g(e, t.name, (n = t.value) == null ? "" : n);
2385
+ }), f.push(`data=${q(e)}`);
2386
+ } else t && f.push(`data=${JSON.stringify(t)}`);
2387
+ }
2388
+ let h = p.length === 0 ? "async with aiohttp.ClientSession() as session:" : `async with aiohttp.ClientSession(\n ${p.join(",\n ")}\n) as session:`, v = Xn("await session", d, (l = u.url) == null ? "" : l, f);
2389
+ return `${h}\n${Yn([...m, v].join("\n"))}`;
2390
+ }
2391
+ }, Qn = {
2392
+ target: "python",
2393
+ client: "httpx_async",
2394
+ title: "HTTPX (Async)",
2395
+ generate(e, t) {
2396
+ let n = Jn("await client", e, t);
2397
+ return n = n.split("\n").map((e) => e.trim() === "" ? e : " " + e).join("\n"), `async with httpx.AsyncClient() as client:\n${n}`;
2398
+ }
2399
+ }, $n = {
2400
+ target: "python",
2401
+ client: "httpx_sync",
2402
+ title: "HTTPX (Sync)",
2403
+ generate(e, t) {
2404
+ return Jn("httpx", e, t);
2405
+ }
2406
+ }, er = (e) => {
2407
+ if (typeof globalThis.btoa == "function") return globalThis.btoa(e);
2408
+ if (typeof Buffer < "u") return Buffer.from(e, "utf-8").toString("base64");
2409
+ throw Error("Could not encode basic auth credentials");
2410
+ }, tr = (e) => {
2411
+ if (!e) return new URL("https://example.com");
2412
+ try {
2413
+ return new URL(e);
2414
+ } catch {
2415
+ return new URL(e, "https://example.com");
2416
+ }
2417
+ }, nr = (e, t = []) => {
2418
+ if (!t.length) return e.search;
2419
+ let n = d(t);
2420
+ return e.search ? `${e.search}&${n.slice(1)}` : n;
2421
+ }, rr = (e) => `b"${JSON.stringify(e).slice(1, -1)}"`, ir = (e, t, n) => {
2422
+ let r = e.postData;
2423
+ if (!r) return { payloadLines: [] };
2424
+ let { mimeType: i, text: a, params: o } = r;
2425
+ if (i === "application/json" && a) try {
2426
+ let e = JSON.parse(a);
2427
+ return n.add("import json"), {
2428
+ payloadLines: [`payload = json.dumps(${q(e, 0)})`],
2429
+ payloadVariable: "payload"
2430
+ };
2431
+ } catch {
2432
+ return {
2433
+ payloadLines: [`payload = ${JSON.stringify(a)}`],
2434
+ payloadVariable: "payload"
2435
+ };
2436
+ }
2437
+ if (i === "application/octet-stream" && a) return {
2438
+ payloadLines: [`payload = ${rr(a)}`],
2439
+ payloadVariable: "payload"
2440
+ };
2441
+ if (i === "application/x-www-form-urlencoded" && o) {
2442
+ n.add("import urllib.parse");
2443
+ let e = {};
2444
+ return o.forEach((t) => {
2445
+ var n;
2446
+ g(e, t.name, (n = t.value) == null ? "" : n);
2447
+ }), t["Content-Type"] || (t["Content-Type"] = "application/x-www-form-urlencoded"), {
2448
+ payloadLines: [`payload = urllib.parse.urlencode(${q(e, 0)}, doseq=True)`],
2449
+ payloadVariable: "payload"
2450
+ };
2451
+ }
2452
+ if (i === "multipart/form-data" && o) {
2453
+ let e = ["boundary = \"----ScalarSnippetzBoundary\"", "data_list = []"];
2454
+ return o.forEach((t) => {
2455
+ if (e.push("data_list.append(\"--\" + boundary)"), t.fileName === void 0 ? e.push(`data_list.append(${JSON.stringify(`Content-Disposition: form-data; name="${t.name}"`)})`) : e.push(`data_list.append(${JSON.stringify(`Content-Disposition: form-data; name="${t.name}"; filename="${t.fileName}"`)})`), t.contentType && e.push(`data_list.append(${JSON.stringify(`Content-Type: ${t.contentType}`)})`), e.push("data_list.append(\"\")"), t.fileName !== void 0) e.push(`data_list.append(open(${JSON.stringify(t.fileName)}, "rb").read().decode("latin-1"))`);
2456
+ else {
2457
+ var n;
2458
+ e.push(`data_list.append(${JSON.stringify((n = t.value) == null ? "" : n)})`);
2459
+ }
2460
+ }), e.push("data_list.append(\"--\" + boundary + \"--\")"), e.push("data_list.append(\"\")"), e.push("payload = \"\\r\\n\".join(data_list)"), t["Content-Type"] = "multipart/form-data; boundary=----ScalarSnippetzBoundary", {
2461
+ payloadLines: e,
2462
+ payloadVariable: "payload"
2463
+ };
2464
+ }
2465
+ if (a) try {
2466
+ let e = JSON.parse(a);
2467
+ return n.add("import json"), {
2468
+ payloadLines: [`payload = json.dumps(${q(e, 0)})`],
2469
+ payloadVariable: "payload"
2470
+ };
2471
+ } catch {
2472
+ return {
2473
+ payloadLines: [`payload = ${JSON.stringify(a)}`],
2474
+ payloadVariable: "payload"
2475
+ };
2476
+ }
2477
+ return { payloadLines: [] };
2478
+ }, ar = {
2479
+ target: "python",
2480
+ client: "python3",
2481
+ title: "http.client",
2482
+ generate(e, t) {
2483
+ var n, r, i, a;
2484
+ let o = u({
2485
+ url: "https://example.com",
2486
+ ...e
2487
+ }), s = tr((n = o.url) == null ? "https://example.com" : n), c = nr(s, o.queryString), l = `${s.pathname || "/"}${c}`, d = (r = o.headers) == null ? void 0 : r.reduce((e, t) => (t.name in e || (e[t.name] = t.value), e), {}), f = d == null ? {} : d;
2488
+ if ((i = o.cookies) != null && i.length) {
2489
+ let e = o.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; ");
2490
+ f.Cookie = f.Cookie ? `${f.Cookie}; ${e}` : e;
2491
+ }
2492
+ t != null && (a = t.auth) != null && a.username && t.auth.password && (f.Authorization = `Basic ${er(`${t.auth.username}:${t.auth.password}`)}`);
2493
+ let p = /* @__PURE__ */ new Set(["import http.client"]), m = [], h = ir(o, f, p);
2494
+ m.push(...h.payloadLines), Object.keys(f).length && m.push(`headers = ${q(f, 0)}`);
2495
+ let g = [JSON.stringify(o.method), JSON.stringify(l)];
2496
+ h.payloadVariable && g.push(`body=${h.payloadVariable}`), Object.keys(f).length && g.push("headers=headers");
2497
+ let _ = g.length <= 2 ? `conn.request(${g.join(", ")})` : `conn.request(\n ${g.join(",\n ")},\n)`;
2498
+ return [
2499
+ ...p,
2500
+ "",
2501
+ `conn = http.client.${s.protocol === "https:" ? "HTTPSConnection" : "HTTPConnection"}(${JSON.stringify(s.host)})`,
2502
+ ...m.length ? ["", ...m] : [],
2503
+ "",
2504
+ _,
2505
+ "",
2506
+ "response = conn.getresponse()",
2507
+ "print(response.read().decode())",
2508
+ "",
2509
+ "conn.close()"
2510
+ ].join("\n");
2511
+ }
2512
+ }, or = {
2513
+ target: "python",
2514
+ client: "requests",
2515
+ title: "Requests",
2516
+ generate(e, t) {
2517
+ return Jn("requests", e, t);
2518
+ }
2519
+ }, sr = (e, t) => {
2520
+ try {
2521
+ return cr(JSON.parse(e), t);
2522
+ } catch {
2523
+ return `"${e}"`;
2524
+ }
2525
+ }, cr = (e, t) => {
2526
+ if (e == null) return "NULL";
2527
+ if (typeof e == "boolean") return e ? "TRUE" : "FALSE";
2528
+ if (typeof e == "number") return String(e);
2529
+ if (typeof e == "string") return `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
2530
+ if (Array.isArray(e)) return e.length === 0 ? "list()" : `list(\n${e.map((e) => `${t} ${cr(e, t + " ")}`).join(",\n")}\n${t})`;
2531
+ if (typeof e == "object") {
2532
+ let n = Object.entries(e);
2533
+ return n.length === 0 ? "list()" : `list(\n${n.map(([e, n]) => `${t} ${e} = ${cr(n, t + " ")}`).join(",\n")}\n${t})`;
2534
+ }
2535
+ return String(e);
2536
+ }, lr = {
2537
+ target: "r",
2538
+ client: "httr2",
2539
+ title: "httr2",
2540
+ generate(e, t) {
2541
+ var n, r, i, a, o;
2542
+ let s = {
2543
+ url: "https://example.com",
2544
+ method: "GET",
2545
+ ...e
2546
+ }, c = s.method.toUpperCase(), l = ["library(httr2)", ""];
2547
+ l.push(`response <- request("${s.url}") |>`);
2548
+ let u = [];
2549
+ c !== "GET" && u.push(` req_method("${c}")`);
2550
+ let d = {};
2551
+ if ((n = s.headers) != null && n.length) for (let e of s.headers) d[e.name] = e.value;
2552
+ if ((r = s.cookies) != null && r.length && (d.Cookie = s.cookies.map((e) => `${e.name}=${e.value}`).join("; ")), t != null && (i = t.auth) != null && i.username && t != null && (a = t.auth) != null && a.password && u.push(` req_auth_basic("${t.auth.username}", "${t.auth.password}")`), Object.keys(d).length) {
2553
+ let e = Object.entries(d);
2554
+ if (e.length === 1) {
2555
+ let [t, n] = e[0];
2556
+ u.push(` req_headers("${t}" = "${n}")`);
2557
+ } else {
2558
+ let t = e.map(([e, t]) => ` "${e}" = "${t}"`).join(",\n");
2559
+ u.push(` req_headers(\n${t}\n )`);
2560
+ }
2561
+ }
2562
+ if ((o = s.queryString) != null && o.length) {
2563
+ let e = _(s.queryString), t = Object.entries(e);
2564
+ if (t.length === 1) {
2565
+ let [e, n] = t[0];
2566
+ if (Array.isArray(n)) {
2567
+ let t = n.map((e) => `"${e}"`).join(", ");
2568
+ u.push(` req_url_query("${e}" = c(${t}))`);
2569
+ } else u.push(` req_url_query("${e}" = "${n}")`);
2570
+ } else {
2571
+ let e = t.map(([e, t]) => Array.isArray(t) ? ` "${e}" = c(${t.map((e) => `"${e}"`).join(", ")})` : ` "${e}" = "${t}"`).join(",\n");
2572
+ u.push(` req_url_query(\n${e}\n )`);
2573
+ }
2574
+ }
2575
+ if (s.postData) {
2576
+ let { mimeType: e, text: t, params: n } = s.postData;
2577
+ if (e === "application/json" && t) {
2578
+ let e = sr(t, " ");
2579
+ u.push(` req_body_json(${e})`);
2580
+ } else if (e === "multipart/form-data" && n) {
2581
+ let e = n.map((e) => {
2582
+ var t;
2583
+ return e.fileName === void 0 ? ` ${e.name} = "${(t = e.value) == null ? "" : t}"` : ` ${e.name} = curl::form_file("${e.fileName}")`;
2584
+ }).join(",\n");
2585
+ u.push(` req_body_multipart(\n${e}\n )`);
2586
+ } else if (e === "application/x-www-form-urlencoded" && n) {
2587
+ let e = n.map((e) => {
2588
+ var t;
2589
+ return ` "${e.name}" = "${(t = e.value) == null ? "" : t}"`;
2590
+ }).join(",\n");
2591
+ u.push(` req_body_form(\n${e}\n )`);
2592
+ } else t && u.push(` req_body_raw("${t}", type = "${e == null ? "application/octet-stream" : e}")`);
2593
+ }
2594
+ return u.push(" req_perform()"), l[l.length - 1] = `response <- request("${s.url}") |>`, l.push(u.join(" |>\n")), l.push(""), l.push("resp_body_string(response)"), l.join("\n");
2595
+ }
2596
+ }, ur = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, "\\\""), J = (e) => e.replace(/\\/g, "\\\\").replace(/'/g, "\\'"), dr = (e) => encodeURIComponent(e).replace(/'/g, "%27"), fr = /* @__PURE__ */ new Set([
2597
+ "GET",
2598
+ "POST",
2599
+ "HEAD",
2600
+ "DELETE",
2601
+ "PATCH",
2602
+ "PUT",
2603
+ "OPTIONS",
2604
+ "COPY",
2605
+ "LOCK",
2606
+ "UNLOCK",
2607
+ "MOVE",
2608
+ "TRACE"
2609
+ ]), pr = (e) => e.charAt(0) + e.slice(1).toLowerCase(), mr = (e, t, n) => {
2610
+ if (fr.has(t)) return;
2611
+ let r = pr(t);
2612
+ e.push(`class Net::HTTP::${r} < Net::HTTPRequest`), e.push(` METHOD = '${t}'`), e.push(` REQUEST_HAS_BODY = '${n ? "true" : "false"}'`), e.push(" RESPONSE_HAS_BODY = true"), e.push("end"), e.push("");
2613
+ }, hr = (e) => {
2614
+ try {
2615
+ let t = new URL(e), n = t.pathname.split("/").map((e) => encodeURIComponent(decodeURIComponent(e)).replace(/%5B/g, "[").replace(/%5D/g, "]").replace(/%24/g, "$")).join("/");
2616
+ return t.pathname === "/" ? `${t.origin}${t.search}${t.hash}` : `${t.origin}${n}${t.search}${t.hash}`;
2617
+ } catch {
2618
+ return e;
2619
+ }
2620
+ }, gr = {
2621
+ target: "ruby",
2622
+ client: "native",
2623
+ title: "net::http",
2624
+ generate(e, t) {
2625
+ var n, r, i, a, o, s;
2626
+ let c = {
2627
+ method: "GET",
2628
+ ...e
2629
+ };
2630
+ c.method = c.method.toUpperCase();
2631
+ let l = d(c.queryString), u = hr(`${(n = c.url) == null ? "" : n}${l}`), f = [
2632
+ "require 'uri'",
2633
+ "require 'net/http'",
2634
+ ""
2635
+ ];
2636
+ mr(f, c.method, !!((r = c.postData) != null && r.text)), f.push(`url = URI("${ur(u)}")`, ""), f.push("http = Net::HTTP.new(url.host, url.port)"), u.startsWith("https://") && f.push("http.use_ssl = true"), f.push("");
2637
+ let p = pr(c.method);
2638
+ if (f.push(`request = Net::HTTP::${p}.new(url)`), t != null && (i = t.auth) != null && i.username && t != null && (a = t.auth) != null && a.password) {
2639
+ let e = ur(t.auth.username), n = ur(t.auth.password);
2640
+ f.push(`request.basic_auth("${e}", "${n}")`);
2641
+ }
2642
+ if ((o = c.headers) != null && o.length && c.headers.forEach((e) => {
2643
+ f.push(`request["${ur(e.name)}"] = '${J(e.value)}'`);
2644
+ }), (s = c.cookies) != null && s.length) {
2645
+ let e = c.cookies.map((e) => `${dr(e.name)}=${dr(e.value)}`).join("; ");
2646
+ f.push(`request["Cookie"] = '${J(e)}'`);
2647
+ }
2648
+ if (c.postData) {
2649
+ let { mimeType: e, text: t, params: n } = c.postData;
2650
+ if (e === "application/json" && t !== void 0) try {
2651
+ let e = JSON.parse(t), n = JSON.stringify(e, null, 2);
2652
+ f.push("request.body = <<~JSON"), f.push(n), f.push("JSON");
2653
+ } catch {
2654
+ f.push(`request.body = ${JSON.stringify(t)}`);
2655
+ }
2656
+ else if (e === "application/x-www-form-urlencoded" && n) {
2657
+ let e = n.map((e) => {
2658
+ var t;
2659
+ return `${dr(e.name)}=${dr((t = e.value) == null ? "" : t)}`;
2660
+ }).join("&");
2661
+ f.push(`request.body = '${J(e)}'`);
2662
+ } else e === "multipart/form-data" && n ? (f.push("form_data = []"), n.forEach((e) => {
2663
+ let t = J(e.name);
2664
+ if (e.fileName !== void 0) {
2665
+ let n = J(e.fileName);
2666
+ if (e.contentType) {
2667
+ let r = J(e.contentType);
2668
+ f.push(`form_data << ['${t}', File.open('${n}'), { filename: '${n}', content_type: '${r}' }]`);
2669
+ } else f.push(`form_data << ['${t}', File.open('${n}')]`);
2670
+ } else if (e.contentType) {
2671
+ var n;
2672
+ let r = J((n = e.value) == null ? "" : n), i = J(e.contentType);
2673
+ f.push(`form_data << ['${t}', '${r}', { content_type: '${i}' }]`);
2674
+ } else {
2675
+ var r;
2676
+ let n = J((r = e.value) == null ? "" : r);
2677
+ f.push(`form_data << ['${t}', '${n}']`);
2678
+ }
2679
+ }), f.push("request.set_form(form_data, 'multipart/form-data')")) : e === "application/octet-stream" ? f.push(`request.body = ${JSON.stringify(t == null ? "" : t)}`) : t !== void 0 && f.push(`request.body = ${JSON.stringify(t)}`);
2680
+ }
2681
+ return f.push("", "response = http.request(request)", "puts response.read_body"), f.join("\n");
2682
+ }
2683
+ };
2684
+ //#endregion
2685
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/libs/rust.js
2686
+ function _r(e) {
2687
+ return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\0/g, "\\0");
2688
+ }
2689
+ function Y(e) {
2690
+ return `"${_r(e)}"`;
2691
+ }
2692
+ function X(e, t) {
2693
+ return `${" ".repeat(e * 4)}${t}`;
2694
+ }
2695
+ function vr(e, ...t) {
2696
+ return X(1, `.${e}(${t.join(", ")})`);
2697
+ }
2698
+ function yr(e) {
2699
+ try {
2700
+ let t = JSON.parse(e), n = JSON.stringify(t, null, 4).split("\n");
2701
+ return n.map((e, t) => t === 0 ? e : (n.length - 1, X(1, e))).join("\n");
2702
+ } catch {
2703
+ return e;
2704
+ }
2705
+ }
2706
+ //#endregion
2707
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/plugins/rust/reqwest/reqwest.js
2708
+ var br = {
2709
+ target: "rust",
2710
+ client: "reqwest",
2711
+ title: "reqwest",
2712
+ generate(e, t) {
2713
+ if (!e) return "";
2714
+ let n = u(e), r = d(n.queryString), i = v(n.url || "", r), a = y(n), o = [], s = Sr(t == null ? void 0 : t.auth);
2715
+ s && o.push(s), o.push(...Cr(a));
2716
+ let c = wr(n.postData);
2717
+ return c && o.push(c), Tr(i, n.method, o);
2718
+ }
2719
+ }, xr = (e) => {
2720
+ if (e.fileName) {
2721
+ let t = [X(2, `let part = reqwest::multipart::Part::text(${Y(e.value || "")})`), X(3, `.file_name(${Y(e.fileName)})`)];
2722
+ return e.contentType ? (t.push(X(3, `.mime_str(${Y(e.contentType)})`)), t.push(X(3, ".unwrap();"))) : t[t.length - 1] += ";", t.push(X(2, `form = form.part(${Y(e.name)}, part);`)), t.join("\n");
2723
+ }
2724
+ return e.contentType ? [
2725
+ X(2, `let part = reqwest::multipart::Part::text(${Y(e.value || "")})`),
2726
+ X(3, `.mime_str(${Y(e.contentType)})`),
2727
+ X(3, ".unwrap();"),
2728
+ X(2, `form = form.part(${Y(e.name)}, part);`)
2729
+ ].join("\n") : X(2, `form = form.text(${Y(e.name)}, ${Y(e.value || "")});`);
2730
+ }, Sr = (e) => !(e != null && e.username) || !(e != null && e.password) ? null : vr("basic_auth", Y(e.username), Y(e.password)), Cr = (e) => Object.entries(e).map(([e, t]) => vr("header", Y(e), Y(t))), wr = (e) => {
2731
+ if (!e) return null;
2732
+ let { mimeType: t, text: n, params: r } = e;
2733
+ switch (t) {
2734
+ case "application/json": return vr("json", `&serde_json::json!(${yr(n)})`);
2735
+ case "application/x-www-form-urlencoded": return vr("form", `&[${(r == null ? void 0 : r.map((e) => `(${Y(e.name)}, ${Y(e.value || "")})`).join(", ")) || ""}]`);
2736
+ case "multipart/form-data": {
2737
+ let e = (r == null ? void 0 : r.map(xr).join("\n")) || "";
2738
+ return X(1, [
2739
+ ".multipart({",
2740
+ X(2, "let mut form = reqwest::multipart::Form::new();"),
2741
+ e,
2742
+ X(3, "form"),
2743
+ X(2, "})")
2744
+ ].join("\n"));
2745
+ }
2746
+ default: return vr("body", Y(n || ""));
2747
+ }
2748
+ }, Tr = (e, t, n) => {
2749
+ let r = ["let client = reqwest::Client::new();", ""];
2750
+ n.length > 0 ? (r.push("let request = client"), r.push(X(1, `.${t.toLowerCase()}(${Y(e)})`)), r.push(...n)) : r.push(`let request = client.${t.toLowerCase()}(${Y(e)})`);
2751
+ let i = r[r.length - 1];
2752
+ return r[r.length - 1] = i + ";", r.push(""), r.push("let response = request.send().await?;"), r.join("\n");
2753
+ }, Z = (e) => e.replace(/'/g, "'\\''"), Er = (e) => {
2754
+ if (!e) return !1;
2755
+ let { subtype: t } = Ce(e);
2756
+ return t === "json" || t.endsWith("+json");
2757
+ }, Dr = {
2758
+ target: "shell",
2759
+ client: "curl",
2760
+ title: "Curl",
2761
+ generate(e, t) {
2762
+ var n, r, i, a, o, s;
2763
+ let c = {
2764
+ method: "GET",
2765
+ ...e
2766
+ };
2767
+ c.method = c.method.toUpperCase();
2768
+ let l = ["curl"], u = (n = c.url) == null ? "" : n, d = u.includes("?") ? "&" : "?", f = `${u}${(r = c.queryString) != null && r.length ? d + c.queryString.map((e) => `${e.name}=${e.value}`).join("&") : ""}`;
2769
+ if (l[0] = `curl ${/^[A-Za-z0-9._~:/%@+,=-]*$/.test(f) ? f : `'${Z(f)}'`}`, c.method !== "GET" && l.push(`--request ${c.method}`), t != null && (i = t.auth) != null && i.username && t != null && (a = t.auth) != null && a.password) {
2770
+ let e = Z(`${t.auth.username}:${t.auth.password}`);
2771
+ l.push(`--user '${e}'`);
2772
+ }
2773
+ if ((o = c.headers) != null && o.length) {
2774
+ c.headers.forEach((e) => {
2775
+ let t = Z(`${e.name}: ${e.value}`);
2776
+ l.push(`--header '${t}'`);
2777
+ });
2778
+ let e = c.headers.find((e) => e.name.toLowerCase() === "accept-encoding");
2779
+ e && /gzip|deflate/.test(e.value) && l.push("--compressed");
2780
+ }
2781
+ if ((s = c.cookies) != null && s.length) {
2782
+ let e = Z(c.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; "));
2783
+ l.push(`--cookie '${e}'`);
2784
+ }
2785
+ if (c.postData) {
2786
+ if (Er(c.postData.mimeType)) {
2787
+ if (c.postData.text) try {
2788
+ let e = JSON.parse(c.postData.text), t = Z(JSON.stringify(e, null, 2));
2789
+ l.push(`--data '${t}'`);
2790
+ } catch {
2791
+ var p;
2792
+ let e = Z((p = c.postData.text) == null ? "" : p);
2793
+ l.push(`--data '${e}'`);
2794
+ }
2795
+ } else if (c.postData.mimeType === "application/octet-stream") {
2796
+ var m;
2797
+ let e = Z((m = c.postData.text) == null ? "" : m);
2798
+ l.push(`--data-binary '${e}'`);
2799
+ } else if (c.postData.mimeType === "application/x-www-form-urlencoded" && c.postData.params) c.postData.params.forEach((e) => {
2800
+ var t;
2801
+ let n = Z((t = e.value) == null ? "" : t), r = Z(encodeURIComponent(e.name));
2802
+ l.push(`--data-urlencode '${r}=${n}'`);
2803
+ });
2804
+ else if (c.postData.mimeType === "multipart/form-data" && c.postData.params) c.postData.params.forEach((e) => {
2805
+ let t = Z(e.name), n = e.contentType ? `;type=${e.contentType}` : "";
2806
+ if (e.fileName !== void 0) {
2807
+ let r = Z(`${e.fileName}${n}`);
2808
+ l.push(`--form '${t}=@${r}'`);
2809
+ } else {
2810
+ var r;
2811
+ let i = (r = e.value) == null ? "" : r, a = Er(e.contentType), o = i;
2812
+ if (a && i) try {
2813
+ o = JSON.stringify(JSON.parse(i), null, 2);
2814
+ } catch {}
2815
+ let s = Z(`${o}${n}`);
2816
+ l.push(`--form '${t}=${s}'`);
2817
+ }
2818
+ });
2819
+ else try {
2820
+ var h;
2821
+ let e = JSON.parse((h = c.postData.text) == null ? "" : h), t = Z(JSON.stringify(e, null, 2));
2822
+ l.push(`--data '${t}'`);
2823
+ } catch {
2824
+ var g;
2825
+ let e = Z((g = c.postData.text) == null ? "" : g);
2826
+ l.push(`--data '${e}'`);
2827
+ }
2828
+ }
2829
+ return l.join(" \\\n ");
2830
+ }
2831
+ }, Q = (e = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`, Or = {
2832
+ info: {
2833
+ key: "httpie",
2834
+ title: "HTTPie",
2835
+ link: "http://httpie.org/",
2836
+ description: "a CLI, cURL-like tool for humans"
2837
+ },
2838
+ convert: ({ allHeaders: e, postData: t, queryObj: n, fullUrl: r, method: i, url: a }, o) => {
2839
+ let s = {
2840
+ body: !1,
2841
+ cert: !1,
2842
+ headers: !1,
2843
+ indent: " ",
2844
+ pretty: !1,
2845
+ print: !1,
2846
+ queryParams: !1,
2847
+ short: !1,
2848
+ style: !1,
2849
+ timeout: !1,
2850
+ verbose: !1,
2851
+ verify: !1,
2852
+ ...o
2853
+ }, { push: c, join: l, unshift: u } = new N({
2854
+ indent: s.indent,
2855
+ join: s.indent === !1 ? " " : ` \\\n${s.indent}`
2856
+ }), d = !1, f = [];
2857
+ if (s.headers && f.push(s.short ? "-h" : "--headers"), s.body && f.push(s.short ? "-b" : "--body"), s.verbose && f.push(s.short ? "-v" : "--verbose"), s.print && f.push(`${s.short ? "-p" : "--print"}=${s.print}`), s.verify && f.push(`--verify=${s.verify}`), s.cert && f.push(`--cert=${s.cert}`), s.pretty && f.push(`--pretty=${s.pretty}`), s.style && f.push(`--style=${s.style}`), s.timeout && f.push(`--timeout=${s.timeout}`), s.queryParams && Object.keys(n).forEach((e) => {
2858
+ let t = n[e];
2859
+ Array.isArray(t) ? t.forEach((t) => {
2860
+ c(`${e}==${Q(t)}`);
2861
+ }) : c(`${e}==${Q(t)}`);
2862
+ }), Object.keys(e).sort().forEach((t) => {
2863
+ c(`${t}:${Q(e[t])}`);
2864
+ }), (t == null ? void 0 : t.mimeType) === "application/x-www-form-urlencoded") {
2865
+ var p;
2866
+ (p = t.params) != null && p.length && (f.push(s.short ? "-f" : "--form"), t.params.forEach((e) => {
2867
+ c(`${e.name}=${Q(e.value)}`);
2868
+ }));
2869
+ } else if ((t == null ? void 0 : t.mimeType) === "multipart/form-data") {
2870
+ var m;
2871
+ t != null && (m = t.params) != null && m.length && (f.push("--multipart"), t.params.forEach((e) => {
2872
+ e.fileName ? c(`${e.name}@${Q(e.fileName)}`) : c(`${e.name}='${Q(e.value)}'`);
2873
+ }));
2874
+ } else d = !0;
2875
+ let h = f.length ? `${f.join(" ")} ` : "";
2876
+ return a = Q(s.queryParams ? a : r), u(`http ${h}${i} ${a}`), d && t != null && t.text && u(`echo ${Q(t.text)} | `), l();
2877
+ }
2878
+ }, kr = {
2879
+ target: "shell",
2880
+ client: "httpie",
2881
+ title: "HTTPie",
2882
+ generate(e) {
2883
+ return F(Or, e);
2884
+ }
2885
+ }, Ar = (e) => {
2886
+ if (!e) return !1;
2887
+ let { subtype: t } = Ce(e);
2888
+ return t === "json" || t.endsWith("+json");
2889
+ }, jr = (e) => {
2890
+ try {
2891
+ return JSON.stringify(JSON.parse(e), null, 2);
2892
+ } catch {
2893
+ return e;
2894
+ }
2895
+ }, Mr = {
2896
+ target: "shell",
2897
+ client: "wget",
2898
+ title: "Wget",
2899
+ generate(e, t) {
2900
+ var n, r, i, a, o, s, c;
2901
+ let l = {
2902
+ ...e,
2903
+ method: ((n = e == null ? void 0 : e.method) == null ? "GET" : n).toUpperCase()
2904
+ }, u = (r = l.url) == null ? "" : r, d = u.includes("?") ? "&" : "?", f = `${u}${(i = l.queryString) != null && i.length ? d + l.queryString.map((e) => `${e.name}=${e.value}`).join("&") : ""}`, p = /^[A-Za-z0-9._~:/%@+,=-]*$/.test(f) ? f : `'${Z(f)}'`, m = ["wget --quiet", `--method ${l.method}`];
2905
+ if (t != null && (a = t.auth) != null && a.username && t != null && (o = t.auth) != null && o.password && (m.push(`--user '${Z(t.auth.username)}'`), m.push(`--password '${Z(t.auth.password)}'`)), (s = l.headers) != null && s.length && l.headers.forEach((e) => {
2906
+ let t = Z(`${e.name}: ${e.value}`);
2907
+ m.push(`--header '${t}'`);
2908
+ }), (c = l.cookies) != null && c.length) {
2909
+ let e = l.cookies.map((e) => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("; ");
2910
+ m.push(`--header 'Cookie: ${Z(e)}'`);
2911
+ }
2912
+ if (l.postData) {
2913
+ let { mimeType: e, text: t, params: n } = l.postData;
2914
+ if (Ar(e)) t && m.push(`--body-data '${Z(jr(t))}'`);
2915
+ else if (e === "application/octet-stream") m.push(`--body-data '${Z(t == null ? "" : t)}'`);
2916
+ else if (e === "application/x-www-form-urlencoded" && n) {
2917
+ let e = n.map((e) => {
2918
+ var t;
2919
+ return `${encodeURIComponent(e.name)}=${encodeURIComponent((t = e.value) == null ? "" : t)}`;
2920
+ }).join("&");
2921
+ m.push(`--body-data '${Z(e)}'`);
2922
+ } else e === "multipart/form-data" && n ? n.forEach((e) => {
2923
+ if (e.fileName !== void 0) m.push(`--body-file='${Z(e.fileName)}'`);
2924
+ else {
2925
+ var t;
2926
+ let n = (t = e.value) == null ? "" : t, r = Ar(e.contentType) && n ? jr(n) : n;
2927
+ m.push(`--body-data '${Z(`${e.name}=${r}`)}'`);
2928
+ }
2929
+ }) : t && m.push(`--body-data '${Z(jr(t))}'`);
2930
+ }
2931
+ return m.push("--output-document", `- ${p}`), m.join(" \\\n ");
2932
+ }
2933
+ }, $ = (e) => JSON.stringify(e), Nr = (e) => {
2934
+ let t = 1;
2935
+ for (; e.includes(`"""${"#".repeat(t)}`);) t += 1;
2936
+ return "#".repeat(t);
2937
+ }, Pr = (e) => {
2938
+ try {
2939
+ return JSON.stringify(JSON.parse(e), null, 2);
2940
+ } catch {
2941
+ return e;
2942
+ }
2943
+ }, Fr = (e) => encodeURIComponent(e), Ir = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, "\\\""), Lr = (e) => {
2944
+ let t = [
2945
+ "let boundary = UUID().uuidString",
2946
+ "var body = Data()",
2947
+ "",
2948
+ "func appendToBody(_ value: String) {",
2949
+ " body.append(value.data(using: .utf8)!)",
2950
+ "}",
2951
+ ""
2952
+ ];
2953
+ return e.forEach((e) => {
2954
+ var n;
2955
+ let r = Ir(e.name), i = Ir((n = e.fileName) == null ? "" : n), a = e.contentType ? Ir(e.contentType) : void 0;
2956
+ if (t.push("appendToBody(\"--\\(boundary)\\r\\n\")"), e.fileName !== void 0) t.push(`appendToBody(${$(`Content-Disposition: form-data; name="${r}"; filename="${i}"\r\n`)})`), a && t.push(`appendToBody(${$(`Content-Type: ${a}\r\n`)})`), t.push("appendToBody(\"\\r\\n\")"), t.push(`appendToBody(${$(`<# File data for ${e.fileName || "file"} #>\r\n`)})`);
2957
+ else {
2958
+ var o;
2959
+ t.push(`appendToBody(${$(`Content-Disposition: form-data; name="${r}"\r\n`)})`), a && t.push(`appendToBody(${$(`Content-Type: ${a}\r\n`)})`), t.push("appendToBody(\"\\r\\n\")"), t.push(`appendToBody(${$((o = e.value) == null ? "" : o)})`), t.push("appendToBody(\"\\r\\n\")");
2960
+ }
2961
+ t.push("");
2962
+ }), t.push("appendToBody(\"--\\(boundary)--\\r\\n\")"), t;
2963
+ }, Rr = [
2964
+ {
2965
+ key: "c",
2966
+ title: "C",
2967
+ default: "libcurl",
2968
+ clients: [l]
2969
+ },
2970
+ {
2971
+ key: "csharp",
2972
+ title: "C#",
2973
+ default: "restsharp",
2974
+ clients: [pe, De]
2975
+ },
2976
+ {
2977
+ key: "clojure",
2978
+ title: "Clojure",
2979
+ default: "clj_http",
2980
+ clients: [re]
2981
+ },
2982
+ {
2983
+ key: "dart",
2984
+ title: "Dart",
2985
+ default: "http",
2986
+ clients: [Oe]
2987
+ },
2988
+ {
2989
+ key: "fsharp",
2990
+ title: "F#",
2991
+ default: "httpclient",
2992
+ clients: [ke]
2993
+ },
2994
+ {
2995
+ key: "go",
2996
+ title: "Go",
2997
+ default: "native",
2998
+ clients: [Ke]
2999
+ },
3000
+ {
3001
+ key: "http",
3002
+ title: "HTTP",
3003
+ default: "http1.1",
3004
+ clients: [qe]
3005
+ },
3006
+ {
3007
+ key: "java",
3008
+ title: "Java",
3009
+ default: "unirest",
3010
+ clients: [
3011
+ $e,
3012
+ tt,
3013
+ rt,
3014
+ at
3015
+ ]
3016
+ },
3017
+ {
3018
+ key: "js",
3019
+ title: "JavaScript",
3020
+ default: "fetch",
3021
+ clients: [
3022
+ ht,
3023
+ mt,
3024
+ sn,
3025
+ on,
3026
+ ln
3027
+ ]
3028
+ },
3029
+ {
3030
+ key: "julia",
3031
+ title: "Julia",
3032
+ default: "http",
3033
+ clients: [xn]
3034
+ },
3035
+ {
3036
+ key: "kotlin",
3037
+ title: "Kotlin",
3038
+ default: "okhttp",
3039
+ clients: [wn]
3040
+ },
3041
+ {
3042
+ key: "node",
3043
+ title: "Node.js",
3044
+ default: "fetch",
3045
+ clients: [
3046
+ En,
3047
+ Tn,
3048
+ Dn,
3049
+ On
3050
+ ]
3051
+ },
3052
+ {
3053
+ key: "objc",
3054
+ title: "Objective-C",
3055
+ default: "nsurlsession",
3056
+ clients: [Mn]
3057
+ },
3058
+ {
3059
+ key: "ocaml",
3060
+ title: "OCaml",
3061
+ default: "cohttp",
3062
+ clients: [Pn]
3063
+ },
3064
+ {
3065
+ key: "php",
3066
+ title: "PHP",
3067
+ default: "curl",
3068
+ clients: [
3069
+ In,
3070
+ Ln,
3071
+ Vn
3072
+ ]
3073
+ },
3074
+ {
3075
+ key: "powershell",
3076
+ title: "PowerShell",
3077
+ default: "webrequest",
3078
+ clients: [Kn, Wn]
3079
+ },
3080
+ {
3081
+ key: "python",
3082
+ title: "Python",
3083
+ default: "python3",
3084
+ clients: [
3085
+ ar,
3086
+ or,
3087
+ Zn,
3088
+ $n,
3089
+ Qn
3090
+ ]
3091
+ },
3092
+ {
3093
+ key: "r",
3094
+ title: "R",
3095
+ default: "httr2",
3096
+ clients: [lr]
3097
+ },
3098
+ {
3099
+ key: "ruby",
3100
+ title: "Ruby",
3101
+ default: "native",
3102
+ clients: [gr]
3103
+ },
3104
+ {
3105
+ key: "rust",
3106
+ title: "Rust",
3107
+ default: "reqwest",
3108
+ clients: [br]
3109
+ },
3110
+ {
3111
+ key: "shell",
3112
+ title: "Shell",
3113
+ default: "curl",
3114
+ clients: [
3115
+ Dr,
3116
+ Mr,
3117
+ kr
3118
+ ]
3119
+ },
3120
+ {
3121
+ key: "swift",
3122
+ title: "Swift",
3123
+ default: "nsurlsession",
3124
+ clients: [{
3125
+ target: "swift",
3126
+ client: "nsurlsession",
3127
+ title: "NSURLSession",
3128
+ generate(e, t) {
3129
+ var n, r, i;
3130
+ if (!e) return "";
3131
+ let a = f(e.method), o = p(m((n = e.url) == null ? "" : n, e.queryString)), s = h(e.headers, e.cookies), c = [
3132
+ "import Foundation",
3133
+ "",
3134
+ `var request = URLRequest(url: URL(string: ${$(o)})!)`
3135
+ ];
3136
+ if (c.push(`request.httpMethod = ${$(a)}`), s.forEach((e) => {
3137
+ c.push(`request.setValue(${$(e.value)}, forHTTPHeaderField: ${$(e.name)})`);
3138
+ }), t != null && (r = t.auth) != null && r.username && t != null && (i = t.auth) != null && i.password && (c.push(`let credentials = ${$(`${t.auth.username}:${t.auth.password}`)}`), c.push("let encodedCredentials = Data(credentials.utf8).base64EncodedString()"), c.push("request.setValue(\"Basic \\(encodedCredentials)\", forHTTPHeaderField: \"Authorization\")")), e.postData) {
3139
+ let { mimeType: t, text: n, params: r } = e.postData;
3140
+ if (t === "application/json" && n !== void 0) {
3141
+ let e = Pr(n), t = Nr(e);
3142
+ c.push(`let jsonBody = ${t}"""`), c.push(e), c.push(`"""${t}`), c.push("request.httpBody = jsonBody.data(using: .utf8)");
3143
+ } else if (t === "application/x-www-form-urlencoded" && r != null && r.length) {
3144
+ let e = r.map((e) => {
3145
+ var t;
3146
+ return `${Fr(e.name)}=${Fr((t = e.value) == null ? "" : t)}`;
3147
+ }).join("&");
3148
+ c.push(`let formBody = ${$(e)}`), c.push("request.httpBody = formBody.data(using: .utf8)");
3149
+ } else t === "multipart/form-data" && r != null && r.length ? (c.push(...Lr(r)), c.push("request.setValue(\"multipart/form-data; boundary=\\(boundary)\", forHTTPHeaderField: \"Content-Type\")"), c.push("request.httpBody = body")) : t === "application/octet-stream" ? (c.push(`let binaryBody = Data(${$(n == null ? "" : n)}.utf8)`), c.push("request.httpBody = binaryBody")) : n !== void 0 && (c.push(`let rawBody = ${$(n)}`), c.push("request.httpBody = rawBody.data(using: .utf8)"));
3150
+ }
3151
+ return c.push(""), c.push("let (data, response) = try await URLSession.shared.data(for: request)"), c.push(""), c.push("guard let httpResponse = response as? HTTPURLResponse,"), c.push(" 200..<300 ~= httpResponse.statusCode else {"), c.push(" throw URLError(.badServerResponse)"), c.push("}"), c.push(""), c.push("print(String(data: data, encoding: .utf8) ?? \"\")"), c.join("\n");
3152
+ }
3153
+ }]
3154
+ }
3155
+ ];
3156
+ //#endregion
3157
+ //#region node_modules/.pnpm/@scalar+snippetz@0.9.29/node_modules/@scalar/snippetz/dist/snippetz.js
3158
+ function zr() {
3159
+ function e(e, t) {
3160
+ var n;
3161
+ return (n = Rr.find(({ key: t }) => t === e)) == null ? void 0 : n.clients.find((e) => e.client === t);
3162
+ }
3163
+ return {
3164
+ print(t, n, r) {
3165
+ var i;
3166
+ return (i = e(t, n)) == null ? void 0 : i.generate(r);
3167
+ },
3168
+ clients() {
3169
+ return Rr;
3170
+ },
3171
+ plugins() {
3172
+ return Rr.flatMap(({ key: e, clients: t }) => t.map((t) => ({
3173
+ target: e,
3174
+ client: t.client
3175
+ })));
3176
+ },
3177
+ findPlugin: e,
3178
+ hasPlugin(t, n) {
3179
+ return !!e(t, n);
3180
+ }
3181
+ };
3182
+ }
3183
+ //#endregion
3184
+ export { zr as snippetz };