@scalar/api-reference 1.64.0 → 1.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (630) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts.map +1 -1
  3. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js +1 -1
  4. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js.map +1 -1
  5. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  6. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js +1 -1
  7. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map +1 -1
  8. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js +2 -2
  9. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js.map +1 -1
  10. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map +1 -1
  11. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js +1 -1
  12. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map +1 -1
  13. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map +1 -1
  14. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -3
  15. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  16. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
  17. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
  18. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +13 -27
  19. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
  20. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  21. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
  22. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
  23. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +37 -25
  24. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
  25. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -1
  26. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  27. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
  28. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
  29. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +10 -4
  30. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
  31. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +1 -1
  32. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
  33. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
  34. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js +1 -1
  35. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js.map +1 -1
  36. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +1 -1
  37. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
  38. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +1 -1
  39. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -1
  40. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js +1 -1
  41. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js.map +1 -1
  42. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
  43. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js +1 -1
  44. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -1
  45. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
  46. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js.map +1 -1
  47. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
  48. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
  49. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +1 -1
  50. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
  51. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js +1 -1
  52. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js +1 -1
  53. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js.map +1 -1
  54. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js +1 -1
  55. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js.map +1 -1
  56. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts.map +1 -1
  57. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js +1 -1
  58. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js.map +1 -1
  59. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js +16 -9
  60. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -1
  61. package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.js.map +1 -1
  62. package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.js.map +1 -1
  63. package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.js.map +1 -1
  64. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  65. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +1 -1
  66. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -1
  67. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
  68. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +1 -1
  69. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
  70. package/dist/browser/chunks/AgentScalarChatInterface-2lNB6wO-.js +27 -0
  71. package/dist/browser/chunks/ScalarTextInput.vue-DVmXRWbS.js +27 -0
  72. package/dist/browser/chunks/{basic-shape-diamond.svg-BTEOT1FL.js → basic-shape-diamond.svg-o5eiY2I7.js} +2 -2
  73. package/dist/browser/chunks/{basic-shape-hexagon.svg-BSPzaCgF.js → basic-shape-hexagon.svg-CGuS7mbd.js} +2 -2
  74. package/dist/browser/chunks/{basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js → basic-shape-primary-circle-ellipse-round.svg-DDIpXiBm.js} +2 -2
  75. package/dist/browser/chunks/{basic-shape-primary-square-rectangle.svg-n2YRykHD.js → basic-shape-primary-square-rectangle.svg-DzVEJHMB.js} +2 -2
  76. package/dist/browser/chunks/{basic-shape-shield.svg-Bec9cJDA.js → basic-shape-shield.svg-BZzapRqv.js} +2 -2
  77. package/dist/browser/chunks/browser-CTPPEMEL.js +129 -0
  78. package/dist/browser/chunks/{computer-device-desktop-monitor.svg-m6j893Hb.js → computer-device-desktop-monitor.svg-OSM05r1I.js} +2 -2
  79. package/dist/browser/chunks/{computer-device-desktop.svg-Dk1VVO7k.js → computer-device-desktop.svg-BMFzGZ27.js} +2 -2
  80. package/dist/browser/chunks/{computer-device-laptop.svg-BNGVUCYS.js → computer-device-laptop.svg-CMAjzuB-.js} +2 -2
  81. package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js → computer-device-mobile-phone-android-samsung-back.svg-D4xBONmL.js} +2 -2
  82. package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js → computer-device-mobile-phone-android-samsung.svg-gbMJLjJw.js} +2 -2
  83. package/dist/browser/chunks/{computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js → computer-device-mobile-phone-iphone-x-back.svg-Bl1rmdKA.js} +2 -2
  84. package/dist/browser/chunks/{computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js → computer-device-mobile-phone-iphone-x.svg-DVetP0aa.js} +2 -2
  85. package/dist/browser/chunks/{computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js → computer-device-mobile-tablet-touch.svg-Zi88BP4L.js} +2 -2
  86. package/dist/browser/chunks/{computer-device-mobile-tablet.svg-DCr0XlRc.js → computer-device-mobile-tablet.svg-C1ggisWP.js} +2 -2
  87. package/dist/browser/chunks/{computer-device-network-ethernet-cat6.svg-AK9l0iOl.js → computer-device-network-ethernet-cat6.svg-BIUymdC1.js} +2 -2
  88. package/dist/browser/chunks/{computer-device-network-lan-www.svg-gUIdFBlE.js → computer-device-network-lan-www.svg-CoFUlIVO.js} +2 -2
  89. package/dist/browser/chunks/{computer-device-network-wifi-connection.svg-Be-EMm4e.js → computer-device-network-wifi-connection.svg-DeWsacxI.js} +2 -2
  90. package/dist/browser/chunks/{computer-device-network-wifi-router.svg-Dc2VzyqK.js → computer-device-network-wifi-router.svg-BjpZEot4.js} +2 -2
  91. package/dist/browser/chunks/{ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js → ecology-science-erlenmeyer-flask.svg-ftjGGirE.js} +2 -2
  92. package/dist/browser/chunks/{image-flash-lightning.svg-EETR_y1q.js → image-flash-lightning.svg-DYQ0W4Fi.js} +2 -2
  93. package/dist/browser/chunks/{image-picture-flower.svg-DN1AYzJU.js → image-picture-flower.svg-Bfe5SVDf.js} +2 -2
  94. package/dist/browser/chunks/{interface-alert-exclamation-diamond.svg-C5NozMV_.js → interface-alert-exclamation-diamond.svg-D1HePDNM.js} +2 -2
  95. package/dist/browser/chunks/{interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js → interface-alert-exclamation-triangle-warning.svg-CILUsxBC.js} +2 -2
  96. package/dist/browser/chunks/{interface-alert-information-circle.svg-ckkkt9Mv.js → interface-alert-information-circle.svg-9LrbJM5J.js} +2 -2
  97. package/dist/browser/chunks/{interface-award-crown.svg-pjvn9hY-.js → interface-award-crown.svg-DllWgiU1.js} +2 -2
  98. package/dist/browser/chunks/{interface-bookmark.svg-BK9HKQBT.js → interface-bookmark-tag.svg-Dc-JL-Kc.js} +2 -2
  99. package/dist/browser/chunks/{interface-bookmark-tag.svg-r2r-lQq4.js → interface-bookmark.svg-Dc-JL-Kc.js} +2 -2
  100. package/dist/browser/chunks/{interface-calendar-date-one.svg-DNnF0M1I.js → interface-calendar-date-one.svg-DO2jelhF.js} +2 -2
  101. package/dist/browser/chunks/{interface-content-book-open-pages.svg-CQj_w9Vp.js → interface-content-book-open-pages.svg-BJjMjIgA.js} +2 -2
  102. package/dist/browser/chunks/{interface-content-book-page.svg-DppoeJRe.js → interface-content-book-page.svg-C6rKB2fs.js} +2 -2
  103. package/dist/browser/chunks/{interface-content-file.svg-CvcD7OiY.js → interface-content-file.svg-CS0q2FKx.js} +2 -2
  104. package/dist/browser/chunks/{interface-content-folder.svg-BmtS5I9A.js → interface-content-folder.svg-CThTWsJX.js} +2 -2
  105. package/dist/browser/chunks/{interface-copy-clipboard.svg-Be6EI50X.js → interface-copy-clipboard.svg-DdN67cLv.js} +2 -2
  106. package/dist/browser/chunks/{interface-edit-attachment.svg-G5TKzpWX.js → interface-edit-attachment.svg-Ciizphuh.js} +2 -2
  107. package/dist/browser/chunks/{interface-edit-binocular.svg-jzL-DvGB.js → interface-edit-binocular.svg-Dw1nDqmL.js} +2 -2
  108. package/dist/browser/chunks/{interface-edit-magic-wand.svg-BOTlymvp.js → interface-edit-magic-wand.svg-BYS0jm_E.js} +2 -2
  109. package/dist/browser/chunks/{interface-edit-tool-paint-roller.svg-s9dwryx7.js → interface-edit-tool-paint-roller.svg-NioSHZC2.js} +2 -2
  110. package/dist/browser/chunks/{interface-edit-tool-pencil.svg-C7v0dbB3.js → interface-edit-tool-pencil.svg-P87QFlat.js} +2 -2
  111. package/dist/browser/chunks/{interface-favorite-award.svg-CYHUgUG0.js → interface-favorite-award.svg-DBBAChSi.js} +2 -2
  112. package/dist/browser/chunks/{interface-favorite-flag.svg-C10zlKOb.js → interface-favorite-flag.svg-HlhPomHY.js} +2 -2
  113. package/dist/browser/chunks/{interface-favorite-heart.svg-eoduXxlz.js → interface-favorite-heart.svg-Cqu2GYDo.js} +2 -2
  114. package/dist/browser/chunks/{interface-favorite-star.svg-BSmxJetr.js → interface-favorite-star.svg-BD4JY_J2.js} +2 -2
  115. package/dist/browser/chunks/{interface-favorite-stars-sparkles.svg-JTFLj3Ls.js → interface-favorite-stars-sparkles.svg-BXi6aO8q.js} +2 -2
  116. package/dist/browser/chunks/{interface-hierarchy-flowchart.svg-Cg_Wy0kN.js → interface-hierarchy-flowchart.svg-CDEVSsD4.js} +2 -2
  117. package/dist/browser/chunks/{interface-home-house.svg-DytoGRnv.js → interface-home-house.svg-DJetUjwj.js} +2 -2
  118. package/dist/browser/chunks/{interface-hyperlink.svg-CuEfmmQI.js → interface-hyperlink.svg-DJ1LREmz.js} +2 -2
  119. package/dist/browser/chunks/{interface-lighting-brightness.svg-DSK0h_Pa.js → interface-lighting-brightness.svg-TGKAaHYV.js} +2 -2
  120. package/dist/browser/chunks/{interface-lock-closed.svg-Cn6TaLYv.js → interface-lock-closed.svg-3hehWr3i.js} +2 -2
  121. package/dist/browser/chunks/{interface-lock-open-unlock.svg-CVkG5-9W.js → interface-lock-open-unlock.svg-CuXKcv1m.js} +2 -2
  122. package/dist/browser/chunks/{interface-login-key.svg-y-cwwXjN.js → interface-login-key.svg-Chwvvywd.js} +2 -2
  123. package/dist/browser/chunks/{interface-search.svg-S-puVFJB.js → interface-search.svg-JDE3fk0u.js} +2 -2
  124. package/dist/browser/chunks/{interface-setting-cog.svg-CTH4_lLg.js → interface-setting-cog.svg-BBCkeh4K.js} +2 -2
  125. package/dist/browser/chunks/{interface-share-megaphone-bullhorn.svg-Pbp39MyC.js → interface-share-megaphone-bullhorn.svg-CDdxF-4y.js} +2 -2
  126. package/dist/browser/chunks/{interface-share-rocket.svg-BgCsIRZO.js → interface-share-rocket.svg-DSbdn_o7.js} +2 -2
  127. package/dist/browser/chunks/{interface-share-satellite.svg-DAMN9d5G.js → interface-share-satellite.svg-CefBVZvY.js} +2 -2
  128. package/dist/browser/chunks/{interface-share-space-ship.svg-Dt-Mejxk.js → interface-share-space-ship.svg-tFA2dsSU.js} +2 -2
  129. package/dist/browser/chunks/{interface-share.svg-vFYTXSti.js → interface-share.svg-BpOGopyv.js} +2 -2
  130. package/dist/browser/chunks/{interface-signal-square.svg-DNG4LpAe.js → interface-signal-square.svg-BcX_BoaC.js} +2 -2
  131. package/dist/browser/chunks/{interface-time-clock-circle.svg-Bpz-nLxo.js → interface-time-clock-circle.svg-C8B_L_RM.js} +2 -2
  132. package/dist/browser/chunks/{interface-time-hour-glass.svg-D7agfKsH.js → interface-time-hour-glass.svg-qw-oeoVn.js} +2 -2
  133. package/dist/browser/chunks/{interface-users-multiple.svg-CkPJBBnG.js → interface-users-multiple.svg-Cs13Eewq.js} +2 -2
  134. package/dist/browser/chunks/{interface-weather-moon.svg-CaTZFMPO.js → interface-weather-moon.svg-CV-oDTae.js} +2 -2
  135. package/dist/browser/chunks/{mail-chat-bubble-square.svg-DC8RIihp.js → mail-chat-bubble-square.svg-dpauJhin.js} +2 -2
  136. package/dist/browser/chunks/{mail-send-email-paper-airplane.svg-D8OLs9jz.js → mail-send-email-paper-airplane.svg-BBofxojL.js} +2 -2
  137. package/dist/browser/chunks/{mail-send-envelope.svg-CV33h5Sx.js → mail-send-envelope.svg-DyENgYOI.js} +2 -2
  138. package/dist/browser/chunks/modal-70ibkEHi.js +102 -0
  139. package/dist/browser/chunks/{money-cashier-receipt.svg-CJL8C2gs.js → money-cashier-receipt.svg-dNTr5aio.js} +2 -2
  140. package/dist/browser/chunks/{money-currency-dollar-pay.svg-VdBplCTx.js → money-currency-dollar-pay.svg-1ZESPtFY.js} +2 -2
  141. package/dist/browser/chunks/{money-graph-arrow-increase.svg-DcRov3zk.js → money-graph-arrow-increase.svg-kEZ2u2z2.js} +2 -2
  142. package/dist/browser/chunks/{money-graph-bar-chart-increase.svg-Cc7KxjX-.js → money-graph-bar-chart-increase.svg-B-t2UWB3.js} +2 -2
  143. package/dist/browser/chunks/{nature-ecology-leaf.svg-DR3cTZxt.js → nature-ecology-leaf.svg-DZ2GJV8m.js} +2 -2
  144. package/dist/browser/chunks/{phone-telephone.svg-DyY0gUlk.js → phone-telephone.svg-C12QjpN7.js} +2 -2
  145. package/dist/browser/chunks/{programming-bug.svg-BHLT-Qhp.js → programming-bug.svg-wLTsruN9.js} +2 -2
  146. package/dist/browser/chunks/{programming-cloud.svg-B6YW33ba.js → programming-cloud.svg-3XU6dNUg.js} +2 -2
  147. package/dist/browser/chunks/{programming-computer-database-server.svg-B6o5Sdn-.js → programming-computer-database-server.svg-B1JrHSPd.js} +2 -2
  148. package/dist/browser/chunks/{programming-computer-database.svg-Cl7OVtpJ.js → programming-computer-database.svg-BxHSuFl7.js} +2 -2
  149. package/dist/browser/chunks/{programming-module-four-layout.svg-BQrerL1x.js → programming-module-four-layout.svg-CeV35q45.js} +2 -2
  150. package/dist/browser/chunks/{programming-module-three.svg-B2KTQzBM.js → programming-module-three.svg-YIBpLt45.js} +2 -2
  151. package/dist/browser/chunks/{programming-module.svg-CiID7kPm.js → programming-module.svg-CU_pEibI.js} +2 -2
  152. package/dist/browser/chunks/{programming-script-code.svg-D1M5rtkN.js → programming-script-code.svg-CLzinmHT.js} +2 -2
  153. package/dist/browser/chunks/runtime-core.esm-bundler-CqqEw5ds.js +17 -0
  154. package/dist/browser/chunks/{shopping-cart.svg-BEegiIR9.js → shopping-cart.svg-Brzddu3K.js} +2 -2
  155. package/dist/browser/chunks/{shopping-gift-present.svg-BUHwuLix.js → shopping-gift-present.svg-l2K48g7L.js} +2 -2
  156. package/dist/browser/chunks/{shopping-shipping-box-parcel-package.svg-D6fxWdYx.js → shopping-shipping-box-parcel-package.svg-DesGopPo.js} +2 -2
  157. package/dist/browser/chunks/{tag-new-circle.svg-jsg1bGs0.js → tag-new-circle.svg-DE-VaLZU.js} +2 -2
  158. package/dist/browser/chunks/{travel-map-earth-globe.svg-ClbMiU-f.js → travel-map-earth-globe.svg-DLaOMzx6.js} +2 -2
  159. package/dist/browser/chunks/vendor-BcTep96u.js +306 -0
  160. package/dist/browser/standalone.esm.js +22 -20
  161. package/dist/browser/standalone.js +256 -254
  162. package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +1 -1
  163. package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -1
  164. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js +1 -1
  165. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -1
  166. package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
  167. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
  168. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +1 -1
  169. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
  170. package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
  171. package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
  172. package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
  173. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +47 -32
  174. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
  175. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  176. package/dist/components/Anchor/Anchor.vue.script.js +1 -1
  177. package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
  178. package/dist/components/Anchor/WithBreadcrumb.vue.script.js +2 -2
  179. package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -1
  180. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  181. package/dist/components/ApiReference.vue.js +1 -1
  182. package/dist/components/ApiReference.vue.js.map +1 -1
  183. package/dist/components/ApiReference.vue.script.js +55 -22
  184. package/dist/components/ApiReference.vue.script.js.map +1 -1
  185. package/dist/components/Badge/Badge.vue.js +1 -1
  186. package/dist/components/Badge/Badge.vue.script.js +1 -1
  187. package/dist/components/Badge/Badge.vue.script.js.map +1 -1
  188. package/dist/components/ClassicHeader.vue.js +1 -1
  189. package/dist/components/ClassicHeader.vue.js.map +1 -1
  190. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +1 -1
  191. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +1 -1
  192. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -1
  193. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +1 -1
  194. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
  195. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
  196. package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
  197. package/dist/components/Content/AsyncApi/Channel.vue.script.js +1 -1
  198. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
  199. package/dist/components/Content/AsyncApi/ChannelsList.vue.js +1 -1
  200. package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js +1 -1
  201. package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js.map +1 -1
  202. package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -1
  203. package/dist/components/Content/AsyncApi/Message.vue.js +1 -1
  204. package/dist/components/Content/AsyncApi/Message.vue.script.js +2 -2
  205. package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -1
  206. package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -1
  207. package/dist/components/Content/AsyncApi/Operation.vue.js +1 -1
  208. package/dist/components/Content/AsyncApi/Operation.vue.script.js +1 -1
  209. package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -1
  210. package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.js.map +1 -1
  211. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -1
  212. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -1
  213. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -1
  214. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js.map +1 -1
  215. package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -1
  216. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -1
  217. package/dist/components/Content/AsyncApi/index.d.ts +3 -0
  218. package/dist/components/Content/AsyncApi/index.d.ts.map +1 -1
  219. package/dist/components/Content/Auth/Auth.vue.script.js +1 -1
  220. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  221. package/dist/components/Content/Content.vue.script.js +1 -1
  222. package/dist/components/Content/Content.vue.script.js.map +1 -1
  223. package/dist/components/Content/Models/Model.vue.script.js +1 -1
  224. package/dist/components/Content/Models/Model.vue.script.js.map +1 -1
  225. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  226. package/dist/components/Content/Models/ModelTag.vue.script.js +2 -2
  227. package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
  228. package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
  229. package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
  230. package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +1 -1
  231. package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -1
  232. package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
  233. package/dist/components/Content/Models/components/ModernLayout.vue.script.js +1 -1
  234. package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -1
  235. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +1 -1
  236. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  237. package/dist/components/Content/Schema/LinkButton.vue.js +1 -1
  238. package/dist/components/Content/Schema/LinkButton.vue.js.map +1 -1
  239. package/dist/components/Content/Schema/RenderString.vue.script.js +1 -1
  240. package/dist/components/Content/Schema/RenderString.vue.script.js.map +1 -1
  241. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  242. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  243. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  244. package/dist/components/Content/Schema/Schema.vue.script.js +5 -13
  245. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  246. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  247. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +1 -1
  248. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  249. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
  250. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +1 -1
  251. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js.map +1 -1
  252. package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
  253. package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
  254. package/dist/components/Content/Schema/SchemaEnums.vue.script.js +1 -1
  255. package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
  256. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  257. package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
  258. package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
  259. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
  260. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
  261. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +1 -1
  262. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  263. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  264. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  265. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  266. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +9 -3
  267. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  268. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
  269. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +1 -1
  270. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
  271. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
  272. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js +1 -1
  273. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js.map +1 -1
  274. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
  275. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +1 -1
  276. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
  277. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +6 -0
  278. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  279. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  280. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  281. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +6 -2
  282. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  283. package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -1
  284. package/dist/components/Content/Schema/helpers/format-example.js.map +1 -1
  285. package/dist/components/Content/Schema/helpers/format-value.js.map +1 -1
  286. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
  287. package/dist/components/Content/Schema/helpers/get-enum-values.js.map +1 -1
  288. package/dist/components/Content/Schema/helpers/get-property-description.js.map +1 -1
  289. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts +16 -0
  290. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
  291. package/dist/components/Content/Schema/helpers/get-ref-name.js +28 -1
  292. package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -1
  293. package/dist/components/Content/Schema/helpers/get-schema-type.js.map +1 -1
  294. package/dist/components/Content/Schema/helpers/has-complex-array-items.js.map +1 -1
  295. package/dist/components/Content/Schema/helpers/is-empty-schema-object.js.map +1 -1
  296. package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts +15 -0
  297. package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts.map +1 -0
  298. package/dist/components/Content/Schema/helpers/is-model-linkable.js +22 -0
  299. package/dist/components/Content/Schema/helpers/is-model-linkable.js.map +1 -0
  300. package/dist/components/Content/Schema/helpers/is-type-object.js.map +1 -1
  301. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +3 -3
  302. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  303. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -1
  304. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js.map +1 -1
  305. package/dist/components/Content/Schema/helpers/schema-composition.js.map +1 -1
  306. package/dist/components/Content/Schema/helpers/schema-cycle.js.map +1 -1
  307. package/dist/components/Content/Schema/helpers/schema-name.d.ts +6 -1
  308. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  309. package/dist/components/Content/Schema/helpers/schema-name.js +5 -4
  310. package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -1
  311. package/dist/components/Content/Schema/helpers/should-display-description.js.map +1 -1
  312. package/dist/components/Content/Schema/helpers/should-display-heading.js.map +1 -1
  313. package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js.map +1 -1
  314. package/dist/components/Content/Schema/helpers/sort-property-names.js.map +1 -1
  315. package/dist/components/Content/Schema/types.d.ts +7 -0
  316. package/dist/components/Content/Schema/types.d.ts.map +1 -1
  317. package/dist/components/Content/Tags/Tag.vue.script.js +1 -1
  318. package/dist/components/Content/Tags/Tag.vue.script.js.map +1 -1
  319. package/dist/components/Content/Tags/components/ClassicLayout.vue.d.ts.map +1 -1
  320. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
  321. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +1 -1
  322. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -1
  323. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
  324. package/dist/components/Content/Tags/components/ModernLayout.vue.js +1 -1
  325. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +1 -1
  326. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -1
  327. package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
  328. package/dist/components/Content/Tags/components/TagSection.vue.script.js +1 -1
  329. package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
  330. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  331. package/dist/components/GettingStarted.vue.js +1 -1
  332. package/dist/components/GettingStarted.vue.js.map +1 -1
  333. package/dist/components/GettingStarted.vue.script.js +4 -3
  334. package/dist/components/GettingStarted.vue.script.js.map +1 -1
  335. package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
  336. package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
  337. package/dist/components/IntersectionObserver.vue.script.js +10 -7
  338. package/dist/components/IntersectionObserver.vue.script.js.map +1 -1
  339. package/dist/components/Lazy/Lazy.vue.script.js +2 -2
  340. package/dist/components/Lazy/Lazy.vue.script.js.map +1 -1
  341. package/dist/components/LinkList/LinkList.vue.js +1 -1
  342. package/dist/components/LinkList/LinkList.vue.script.js +1 -1
  343. package/dist/components/LinkList/LinkList.vue.script.js.map +1 -1
  344. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  345. package/dist/components/MobileHeader.vue.script.js +4 -4
  346. package/dist/components/MobileHeader.vue.script.js.map +1 -1
  347. package/dist/components/OperationPath.vue.d.ts.map +1 -1
  348. package/dist/components/OperationPath.vue.js +1 -1
  349. package/dist/components/OperationPath.vue.script.js +1 -1
  350. package/dist/components/OperationPath.vue.script.js.map +1 -1
  351. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  352. package/dist/components/OperationsList/OperationsList.vue.script.js +1 -1
  353. package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
  354. package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
  355. package/dist/components/OperationsList/OperationsListItem.vue.script.js +1 -1
  356. package/dist/components/OperationsList/OperationsListItem.vue.script.js.map +1 -1
  357. package/dist/components/RenderPlugins/RenderPluginView.vue.script.js +1 -1
  358. package/dist/components/RenderPlugins/RenderPluginView.vue.script.js.map +1 -1
  359. package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +1 -1
  360. package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -1
  361. package/dist/components/ScreenReader.vue.js +1 -1
  362. package/dist/components/ScreenReader.vue.script.js +2 -2
  363. package/dist/components/ScreenReader.vue.script.js.map +1 -1
  364. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  365. package/dist/components/Section/CompactSection.vue.js +1 -1
  366. package/dist/components/Section/CompactSection.vue.script.js +1 -1
  367. package/dist/components/Section/CompactSection.vue.script.js.map +1 -1
  368. package/dist/components/Section/Section.vue.js +1 -1
  369. package/dist/components/Section/Section.vue.script.js +1 -1
  370. package/dist/components/Section/Section.vue.script.js.map +1 -1
  371. package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
  372. package/dist/components/Section/SectionAccordion.vue.js +1 -1
  373. package/dist/components/Section/SectionAccordion.vue.script.js +1 -1
  374. package/dist/components/Section/SectionAccordion.vue.script.js.map +1 -1
  375. package/dist/components/Section/SectionColumn.vue.js +1 -1
  376. package/dist/components/Section/SectionColumn.vue.js.map +1 -1
  377. package/dist/components/Section/SectionColumns.vue.js +1 -1
  378. package/dist/components/Section/SectionColumns.vue.js.map +1 -1
  379. package/dist/components/Section/SectionContainer.vue.js +1 -1
  380. package/dist/components/Section/SectionContainer.vue.script.js +2 -2
  381. package/dist/components/Section/SectionContainer.vue.script.js.map +1 -1
  382. package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
  383. package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
  384. package/dist/components/Section/SectionContainerAccordion.vue.script.js +1 -1
  385. package/dist/components/Section/SectionContainerAccordion.vue.script.js.map +1 -1
  386. package/dist/components/Section/SectionContent.vue.js +1 -1
  387. package/dist/components/Section/SectionContent.vue.js.map +1 -1
  388. package/dist/components/Section/SectionHeader.vue.js +1 -1
  389. package/dist/components/Section/SectionHeader.vue.script.js +2 -2
  390. package/dist/components/Section/SectionHeader.vue.script.js.map +1 -1
  391. package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
  392. package/dist/components/Section/SectionHeaderTag.vue.script.js +1 -1
  393. package/dist/components/Section/SectionHeaderTag.vue.script.js.map +1 -1
  394. package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
  395. package/dist/components/SectionFlare/SectionFlare.vue.js.map +1 -1
  396. package/dist/components/ShowMoreButton.vue.js +1 -1
  397. package/dist/components/ShowMoreButton.vue.script.js +1 -1
  398. package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
  399. package/dist/components/index.d.ts +1 -0
  400. package/dist/components/index.d.ts.map +1 -1
  401. package/dist/components/index.js +5 -1
  402. package/dist/features/Operation/Operation.vue.script.js +1 -1
  403. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  404. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  405. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +2 -2
  406. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
  407. package/dist/features/Operation/components/Header.vue.d.ts +2 -0
  408. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
  409. package/dist/features/Operation/components/Header.vue.js.map +1 -1
  410. package/dist/features/Operation/components/Header.vue.script.js +4 -2
  411. package/dist/features/Operation/components/Header.vue.script.js.map +1 -1
  412. package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
  413. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  414. package/dist/features/Operation/components/Headers.vue.js +1 -1
  415. package/dist/features/Operation/components/Headers.vue.js.map +1 -1
  416. package/dist/features/Operation/components/Headers.vue.script.js +5 -2
  417. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  418. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  419. package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
  420. package/dist/features/Operation/components/OperationParameters.vue.script.js +4 -4
  421. package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
  422. package/dist/features/Operation/components/OperationResponses.vue.script.js +1 -1
  423. package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
  424. package/dist/features/Operation/components/OperationScopes.vue.script.js +1 -1
  425. package/dist/features/Operation/components/OperationScopes.vue.script.js.map +1 -1
  426. package/dist/features/Operation/components/ParameterList.vue.script.js +1 -1
  427. package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -1
  428. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  429. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  430. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  431. package/dist/features/Operation/components/ParameterListItem.vue.script.js +4 -1
  432. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  433. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  434. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  435. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  436. package/dist/features/Operation/components/RequestBody.vue.script.js +12 -3
  437. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  438. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +1 -1
  439. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
  440. package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js +1 -1
  441. package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js.map +1 -1
  442. package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
  443. package/dist/features/Operation/components/callbacks/Callback.vue.script.js +1 -1
  444. package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -1
  445. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +1 -1
  446. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
  447. package/dist/features/Operation/components/helpers/get-parameter-examples.js.map +1 -1
  448. package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -1
  449. package/dist/features/Operation/helpers/flatten-deep-object-query-parameter.js.map +1 -1
  450. package/dist/features/Operation/helpers/get-required-security.js.map +1 -1
  451. package/dist/features/Operation/helpers/operation-stability.js.map +1 -1
  452. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  453. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  454. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +1 -1
  455. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  456. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  457. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  458. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +1 -1
  459. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  460. package/dist/features/Operation/request-body-composition-index.js.map +1 -1
  461. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  462. package/dist/features/Search/components/SearchButton.vue.script.js +1 -1
  463. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  464. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  465. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  466. package/dist/features/Search/components/SearchModal.vue.script.js +1 -1
  467. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  468. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  469. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  470. package/dist/features/Search/components/SearchResult.vue.script.js +3 -3
  471. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  472. package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
  473. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  474. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  475. package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
  476. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +1 -1
  477. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
  478. package/dist/features/developer-tools/DeveloperTools.vue.script.js +2 -2
  479. package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
  480. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +1 -1
  481. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js.map +1 -1
  482. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +1 -1
  483. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
  484. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  485. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  486. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +3 -3
  487. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  488. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
  489. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -1
  490. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +1 -1
  491. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
  492. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
  493. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +4 -3
  494. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
  495. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  496. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  497. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +2 -1
  498. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  499. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
  500. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +4 -3
  501. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
  502. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
  503. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +1 -1
  504. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
  505. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +1 -1
  506. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
  507. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +2 -2
  508. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
  509. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +1 -1
  510. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
  511. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  512. package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -1
  513. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  514. package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
  515. package/dist/features/example-responses/ExampleResponseTab.vue.script.js +1 -1
  516. package/dist/features/example-responses/ExampleResponseTab.vue.script.js.map +1 -1
  517. package/dist/features/example-responses/ExampleResponseTabList.vue.d.ts.map +1 -1
  518. package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
  519. package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +1 -1
  520. package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -1
  521. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  522. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  523. package/dist/features/example-responses/ExampleResponses.vue.script.js +1 -1
  524. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  525. package/dist/features/example-responses/ExampleSchema.vue.script.js +1 -1
  526. package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
  527. package/dist/features/example-responses/helpers/has-response-content.js.map +1 -1
  528. package/dist/features/example-responses/helpers/normalize-mime-type-object.js.map +1 -1
  529. package/dist/features/example-responses/helpers/normalize-mime-type.js.map +1 -1
  530. package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
  531. package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
  532. package/dist/features/external-docs/ExternalDocs.vue.script.js +25 -13
  533. package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -1
  534. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  535. package/dist/features/info-object/Contact.vue.js.map +1 -1
  536. package/dist/features/info-object/Contact.vue.script.js +10 -4
  537. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  538. package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -1
  539. package/dist/features/info-object/InfoLink.vue.js.map +1 -1
  540. package/dist/features/info-object/InfoLink.vue.script.js +17 -5
  541. package/dist/features/info-object/InfoLink.vue.script.js.map +1 -1
  542. package/dist/features/info-object/License.vue.d.ts.map +1 -1
  543. package/dist/features/info-object/License.vue.js.map +1 -1
  544. package/dist/features/info-object/License.vue.script.js +11 -5
  545. package/dist/features/info-object/License.vue.script.js.map +1 -1
  546. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  547. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  548. package/dist/features/info-object/TermsOfService.vue.script.js +10 -4
  549. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  550. package/dist/features/localization/locales/ar.js.map +1 -1
  551. package/dist/features/localization/locales/de.js.map +1 -1
  552. package/dist/features/localization/locales/en.js.map +1 -1
  553. package/dist/features/localization/locales/es.js.map +1 -1
  554. package/dist/features/localization/locales/fr.js.map +1 -1
  555. package/dist/features/localization/locales/pt.d.ts +229 -0
  556. package/dist/features/localization/locales/pt.d.ts.map +1 -0
  557. package/dist/features/localization/locales/pt.js +227 -0
  558. package/dist/features/localization/locales/pt.js.map +1 -0
  559. package/dist/features/localization/locales/ru.js.map +1 -1
  560. package/dist/features/localization/locales/zh-cn.js.map +1 -1
  561. package/dist/features/localization/translations.d.ts +228 -0
  562. package/dist/features/localization/translations.d.ts.map +1 -1
  563. package/dist/features/localization/translations.js +4 -2
  564. package/dist/features/localization/translations.js.map +1 -1
  565. package/dist/features/localization/use-localization.js.map +1 -1
  566. package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
  567. package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
  568. package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -1
  569. package/dist/features/specification-extension/SpecificationExtension.vue.script.js +1 -1
  570. package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -1
  571. package/dist/features/specification-extension/helpers.js.map +1 -1
  572. package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
  573. package/dist/features/test-request-button/TestRequestButton.vue.script.js +1 -1
  574. package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
  575. package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -1
  576. package/dist/features/x-badges/XBadges.vue.script.js +1 -1
  577. package/dist/features/x-badges/XBadges.vue.script.js.map +1 -1
  578. package/dist/helpers/build-models-index.d.ts +15 -0
  579. package/dist/helpers/build-models-index.d.ts.map +1 -0
  580. package/dist/helpers/build-models-index.js +28 -0
  581. package/dist/helpers/build-models-index.js.map +1 -0
  582. package/dist/helpers/color-mode.js.map +1 -1
  583. package/dist/helpers/download.js.map +1 -1
  584. package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -1
  585. package/dist/helpers/get-async-api-model-schema.js.map +1 -1
  586. package/dist/helpers/id-routing.d.ts +18 -4
  587. package/dist/helpers/id-routing.d.ts.map +1 -1
  588. package/dist/helpers/id-routing.js +67 -20
  589. package/dist/helpers/id-routing.js.map +1 -1
  590. package/dist/helpers/is-introduction-entry.js.map +1 -1
  591. package/dist/helpers/lazy-bus.js.map +1 -1
  592. package/dist/helpers/load-from-perssistance.js.map +1 -1
  593. package/dist/helpers/map-config-plugins.js.map +1 -1
  594. package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
  595. package/dist/helpers/normalize-configurations.js +1 -1
  596. package/dist/helpers/normalize-configurations.js.map +1 -1
  597. package/dist/helpers/openapi.d.ts +6 -1
  598. package/dist/helpers/openapi.d.ts.map +1 -1
  599. package/dist/helpers/openapi.js +37 -6
  600. package/dist/helpers/openapi.js.map +1 -1
  601. package/dist/helpers/safe-deep-clone.js.map +1 -1
  602. package/dist/helpers/storage.d.ts +16 -0
  603. package/dist/helpers/storage.d.ts.map +1 -1
  604. package/dist/helpers/storage.js +14 -0
  605. package/dist/helpers/storage.js.map +1 -1
  606. package/dist/helpers/upload-temp-document.js.map +1 -1
  607. package/dist/hooks/use-agent.js.map +1 -1
  608. package/dist/hooks/use-intersection.js.map +1 -1
  609. package/dist/plugins/hooks/usePluginManager.js.map +1 -1
  610. package/dist/plugins/persistence-plugin.js +6 -1
  611. package/dist/plugins/persistence-plugin.js.map +1 -1
  612. package/dist/plugins/plugin-manager.js +35 -0
  613. package/dist/plugins/plugin-manager.js.map +1 -1
  614. package/dist/plugins/posthog/index.js.map +1 -1
  615. package/dist/standalone/lib/html-api.js.map +1 -1
  616. package/dist/standalone/lib/load-plugins-from-urls.js.map +1 -1
  617. package/dist/style.css +1419 -1316
  618. package/dist/vue-styles.css +918 -831
  619. package/package.json +27 -27
  620. package/dist/browser/chunks/AgentScalarChatInterface-C8lX3RCo.js +0 -27
  621. package/dist/browser/chunks/ScalarTextInput.vue-Xf60Nwf-.js +0 -27
  622. package/dist/browser/chunks/browser-67K6wmG9.js +0 -129
  623. package/dist/browser/chunks/modal-B8Opb61-.js +0 -15
  624. package/dist/browser/chunks/modal-Dcl-Y2Zk.js +0 -99
  625. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +0 -17
  626. package/dist/browser/chunks/vendor-CBP43oHJ.js +0 -306
  627. package/dist/features/Operation/helpers/should-ignore-entity.d.ts +0 -8
  628. package/dist/features/Operation/helpers/should-ignore-entity.d.ts.map +0 -1
  629. package/dist/features/Operation/helpers/should-ignore-entity.js +0 -9
  630. package/dist/features/Operation/helpers/should-ignore-entity.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"translations.js","names":[],"sources":["../../../src/features/localization/translations.ts"],"sourcesContent":["import type { ApiReferenceBuiltInLocale, ApiReferenceTranslations } from '@scalar/types/api-reference'\n\nimport { ar } from './locales/ar'\nimport { de } from './locales/de'\nimport { en } from './locales/en'\nimport { es } from './locales/es'\nimport { fr } from './locales/fr'\nimport { ru } from './locales/ru'\nimport { zhCn } from './locales/zh-cn'\n\nexport const localeTranslations = {\n en,\n ru,\n es,\n fr,\n de,\n 'zh-CN': zhCn,\n ar,\n} satisfies Record<ApiReferenceBuiltInLocale, ApiReferenceTranslations>\n\nexport const DEFAULT_LOCALE: ApiReferenceBuiltInLocale = 'en'\n\nexport const RTL_LOCALES = new Set(['ar', 'fa', 'he', 'ur'])\n"],"mappings":";;;;;;;;AAUA,IAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA,SAAS;CACT;CACD;AAID,IAAa,cAAc,IAAI,IAAI;CAAC;CAAM;CAAM;CAAM;CAAK,CAAC"}
1
+ {"version":3,"file":"translations.js","names":[],"sources":["../../../src/features/localization/translations.ts"],"sourcesContent":["import type { ApiReferenceBuiltInLocale, ApiReferenceTranslations } from '@scalar/types/api-reference'\n\nimport { ar } from './locales/ar'\nimport { de } from './locales/de'\nimport { en } from './locales/en'\nimport { es } from './locales/es'\nimport { fr } from './locales/fr'\nimport { pt } from './locales/pt'\nimport { ru } from './locales/ru'\nimport { zhCn } from './locales/zh-cn'\n\nexport const localeTranslations = {\n en,\n ru,\n es,\n fr,\n de,\n 'zh-CN': zhCn,\n ar,\n pt,\n} satisfies Record<ApiReferenceBuiltInLocale, ApiReferenceTranslations>\n\nexport const DEFAULT_LOCALE: ApiReferenceBuiltInLocale = 'en'\n\nexport const RTL_LOCALES = new Set(['ar', 'fa', 'he', 'ur'])\n"],"mappings":";;;;;;;;;AAWA,IAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA,SAAS;CACT;CACA;AACF;AAIA,IAAa,8BAAc,IAAI,IAAI;CAAC;CAAM;CAAM;CAAM;AAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-localization.js","names":[],"sources":["../../../src/features/localization/use-localization.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport { mergeObjects } from '@scalar/helpers/object/merge-objects'\nimport type {\n ApiReferenceLocale,\n ApiReferenceLocalization,\n ApiReferenceTextDirection,\n ApiReferenceTranslationKey,\n ApiReferenceTranslations,\n} from '@scalar/types/api-reference'\nimport { type ComputedRef, type InjectionKey, type MaybeRefOrGetter, computed, inject, provide, toValue } from 'vue'\n\nimport { DEFAULT_LOCALE, RTL_LOCALES, localeTranslations } from './translations'\n\ntype LocalizationContext = {\n locale: ComputedRef<ApiReferenceLocale>\n direction: ComputedRef<ApiReferenceTextDirection>\n translations: ComputedRef<ApiReferenceTranslations>\n translate: (key: ApiReferenceTranslationKey, params?: Record<string, number | string>) => string\n}\n\ntype ResolvedLocalization = {\n locale: ApiReferenceLocale\n direction: ApiReferenceTextDirection\n translations: ApiReferenceTranslations\n}\n\nconst LOCALIZATION_SYMBOL: InjectionKey<LocalizationContext> = Symbol('LOCALIZATION')\n\nconst resolveBuiltInLocale = (locale?: ApiReferenceLocale): keyof typeof localeTranslations => {\n if (!locale) {\n return DEFAULT_LOCALE\n }\n\n if (locale in localeTranslations) {\n return locale as keyof typeof localeTranslations\n }\n\n const normalized = locale.replace('_', '-').toLowerCase()\n\n if (normalized.startsWith('zh')) {\n return 'zh-CN'\n }\n\n const language = normalized.split('-')[0]\n const match = Object.keys(localeTranslations).find((key) => key.toLowerCase() === language)\n\n return (match as keyof typeof localeTranslations | undefined) ?? DEFAULT_LOCALE\n}\n\nconst resolveDirection = (localization?: ApiReferenceLocalization): ApiReferenceTextDirection => {\n if (localization?.direction && localization.direction !== 'auto') {\n return localization.direction\n }\n\n const locale = localization?.locale ?? DEFAULT_LOCALE\n const language = locale.replace('_', '-').split('-')[0]?.toLowerCase()\n\n return language && RTL_LOCALES.has(language) ? 'rtl' : 'ltr'\n}\n\nexport const resolveLocalization = (localization?: ApiReferenceLocalization): ResolvedLocalization => {\n const locale = localization?.locale ?? DEFAULT_LOCALE\n const builtInLocale = resolveBuiltInLocale(locale)\n const translations = mergeObjects(\n mergeObjects(localeTranslations.en, localeTranslations[builtInLocale]),\n localization?.translations,\n )\n\n return {\n locale,\n direction: resolveDirection(localization),\n translations,\n }\n}\n\nconst getTranslationValue = (translations: ApiReferenceTranslations, key: ApiReferenceTranslationKey) =>\n key.split('.').reduce<unknown>((value, segment) => {\n if (!isObject(value)) {\n return undefined\n }\n\n return value[segment]\n }, translations)\n\nconst translateApiReference = (\n translations: ApiReferenceTranslations,\n key: ApiReferenceTranslationKey,\n params?: Record<string, number | string>,\n): string => {\n const value = getTranslationValue(translations, key)\n\n if (typeof value !== 'string' && import.meta.env.DEV) {\n console.warn(`[@scalar/api-reference] Missing translation for key \"${key}\". Falling back to the key itself.`)\n }\n\n const template = typeof value === 'string' ? value : key\n\n if (!params) {\n return template\n }\n\n return Object.entries(params).reduce(\n (result, [param, paramValue]) => result.replaceAll(`{${param}}`, String(paramValue)),\n template,\n )\n}\n\nconst createLocalizationContext = (\n localization: MaybeRefOrGetter<ApiReferenceLocalization | undefined>,\n): LocalizationContext => {\n const resolved = computed(() => resolveLocalization(toValue(localization)))\n\n return {\n locale: computed(() => resolved.value.locale),\n direction: computed(() => resolved.value.direction),\n translations: computed(() => resolved.value.translations),\n translate: (key, params) => translateApiReference(resolved.value.translations, key, params),\n }\n}\n\nexport const provideLocalization = (localization: MaybeRefOrGetter<ApiReferenceLocalization | undefined>) => {\n const context = createLocalizationContext(localization)\n\n provide(LOCALIZATION_SYMBOL, context)\n\n return context\n}\n\nexport const useLocalization = (): LocalizationContext =>\n inject(LOCALIZATION_SYMBOL, createLocalizationContext(undefined))\n"],"mappings":";;;;;AA0BA,IAAM,sBAAyD,OAAO,eAAe;AAErF,IAAM,wBAAwB,WAAiE;AAC7F,KAAI,CAAC,OACH,QAAA;AAGF,KAAI,UAAU,mBACZ,QAAO;CAGT,MAAM,aAAa,OAAO,QAAQ,KAAK,IAAI,CAAC,aAAa;AAEzD,KAAI,WAAW,WAAW,KAAK,CAC7B,QAAO;CAGT,MAAM,WAAW,WAAW,MAAM,IAAI,CAAC;AAGvC,QAFc,OAAO,KAAK,mBAAmB,CAAC,MAAM,QAAQ,IAAI,aAAa,KAAK,SAAS,IAAA;;AAK7F,IAAM,oBAAoB,iBAAuE;AAC/F,KAAI,cAAc,aAAa,aAAa,cAAc,OACxD,QAAO,aAAa;CAItB,MAAM,YADS,cAAc,UAAA,MACL,QAAQ,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,aAAa;AAEtE,QAAO,YAAY,YAAY,IAAI,SAAS,GAAG,QAAQ;;AAGzD,IAAa,uBAAuB,iBAAkE;CACpG,MAAM,SAAS,cAAc,UAAA;CAC7B,MAAM,gBAAgB,qBAAqB,OAAO;CAClD,MAAM,eAAe,aACnB,aAAa,mBAAmB,IAAI,mBAAmB,eAAe,EACtE,cAAc,aACf;AAED,QAAO;EACL;EACA,WAAW,iBAAiB,aAAa;EACzC;EACD;;AAGH,IAAM,uBAAuB,cAAwC,QACnE,IAAI,MAAM,IAAI,CAAC,QAAiB,OAAO,YAAY;AACjD,KAAI,CAAC,SAAS,MAAM,CAClB;AAGF,QAAO,MAAM;GACZ,aAAa;AAElB,IAAM,yBACJ,cACA,KACA,WACW;CACX,MAAM,QAAQ,oBAAoB,cAAc,IAAI;CAMpD,MAAM,WAAW,OAAO,UAAU,WAAW,QAAQ;AAErD,KAAI,CAAC,OACH,QAAO;AAGT,QAAO,OAAO,QAAQ,OAAO,CAAC,QAC3B,QAAQ,CAAC,OAAO,gBAAgB,OAAO,WAAW,IAAI,MAAM,IAAI,OAAO,WAAW,CAAC,EACpF,SACD;;AAGH,IAAM,6BACJ,iBACwB;CACxB,MAAM,WAAW,eAAe,oBAAoB,QAAQ,aAAa,CAAC,CAAC;AAE3E,QAAO;EACL,QAAQ,eAAe,SAAS,MAAM,OAAO;EAC7C,WAAW,eAAe,SAAS,MAAM,UAAU;EACnD,cAAc,eAAe,SAAS,MAAM,aAAa;EACzD,YAAY,KAAK,WAAW,sBAAsB,SAAS,MAAM,cAAc,KAAK,OAAO;EAC5F;;AAGH,IAAa,uBAAuB,iBAAyE;CAC3G,MAAM,UAAU,0BAA0B,aAAa;AAEvD,SAAQ,qBAAqB,QAAQ;AAErC,QAAO;;AAGT,IAAa,wBACX,OAAO,qBAAqB,0BAA0B,KAAA,EAAU,CAAC"}
1
+ {"version":3,"file":"use-localization.js","names":[],"sources":["../../../src/features/localization/use-localization.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport { mergeObjects } from '@scalar/helpers/object/merge-objects'\nimport type {\n ApiReferenceLocale,\n ApiReferenceLocalization,\n ApiReferenceTextDirection,\n ApiReferenceTranslationKey,\n ApiReferenceTranslations,\n} from '@scalar/types/api-reference'\nimport { type ComputedRef, type InjectionKey, type MaybeRefOrGetter, computed, inject, provide, toValue } from 'vue'\n\nimport { DEFAULT_LOCALE, RTL_LOCALES, localeTranslations } from './translations'\n\ntype LocalizationContext = {\n locale: ComputedRef<ApiReferenceLocale>\n direction: ComputedRef<ApiReferenceTextDirection>\n translations: ComputedRef<ApiReferenceTranslations>\n translate: (key: ApiReferenceTranslationKey, params?: Record<string, number | string>) => string\n}\n\ntype ResolvedLocalization = {\n locale: ApiReferenceLocale\n direction: ApiReferenceTextDirection\n translations: ApiReferenceTranslations\n}\n\nconst LOCALIZATION_SYMBOL: InjectionKey<LocalizationContext> = Symbol('LOCALIZATION')\n\nconst resolveBuiltInLocale = (locale?: ApiReferenceLocale): keyof typeof localeTranslations => {\n if (!locale) {\n return DEFAULT_LOCALE\n }\n\n if (locale in localeTranslations) {\n return locale as keyof typeof localeTranslations\n }\n\n const normalized = locale.replace('_', '-').toLowerCase()\n\n if (normalized.startsWith('zh')) {\n return 'zh-CN'\n }\n\n const language = normalized.split('-')[0]\n const match = Object.keys(localeTranslations).find((key) => key.toLowerCase() === language)\n\n return (match as keyof typeof localeTranslations | undefined) ?? DEFAULT_LOCALE\n}\n\nconst resolveDirection = (localization?: ApiReferenceLocalization): ApiReferenceTextDirection => {\n if (localization?.direction && localization.direction !== 'auto') {\n return localization.direction\n }\n\n const locale = localization?.locale ?? DEFAULT_LOCALE\n const language = locale.replace('_', '-').split('-')[0]?.toLowerCase()\n\n return language && RTL_LOCALES.has(language) ? 'rtl' : 'ltr'\n}\n\nexport const resolveLocalization = (localization?: ApiReferenceLocalization): ResolvedLocalization => {\n const locale = localization?.locale ?? DEFAULT_LOCALE\n const builtInLocale = resolveBuiltInLocale(locale)\n const translations = mergeObjects(\n mergeObjects(localeTranslations.en, localeTranslations[builtInLocale]),\n localization?.translations,\n )\n\n return {\n locale,\n direction: resolveDirection(localization),\n translations,\n }\n}\n\nconst getTranslationValue = (translations: ApiReferenceTranslations, key: ApiReferenceTranslationKey) =>\n key.split('.').reduce<unknown>((value, segment) => {\n if (!isObject(value)) {\n return undefined\n }\n\n return value[segment]\n }, translations)\n\nconst translateApiReference = (\n translations: ApiReferenceTranslations,\n key: ApiReferenceTranslationKey,\n params?: Record<string, number | string>,\n): string => {\n const value = getTranslationValue(translations, key)\n\n if (typeof value !== 'string' && import.meta.env.DEV) {\n console.warn(`[@scalar/api-reference] Missing translation for key \"${key}\". Falling back to the key itself.`)\n }\n\n const template = typeof value === 'string' ? value : key\n\n if (!params) {\n return template\n }\n\n return Object.entries(params).reduce(\n (result, [param, paramValue]) => result.replaceAll(`{${param}}`, String(paramValue)),\n template,\n )\n}\n\nconst createLocalizationContext = (\n localization: MaybeRefOrGetter<ApiReferenceLocalization | undefined>,\n): LocalizationContext => {\n const resolved = computed(() => resolveLocalization(toValue(localization)))\n\n return {\n locale: computed(() => resolved.value.locale),\n direction: computed(() => resolved.value.direction),\n translations: computed(() => resolved.value.translations),\n translate: (key, params) => translateApiReference(resolved.value.translations, key, params),\n }\n}\n\nexport const provideLocalization = (localization: MaybeRefOrGetter<ApiReferenceLocalization | undefined>) => {\n const context = createLocalizationContext(localization)\n\n provide(LOCALIZATION_SYMBOL, context)\n\n return context\n}\n\nexport const useLocalization = (): LocalizationContext =>\n inject(LOCALIZATION_SYMBOL, createLocalizationContext(undefined))\n"],"mappings":";;;;;AA0BA,IAAM,sBAAyD,OAAO,cAAc;AAEpF,IAAM,wBAAwB,WAAiE;CAC7F,IAAI,CAAC,QACH,OAAA;CAGF,IAAI,UAAU,oBACZ,OAAO;CAGT,MAAM,aAAa,OAAO,QAAQ,KAAK,GAAG,CAAC,CAAC,YAAY;CAExD,IAAI,WAAW,WAAW,IAAI,GAC5B,OAAO;CAGT,MAAM,WAAW,WAAW,MAA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AAS,MAAM,YAAY;EACxD,YAAY,KAAK,WAAW,sBAAsB,SAAS,MAAM,cAAc,KAAK,MAAM;CAC5F;AACF;AAEA,IAAa,uBAAuB,iBAAyE;CAC3G,MAAM,UAAU,0BAA0B,YAAY;CAEtD,QAAQ,qBAAqB,OAAO;CAEpC,OAAO;AACT;AAEA,IAAa,wBACX,OAAO,qBAAqB,0BAA0B,KAAA,CAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"names":[],"mappings":"AAsDA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;AAsHF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"names":[],"mappings":"AAsDA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;AAuHF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -11,7 +11,7 @@ var _hoisted_2 = {
11
11
  type: "button"
12
12
  };
13
13
  var _hoisted_3 = { class: "overflow-hidden text-base text-ellipsis" };
14
- var DocumentSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
14
+ var DocumentSelector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
15
15
  __name: "DocumentSelector",
16
16
  props: {
17
17
  options: {},
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSelector.vue.script.js","names":[],"sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n options: { label: string; id: string }[]\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\nconst formattedOptions = computed(() =>\n props.options.map((o) => ({ id: o.id, label: o.label })),\n)\n\nconst selected = computed(() =>\n formattedOptions.value.find((o) => o.id === props.modelValue),\n)\n</script>\n\n<template>\n <div\n v-if=\"options.length > 1\"\n class=\"document-selector px-3 pt-3\">\n <ScalarListbox\n v-slot=\"{ open }\"\n :modelValue=\"selected\"\n :options=\"formattedOptions\"\n resize\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <button\n class=\"group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium\"\n type=\"button\">\n <span class=\"overflow-hidden text-base text-ellipsis\">\n {{ selected?.label || 'Select API' }}\n </span>\n <ScalarIconCaretDown\n class=\"size-3 text-current transition-transform\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </button>\n </ScalarListbox>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAIb,MAAM,mBAAmB,eACvB,MAAM,QAAQ,KAAK,OAAO;GAAE,IAAI,EAAE;GAAI,OAAO,EAAE;GAAO,EAAE,CAC1D;EAEA,MAAM,WAAW,eACf,iBAAiB,MAAM,MAAM,MAAM,EAAE,OAAO,MAAM,WAAW,CAC/D;;UAKU,QAAA,QAAQ,SAAM,KAAA,WAAA,EADtB,mBAqBM,OArBN,YAqBM,CAlBJ,YAiBgB,MAAA,cAAA,EAAA;IAfb,YAAY,SAAA;IACZ,SAAS,iBAAA;IACV,QAAA;IACC,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,GAAE;;sBAWhD,EAfC,WAAI,CAKd,mBAUS,UAVT,YAUS,CAPP,mBAEO,QAFP,YAEO,gBADF,SAAA,OAAU,SAAK,aAAA,EAAA,EAAA,EAEpB,YAGkB,MAAA,oBAAA,EAAA;KAFhB,OAAK,eAAA,CAAC,4CAA0C,EAAA,cACxB,MAAI,CAAA,CAAA;KAC5B,QAAO"}
1
+ {"version":3,"file":"DocumentSelector.vue.script.js","names":[],"sources":["../../../src/features/multiple-documents/DocumentSelector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n options: { label: string; id: string }[]\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\nconst formattedOptions = computed(() =>\n props.options.map((o) => ({ id: o.id, label: o.label })),\n)\n\nconst selected = computed(() =>\n formattedOptions.value.find((o) => o.id === props.modelValue),\n)\n</script>\n\n<template>\n <div\n v-if=\"options.length > 1\"\n class=\"document-selector px-3 pt-3\">\n <ScalarListbox\n v-slot=\"{ open }\"\n :modelValue=\"selected\"\n :options=\"formattedOptions\"\n resize\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <button\n class=\"group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium\"\n type=\"button\">\n <span class=\"overflow-hidden text-base text-ellipsis\">\n {{ selected?.label || 'Select API' }}\n </span>\n <ScalarIconCaretDown\n class=\"size-3 text-current transition-transform\"\n :class=\"{ 'rotate-180': open }\"\n weight=\"bold\" />\n </button>\n </ScalarListbox>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAIb,MAAM,mBAAmB,eACvB,MAAM,QAAQ,KAAK,OAAO;GAAE,IAAI,EAAE;GAAI,OAAO,EAAE;EAAM,EAAE,CACzD;EAEA,MAAM,WAAW,eACf,iBAAiB,MAAM,MAAM,MAAM,EAAE,OAAO,MAAM,UAAU,CAC9D;;UAKU,QAAA,QAAQ,SAAM,KAAA,UAAA,GADtB,mBAqBM,OArBN,YAqBM,CAlBJ,YAiBgB,MAAA,aAAA,GAAA;IAfb,YAAY,SAAA;IACZ,SAAS,iBAAA;IACV,QAAA;IACC,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,EAAE;;sBAWhD,EAfC,WAAI,CAKd,mBAUS,UAVT,YAUS,CAPP,mBAEO,QAFP,YAEO,gBADF,SAAA,OAAU,SAAK,YAAA,GAAA,CAAA,GAEpB,YAGkB,MAAA,mBAAA,GAAA;KAFhB,OAAK,eAAA,CAAC,4CAA0C,EAAA,cACxB,KAAI,CAAA,CAAA;KAC5B,QAAO"}
@@ -6,7 +6,7 @@ var _hoisted_1 = {
6
6
  key: 0,
7
7
  class: "text-base"
8
8
  };
9
- var SpecificationExtension_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
+ var SpecificationExtension_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
10
10
  __name: "SpecificationExtension",
11
11
  props: { value: {} },
12
12
  setup(__props) {
@@ -1 +1 @@
1
- {"version":3,"file":"SpecificationExtension.vue.script.js","names":[],"sources":["../../../src/features/specification-extension/SpecificationExtension.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { computed } from 'vue'\n\nimport { usePluginManager } from '@/plugins'\n\nconst { value } = defineProps<{\n /**\n * Any value that can contain OpenAPI specification extensions.\n */\n value: Record<string, unknown> | undefined\n}>()\n\nconst { getSpecificationExtensions } = usePluginManager()\n\n/**\n * Extract registered OpenAPI extension names\n */\nfunction getCustomExtensionNames(\n value: Record<string, any> | undefined,\n): `x-${string}`[] {\n return Object.keys(value ?? {}).filter((item) =>\n item.startsWith('x-'),\n ) as `x-${string}`[]\n}\n\n/**\n * Get the components for the specification extensions\n */\nfunction getCustomOpenApiExtensionComponents(extensionNames: `x-${string}`[]) {\n return extensionNames\n .flatMap((name) => getSpecificationExtensions(name))\n .filter((extension) => extension.component)\n}\n\n/**\n * Get the names of custom extensions from the provided value.\n */\nconst customExtensionNames = computed(() => getCustomExtensionNames(value))\n\n/**\n * Get the components for the custom extensions.\n */\nconst customExtensions = computed(() =>\n getCustomOpenApiExtensionComponents(customExtensionNames.value),\n)\n</script>\n\n<template>\n <template v-if=\"typeof value === 'object' && customExtensions.length\">\n <div class=\"text-base\">\n <template v-for=\"extension in customExtensions\">\n <ScalarErrorBoundary>\n <template v-if=\"extension.renderer\">\n <!-- Custom rendering -->\n <component\n :is=\"extension.renderer\"\n v-bind=\"{\n [extension.name]: value?.[extension.name],\n component: extension.component,\n }\" />\n </template>\n <template v-else>\n <!-- Vue rendering -->\n <component\n :is=\"extension.component\"\n v-bind=\"{ [extension.name]: value?.[extension.name] }\" />\n </template>\n </ScalarErrorBoundary>\n </template>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;EAaA,MAAM,EAAE,+BAA+B,kBAAiB;;;;EAKxD,SAAS,wBACP,OACiB;AACjB,UAAO,OAAO,KAAK,SAAS,EAAE,CAAC,CAAC,QAAQ,SACtC,KAAK,WAAW,KAAK,CACtB;;;;;EAMH,SAAS,oCAAoC,gBAAiC;AAC5E,UAAO,eACJ,SAAS,SAAS,2BAA2B,KAAK,CAAA,CAClD,QAAQ,cAAc,UAAU,UAAS;;;;;EAM9C,MAAM,uBAAuB,eAAe,wBAAwB,QAAA,MAAM,CAAA;;;;EAK1E,MAAM,mBAAmB,eACvB,oCAAoC,qBAAqB,MAAM,CACjE;;iBAIyB,QAAA,UAAK,YAAiB,iBAAA,MAAiB,UAAA,WAAA,EAC5D,mBAoBM,OApBN,YAoBM,EAAA,UAAA,KAAA,EAnBJ,mBAkBW,UAAA,MAAA,WAlBmB,iBAAA,QAAb,cAAS;wBACxB,YAgBsB,MAAA,oBAAA,EAAA,MAAA;4BAPT,CARK,UAAU,YAAA,WAAA,EAExB,YAKO,wBAJA,UAAU,SAAQ,EADzB,WAKO;;;;OAHsB,UAAU,OAAO,QAAA,QAAQ,UAAU;iBAAkC,UAAU;oCAO5G,YAE2D,wBADpD,UAAU,UAAS,EAD1B,WAE2D;;;WAA9C,UAAU,OAAO,QAAA,QAAQ,UAAU,OAAI,CAAA,EAAA,MAAA,GAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"SpecificationExtension.vue.script.js","names":[],"sources":["../../../src/features/specification-extension/SpecificationExtension.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarErrorBoundary } from '@scalar/components/error-boundary'\nimport { computed } from 'vue'\n\nimport { usePluginManager } from '@/plugins'\n\nconst { value } = defineProps<{\n /**\n * Any value that can contain OpenAPI specification extensions.\n */\n value: Record<string, unknown> | undefined\n}>()\n\nconst { getSpecificationExtensions } = usePluginManager()\n\n/**\n * Extract registered OpenAPI extension names\n */\nfunction getCustomExtensionNames(\n value: Record<string, any> | undefined,\n): `x-${string}`[] {\n return Object.keys(value ?? {}).filter((item) =>\n item.startsWith('x-'),\n ) as `x-${string}`[]\n}\n\n/**\n * Get the components for the specification extensions\n */\nfunction getCustomOpenApiExtensionComponents(extensionNames: `x-${string}`[]) {\n return extensionNames\n .flatMap((name) => getSpecificationExtensions(name))\n .filter((extension) => extension.component)\n}\n\n/**\n * Get the names of custom extensions from the provided value.\n */\nconst customExtensionNames = computed(() => getCustomExtensionNames(value))\n\n/**\n * Get the components for the custom extensions.\n */\nconst customExtensions = computed(() =>\n getCustomOpenApiExtensionComponents(customExtensionNames.value),\n)\n</script>\n\n<template>\n <template v-if=\"typeof value === 'object' && customExtensions.length\">\n <div class=\"text-base\">\n <template v-for=\"extension in customExtensions\">\n <ScalarErrorBoundary>\n <template v-if=\"extension.renderer\">\n <!-- Custom rendering -->\n <component\n :is=\"extension.renderer\"\n v-bind=\"{\n [extension.name]: value?.[extension.name],\n component: extension.component,\n }\" />\n </template>\n <template v-else>\n <!-- Vue rendering -->\n <component\n :is=\"extension.component\"\n v-bind=\"{ [extension.name]: value?.[extension.name] }\" />\n </template>\n </ScalarErrorBoundary>\n </template>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;EAaA,MAAM,EAAE,+BAA+B,iBAAiB;;;;EAKxD,SAAS,wBACP,OACiB;GACjB,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,SACtC,KAAK,WAAW,IAAI,CACtB;EACF;;;;EAKA,SAAS,oCAAoC,gBAAiC;GAC5E,OAAO,eACJ,SAAS,SAAS,2BAA2B,IAAI,CAAC,CAAA,CAClD,QAAQ,cAAc,UAAU,SAAS;EAC9C;;;;EAKA,MAAM,uBAAuB,eAAe,wBAAwB,QAAA,KAAK,CAAC;;;;EAK1E,MAAM,mBAAmB,eACvB,oCAAoC,qBAAqB,KAAK,CAChE;;iBAIyB,QAAA,UAAK,YAAiB,iBAAA,MAAiB,UAAA,UAAA,GAC5D,mBAoBM,OApBN,YAoBM,EAAA,UAAA,IAAA,GAnBJ,mBAkBW,UAAA,MAAA,WAlBmB,iBAAA,QAAb,cAAS;wBACxB,YAgBsB,MAAA,mBAAA,GAAA,MAAA;4BAPT,CARK,UAAU,YAAA,UAAA,GAExB,YAKO,wBAJA,UAAU,QAAQ,GADzB,WAKO;;;;OAHsB,UAAU,OAAO,QAAA,QAAQ,UAAU;iBAAkC,UAAU;oCAO5G,YAE2D,wBADpD,UAAU,SAAS,GAD1B,WAE2D;;;WAA9C,UAAU,OAAO,QAAA,QAAQ,UAAU,MAAI,CAAA,GAAA,MAAA,EAAA,EAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":[],"sources":["../../../src/features/specification-extension/helpers.ts"],"sourcesContent":["/**\n * Utility function to extract all keys starting with 'x-' (OpenAPI extensions) from an object.\n *\n * @param object - The object from which to extract extension keys.\n * @returns An object containing only the entries whose keys start with 'x-'.\n */\nexport const getXKeysFromObject = (object?: Record<string, unknown>) => {\n if (!object) {\n // Return an empty object if input is undefined or null\n return {}\n }\n // Filter and return only the entries whose keys start with 'x-'\n return Object.fromEntries(Object.entries(object).filter(([key]) => key.startsWith('x-')))\n}\n"],"mappings":";;;;;;;AAMA,IAAa,sBAAsB,WAAqC;AACtE,KAAI,CAAC,OAEH,QAAO,EAAE;AAGX,QAAO,OAAO,YAAY,OAAO,QAAQ,OAAO,CAAC,QAAQ,CAAC,SAAS,IAAI,WAAW,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"helpers.js","names":[],"sources":["../../../src/features/specification-extension/helpers.ts"],"sourcesContent":["/**\n * Utility function to extract all keys starting with 'x-' (OpenAPI extensions) from an object.\n *\n * @param object - The object from which to extract extension keys.\n * @returns An object containing only the entries whose keys start with 'x-'.\n */\nexport const getXKeysFromObject = (object?: Record<string, unknown>) => {\n if (!object) {\n // Return an empty object if input is undefined or null\n return {}\n }\n // Filter and return only the entries whose keys start with 'x-'\n return Object.fromEntries(Object.entries(object).filter(([key]) => key.startsWith('x-')))\n}\n"],"mappings":";;;;;;;AAMA,IAAa,sBAAsB,WAAqC;CACtE,IAAI,CAAC,QAEH,OAAO,CAAC;CAGV,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,WAAW,IAAI,CAAC,CAAC;AAC1F"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
2
2
  import TestRequestButton_vue_vue_type_script_setup_true_lang_default from "./TestRequestButton.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/features/test-request-button/TestRequestButton.vue
5
- var TestRequestButton_default = /* @__PURE__ */ _plugin_vue_export_helper_default(TestRequestButton_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ad72d914"]]);
5
+ var TestRequestButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(TestRequestButton_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ad72d914"]]);
6
6
  //#endregion
7
7
  export { TestRequestButton_default as default };
8
8
 
@@ -4,7 +4,7 @@ import { createElementBlock, createElementVNode, createTextVNode, createVNode, d
4
4
  import { ScalarIconPlay } from "@scalar/icons";
5
5
  //#region src/features/test-request-button/TestRequestButton.vue?vue&type=script&setup=true&lang.ts
6
6
  var _hoisted_1 = ["method"];
7
- var TestRequestButton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
7
+ var TestRequestButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
8
8
  __name: "TestRequestButton",
9
9
  props: {
10
10
  id: {},
@@ -1 +1 @@
1
- {"version":3,"file":"TestRequestButton.vue.script.js","names":[],"sources":["../../../src/features/test-request-button/TestRequestButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconPlay } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\n\nconst {\n id,\n method,\n path,\n eventBus,\n exampleName,\n requestBodyCompositionSelection,\n} = defineProps<{\n id: string\n method: HttpMethod\n path: string\n eventBus: WorkspaceEventBus\n exampleName?: string\n requestBodyCompositionSelection?: Record<string, number>\n}>()\nconst { translate } = useLocalization()\n\n/** Route via ID and optionally with example name */\nconst handleClick = () => {\n // Include exampleName in payload if provided\n const payload = {\n id,\n ...(exampleName && { exampleName }),\n ...(requestBodyCompositionSelection &&\n Object.keys(requestBodyCompositionSelection).length > 0 && {\n requestBodyCompositionSelection,\n }),\n }\n eventBus.emit('ui:open:client-modal', payload)\n}\n</script>\n<template>\n <!-- Render the Test Request Button -->\n <button\n class=\"show-api-client-button\"\n :method=\"method\"\n type=\"button\"\n @click.stop=\"handleClick\">\n <ScalarIconPlay\n class=\"size-3\"\n weight=\"fill\" />\n <span>{{ translate('operation.testRequest') }}</span>\n <ScreenReader>({{ method }} {{ path }})</ScreenReader>\n </button>\n</template>\n<style scoped>\n.show-api-client-button {\n appearance: none;\n border: none;\n padding: 1px 6px;\n white-space: nowrap;\n border-radius: var(--scalar-radius);\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-small);\n line-height: 22px;\n color: var(--scalar-background-2);\n font-family: var(--scalar-font);\n background: var(--scalar-button-1);\n position: relative;\n cursor: pointer;\n box-sizing: border-box;\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);\n\n outline-offset: 2px;\n}\n.show-api-client-button span,\n.show-api-client-button svg {\n fill: currentColor;\n color: var(--scalar-button-1-color);\n z-index: 1;\n}\n.show-api-client-button:hover {\n background: var(--scalar-button-1-hover);\n}\n.show-api-client-button svg {\n margin-right: 4px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;EAuBA,MAAM,EAAE,cAAc,iBAAgB;;EAGtC,MAAM,oBAAoB;GAExB,MAAM,UAAU;IACd,IAAC,QAAA;IACD,GAAI,QAAA,eAAe,EAAE,aAAU,QAAA,aAAG;IAClC,GAAI,QAAA,mCACF,OAAO,KAAK,QAAA,gCAAgC,CAAC,SAAS,KAAK,EACzD,iCAA8B,QAAA,iCAC/B;IACL;AACA,WAAA,SAAS,KAAK,wBAAwB,QAAO;;;uBAK7C,mBAUS,UAAA;IATP,OAAM;IACL,QAAQ,QAAA;IACT,MAAK;IACJ,SAAK,cAAO,aAAW,CAAA,OAAA,CAAA;;IACxB,YAEkB,MAAA,eAAA,EAAA;KADhB,OAAM;KACN,QAAO;;IACT,mBAAqD,QAAA,MAAA,gBAA5C,MAAA,UAAS,CAAA,wBAAA,CAAA,EAAA,EAAA;IAClB,YAAsD,sBAAA,MAAA;4BAAvC,CAAA,gBAAD,MAAC,gBAAG,QAAA,OAAM,GAAG,MAAC,gBAAG,QAAA,KAAI,GAAG,KAAC,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"TestRequestButton.vue.script.js","names":[],"sources":["../../../src/features/test-request-button/TestRequestButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport { ScalarIconPlay } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\n\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\n\nconst {\n id,\n method,\n path,\n eventBus,\n exampleName,\n requestBodyCompositionSelection,\n} = defineProps<{\n id: string\n method: HttpMethod\n path: string\n eventBus: WorkspaceEventBus\n exampleName?: string\n requestBodyCompositionSelection?: Record<string, number>\n}>()\nconst { translate } = useLocalization()\n\n/** Route via ID and optionally with example name */\nconst handleClick = () => {\n // Include exampleName in payload if provided\n const payload = {\n id,\n ...(exampleName && { exampleName }),\n ...(requestBodyCompositionSelection &&\n Object.keys(requestBodyCompositionSelection).length > 0 && {\n requestBodyCompositionSelection,\n }),\n }\n eventBus.emit('ui:open:client-modal', payload)\n}\n</script>\n<template>\n <!-- Render the Test Request Button -->\n <button\n class=\"show-api-client-button\"\n :method=\"method\"\n type=\"button\"\n @click.stop=\"handleClick\">\n <ScalarIconPlay\n class=\"size-3\"\n weight=\"fill\" />\n <span>{{ translate('operation.testRequest') }}</span>\n <ScreenReader>({{ method }} {{ path }})</ScreenReader>\n </button>\n</template>\n<style scoped>\n.show-api-client-button {\n appearance: none;\n border: none;\n padding: 1px 6px;\n white-space: nowrap;\n border-radius: var(--scalar-radius);\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-small);\n line-height: 22px;\n color: var(--scalar-background-2);\n font-family: var(--scalar-font);\n background: var(--scalar-button-1);\n position: relative;\n cursor: pointer;\n box-sizing: border-box;\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);\n\n outline-offset: 2px;\n}\n.show-api-client-button span,\n.show-api-client-button svg {\n fill: currentColor;\n color: var(--scalar-button-1-color);\n z-index: 1;\n}\n.show-api-client-button:hover {\n background: var(--scalar-button-1-hover);\n}\n.show-api-client-button svg {\n margin-right: 4px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;EAuBA,MAAM,EAAE,cAAc,gBAAgB;;EAGtC,MAAM,oBAAoB;GAExB,MAAM,UAAU;IACd,IAAC,QAAA;IACD,GAAI,QAAA,eAAe,EAAE,aAAU,QAAA,YAAE;IACjC,GAAI,QAAA,mCACF,OAAO,KAAK,QAAA,+BAA+B,CAAC,CAAC,SAAS,KAAK,EACzD,iCAA8B,QAAA,gCAChC;GACJ;GACA,QAAA,SAAS,KAAK,wBAAwB,OAAO;EAC/C;;uBAIE,mBAUS,UAAA;IATP,OAAM;IACL,QAAQ,QAAA;IACT,MAAK;IACJ,SAAK,cAAO,aAAW,CAAA,MAAA,CAAA;;IACxB,YAEkB,MAAA,cAAA,GAAA;KADhB,OAAM;KACN,QAAO;;IACT,mBAAqD,QAAA,MAAA,gBAA5C,MAAA,SAAA,CAAS,CAAA,uBAAA,CAAA,GAAA,CAAA;IAClB,YAAsD,sBAAA,MAAA;4BAAvC,CAAA,gBAAD,MAAC,gBAAG,QAAA,MAAM,IAAG,MAAC,gBAAG,QAAA,IAAI,IAAG,KAAC,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"XBadges.vue.d.ts","sourceRoot":"","sources":["../../../src/features/x-badges/XBadges.vue"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sDAAsD,CAAA;AAKlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAC3B,CAAC;AA2DF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"XBadges.vue.d.ts","sourceRoot":"","sources":["../../../src/features/x-badges/XBadges.vue"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sDAAsD,CAAA;AAKlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAC3B,CAAC;AA4DF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import Badge_default from "../../components/Badge/Badge.vue.js";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
3
3
  //#region src/features/x-badges/XBadges.vue?vue&type=script&setup=true&lang.ts
4
- var XBadges_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4
+ var XBadges_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
5
5
  __name: "XBadges",
6
6
  props: {
7
7
  position: {},
@@ -1 +1 @@
1
- {"version":3,"file":"XBadges.vue.script.js","names":[],"sources":["../../../src/features/x-badges/XBadges.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation'\nimport { computed } from 'vue'\n\nimport { Badge } from '@/components/Badge'\n\nconst { position, badges } = defineProps<{\n position: 'before' | 'after'\n badges: XBadge[] | unknown\n}>()\n\nconst filteredBadges = computed<XBadge[]>(() => {\n if (Array.isArray(badges)) {\n return badges.filter(\n (badge) =>\n badge.position === position ||\n (position === 'after' && !badge.position),\n )\n }\n\n return []\n})\n</script>\n\n<template>\n <template v-if=\"filteredBadges.length\">\n <template\n v-for=\"badge in filteredBadges\"\n :key=\"badge.name\">\n <Badge :color=\"badge.color\">\n {{ badge.name }}\n </Badge>\n </template>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;EAWA,MAAM,iBAAiB,eAAyB;AAC9C,OAAI,MAAM,QAAQ,QAAA,OAAO,CACvB,QAAO,QAAA,OAAO,QACX,UACC,MAAM,aAAa,QAAA,YAClB,QAAA,aAAa,WAAW,CAAC,MAAM,SACpC;AAGF,UAAO,EAAC;IACT;;UAIiB,eAAA,MAAe,UAAA,UAAA,KAAA,EAC7B,mBAMW,UAAA,EAAA,KAAA,GAAA,EAAA,WALO,eAAA,QAAT,UAAK;wBAEZ,YAEQ,MAAA,cAAA,EAAA;UAHF,MAAM;KACJ,OAAO,MAAM;;4BACH,CAAA,gBAAA,gBAAb,MAAM,KAAI,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"XBadges.vue.script.js","names":[],"sources":["../../../src/features/x-badges/XBadges.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XBadge } from '@scalar/workspace-store/schemas/extensions/operation'\nimport { computed } from 'vue'\n\nimport { Badge } from '@/components/Badge'\n\nconst { position, badges } = defineProps<{\n position: 'before' | 'after'\n badges: XBadge[] | unknown\n}>()\n\nconst filteredBadges = computed<XBadge[]>(() => {\n if (Array.isArray(badges)) {\n return badges.filter(\n (badge) =>\n badge.position === position ||\n (position === 'after' && !badge.position),\n )\n }\n\n return []\n})\n</script>\n\n<template>\n <template v-if=\"filteredBadges.length\">\n <template\n v-for=\"badge in filteredBadges\"\n :key=\"badge.name\">\n <Badge :color=\"badge.color\">\n {{ badge.name }}\n </Badge>\n </template>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;EAWA,MAAM,iBAAiB,eAAyB;GAC9C,IAAI,MAAM,QAAQ,QAAA,MAAM,GACtB,OAAO,QAAA,OAAO,QACX,UACC,MAAM,aAAa,QAAA,YAClB,QAAA,aAAa,WAAW,CAAC,MAAM,QACpC;GAGF,OAAO,CAAC;EACV,CAAC;;UAIiB,eAAA,MAAe,UAAA,UAAA,IAAA,GAC7B,mBAMW,UAAA,EAAA,KAAA,EAAA,GAAA,WALO,eAAA,QAAT,UAAK;wBAEZ,YAEQ,MAAA,aAAA,GAAA;UAHF,MAAM;KACJ,OAAO,MAAM;;4BACH,CAAA,gBAAA,gBAAb,MAAM,IAAI,GAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
2
+ /**
3
+ * Builds a mapping from model names to their sidebar entry IDs.
4
+ *
5
+ * The map powers the `scroll-to:model-by-name` navigation used by model-name links
6
+ * (for example the `Satellite[]` link next to a property type, or a request-body model name).
7
+ *
8
+ * Model entries do not always live under the top-level `models` group: a component schema with an
9
+ * `x-tags` extension is placed under its tag group instead. To keep those links working we walk the
10
+ * whole navigation tree and collect every `type === 'model'` entry, wherever it lives.
11
+ *
12
+ * @see https://github.com/scalar/scalar/issues/9854
13
+ */
14
+ export declare const buildModelsIndex: (entries: TraversedEntry[]) => Record<string, string>;
15
+ //# sourceMappingURL=build-models-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-models-index.d.ts","sourceRoot":"","sources":["../../src/helpers/build-models-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAEhF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,cAAc,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAqBjF,CAAA"}
@@ -0,0 +1,28 @@
1
+ //#region src/helpers/build-models-index.ts
2
+ /**
3
+ * Builds a mapping from model names to their sidebar entry IDs.
4
+ *
5
+ * The map powers the `scroll-to:model-by-name` navigation used by model-name links
6
+ * (for example the `Satellite[]` link next to a property type, or a request-body model name).
7
+ *
8
+ * Model entries do not always live under the top-level `models` group: a component schema with an
9
+ * `x-tags` extension is placed under its tag group instead. To keep those links working we walk the
10
+ * whole navigation tree and collect every `type === 'model'` entry, wherever it lives.
11
+ *
12
+ * @see https://github.com/scalar/scalar/issues/9854
13
+ */
14
+ var buildModelsIndex = (entries) => {
15
+ const index = {};
16
+ const collect = (items) => {
17
+ for (const item of items) {
18
+ if (item.type === "model") index[item.name] ??= item.id;
19
+ if ("children" in item && item.children?.length) collect(item.children);
20
+ }
21
+ };
22
+ collect(entries);
23
+ return index;
24
+ };
25
+ //#endregion
26
+ export { buildModelsIndex };
27
+
28
+ //# sourceMappingURL=build-models-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-models-index.js","names":[],"sources":["../../src/helpers/build-models-index.ts"],"sourcesContent":["import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\n\n/**\n * Builds a mapping from model names to their sidebar entry IDs.\n *\n * The map powers the `scroll-to:model-by-name` navigation used by model-name links\n * (for example the `Satellite[]` link next to a property type, or a request-body model name).\n *\n * Model entries do not always live under the top-level `models` group: a component schema with an\n * `x-tags` extension is placed under its tag group instead. To keep those links working we walk the\n * whole navigation tree and collect every `type === 'model'` entry, wherever it lives.\n *\n * @see https://github.com/scalar/scalar/issues/9854\n */\nexport const buildModelsIndex = (entries: TraversedEntry[]): Record<string, string> => {\n const index: Record<string, string> = {}\n\n const collect = (items: TraversedEntry[]): void => {\n for (const item of items) {\n if (item.type === 'model') {\n // Keep the first entry for a given name. A name can appear more than once when a schema is\n // listed under multiple tags, and the exact target does not matter as long as it scrolls\n // to that model.\n index[item.name] ??= item.id\n }\n\n if ('children' in item && item.children?.length) {\n collect(item.children)\n }\n }\n }\n\n collect(entries)\n\n return index\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,oBAAoB,YAAsD;CACrF,MAAM,QAAgC,CAAC;CAEvC,MAAM,WAAW,UAAkC;EACjD,KAAK,MAAM,QAAQ,OAAO;GACxB,IAAI,KAAK,SAAS,SAIhB,MAAM,KAAK,UAAU,KAAK;GAG5B,IAAI,cAAc,QAAQ,KAAK,UAAU,QACvC,QAAQ,KAAK,QAAQ;EAEzB;CACF;CAEA,QAAQ,OAAO;CAEf,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"color-mode.js","names":[],"sources":["../../src/helpers/color-mode.ts"],"sourcesContent":["/**\n * Gets the system color mode preference from the browser.\n * Falls back to 'light' if running in a non-browser environment.\n *\n * @returns The system preference for dark or light mode.\n */\nexport const getSystemModePreference = (): 'dark' | 'light' => {\n if (typeof window === 'undefined' || typeof window?.matchMedia !== 'function') {\n return 'light'\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n}\n"],"mappings":";;;;;;;AAMA,IAAa,gCAAkD;AAC7D,KAAI,OAAO,WAAW,eAAe,OAAO,QAAQ,eAAe,WACjE,QAAO;AAGT,QAAO,OAAO,WAAW,+BAA+B,CAAC,UAAU,SAAS"}
1
+ {"version":3,"file":"color-mode.js","names":[],"sources":["../../src/helpers/color-mode.ts"],"sourcesContent":["/**\n * Gets the system color mode preference from the browser.\n * Falls back to 'light' if running in a non-browser environment.\n *\n * @returns The system preference for dark or light mode.\n */\nexport const getSystemModePreference = (): 'dark' | 'light' => {\n if (typeof window === 'undefined' || typeof window?.matchMedia !== 'function') {\n return 'light'\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n}\n"],"mappings":";;;;;;;AAMA,IAAa,gCAAkD;CAC7D,IAAI,OAAO,WAAW,eAAe,OAAO,QAAQ,eAAe,YACjE,OAAO;CAGT,OAAO,OAAO,WAAW,8BAA8B,CAAC,CAAC,UAAU,SAAS;AAC9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"download.js","names":[],"sources":["../../src/helpers/download.ts"],"sourcesContent":["/**\n * Create a click event that works in both browser and test environments\n */\nfunction createClickEvent() {\n try {\n return new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n })\n } catch {\n // Fallback for test environment\n return new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n })\n }\n}\n\n/**\n * Parse YAML or JSON content into a JavaScript object\n */\nasync function parseContent(content: string) {\n try {\n return JSON.parse(content)\n } catch {\n const { parse } = await import('yaml')\n return parse(content, {\n maxAliasCount: 10000,\n merge: true,\n })\n }\n}\n\n/**\n * Detect if content is JSON or YAML using lightweight string heuristics\n * to avoid the cost of a full JSON.parse call.\n */\nfunction detectFormat(content: string): 'json' | 'yaml' {\n const trimmed = content.trimStart()\n if (trimmed.startsWith('{') || trimmed.startsWith('[')) {\n return 'json'\n }\n return 'yaml'\n}\n\n/**\n * Convert content to the target format, returning the original string when\n * no conversion is needed so that YAML comments, custom formatting, and key\n * ordering are preserved.\n */\nasync function formatContent(\n content: string,\n inputFormat: 'json' | 'yaml',\n outputFormat: 'json' | 'yaml',\n): Promise<string> {\n if (inputFormat === outputFormat) {\n return content\n }\n\n const parsed = await parseContent(content)\n\n if (outputFormat === 'json') {\n return JSON.stringify(parsed, null, 2)\n }\n\n const { stringify } = await import('yaml')\n return stringify(parsed)\n}\n\n/**\n * Trigger the download of the OpenAPI document\n */\nexport async function downloadDocument(content: string, filename?: string, format?: 'json' | 'yaml') {\n const inputFormat = detectFormat(content)\n const outputFormat = format ?? inputFormat\n const contentFilename = `${filename ?? 'openapi'}.${outputFormat}`\n const mimeType = outputFormat === 'json' ? 'application/json' : 'application/x-yaml'\n\n const formattedContent = await formatContent(content, inputFormat, outputFormat)\n const blob = new Blob([formattedContent], { type: mimeType })\n\n const data = URL.createObjectURL(blob)\n const link = document.createElement('a')\n\n link.href = data\n link.download = contentFilename\n\n // this is necessary as link.click() does not work on the latest firefox\n link.dispatchEvent(createClickEvent())\n\n // For Firefox it is necessary to delay revoking the ObjectURL\n setTimeout(() => {\n window.URL.revokeObjectURL(data)\n link.remove()\n }, 100)\n}\n"],"mappings":";;;;AAGA,SAAS,mBAAmB;AAC1B,KAAI;AACF,SAAO,IAAI,WAAW,SAAS;GAC7B,SAAS;GACT,YAAY;GACZ,MAAM;GACP,CAAC;SACI;AAEN,SAAO,IAAI,WAAW,SAAS;GAC7B,SAAS;GACT,YAAY;GACb,CAAC;;;;;;AAON,eAAe,aAAa,SAAiB;AAC3C,KAAI;AACF,SAAO,KAAK,MAAM,QAAQ;SACpB;EACN,MAAM,EAAE,UAAU,MAAM,OAAO;AAC/B,SAAO,MAAM,SAAS;GACpB,eAAe;GACf,OAAO;GACR,CAAC;;;;;;;AAQN,SAAS,aAAa,SAAkC;CACtD,MAAM,UAAU,QAAQ,WAAW;AACnC,KAAI,QAAQ,WAAW,IAAI,IAAI,QAAQ,WAAW,IAAI,CACpD,QAAO;AAET,QAAO;;;;;;;AAQT,eAAe,cACb,SACA,aACA,cACiB;AACjB,KAAI,gBAAgB,aAClB,QAAO;CAGT,MAAM,SAAS,MAAM,aAAa,QAAQ;AAE1C,KAAI,iBAAiB,OACnB,QAAO,KAAK,UAAU,QAAQ,MAAM,EAAE;CAGxC,MAAM,EAAE,cAAc,MAAM,OAAO;AACnC,QAAO,UAAU,OAAO;;;;;AAM1B,eAAsB,iBAAiB,SAAiB,UAAmB,QAA0B;CACnG,MAAM,cAAc,aAAa,QAAQ;CACzC,MAAM,eAAe,UAAU;CAC/B,MAAM,kBAAkB,GAAG,YAAY,UAAU,GAAG;CACpD,MAAM,WAAW,iBAAiB,SAAS,qBAAqB;CAEhE,MAAM,mBAAmB,MAAM,cAAc,SAAS,aAAa,aAAa;CAChF,MAAM,OAAO,IAAI,KAAK,CAAC,iBAAiB,EAAE,EAAE,MAAM,UAAU,CAAC;CAE7D,MAAM,OAAO,IAAI,gBAAgB,KAAK;CACtC,MAAM,OAAO,SAAS,cAAc,IAAI;AAExC,MAAK,OAAO;AACZ,MAAK,WAAW;AAGhB,MAAK,cAAc,kBAAkB,CAAC;AAGtC,kBAAiB;AACf,SAAO,IAAI,gBAAgB,KAAK;AAChC,OAAK,QAAQ;IACZ,IAAI"}
1
+ {"version":3,"file":"download.js","names":[],"sources":["../../src/helpers/download.ts"],"sourcesContent":["/**\n * Create a click event that works in both browser and test environments\n */\nfunction createClickEvent() {\n try {\n return new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n })\n } catch {\n // Fallback for test environment\n return new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n })\n }\n}\n\n/**\n * Parse YAML or JSON content into a JavaScript object\n */\nasync function parseContent(content: string) {\n try {\n return JSON.parse(content)\n } catch {\n const { parse } = await import('yaml')\n return parse(content, {\n maxAliasCount: 10000,\n merge: true,\n })\n }\n}\n\n/**\n * Detect if content is JSON or YAML using lightweight string heuristics\n * to avoid the cost of a full JSON.parse call.\n */\nfunction detectFormat(content: string): 'json' | 'yaml' {\n const trimmed = content.trimStart()\n if (trimmed.startsWith('{') || trimmed.startsWith('[')) {\n return 'json'\n }\n return 'yaml'\n}\n\n/**\n * Convert content to the target format, returning the original string when\n * no conversion is needed so that YAML comments, custom formatting, and key\n * ordering are preserved.\n */\nasync function formatContent(\n content: string,\n inputFormat: 'json' | 'yaml',\n outputFormat: 'json' | 'yaml',\n): Promise<string> {\n if (inputFormat === outputFormat) {\n return content\n }\n\n const parsed = await parseContent(content)\n\n if (outputFormat === 'json') {\n return JSON.stringify(parsed, null, 2)\n }\n\n const { stringify } = await import('yaml')\n return stringify(parsed)\n}\n\n/**\n * Trigger the download of the OpenAPI document\n */\nexport async function downloadDocument(content: string, filename?: string, format?: 'json' | 'yaml') {\n const inputFormat = detectFormat(content)\n const outputFormat = format ?? inputFormat\n const contentFilename = `${filename ?? 'openapi'}.${outputFormat}`\n const mimeType = outputFormat === 'json' ? 'application/json' : 'application/x-yaml'\n\n const formattedContent = await formatContent(content, inputFormat, outputFormat)\n const blob = new Blob([formattedContent], { type: mimeType })\n\n const data = URL.createObjectURL(blob)\n const link = document.createElement('a')\n\n link.href = data\n link.download = contentFilename\n\n // this is necessary as link.click() does not work on the latest firefox\n link.dispatchEvent(createClickEvent())\n\n // For Firefox it is necessary to delay revoking the ObjectURL\n setTimeout(() => {\n window.URL.revokeObjectURL(data)\n link.remove()\n }, 100)\n}\n"],"mappings":";;;;AAGA,S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iBAAiB;EACf,OAAO,IAAI,gBAAgB,IAAI;EAC/B,KAAK,OAAO;CACd,GAAG,GAAG;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-async-api-message-payload-schema.js","names":[],"sources":["../../src/helpers/get-async-api-message-payload-schema.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport type { AsyncApiMessageObject } from '@scalar/types/asyncapi/3.1'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * A resolved schema-bearing value may be a JSON Schema object, a boolean (`true`/`false`)\n * schema, or a Multi Format Schema wrapper, so accept only plain objects and treat them as the\n * `SchemaObject` the shared Schema/Model rendering expects.\n */\nconst isSchemaObject = (value: unknown): value is SchemaObject => isObject(value)\n\n/**\n * Unwraps an AsyncAPI schema-bearing value into the `SchemaObject` shape the shared OpenAPI\n * `Schema`/`Model` components expect.\n *\n * AsyncAPI reuses JSON Schema, but a value may need extra handling:\n * - The value itself may be a `$ref`; it is resolved to its `$ref-value`.\n * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its\n * payload, so we render the inner JSON Schema rather than the wrapper.\n * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.\n */\nexport const unwrapAsyncApiSchema = (value: unknown): SchemaObject | undefined => {\n if (value === undefined) {\n return undefined\n }\n\n // Resolve the value the same way OpenAPI model rendering does (plain `$ref-value`).\n const resolved = getResolvedRef(value)\n\n // Multi Format Schema Objects carry the real schema under `schema`; unwrap to that payload.\n const schema = isObject(resolved) && 'schemaFormat' in resolved ? getResolvedRef(resolved.schema) : resolved\n\n return isSchemaObject(schema) ? schema : undefined\n}\n\n/** Resolves an AsyncAPI message `payload` into the `SchemaObject` the shared Schema component expects. */\nexport const getAsyncApiMessagePayloadSchema = (message: AsyncApiMessageObject): SchemaObject | undefined =>\n unwrapAsyncApiSchema(message.payload)\n\n/** Resolves an AsyncAPI message `headers` into the `SchemaObject` the shared Schema component expects. */\nexport const getAsyncApiMessageHeadersSchema = (message: AsyncApiMessageObject): SchemaObject | undefined =>\n unwrapAsyncApiSchema(message.headers)\n"],"mappings":";;;;;;;;AAUA,IAAM,kBAAkB,UAA0C,SAAS,MAAM;;;;;;;;;;;AAYjF,IAAa,wBAAwB,UAA6C;AAChF,KAAI,UAAU,KAAA,EACZ;CAIF,MAAM,WAAW,eAAe,MAAM;CAGtC,MAAM,SAAS,SAAS,SAAS,IAAI,kBAAkB,WAAW,eAAe,SAAS,OAAO,GAAG;AAEpG,QAAO,eAAe,OAAO,GAAG,SAAS,KAAA;;;AAI3C,IAAa,mCAAmC,YAC9C,qBAAqB,QAAQ,QAAQ;;AAGvC,IAAa,mCAAmC,YAC9C,qBAAqB,QAAQ,QAAQ"}
1
+ {"version":3,"file":"get-async-api-message-payload-schema.js","names":[],"sources":["../../src/helpers/get-async-api-message-payload-schema.ts"],"sourcesContent":["import { isObject } from '@scalar/helpers/object/is-object'\nimport type { AsyncApiMessageObject } from '@scalar/types/asyncapi/3.1'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * A resolved schema-bearing value may be a JSON Schema object, a boolean (`true`/`false`)\n * schema, or a Multi Format Schema wrapper, so accept only plain objects and treat them as the\n * `SchemaObject` the shared Schema/Model rendering expects.\n */\nconst isSchemaObject = (value: unknown): value is SchemaObject => isObject(value)\n\n/**\n * Unwraps an AsyncAPI schema-bearing value into the `SchemaObject` shape the shared OpenAPI\n * `Schema`/`Model` components expect.\n *\n * AsyncAPI reuses JSON Schema, but a value may need extra handling:\n * - The value itself may be a `$ref`; it is resolved to its `$ref-value`.\n * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its\n * payload, so we render the inner JSON Schema rather than the wrapper.\n * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.\n */\nexport const unwrapAsyncApiSchema = (value: unknown): SchemaObject | undefined => {\n if (value === undefined) {\n return undefined\n }\n\n // Resolve the value the same way OpenAPI model rendering does (plain `$ref-value`).\n const resolved = getResolvedRef(value)\n\n // Multi Format Schema Objects carry the real schema under `schema`; unwrap to that payload.\n const schema = isObject(resolved) && 'schemaFormat' in resolved ? getResolvedRef(resolved.schema) : resolved\n\n return isSchemaObject(schema) ? schema : undefined\n}\n\n/** Resolves an AsyncAPI message `payload` into the `SchemaObject` the shared Schema component expects. */\nexport const getAsyncApiMessagePayloadSchema = (message: AsyncApiMessageObject): SchemaObject | undefined =>\n unwrapAsyncApiSchema(message.payload)\n\n/** Resolves an AsyncAPI message `headers` into the `SchemaObject` the shared Schema component expects. */\nexport const getAsyncApiMessageHeadersSchema = (message: AsyncApiMessageObject): SchemaObject | undefined =>\n unwrapAsyncApiSchema(message.headers)\n"],"mappings":";;;;;;;;AAUA,IAAM,kBAAkB,UAA0C,SAAS,KAAK;;;;;;;;;;;AAYhF,IAAa,wBAAwB,UAA6C;CAChF,IAAI,UAAU,KAAA,GACZ;CAIF,MAAM,WAAW,eAAe,KAAK;CAGrC,MAAM,SAAS,SAAS,QAAQ,KAAK,kBAAkB,WAAW,eAAe,SAAS,MAAM,IAAI;CAEpG,OAAO,eAAe,MAAM,IAAI,SAAS,KAAA;AAC3C;;AAGA,IAAa,mCAAmC,YAC9C,qBAAqB,QAAQ,OAAO;;AAGtC,IAAa,mCAAmC,YAC9C,qBAAqB,QAAQ,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-async-api-model-schema.js","names":[],"sources":["../../src/helpers/get-async-api-model-schema.ts"],"sourcesContent":["import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { unwrapAsyncApiSchema } from './get-async-api-message-payload-schema'\n\n/**\n * Resolves a named schema from an AsyncAPI document's `components.schemas` into the `SchemaObject`\n * shape the shared OpenAPI Model components and search indexing expect.\n *\n * AsyncAPI keeps reusable schemas in the same place OpenAPI does, but an entry may need extra handling:\n * - `components` or the schema itself may be a `$ref`; siblings are merged so keys declared alongside\n * a `$ref` are kept rather than dropped.\n * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its payload,\n * so we index and render the inner JSON Schema rather than the wrapper.\n * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.\n */\nexport const getAsyncApiModelSchema = (document: AsyncApiDocument, name: string): SchemaObject | undefined => {\n if (!document.components) {\n return undefined\n }\n\n // Merge siblings at the components level so schemas declared alongside a `$ref` are kept.\n const components = getResolvedRef(document.components, mergeSiblingReferences)\n const entry = components.schemas?.[name]\n\n // Resolve `$ref`s and unwrap Multi Format Schema Objects into the plain JSON Schema shape.\n return unwrapAsyncApiSchema(entry)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAa,0BAA0B,UAA4B,SAA2C;AAC5G,KAAI,CAAC,SAAS,WACZ;CAKF,MAAM,QADa,eAAe,SAAS,YAAY,uBAAuB,CACrD,UAAU;AAGnC,QAAO,qBAAqB,MAAM"}
1
+ {"version":3,"file":"get-async-api-model-schema.js","names":[],"sources":["../../src/helpers/get-async-api-model-schema.ts"],"sourcesContent":["import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { unwrapAsyncApiSchema } from './get-async-api-message-payload-schema'\n\n/**\n * Resolves a named schema from an AsyncAPI document's `components.schemas` into the `SchemaObject`\n * shape the shared OpenAPI Model components and search indexing expect.\n *\n * AsyncAPI keeps reusable schemas in the same place OpenAPI does, but an entry may need extra handling:\n * - `components` or the schema itself may be a `$ref`; siblings are merged so keys declared alongside\n * a `$ref` are kept rather than dropped.\n * - A Multi Format Schema Object (`schemaFormat` plus a nested `schema`) is unwrapped to its payload,\n * so we index and render the inner JSON Schema rather than the wrapper.\n * - Boolean (`true`/`false`) and non-JSON-Schema payloads are skipped.\n */\nexport const getAsyncApiModelSchema = (document: AsyncApiDocument, name: string): SchemaObject | undefined => {\n if (!document.components) {\n return undefined\n }\n\n // Merge siblings at the components level so schemas declared alongside a `$ref` are kept.\n const components = getResolvedRef(document.components, mergeSiblingReferences)\n const entry = components.schemas?.[name]\n\n // Resolve `$ref`s and unwrap Multi Format Schema Objects into the plain JSON Schema shape.\n return unwrapAsyncApiSchema(entry)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAa,0BAA0B,UAA4B,SAA2C;CAC5G,IAAI,CAAC,SAAS,YACZ;CAKF,MAAM,QADa,eAAe,SAAS,YAAY,sBACzC,CAAA,CAAW,UAAU;CAGnC,OAAO,qBAAqB,KAAK;AACnC"}
@@ -24,17 +24,31 @@ export declare const getIdFromUrl: (url: string | URL, basePath: string | undefi
24
24
  * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id
25
25
  */
26
26
  export declare const makeUrlFromId: (_id: string, basePath: string | undefined, isMultiDocument: boolean) => URL | undefined;
27
+ /**
28
+ * Source data for a single webhook redirect: the raw event name, its method, and the current id.
29
+ *
30
+ * The current slug is read back off the id, so this layer does not need to know the (dot-keeping)
31
+ * slug rule — it only reproduces the legacy (dot-dropping) slug to match old bookmarks.
32
+ */
33
+ export type WebhookRedirectSource = {
34
+ /** Raw webhook event name from the OpenAPI `webhooks` key, e.g. `account_holder.created`. */
35
+ name: string;
36
+ /** HTTP method of the webhook operation. */
37
+ method: string;
38
+ /** Current navigation id of the webhook, e.g. `default/webhook/POST/account-holder.created`. */
39
+ id: string;
40
+ };
27
41
  /**
28
42
  * Rewrites navigation ids in a URL to their current form.
29
43
  *
30
44
  * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule
31
- * is applied in id-space (see {@link buildRedirects}), and the result is spliced back into the
32
- * original location. This handles hash, hash-base-path, and path routing uniformly, so a new
33
- * redirect only has to be added to the list once.
45
+ * is applied in id-space (see {@link buildRedirects} for models and {@link buildWebhookRedirects} for
46
+ * webhooks), and the result is spliced back into the original location. This handles hash,
47
+ * hash-base-path, and path routing uniformly, so a new redirect only has to be added to the list once.
34
48
  *
35
49
  * Returns the canonicalized URL when a rewrite happens, or null otherwise.
36
50
  */
37
- export declare const redirectUrl: (url: string | URL, modelsSectionSlug: string, documentSlug: string, isMultiDocument: boolean, basePath?: string) => URL | null;
51
+ export declare const redirectUrl: (url: string | URL, modelsSectionSlug: string, documentSlug: string, isMultiDocument: boolean, basePath?: string, webhooks?: WebhookRedirectSource[]) => URL | null;
38
52
  /** Extracts the schema parameters from the id if they are present */
39
53
  export declare const getSchemaParamsFromId: (id: string) => {
40
54
  rawId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"id-routing.d.ts","sourceRoot":"","sources":["../../src/helpers/id-routing.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,WAEhD,CAAA;AAyCD,mEAAmE;AACnE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,YAAY,MAAM,GAAG,SAAS,WAMnF,CAAA;AACD,mEAAmE;AACnE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,WAYrG,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,WAW7G,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,YAWvE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAA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,GAAG,EAAE,UAAU,MAAM,GAAG,SAAS,EAAE,YAAY,MAAM,GAAG,SAAS,WAQ3G,CAAA;AAmBD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,EAAE,iBAAiB,OAAO,oBAsBhG,CAAA;AA6KD;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,gGAAgG;IAChG,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAqED;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,MAAM,GAAG,GAAG,EACjB,mBAAmB,MAAM,EACzB,cAAc,MAAM,EACpB,iBAAiB,OAAO,EACxB,WAAW,MAAM,EACjB,WAAU,qBAAqB,EAAO,KACrC,GAAG,GAAG,IA4BR,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CA2BjF,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { slugify } from "@scalar/helpers/string/slugify";
1
2
  //#region src/helpers/id-routing.ts
2
3
  var sanitizeBasePath = (basePath) => {
3
4
  return basePath.replace(/^\/+|\/+$/g, "");
@@ -172,23 +173,82 @@ var buildRedirects = ({ modelsSectionSlug, documentSlug, isMultiDocument }) => {
172
173
  return redirects;
173
174
  };
174
175
  /**
176
+ * Markers that separate an operation id from a schema path within an anchor id.
177
+ * `responses` mirrors the request-body/parameter markers so response property
178
+ * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.
179
+ * Without it, deep links into responses cannot find their operation.
180
+ */
181
+ var SCHEMA_PARAM_MARKERS = [
182
+ ".body.",
183
+ ".path.",
184
+ ".query.",
185
+ ".header.",
186
+ ".responses."
187
+ ];
188
+ /**
189
+ * Builds redirect rules mapping each webhook's legacy dot-dropped slug to its current slug.
190
+ *
191
+ * Webhook ids used to slugify the event name with no options, which dropped dots
192
+ * (`account_holder.created` -> `account-holdercreated`); the current id keeps them
193
+ * (`account-holder.created`). That rewrite cannot be reversed generically, so we emit one exact rule
194
+ * per webhook whose legacy slug differs from the current one. Each rule matches the invariant
195
+ * `webhook/<METHOD>/<legacy-slug>` tail, so it applies regardless of the document/tag prefix in front
196
+ * of it and preserves any sub-anchor after it. A sub-anchor is either a `/` segment or a dot-joined
197
+ * schema property anchor (e.g. `.body.id`, see {@link SCHEMA_PARAM_MARKERS}); a dot followed by
198
+ * anything else is not treated as a boundary, because the legacy slug never contains a dot while a
199
+ * current webhook slug can, so such a URL belongs to a different webhook.
200
+ *
201
+ * Because the legacy slug is lossy, two things can make a redirect unsafe, and both are dropped so an
202
+ * ambiguous link falls through to normal not-found handling instead of landing on the wrong webhook:
203
+ * - the legacy slug is already another webhook's *current* slug (redirecting it would hijack a valid
204
+ * URL), or
205
+ * - two webhooks collapse to the same legacy slug (the old bookmark is genuinely ambiguous).
206
+ */
207
+ var buildWebhookRedirects = (webhooks) => {
208
+ const key = (method, slug) => `${method.toUpperCase()}/${slug}`;
209
+ const currentKeys = /* @__PURE__ */ new Set();
210
+ const legacyCounts = /* @__PURE__ */ new Map();
211
+ for (const { name, method, id } of webhooks) {
212
+ currentKeys.add(key(method, id.slice(id.lastIndexOf("/") + 1)));
213
+ const legacySlug = slugify(name);
214
+ if (legacySlug) {
215
+ const legacyKey = key(method, legacySlug);
216
+ legacyCounts.set(legacyKey, (legacyCounts.get(legacyKey) ?? 0) + 1);
217
+ }
218
+ }
219
+ const boundary = `(?=$|/|${SCHEMA_PARAM_MARKERS.map(escapeRegex).join("|")})`;
220
+ const redirects = [];
221
+ for (const { name, method, id } of webhooks) {
222
+ const upperMethod = method.toUpperCase();
223
+ const currentSlug = id.slice(id.lastIndexOf("/") + 1);
224
+ const legacySlug = slugify(name);
225
+ const legacyKey = key(method, legacySlug);
226
+ if (!legacySlug || legacySlug === currentSlug || currentKeys.has(legacyKey) || (legacyCounts.get(legacyKey) ?? 0) > 1) continue;
227
+ redirects.push({
228
+ match: new RegExp(`(^|/)webhook/${escapeRegex(upperMethod)}/${escapeRegex(legacySlug)}${boundary}`),
229
+ replace: (_match, prefix) => `${prefix}webhook/${upperMethod}/${currentSlug}`
230
+ });
231
+ }
232
+ return redirects;
233
+ };
234
+ /**
175
235
  * Rewrites navigation ids in a URL to their current form.
176
236
  *
177
237
  * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule
178
- * is applied in id-space (see {@link buildRedirects}), and the result is spliced back into the
179
- * original location. This handles hash, hash-base-path, and path routing uniformly, so a new
180
- * redirect only has to be added to the list once.
238
+ * is applied in id-space (see {@link buildRedirects} for models and {@link buildWebhookRedirects} for
239
+ * webhooks), and the result is spliced back into the original location. This handles hash,
240
+ * hash-base-path, and path routing uniformly, so a new redirect only has to be added to the list once.
181
241
  *
182
242
  * Returns the canonicalized URL when a rewrite happens, or null otherwise.
183
243
  */
184
- var redirectUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePath) => {
244
+ var redirectUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePath, webhooks = []) => {
185
245
  if (!documentSlug) return null;
186
246
  const target = new URL(typeof url === "string" ? url : url.toString());
187
- const redirects = buildRedirects({
247
+ const redirects = [...buildRedirects({
188
248
  modelsSectionSlug,
189
249
  documentSlug,
190
250
  isMultiDocument
191
- });
251
+ }), ...buildWebhookRedirects(webhooks)];
192
252
  let didRedirect = false;
193
253
  for (const carrier of locateIdCarriers(target, basePath)) {
194
254
  const rewritten = applyIdRedirects(carrier.value, redirects);
@@ -199,19 +259,6 @@ var redirectUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePa
199
259
  }
200
260
  return didRedirect ? target : null;
201
261
  };
202
- /**
203
- * Markers that separate an operation id from a schema path within an anchor id.
204
- * `responses` mirrors the request-body/parameter markers so response property
205
- * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.
206
- * Without it, deep links into responses cannot find their operation.
207
- */
208
- var SCHEMA_PARAM_MARKERS = [
209
- ".body.",
210
- ".path.",
211
- ".query.",
212
- ".header.",
213
- ".responses."
214
- ];
215
262
  /** Extracts the schema parameters from the id if they are present */
216
263
  var getSchemaParamsFromId = (id) => {
217
264
  let markerIndex = -1;
@@ -229,6 +276,6 @@ var getSchemaParamsFromId = (id) => {
229
276
  };
230
277
  };
231
278
  //#endregion
232
- export { getIdFromUrl, getSchemaParamsFromId, makeUrlFromId, matchesBasePath, redirectUrl };
279
+ export { getIdFromHash, getIdFromHashBasePath, getIdFromPath, getIdFromUrl, getSchemaParamsFromId, makeUrlFromId, matchesBasePath, redirectUrl, sanitizeBasePath };
233
280
 
234
281
  //# sourceMappingURL=id-routing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"id-routing.js","names":[],"sources":["../../src/helpers/id-routing.ts"],"sourcesContent":["export const sanitizeBasePath = (basePath: string) => {\n return basePath.replace(/^\\/+|\\/+$/g, '')\n}\n\nconst isHashBasePath = (basePath: string) => basePath.startsWith('#')\n\nconst sanitizeHashBasePath = (basePath: string) => {\n return basePath.replace(/^#+/, '').replace(/\\/+$/g, '')\n}\n\nconst applySlugPrefix = (base: string, slugPrefix: string | undefined) => {\n return slugPrefix ? `${slugPrefix}${base ? '/' : ''}${base}` : base\n}\n\nconst stripBasePathPrefix = (value: string, basePath: string) => {\n if (value === basePath) {\n return ''\n }\n\n if (value.startsWith(`${basePath}/`)) {\n return value.slice(basePath.length + 1)\n }\n\n return null\n}\n\n/**\n * Builds the URL-encoded, slash-prefixed form of a sanitized base path.\n *\n * Each segment is encoded separately so the result matches how the browser stores\n * `location.pathname` (which encodes within segments but leaves the slashes between them).\n */\nconst encodeBasePath = (sanitized: string) => {\n if (!sanitized) {\n return ''\n }\n\n return `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n}\n\n/** Extracts an element id from the hash when using hash routing */\nexport const getIdFromHash = (location: string | URL, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n const base = decodeURIComponent(url.hash.slice(1))\n\n return applySlugPrefix(base, slugPrefix)\n}\n/** Extracts an element id from the path when using path routing */\nexport const getIdFromPath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n // Extract the portion after the basePath\n if (url.pathname.startsWith(basePathWithSlash)) {\n const remainder = url.pathname.slice(basePathWithSlash.length)\n const base = decodeURIComponent(remainder.startsWith('/') ? remainder.slice(1) : remainder)\n return applySlugPrefix(base, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Extracts an element id from a hash-prefixed basePath */\nexport const getIdFromHashBasePath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const hash = decodeURIComponent(url.hash.slice(1))\n const sanitized = sanitizeHashBasePath(basePath)\n\n const remainder = stripBasePathPrefix(hash, sanitized)\n if (remainder !== null) {\n return applySlugPrefix(remainder, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Determines whether a URL matches the provided basePath. */\nexport const matchesBasePath = (location: string | URL, basePath: string) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n if (isHashBasePath(basePath)) {\n const hash = decodeURIComponent(url.hash)\n return hash === basePath || hash.startsWith(`${basePath}/`)\n }\n\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`)\n}\n\n/**\n * Extracts a navigation id from a URL based on the routing type\n *\n * @param url - The URL to extract the id from\n * @param basePath - The base path used in path routing\n * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it\n */\nexport const getIdFromUrl = (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => {\n if (typeof basePath !== 'string') {\n return getIdFromHash(url, slugPrefix)\n }\n\n return isHashBasePath(basePath)\n ? getIdFromHashBasePath(url, basePath, slugPrefix)\n : getIdFromPath(url, basePath, slugPrefix)\n}\n\n/**\n * Strips the first segment from an id and preserves trailing slashes\n * Used in single-document mode where the document slug is not needed in the URL\n *\n * @param id - The full id to process\n * @returns The id with the first segment removed, preserving trailing slash if present\n */\nconst stripFirstSegment = (id: string): string => {\n // For preserving trailing slash in the id\n const hasTrailingSlash = id.endsWith('/')\n const segments = id.split('/').filter(Boolean).slice(1)\n const result = segments.join('/')\n\n // Only preserve trailing slash if there's actual content\n return hasTrailingSlash && result ? `${result}/` : result\n}\n\n/**\n * Generate a new URL and applies the ID to the path or hash\n * depending on the type of routing used\n *\n * @param id - The id to apply to the URL\n * @param basePath - The base path used in path routing\n * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id\n */\nexport const makeUrlFromId = (_id: string, basePath: string | undefined, isMultiDocument: boolean) => {\n if (typeof window === 'undefined') {\n return undefined\n }\n\n /** When there is only 1 document we don't need to include the document name in the URL */\n const id = isMultiDocument ? _id : stripFirstSegment(_id)\n const url = new URL(window.location.href)\n\n if (typeof basePath === 'string') {\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n url.hash = [base, id].filter(Boolean).join('/')\n } else {\n const base = sanitizeBasePath(basePath)\n url.pathname = `${base}/${id}`\n }\n } else {\n url.hash = id\n }\n\n return url\n}\n\nconst escapeRegex = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\n/**\n * A located navigation id: the decoded id plus a way to write a rewritten id back.\n */\ntype IdCarrier = {\n /** The decoded navigation id with all routing chrome (`#`, base path) removed. */\n value: string\n /** Splices `next` back into the location this id came from, preserving the URL shape. */\n write: (next: string) => void\n}\n\n/** Carrier for an id that lives in the bare hash fragment (`#<id>`). */\nconst bareHashCarrier = (url: URL): IdCarrier => ({\n value: decodeURIComponent(url.hash.slice(1)),\n write: (next) => {\n url.hash = next\n },\n})\n\n/**\n * Locates the navigation id inside a URL regardless of the routing mode.\n *\n * The id can live in three places — the bare hash, a hash base path (`#<base>/<id>`), or the\n * pathname after a path base path. Each carrier pairs the decoded id with a `write` callback, so\n * callers edit ids in id-space without re-deriving the routing chrome for each mode.\n *\n * Multiple carriers are returned: the canonical location for the active routing mode comes first,\n * followed by a legacy bare-hash carrier. Both path and hash-base-path routing include the bare hash\n * so a stale `#default/model/User` bookmark (left over from before the base path was configured) is\n * still canonicalized — the previous implementation rewrote such doc-slug-anchored hashes on every\n * load regardless of the routing mode. Callers rewrite every carrier that matches, not just the\n * first, so a legacy id sitting in both the pathname and the hash is cleaned up in one pass.\n */\nconst locateIdCarriers = (url: URL, basePath: string | undefined): IdCarrier[] => {\n // Hash routing: the id is the bare fragment.\n if (typeof basePath !== 'string') {\n return [bareHashCarrier(url)]\n }\n\n // Hash base path routing: the id follows a `#<base>/` prefix.\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n const hash = decodeURIComponent(url.hash.slice(1))\n\n return [\n {\n value: stripBasePathPrefix(hash, base) ?? '',\n write: (next) => {\n url.hash = [base, next].filter(Boolean).join('/')\n },\n },\n // Legacy fallback: an old bookmark may carry the id in the fragment without the base prefix.\n bareHashCarrier(url),\n ]\n }\n\n // Path routing: the id follows the (URL-encoded) base path in the pathname.\n const base = sanitizeBasePath(basePath)\n const remainder = stripBasePathPrefix(url.pathname, encodeBasePath(base))\n\n return [\n {\n value: remainder === null ? '' : decodeURIComponent(remainder),\n write: (next) => {\n // Assigning to `pathname` re-encodes characters, so we splice with the decoded base.\n url.pathname = base ? `/${base}/${next}` : `/${next}`\n },\n },\n // Legacy fallback: an old hash-routing bookmark may still carry the id in the fragment.\n bareHashCarrier(url),\n ]\n}\n\n/**\n * A single redirect rule, expressed in routing-agnostic id-space.\n *\n * Ids are navigation strings with all routing chrome (`#`, base path) stripped — see\n * {@link locateIdCarrier}. A rule is just the shape of an id rewrite: `match` is tested against the\n * id and `replace` follows the native `String.prototype.replace` contract, so a rule can be a plain\n * segment swap or an arbitrary replacer function. A rule that does not match leaves the id alone.\n */\ntype IdRedirect = {\n /** Pattern tested against the routing-agnostic id. */\n match: RegExp\n /** Replacement passed straight to `String.prototype.replace` (template string or replacer fn). */\n replace: string | ((substring: string, ...groups: string[]) => string)\n}\n\n/**\n * Applies redirect rules to an id and returns the first rewrite that changes it.\n *\n * Rules are tried in order and the search stops at the first match, so list more specific rules\n * before more general ones. Returns the id unchanged when no rule applies.\n */\nconst applyIdRedirects = (id: string, redirects: IdRedirect[]): string => {\n for (const { match, replace } of redirects) {\n // The ternary narrows the union so each `String.prototype.replace` overload type-checks.\n const next = typeof replace === 'string' ? id.replace(match, replace) : id.replace(match, replace)\n if (next !== id) {\n return next\n }\n }\n\n return id\n}\n\n/** Optional `(tag-group/<n>/)?tag/<slug>/` chrome that may sit in front of a section segment. */\nconst TAG_CHROME = '(?:(?:tag-group/[^/]+/)?tag/[^/]+/)?'\n\n/**\n * Runtime values the redirect rules are built from.\n *\n * The rules are data, but a few entries depend on per-document values (the configurable models\n * section slug, the active document slug, single- vs multi-document mode), so the list is built per\n * call rather than declared as a static constant.\n */\ntype RedirectContext = {\n /** Current (possibly customized) slug of the models section, e.g. `models` or `schemas`. */\n modelsSectionSlug: string\n /** Slug of the active document; legacy ids are anchored to it to avoid false positives. */\n documentSlug: string\n /** Multi-document ids always carry the doc slug; single-document bookmarks may omit it. */\n isMultiDocument: boolean\n}\n\n/**\n * Builds the list of id redirects for the current document.\n *\n * Add an entry here to support a new redirect. Each rule runs against every URL shape (hash, hash\n * base path, path) for free, because rules operate on routing-agnostic ids.\n */\nconst buildRedirects = ({ modelsSectionSlug, documentSlug, isMultiDocument }: RedirectContext): IdRedirect[] => {\n const escapedDoc = escapeRegex(documentSlug)\n // Keeping the tag chrome inside the doc-slug group is deliberate: a slug-less\n // `tag/<slug>/<segment>/<name>` is left alone, since once the document slug is stripped it is\n // ambiguous with an operation under a tag literally named after the segment.\n const documentPrefix = isMultiDocument ? `${escapedDoc}/${TAG_CHROME}` : `(?:${escapedDoc}/${TAG_CHROME})?`\n\n // Rewrites a leading `<from>/` section segment to the current models section slug. The trailing\n // `/` leaves an already-correct segment and operation paths such as `default/POST/model/train`\n // untouched.\n const renameSectionSegment = (from: string): IdRedirect => ({\n match: new RegExp(`^(${documentPrefix})${escapeRegex(from)}/`),\n replace: (_match, prefix) => `${prefix}${modelsSectionSlug}/`,\n })\n\n const redirects = [\n // Earlier versions hardcoded a singular `model/` prefix for individual schema entries even\n // though the section itself was plural, so old bookmarks like `default/model/User` would 404.\n renameSectionSegment('model'),\n ]\n\n // The models section used to live at the literal `models/`. Once a custom label moves it\n // elsewhere (e.g. `schemas/`), older `models/<name>` bookmarks must follow it. When the slug is\n // still the default `models` this would be a no-op, so only register it when it actually differs.\n if (modelsSectionSlug !== 'models') {\n redirects.push(renameSectionSegment('models'))\n }\n\n return redirects\n}\n\n/**\n * Rewrites navigation ids in a URL to their current form.\n *\n * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule\n * is applied in id-space (see {@link buildRedirects}), and the result is spliced back into the\n * original location. This handles hash, hash-base-path, and path routing uniformly, so a new\n * redirect only has to be added to the list once.\n *\n * Returns the canonicalized URL when a rewrite happens, or null otherwise.\n */\nexport const redirectUrl = (\n url: string | URL,\n modelsSectionSlug: string,\n documentSlug: string,\n isMultiDocument: boolean,\n basePath?: string,\n): URL | null => {\n if (!documentSlug) {\n return null\n }\n\n const target = new URL(typeof url === 'string' ? url : url.toString())\n const redirects = buildRedirects({ modelsSectionSlug, documentSlug, isMultiDocument })\n\n // Canonicalize every place the id might live. The carriers are distinct physical locations (the\n // pathname and the bare hash), so a single page load can carry a legacy id in more than one — for\n // example a path-routing URL whose stale hash still holds an old bookmark. Rewriting all of them\n // avoids the address bar showing a corrected path next to an outdated hash. A redirect rule is\n // anchored to the document slug, so it never matches the base-prefixed value of a fallback carrier,\n // which keeps carriers that happen to share a location (hash base path + bare hash) from clobbering\n // each other.\n let didRedirect = false\n for (const carrier of locateIdCarriers(target, basePath)) {\n const rewritten = applyIdRedirects(carrier.value, redirects)\n if (rewritten !== carrier.value) {\n carrier.write(rewritten)\n didRedirect = true\n }\n }\n\n return didRedirect ? target : null\n}\n\n/**\n * Markers that separate an operation id from a schema path within an anchor id.\n * `responses` mirrors the request-body/parameter markers so response property\n * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.\n * Without it, deep links into responses cannot find their operation.\n */\nconst SCHEMA_PARAM_MARKERS = ['.body.', '.path.', '.query.', '.header.', '.responses.']\n\n/** Extracts the schema parameters from the id if they are present */\nexport const getSchemaParamsFromId = (id: string): { rawId: string; params: string } => {\n // Split at the first marker: an operation id never contains one, so everything\n // before the first marker is the operation id and the rest is the schema path.\n // (Splitting at the last marker would mishandle a property named like a marker\n // keyword, e.g. a request body field called `responses`.) A plain string scan\n // avoids the polynomial backtracking a `(.*)marker(.*)` regex would incur on\n // long, marker-less ids.\n let markerIndex = -1\n for (const marker of SCHEMA_PARAM_MARKERS) {\n const index = id.indexOf(marker)\n if (index !== -1 && (markerIndex === -1 || index < markerIndex)) {\n markerIndex = index\n }\n }\n\n if (markerIndex === -1) {\n return {\n rawId: id,\n params: '',\n }\n }\n\n return {\n rawId: id.slice(0, markerIndex),\n // Drop the leading dot but keep the marker keyword (e.g. `body.name`).\n params: id.slice(markerIndex + 1),\n }\n}\n"],"mappings":";AAAA,IAAa,oBAAoB,aAAqB;AACpD,QAAO,SAAS,QAAQ,cAAc,GAAG;;AAG3C,IAAM,kBAAkB,aAAqB,SAAS,WAAW,IAAI;AAErE,IAAM,wBAAwB,aAAqB;AACjD,QAAO,SAAS,QAAQ,OAAO,GAAG,CAAC,QAAQ,SAAS,GAAG;;AAGzD,IAAM,mBAAmB,MAAc,eAAmC;AACxE,QAAO,aAAa,GAAG,aAAa,OAAO,MAAM,KAAK,SAAS;;AAGjE,IAA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BAAqB,QAAQ,CAC9B;AAKD,KAAI,sBAAsB,SACxB,WAAU,KAAK,qBAAqB,SAAS,CAAC;AAGhD,QAAO;;;;;;;;;;;;AAaT,IAAa,eACX,KACA,mBACA,cACA,iBACA,aACe;AACf,KAAI,CAAC,aACH,QAAO;CAGT,MAAM,SAAS,IAAI,IAAI,OAAO,QAAQ,WAAW,MAAM,IAAI,UAAU,CAAC;CACtE,MAAM,YAAY,eAAe;EAAE;EAAmB;EAAc;EAAiB,CAAC;CAStF,IAAI,cAAc;AAClB,MAAK,MAAM,WAAW,iBAAiB,QAAQ,SAAS,EAAE;EACxD,MAAM,YAAY,iBAAiB,QAAQ,OAAO,UAAU;AAC5D,MAAI,cAAc,QAAQ,OAAO;AAC/B,WAAQ,MAAM,UAAU;AACxB,iBAAc;;;AAIlB,QAAO,cAAc,SAAS;;;;;;;;AAShC,IAAM,uBAAuB;CAAC;CAAU;CAAU;CAAW;CAAY;CAAc;;AAGvF,IAAa,yBAAyB,OAAkD;CAOtF,IAAI,cAAc;AAClB,MAAK,MAAM,UAAU,sBAAsB;EACzC,MAAM,QAAQ,GAAG,QAAQ,OAAO;AAChC,MAAI,UAAU,OAAO,gBAAgB,MAAM,QAAQ,aACjD,eAAc;;AAIlB,KAAI,gBAAgB,GAClB,QAAO;EACL,OAAO;EACP,QAAQ;EACT;AAGH,QAAO;EACL,OAAO,GAAG,MAAM,GAAG,YAAY;EAE/B,QAAQ,GAAG,MAAM,cAAc,EAAE;EAClC"}
1
+ {"version":3,"file":"id-routing.js","names":[],"sources":["../../src/helpers/id-routing.ts"],"sourcesContent":["import { slugify } from '@scalar/helpers/string/slugify'\n\nexport const sanitizeBasePath = (basePath: string) => {\n return basePath.replace(/^\\/+|\\/+$/g, '')\n}\n\nconst isHashBasePath = (basePath: string) => basePath.startsWith('#')\n\nconst sanitizeHashBasePath = (basePath: string) => {\n return basePath.replace(/^#+/, '').replace(/\\/+$/g, '')\n}\n\nconst applySlugPrefix = (base: string, slugPrefix: string | undefined) => {\n return slugPrefix ? `${slugPrefix}${base ? '/' : ''}${base}` : base\n}\n\nconst stripBasePathPrefix = (value: string, basePath: string) => {\n if (value === basePath) {\n return ''\n }\n\n if (value.startsWith(`${basePath}/`)) {\n return value.slice(basePath.length + 1)\n }\n\n return null\n}\n\n/**\n * Builds the URL-encoded, slash-prefixed form of a sanitized base path.\n *\n * Each segment is encoded separately so the result matches how the browser stores\n * `location.pathname` (which encodes within segments but leaves the slashes between them).\n */\nconst encodeBasePath = (sanitized: string) => {\n if (!sanitized) {\n return ''\n }\n\n return `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n}\n\n/** Extracts an element id from the hash when using hash routing */\nexport const getIdFromHash = (location: string | URL, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n const base = decodeURIComponent(url.hash.slice(1))\n\n return applySlugPrefix(base, slugPrefix)\n}\n/** Extracts an element id from the path when using path routing */\nexport const getIdFromPath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n // Extract the portion after the basePath\n if (url.pathname.startsWith(basePathWithSlash)) {\n const remainder = url.pathname.slice(basePathWithSlash.length)\n const base = decodeURIComponent(remainder.startsWith('/') ? remainder.slice(1) : remainder)\n return applySlugPrefix(base, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Extracts an element id from a hash-prefixed basePath */\nexport const getIdFromHashBasePath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const hash = decodeURIComponent(url.hash.slice(1))\n const sanitized = sanitizeHashBasePath(basePath)\n\n const remainder = stripBasePathPrefix(hash, sanitized)\n if (remainder !== null) {\n return applySlugPrefix(remainder, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Determines whether a URL matches the provided basePath. */\nexport const matchesBasePath = (location: string | URL, basePath: string) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n if (isHashBasePath(basePath)) {\n const hash = decodeURIComponent(url.hash)\n return hash === basePath || hash.startsWith(`${basePath}/`)\n }\n\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`)\n}\n\n/**\n * Extracts a navigation id from a URL based on the routing type\n *\n * @param url - The URL to extract the id from\n * @param basePath - The base path used in path routing\n * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it\n */\nexport const getIdFromUrl = (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => {\n if (typeof basePath !== 'string') {\n return getIdFromHash(url, slugPrefix)\n }\n\n return isHashBasePath(basePath)\n ? getIdFromHashBasePath(url, basePath, slugPrefix)\n : getIdFromPath(url, basePath, slugPrefix)\n}\n\n/**\n * Strips the first segment from an id and preserves trailing slashes\n * Used in single-document mode where the document slug is not needed in the URL\n *\n * @param id - The full id to process\n * @returns The id with the first segment removed, preserving trailing slash if present\n */\nconst stripFirstSegment = (id: string): string => {\n // For preserving trailing slash in the id\n const hasTrailingSlash = id.endsWith('/')\n const segments = id.split('/').filter(Boolean).slice(1)\n const result = segments.join('/')\n\n // Only preserve trailing slash if there's actual content\n return hasTrailingSlash && result ? `${result}/` : result\n}\n\n/**\n * Generate a new URL and applies the ID to the path or hash\n * depending on the type of routing used\n *\n * @param id - The id to apply to the URL\n * @param basePath - The base path used in path routing\n * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id\n */\nexport const makeUrlFromId = (_id: string, basePath: string | undefined, isMultiDocument: boolean) => {\n if (typeof window === 'undefined') {\n return undefined\n }\n\n /** When there is only 1 document we don't need to include the document name in the URL */\n const id = isMultiDocument ? _id : stripFirstSegment(_id)\n const url = new URL(window.location.href)\n\n if (typeof basePath === 'string') {\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n url.hash = [base, id].filter(Boolean).join('/')\n } else {\n const base = sanitizeBasePath(basePath)\n url.pathname = `${base}/${id}`\n }\n } else {\n url.hash = id\n }\n\n return url\n}\n\nconst escapeRegex = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\n/**\n * A located navigation id: the decoded id plus a way to write a rewritten id back.\n */\ntype IdCarrier = {\n /** The decoded navigation id with all routing chrome (`#`, base path) removed. */\n value: string\n /** Splices `next` back into the location this id came from, preserving the URL shape. */\n write: (next: string) => void\n}\n\n/** Carrier for an id that lives in the bare hash fragment (`#<id>`). */\nconst bareHashCarrier = (url: URL): IdCarrier => ({\n value: decodeURIComponent(url.hash.slice(1)),\n write: (next) => {\n url.hash = next\n },\n})\n\n/**\n * Locates the navigation id inside a URL regardless of the routing mode.\n *\n * The id can live in three places — the bare hash, a hash base path (`#<base>/<id>`), or the\n * pathname after a path base path. Each carrier pairs the decoded id with a `write` callback, so\n * callers edit ids in id-space without re-deriving the routing chrome for each mode.\n *\n * Multiple carriers are returned: the canonical location for the active routing mode comes first,\n * followed by a legacy bare-hash carrier. Both path and hash-base-path routing include the bare hash\n * so a stale `#default/model/User` bookmark (left over from before the base path was configured) is\n * still canonicalized — the previous implementation rewrote such doc-slug-anchored hashes on every\n * load regardless of the routing mode. Callers rewrite every carrier that matches, not just the\n * first, so a legacy id sitting in both the pathname and the hash is cleaned up in one pass.\n */\nconst locateIdCarriers = (url: URL, basePath: string | undefined): IdCarrier[] => {\n // Hash routing: the id is the bare fragment.\n if (typeof basePath !== 'string') {\n return [bareHashCarrier(url)]\n }\n\n // Hash base path routing: the id follows a `#<base>/` prefix.\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n const hash = decodeURIComponent(url.hash.slice(1))\n\n return [\n {\n value: stripBasePathPrefix(hash, base) ?? '',\n write: (next) => {\n url.hash = [base, next].filter(Boolean).join('/')\n },\n },\n // Legacy fallback: an old bookmark may carry the id in the fragment without the base prefix.\n bareHashCarrier(url),\n ]\n }\n\n // Path routing: the id follows the (URL-encoded) base path in the pathname.\n const base = sanitizeBasePath(basePath)\n const remainder = stripBasePathPrefix(url.pathname, encodeBasePath(base))\n\n return [\n {\n value: remainder === null ? '' : decodeURIComponent(remainder),\n write: (next) => {\n // Assigning to `pathname` re-encodes characters, so we splice with the decoded base.\n url.pathname = base ? `/${base}/${next}` : `/${next}`\n },\n },\n // Legacy fallback: an old hash-routing bookmark may still carry the id in the fragment.\n bareHashCarrier(url),\n ]\n}\n\n/**\n * A single redirect rule, expressed in routing-agnostic id-space.\n *\n * Ids are navigation strings with all routing chrome (`#`, base path) stripped — see\n * {@link locateIdCarrier}. A rule is just the shape of an id rewrite: `match` is tested against the\n * id and `replace` follows the native `String.prototype.replace` contract, so a rule can be a plain\n * segment swap or an arbitrary replacer function. A rule that does not match leaves the id alone.\n */\ntype IdRedirect = {\n /** Pattern tested against the routing-agnostic id. */\n match: RegExp\n /** Replacement passed straight to `String.prototype.replace` (template string or replacer fn). */\n replace: string | ((substring: string, ...groups: string[]) => string)\n}\n\n/**\n * Applies redirect rules to an id and returns the first rewrite that changes it.\n *\n * Rules are tried in order and the search stops at the first match, so list more specific rules\n * before more general ones. Returns the id unchanged when no rule applies.\n */\nconst applyIdRedirects = (id: string, redirects: IdRedirect[]): string => {\n for (const { match, replace } of redirects) {\n // The ternary narrows the union so each `String.prototype.replace` overload type-checks.\n const next = typeof replace === 'string' ? id.replace(match, replace) : id.replace(match, replace)\n if (next !== id) {\n return next\n }\n }\n\n return id\n}\n\n/** Optional `(tag-group/<n>/)?tag/<slug>/` chrome that may sit in front of a section segment. */\nconst TAG_CHROME = '(?:(?:tag-group/[^/]+/)?tag/[^/]+/)?'\n\n/**\n * Runtime values the redirect rules are built from.\n *\n * The rules are data, but a few entries depend on per-document values (the configurable models\n * section slug, the active document slug, single- vs multi-document mode), so the list is built per\n * call rather than declared as a static constant.\n */\ntype RedirectContext = {\n /** Current (possibly customized) slug of the models section, e.g. `models` or `schemas`. */\n modelsSectionSlug: string\n /** Slug of the active document; legacy ids are anchored to it to avoid false positives. */\n documentSlug: string\n /** Multi-document ids always carry the doc slug; single-document bookmarks may omit it. */\n isMultiDocument: boolean\n}\n\n/**\n * Builds the list of id redirects for the current document.\n *\n * Add an entry here to support a new redirect. Each rule runs against every URL shape (hash, hash\n * base path, path) for free, because rules operate on routing-agnostic ids.\n */\nconst buildRedirects = ({ modelsSectionSlug, documentSlug, isMultiDocument }: RedirectContext): IdRedirect[] => {\n const escapedDoc = escapeRegex(documentSlug)\n // Keeping the tag chrome inside the doc-slug group is deliberate: a slug-less\n // `tag/<slug>/<segment>/<name>` is left alone, since once the document slug is stripped it is\n // ambiguous with an operation under a tag literally named after the segment.\n const documentPrefix = isMultiDocument ? `${escapedDoc}/${TAG_CHROME}` : `(?:${escapedDoc}/${TAG_CHROME})?`\n\n // Rewrites a leading `<from>/` section segment to the current models section slug. The trailing\n // `/` leaves an already-correct segment and operation paths such as `default/POST/model/train`\n // untouched.\n const renameSectionSegment = (from: string): IdRedirect => ({\n match: new RegExp(`^(${documentPrefix})${escapeRegex(from)}/`),\n replace: (_match, prefix) => `${prefix}${modelsSectionSlug}/`,\n })\n\n const redirects = [\n // Earlier versions hardcoded a singular `model/` prefix for individual schema entries even\n // though the section itself was plural, so old bookmarks like `default/model/User` would 404.\n renameSectionSegment('model'),\n ]\n\n // The models section used to live at the literal `models/`. Once a custom label moves it\n // elsewhere (e.g. `schemas/`), older `models/<name>` bookmarks must follow it. When the slug is\n // still the default `models` this would be a no-op, so only register it when it actually differs.\n if (modelsSectionSlug !== 'models') {\n redirects.push(renameSectionSegment('models'))\n }\n\n return redirects\n}\n\n/**\n * Markers that separate an operation id from a schema path within an anchor id.\n * `responses` mirrors the request-body/parameter markers so response property\n * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.\n * Without it, deep links into responses cannot find their operation.\n */\nconst SCHEMA_PARAM_MARKERS = ['.body.', '.path.', '.query.', '.header.', '.responses.']\n\n/**\n * Source data for a single webhook redirect: the raw event name, its method, and the current id.\n *\n * The current slug is read back off the id, so this layer does not need to know the (dot-keeping)\n * slug rule — it only reproduces the legacy (dot-dropping) slug to match old bookmarks.\n */\nexport type WebhookRedirectSource = {\n /** Raw webhook event name from the OpenAPI `webhooks` key, e.g. `account_holder.created`. */\n name: string\n /** HTTP method of the webhook operation. */\n method: string\n /** Current navigation id of the webhook, e.g. `default/webhook/POST/account-holder.created`. */\n id: string\n}\n\n/**\n * Builds redirect rules mapping each webhook's legacy dot-dropped slug to its current slug.\n *\n * Webhook ids used to slugify the event name with no options, which dropped dots\n * (`account_holder.created` -> `account-holdercreated`); the current id keeps them\n * (`account-holder.created`). That rewrite cannot be reversed generically, so we emit one exact rule\n * per webhook whose legacy slug differs from the current one. Each rule matches the invariant\n * `webhook/<METHOD>/<legacy-slug>` tail, so it applies regardless of the document/tag prefix in front\n * of it and preserves any sub-anchor after it. A sub-anchor is either a `/` segment or a dot-joined\n * schema property anchor (e.g. `.body.id`, see {@link SCHEMA_PARAM_MARKERS}); a dot followed by\n * anything else is not treated as a boundary, because the legacy slug never contains a dot while a\n * current webhook slug can, so such a URL belongs to a different webhook.\n *\n * Because the legacy slug is lossy, two things can make a redirect unsafe, and both are dropped so an\n * ambiguous link falls through to normal not-found handling instead of landing on the wrong webhook:\n * - the legacy slug is already another webhook's *current* slug (redirecting it would hijack a valid\n * URL), or\n * - two webhooks collapse to the same legacy slug (the old bookmark is genuinely ambiguous).\n */\nconst buildWebhookRedirects = (webhooks: WebhookRedirectSource[]): IdRedirect[] => {\n const key = (method: string, slug: string) => `${method.toUpperCase()}/${slug}`\n\n // Index current slugs so a legacy redirect never clobbers a real, current URL, and count legacy\n // slugs so we can drop the ones two webhooks share.\n const currentKeys = new Set<string>()\n const legacyCounts = new Map<string, number>()\n for (const { name, method, id } of webhooks) {\n currentKeys.add(key(method, id.slice(id.lastIndexOf('/') + 1)))\n const legacySlug = slugify(name)\n if (legacySlug) {\n const legacyKey = key(method, legacySlug)\n legacyCounts.set(legacyKey, (legacyCounts.get(legacyKey) ?? 0) + 1)\n }\n }\n\n // Property deep links append their breadcrumb to the operation id with dots\n // (`<slug>.body.id`), so the slug boundary must accept a schema-param marker\n // alongside the end of the id and a `/` segment.\n const boundary = `(?=$|/|${SCHEMA_PARAM_MARKERS.map(escapeRegex).join('|')})`\n\n const redirects: IdRedirect[] = []\n for (const { name, method, id } of webhooks) {\n const upperMethod = method.toUpperCase()\n const currentSlug = id.slice(id.lastIndexOf('/') + 1)\n const legacySlug = slugify(name)\n const legacyKey = key(method, legacySlug)\n\n // Skip when the slug did not change, when the legacy slug is a real current URL, or when it is\n // shared by more than one webhook.\n if (\n !legacySlug ||\n legacySlug === currentSlug ||\n currentKeys.has(legacyKey) ||\n (legacyCounts.get(legacyKey) ?? 0) > 1\n ) {\n continue\n }\n\n redirects.push({\n match: new RegExp(`(^|/)webhook/${escapeRegex(upperMethod)}/${escapeRegex(legacySlug)}${boundary}`),\n replace: (_match, prefix) => `${prefix}webhook/${upperMethod}/${currentSlug}`,\n })\n }\n\n return redirects\n}\n\n/**\n * Rewrites navigation ids in a URL to their current form.\n *\n * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule\n * is applied in id-space (see {@link buildRedirects} for models and {@link buildWebhookRedirects} for\n * webhooks), and the result is spliced back into the original location. This handles hash,\n * hash-base-path, and path routing uniformly, so a new redirect only has to be added to the list once.\n *\n * Returns the canonicalized URL when a rewrite happens, or null otherwise.\n */\nexport const redirectUrl = (\n url: string | URL,\n modelsSectionSlug: string,\n documentSlug: string,\n isMultiDocument: boolean,\n basePath?: string,\n webhooks: WebhookRedirectSource[] = [],\n): URL | null => {\n if (!documentSlug) {\n return null\n }\n\n const target = new URL(typeof url === 'string' ? url : url.toString())\n const redirects = [\n ...buildRedirects({ modelsSectionSlug, documentSlug, isMultiDocument }),\n ...buildWebhookRedirects(webhooks),\n ]\n\n // Canonicalize every place the id might live. The carriers are distinct physical locations (the\n // pathname and the bare hash), so a single page load can carry a legacy id in more than one — for\n // example a path-routing URL whose stale hash still holds an old bookmark. Rewriting all of them\n // avoids the address bar showing a corrected path next to an outdated hash. A redirect rule is\n // anchored to the document slug, so it never matches the base-prefixed value of a fallback carrier,\n // which keeps carriers that happen to share a location (hash base path + bare hash) from clobbering\n // each other.\n let didRedirect = false\n for (const carrier of locateIdCarriers(target, basePath)) {\n const rewritten = applyIdRedirects(carrier.value, redirects)\n if (rewritten !== carrier.value) {\n carrier.write(rewritten)\n didRedirect = true\n }\n }\n\n return didRedirect ? target : null\n}\n\n/** Extracts the schema parameters from the id if they are present */\nexport const getSchemaParamsFromId = (id: string): { rawId: string; params: string } => {\n // Split at the first marker: an operation id never contains one, so everything\n // before the first marker is the operation id and the rest is the schema path.\n // (Splitting at the last marker would mishandle a property named like a marker\n // keyword, e.g. a request body field called `responses`.) A plain string scan\n // avoids the polynomial backtracking a `(.*)marker(.*)` regex would incur on\n // long, marker-less ids.\n let markerIndex = -1\n for (const marker of SCHEMA_PARAM_MARKERS) {\n const index = id.indexOf(marker)\n if (index !== -1 && (markerIndex === -1 || index < markerIndex)) {\n markerIndex = index\n }\n }\n\n if (markerIndex === -1) {\n return {\n rawId: id,\n params: '',\n }\n }\n\n return {\n rawId: id.slice(0, markerIndex),\n // Drop the leading dot but keep the marker keyword (e.g. `body.name`).\n params: id.slice(markerIndex + 1),\n }\n}\n"],"mappings":";;AAEA,IAAa,oBAAoB,aAAqB;CACpD,OAAO,SAAS,QAAQ,cAAc,EAAE;AAC1C;AAEA,IAAM,kBAAkB,aAAqB,SAAS,WAAW,GAAG;AAEpE,IAAM,wBAAwB,aAAqB;CACjD,OAAO,SAAS,QAAQ,OAAO,EAAE,CAAC,CAAC,QAAQ,SAAS,EAAE;AACxD;AAEA,IAAM,mBAAmB,MAAc,eAAmC;CACxE,OAAO,aAAa,GAAG,aAAa,OAAO,MAAM,KAAK,SAAS;AACjE;AAEA,IAAM,uBAAuB,OAAe,aAAqB;CAC/D,IAAI,UAAU,UAC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