@scalar/api-reference 1.64.1 → 1.65.1

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 (178) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/browser/chunks/{AgentScalarChatInterface-D1mzA447.js → AgentScalarChatInterface-B8091hGB.js} +4 -4
  3. package/dist/browser/chunks/ScalarTextInput.vue-Y69qfG1_.js +27 -0
  4. package/dist/browser/chunks/basic-shape-diamond.svg-o5eiY2I7.js +1 -1
  5. package/dist/browser/chunks/basic-shape-hexagon.svg-CGuS7mbd.js +1 -1
  6. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DDIpXiBm.js +1 -1
  7. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-DzVEJHMB.js +1 -1
  8. package/dist/browser/chunks/basic-shape-shield.svg-BZzapRqv.js +1 -1
  9. package/dist/browser/chunks/browser-CTPPEMEL.js +1 -1
  10. package/dist/browser/chunks/computer-device-desktop-monitor.svg-OSM05r1I.js +1 -1
  11. package/dist/browser/chunks/computer-device-desktop.svg-BMFzGZ27.js +1 -1
  12. package/dist/browser/chunks/computer-device-laptop.svg-CMAjzuB-.js +1 -1
  13. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-D4xBONmL.js +1 -1
  14. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-gbMJLjJw.js +1 -1
  15. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-Bl1rmdKA.js +1 -1
  16. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-DVetP0aa.js +1 -1
  17. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-Zi88BP4L.js +1 -1
  18. package/dist/browser/chunks/computer-device-mobile-tablet.svg-C1ggisWP.js +1 -1
  19. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-BIUymdC1.js +1 -1
  20. package/dist/browser/chunks/computer-device-network-lan-www.svg-CoFUlIVO.js +1 -1
  21. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-DeWsacxI.js +1 -1
  22. package/dist/browser/chunks/computer-device-network-wifi-router.svg-BjpZEot4.js +1 -1
  23. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-ftjGGirE.js +1 -1
  24. package/dist/browser/chunks/image-flash-lightning.svg-DYQ0W4Fi.js +1 -1
  25. package/dist/browser/chunks/image-picture-flower.svg-Bfe5SVDf.js +1 -1
  26. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-D1HePDNM.js +1 -1
  27. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-CILUsxBC.js +1 -1
  28. package/dist/browser/chunks/interface-alert-information-circle.svg-9LrbJM5J.js +1 -1
  29. package/dist/browser/chunks/interface-award-crown.svg-DllWgiU1.js +1 -1
  30. package/dist/browser/chunks/interface-bookmark-tag.svg-Dc-JL-Kc.js +1 -1
  31. package/dist/browser/chunks/interface-bookmark.svg-Dc-JL-Kc.js +1 -1
  32. package/dist/browser/chunks/interface-calendar-date-one.svg-DO2jelhF.js +1 -1
  33. package/dist/browser/chunks/interface-content-book-open-pages.svg-BJjMjIgA.js +1 -1
  34. package/dist/browser/chunks/interface-content-book-page.svg-C6rKB2fs.js +1 -1
  35. package/dist/browser/chunks/interface-content-file.svg-CS0q2FKx.js +1 -1
  36. package/dist/browser/chunks/interface-content-folder.svg-CThTWsJX.js +1 -1
  37. package/dist/browser/chunks/interface-copy-clipboard.svg-DdN67cLv.js +1 -1
  38. package/dist/browser/chunks/interface-edit-attachment.svg-Ciizphuh.js +1 -1
  39. package/dist/browser/chunks/interface-edit-binocular.svg-Dw1nDqmL.js +1 -1
  40. package/dist/browser/chunks/interface-edit-magic-wand.svg-BYS0jm_E.js +1 -1
  41. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-NioSHZC2.js +1 -1
  42. package/dist/browser/chunks/interface-edit-tool-pencil.svg-P87QFlat.js +1 -1
  43. package/dist/browser/chunks/interface-favorite-award.svg-DBBAChSi.js +1 -1
  44. package/dist/browser/chunks/interface-favorite-flag.svg-HlhPomHY.js +1 -1
  45. package/dist/browser/chunks/interface-favorite-heart.svg-Cqu2GYDo.js +1 -1
  46. package/dist/browser/chunks/interface-favorite-star.svg-BD4JY_J2.js +1 -1
  47. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-BXi6aO8q.js +1 -1
  48. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-CDEVSsD4.js +1 -1
  49. package/dist/browser/chunks/interface-home-house.svg-DJetUjwj.js +1 -1
  50. package/dist/browser/chunks/interface-hyperlink.svg-DJ1LREmz.js +1 -1
  51. package/dist/browser/chunks/interface-lighting-brightness.svg-TGKAaHYV.js +1 -1
  52. package/dist/browser/chunks/interface-lock-closed.svg-3hehWr3i.js +1 -1
  53. package/dist/browser/chunks/interface-lock-open-unlock.svg-CuXKcv1m.js +1 -1
  54. package/dist/browser/chunks/interface-login-key.svg-Chwvvywd.js +1 -1
  55. package/dist/browser/chunks/interface-search.svg-JDE3fk0u.js +1 -1
  56. package/dist/browser/chunks/interface-setting-cog.svg-BBCkeh4K.js +1 -1
  57. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-CDdxF-4y.js +1 -1
  58. package/dist/browser/chunks/interface-share-rocket.svg-DSbdn_o7.js +1 -1
  59. package/dist/browser/chunks/interface-share-satellite.svg-CefBVZvY.js +1 -1
  60. package/dist/browser/chunks/interface-share-space-ship.svg-tFA2dsSU.js +1 -1
  61. package/dist/browser/chunks/interface-share.svg-BpOGopyv.js +1 -1
  62. package/dist/browser/chunks/interface-signal-square.svg-BcX_BoaC.js +1 -1
  63. package/dist/browser/chunks/interface-time-clock-circle.svg-C8B_L_RM.js +1 -1
  64. package/dist/browser/chunks/interface-time-hour-glass.svg-qw-oeoVn.js +1 -1
  65. package/dist/browser/chunks/interface-users-multiple.svg-Cs13Eewq.js +1 -1
  66. package/dist/browser/chunks/interface-weather-moon.svg-CV-oDTae.js +1 -1
  67. package/dist/browser/chunks/mail-chat-bubble-square.svg-dpauJhin.js +1 -1
  68. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-BBofxojL.js +1 -1
  69. package/dist/browser/chunks/mail-send-envelope.svg-DyENgYOI.js +1 -1
  70. package/dist/browser/chunks/modal-C-pxwP3A.js +102 -0
  71. package/dist/browser/chunks/money-cashier-receipt.svg-dNTr5aio.js +1 -1
  72. package/dist/browser/chunks/money-currency-dollar-pay.svg-1ZESPtFY.js +1 -1
  73. package/dist/browser/chunks/money-graph-arrow-increase.svg-kEZ2u2z2.js +1 -1
  74. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-B-t2UWB3.js +1 -1
  75. package/dist/browser/chunks/nature-ecology-leaf.svg-DZ2GJV8m.js +1 -1
  76. package/dist/browser/chunks/phone-telephone.svg-C12QjpN7.js +1 -1
  77. package/dist/browser/chunks/programming-bug.svg-wLTsruN9.js +1 -1
  78. package/dist/browser/chunks/programming-cloud.svg-3XU6dNUg.js +1 -1
  79. package/dist/browser/chunks/programming-computer-database-server.svg-B1JrHSPd.js +1 -1
  80. package/dist/browser/chunks/programming-computer-database.svg-BxHSuFl7.js +1 -1
  81. package/dist/browser/chunks/programming-module-four-layout.svg-CeV35q45.js +1 -1
  82. package/dist/browser/chunks/programming-module-three.svg-YIBpLt45.js +1 -1
  83. package/dist/browser/chunks/programming-module.svg-CU_pEibI.js +1 -1
  84. package/dist/browser/chunks/programming-script-code.svg-CLzinmHT.js +1 -1
  85. package/dist/browser/chunks/runtime-core.esm-bundler-CqqEw5ds.js +1 -1
  86. package/dist/browser/chunks/shopping-cart.svg-Brzddu3K.js +1 -1
  87. package/dist/browser/chunks/shopping-gift-present.svg-l2K48g7L.js +1 -1
  88. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-DesGopPo.js +1 -1
  89. package/dist/browser/chunks/tag-new-circle.svg-DE-VaLZU.js +1 -1
  90. package/dist/browser/chunks/travel-map-earth-globe.svg-DLaOMzx6.js +1 -1
  91. package/dist/browser/chunks/vendor-B93Hdr0r.js +306 -0
  92. package/dist/browser/standalone.esm.js +20 -20
  93. package/dist/browser/standalone.js +235 -232
  94. package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
  95. package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
  96. package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
  97. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
  98. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  99. package/dist/components/ApiReference.vue.js +1 -1
  100. package/dist/components/ApiReference.vue.js.map +1 -1
  101. package/dist/components/ApiReference.vue.script.js +8 -8
  102. package/dist/components/ApiReference.vue.script.js.map +1 -1
  103. package/dist/components/Content/AsyncApi/index.d.ts +3 -0
  104. package/dist/components/Content/AsyncApi/index.d.ts.map +1 -1
  105. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  106. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  107. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  108. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +5 -0
  109. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  110. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +6 -0
  111. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  112. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  113. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  114. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +5 -1
  115. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  116. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts +16 -0
  117. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
  118. package/dist/components/Content/Schema/helpers/get-ref-name.js +28 -1
  119. package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -1
  120. package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts +15 -0
  121. package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts.map +1 -0
  122. package/dist/components/Content/Schema/helpers/is-model-linkable.js +22 -0
  123. package/dist/components/Content/Schema/helpers/is-model-linkable.js.map +1 -0
  124. package/dist/components/Content/Schema/helpers/schema-name.d.ts +6 -1
  125. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  126. package/dist/components/Content/Schema/helpers/schema-name.js +5 -4
  127. package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -1
  128. package/dist/components/Content/Schema/types.d.ts +7 -0
  129. package/dist/components/Content/Schema/types.d.ts.map +1 -1
  130. package/dist/components/index.d.ts +1 -0
  131. package/dist/components/index.d.ts.map +1 -1
  132. package/dist/components/index.js +5 -1
  133. package/dist/features/Operation/components/Header.vue.d.ts +2 -0
  134. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
  135. package/dist/features/Operation/components/Header.vue.js.map +1 -1
  136. package/dist/features/Operation/components/Header.vue.script.js +3 -1
  137. package/dist/features/Operation/components/Header.vue.script.js.map +1 -1
  138. package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
  139. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  140. package/dist/features/Operation/components/Headers.vue.js +1 -1
  141. package/dist/features/Operation/components/Headers.vue.js.map +1 -1
  142. package/dist/features/Operation/components/Headers.vue.script.js +4 -1
  143. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  144. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  145. package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
  146. package/dist/features/Operation/components/OperationParameters.vue.script.js +2 -2
  147. package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
  148. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  149. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  150. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  151. package/dist/features/Operation/components/ParameterListItem.vue.script.js +3 -0
  152. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  153. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  154. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  155. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  156. package/dist/features/Operation/components/RequestBody.vue.script.js +10 -1
  157. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  158. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  159. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  160. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  161. package/dist/features/Search/components/SearchResult.vue.script.js +2 -2
  162. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  163. package/dist/helpers/build-models-index.d.ts +15 -0
  164. package/dist/helpers/build-models-index.d.ts.map +1 -0
  165. package/dist/helpers/build-models-index.js +28 -0
  166. package/dist/helpers/build-models-index.js.map +1 -0
  167. package/dist/helpers/storage.d.ts +16 -0
  168. package/dist/helpers/storage.d.ts.map +1 -1
  169. package/dist/style.css +418 -409
  170. package/dist/vue-styles.css +370 -361
  171. package/package.json +13 -13
  172. package/dist/browser/chunks/ScalarTextInput.vue-OfiA6SHf.js +0 -27
  173. package/dist/browser/chunks/modal-BS4e2gew.js +0 -99
  174. package/dist/browser/chunks/vendor-DWZAEyBy.js +0 -306
  175. package/dist/features/Operation/helpers/should-ignore-entity.d.ts +0 -8
  176. package/dist/features/Operation/helpers/should-ignore-entity.d.ts.map +0 -1
  177. package/dist/features/Operation/helpers/should-ignore-entity.js +0 -9
  178. package/dist/features/Operation/helpers/should-ignore-entity.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.script.js","names":["$attrs","$slots"],"sources":["../../src/components/ApiReference.vue"],"sourcesContent":["<script lang=\"ts\">\n/* global PACKAGE_VERSION */\n// Injected by Vite at build time (see vite.config.ts and vite.standalone.config.ts).\n// Read via process.env so the constant is replaced inline without pulling package.json\n// into the TypeScript program — that would expand rootDir and emit declarations under dist/src/.\nconst version = PACKAGE_VERSION\n\nif (version && typeof window !== 'undefined') {\n console.info(`@scalar/api-reference@${version}`)\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { provideUseId } from '@headlessui/vue'\nimport { OpenApiClientButton } from '@scalar/api-client/blocks/operation-block'\nimport type { ApiClientModal } from '@scalar/api-client/modal'\nimport {\n ScalarColorModeToggleButton,\n ScalarColorModeToggleIcon,\n} from '@scalar/components/color-mode-toggle'\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport {\n ScalarSidebarFooter,\n ScalarSidebarSection,\n} from '@scalar/components/sidebar'\nimport { toJsonCompatible } from '@scalar/helpers/object/to-json-compatible'\nimport { slugify } from '@scalar/helpers/string/slugify'\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport { apiReferenceConfigurationSchema } from '@scalar/schemas/api-reference'\nimport {\n createSidebarState,\n ScalarSidebar,\n scrollSidebarToTop,\n} from '@scalar/sidebar'\nimport { getThemeStyles, hasObtrusiveScrollbars } from '@scalar/themes'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfiguration,\n type ApiReferenceConfigurationRaw,\n} from '@scalar/types/api-reference'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { useColorMode } from '@scalar/use-hooks/useColorMode'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport { coerce } from '@scalar/validation'\nimport { getAsyncApiServers } from '@scalar/workspace-store/channel-example'\nimport { createWorkspaceStore } from '@scalar/workspace-store/client'\nimport { createWorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveEnvironment,\n getServers,\n} from '@scalar/workspace-store/request-example'\nimport type {\n TraversedEntry,\n TraversedTag,\n} from '@scalar/workspace-store/schemas/navigation'\nimport {\n isAsyncApiDocument,\n isOpenApiDocument,\n} from '@scalar/workspace-store/schemas/type-guards'\nimport { useScrollLock } from '@vueuse/core'\nimport diff from 'microdiff'\nimport {\n computed,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n onServerPrefetch,\n provide,\n ref,\n useId,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport {\n AsyncApiSidebarFilters,\n filterAsyncApiNavigation,\n} from '@/blocks/scalar-asyncapi-sidebar-filters-block'\nimport {\n AgentScalarButton,\n AgentScalarDrawer,\n OpenMCPButton,\n} from '@/components/AgentScalar'\nimport ClassicHeader from '@/components/ClassicHeader.vue'\nimport Content from '@/components/Content/Content.vue'\nimport MobileHeader from '@/components/MobileHeader.vue'\nimport { DeveloperTools } from '@/features/developer-tools'\nimport {\n provideLocalization,\n resolveLocalization,\n} from '@/features/localization'\nimport DocumentSelector from '@/features/multiple-documents/DocumentSelector.vue'\nimport SearchButton from '@/features/Search/components/SearchButton.vue'\nimport { getSystemModePreference } from '@/helpers/color-mode'\nimport { downloadDocument } from '@/helpers/download'\nimport {\n getIdFromUrl,\n makeUrlFromId,\n matchesBasePath,\n redirectUrl,\n type WebhookRedirectSource,\n} from '@/helpers/id-routing'\nimport {\n INTRODUCTION_ENTRY_ID_SUFFIX,\n isIntroductionEntry,\n} from '@/helpers/is-introduction-entry'\nimport {\n scrollToLazy as _scrollToLazy,\n addToPriorityQueue,\n blockIntersection,\n intersectionEnabled,\n} from '@/helpers/lazy-bus'\nimport {\n loadAuthFromStorage,\n loadClientFromStorage,\n} from '@/helpers/load-from-perssistance'\nimport { mapConfigPlugins } from '@/helpers/map-config-plugins'\nimport { mapConfigToWorkspaceStore } from '@/helpers/map-config-to-workspace-store'\nimport {\n normalizeConfigurations,\n type NormalizedConfiguration,\n} from '@/helpers/normalize-configurations'\nimport { safeDeepClone } from '@/helpers/safe-deep-clone'\nimport { AGENT_CONTEXT_SYMBOL, useAgent } from '@/hooks/use-agent'\nimport { useIntersection } from '@/hooks/use-intersection'\nimport { createPluginManager, PLUGIN_MANAGER_SYMBOL } from '@/plugins'\nimport { persistencePlugin } from '@/plugins/persistence-plugin'\n\nconst props = defineProps<{\n /**\n * Configuration for the API reference.\n * Can be a single configuration or an array of configurations for multiple documents.\n */\n configuration?: AnyApiReferenceConfiguration\n}>()\n\ndefineSlots<{\n 'content-start'?(): { breadcrumb: string }\n 'content-end'?(): { breadcrumb: string }\n 'sidebar-start'?(): { breadcrumb: string }\n 'sidebar-end'?(): { breadcrumb: string }\n 'editor-placeholder'?(): { breadcrumb: string }\n footer?(): { breadcrumb: string }\n}>()\n\nconst { copyToClipboard } = useClipboard()\n\n/**\n * Used to inject the environment into built packages\n *\n * Primary use case is the open-in-client button\n */\nconst isDevelopment = import.meta.env.DEV\n\n/**\n * Whether scrollbars take up screen real estate.\n *\n * This defaults to `false` so the first client render matches the server (where\n * there is no DOM to measure). The real value is resolved in `onMounted` to\n * avoid a hydration mismatch on the root class.\n */\nconst obtrusiveScrollbars = ref(false)\nonMounted(() => {\n obtrusiveScrollbars.value = hasObtrusiveScrollbars()\n})\n\nconst eventBus = createWorkspaceEventBus({ debug: isDevelopment })\nconst isSidebarOpen = ref(false)\n\n/**\n * Due to a bug in headless UI, we need to set an ID here that can be shared across server/client\n * TODO remove this once the bug is fixed\n *\n * @see https://github.com/tailwindlabs/headlessui/issues/2979\n */\nprovideUseId(() => useId())\n\n// ---------------------------------------------------------------------------\n/**\n * Configuration Handling\n *\n * We will normalize the configurations and store them in a computed property.\n * The active configuration will be associated with the active document.\n */\nconst configList = computed(() => normalizeConfigurations(props.configuration))\n\nconst isMultiDocument = computed(() => Object.keys(configList.value).length > 1)\n\n/** Search for the source with a default attribute or use the first one */\nconst activeSlug = ref<string>(\n Object.values(configList.value).find((c) => c.default)?.slug ??\n configList.value[Object.keys(configList.value)?.[0] ?? '']?.slug ??\n '',\n)\n\n/**\n * On initial page load we need to determine if there is a valid document slug in the URL\n *\n * If there is we set the active slug to the document slug\n */\nif (typeof window !== 'undefined') {\n const url = new URL(window.location.href)\n\n // To handle legacy query parameter multi-document support we redirect\n // to the new path routing format\n const apiParam = url.searchParams.get('api')\n if (apiParam && configList.value[apiParam]) {\n activeSlug.value = apiParam\n const idFromUrl = getIdFromUrl(\n url,\n configList.value[apiParam].config.pathRouting?.basePath,\n apiParam,\n )\n const newUrl = makeUrlFromId(\n idFromUrl,\n configList.value[apiParam].config.pathRouting?.basePath,\n isMultiDocument.value,\n )\n if (newUrl) {\n newUrl.searchParams.delete('api')\n window.history.replaceState({}, '', newUrl.toString())\n }\n }\n\n /**\n * For path routing on initial load we do not know which basePath to check for\n * we need to search the configs to see if any of the base paths match the URL\n * and then use that basePath to get the initial id\n *\n * With this approach we cannot support multi-document mode with one of configs having\n * an empty basePath\n *\n * Other conflicts are possible.\n */\n const basePaths = Object.values(configList.value).map(\n (c) => c.config.pathRouting?.basePath,\n )\n\n const initialId = getIdFromUrl(\n url,\n basePaths.find((p) => (p ? matchesBasePath(url, p) : false)),\n isMultiDocument.value ? undefined : activeSlug.value,\n )\n const documentSlug = initialId.split('/')[0]\n\n if (documentSlug && configList.value[documentSlug]) {\n activeSlug.value = documentSlug\n }\n}\n\n/** Computed document options list for the selector logic */\nconst documentOptionList = computed(() =>\n Object.values(configList.value).map((c) => ({\n label: c.title,\n id: c.slug,\n })),\n)\n\n/**\n * AsyncAPI sidebar filters (protocol + server).\n *\n * These mirror the document picker: stacked dropdowns at the top of the sidebar\n * that narrow the visible operations. State resets whenever the active document\n * changes so a filter never leaks across documents.\n */\nconst selectedProtocol = ref<string>('')\nconst selectedServer = ref<string>('')\n\n/** The active document, narrowed to AsyncAPI (or `null` for OpenAPI documents). */\nconst activeAsyncApiDocument = computed(() => {\n const document = workspaceStore.workspace.activeDocument\n return isAsyncApiDocument(document) ? document : null\n})\n\n// Reset the filters when switching documents.\nwatch(activeSlug, () => {\n selectedProtocol.value = ''\n selectedServer.value = ''\n})\n\n/** Configuration overrides to apply to the selected document (from the localhost toolbar) */\nconst configurationOverrides = ref<\n Partial<Omit<ApiReferenceConfiguration, 'slug' | 'title' | ''>>\n>({})\n\nconst withLocalizedConfigurationDefaults = (\n config: ApiReferenceConfiguration,\n activeConfig: Partial<ApiReferenceConfiguration> | undefined,\n): ApiReferenceConfiguration => {\n const localization = resolveLocalization(config.localization)\n const configuredModelsSectionLabel =\n configurationOverrides.value.modelsSectionLabel ??\n (activeConfig?.modelsSectionLabel !== DEFAULT_MODELS_SECTION_LABEL\n ? activeConfig?.modelsSectionLabel\n : undefined)\n\n return {\n ...config,\n modelsSectionLabel:\n configuredModelsSectionLabel ??\n localization.translations.models.label ??\n DEFAULT_MODELS_SECTION_LABEL,\n }\n}\n\n/** Any dev toolbar modifications are merged with the active configuration */\nconst mergedConfig = computed<ApiReferenceConfiguration>(() => {\n const activeConfig = configList.value[activeSlug.value]?.config\n const merged = {\n // Provides a default set of values when the lookup fails\n ...coerce(apiReferenceConfigurationSchema, {}),\n // The active configuration based on the slug\n ...activeConfig,\n // Any overrides from the localhost toolbar\n ...configurationOverrides.value,\n }\n\n return withLocalizedConfigurationDefaults(merged, activeConfig)\n})\n\nconst apiReferenceLocalization = provideLocalization(\n () => mergedConfig.value.localization,\n)\n\nconst sidebarOptions = computed(() => ({\n ...mergedConfig.value,\n labels: {\n closeGroup: apiReferenceLocalization.translate('navigation.closeGroup'),\n httpMethod: apiReferenceLocalization.translate('common.httpMethod'),\n openGroup: apiReferenceLocalization.translate('navigation.openGroup'),\n },\n}))\n\n/**\n * Locale string for the `lang` attribute. We normalize underscores to hyphens so values like\n * `es_MX` become valid BCP-47 language tags (`es-MX`).\n */\nconst documentLang = computed(() =>\n apiReferenceLocalization.locale.value.replace('_', '-'),\n)\n\n/** Convenience break out var to determine which routing mode we are using */\nconst basePath = computed(() => mergedConfig.value.pathRouting?.basePath)\n\nconst themeStyle = computed(() =>\n getThemeStyles(mergedConfig.value.theme, {\n fonts: mergedConfig.value.withDefaultFonts,\n }),\n)\n\n/**\n * Custom CSS plus the theme styles, injected into a single `<style>` tag.\n *\n * This is rendered with `v-html` so the CSS is emitted verbatim. Interpolating\n * it as text content makes Vue HTML-escape characters like `\"` into `&quot;` on\n * the server while the client keeps `\"`, which both breaks the CSS and causes a\n * hydration mismatch.\n *\n * A closing `</style>` tag is neutralized first. It never appears in valid CSS,\n * but during server rendering the string lands in the HTML stream unescaped, so\n * `customCss` coming from a docs platform where readers can supply their own\n * theme would otherwise be able to close the tag and open a `<script>`.\n */\nconst styleContent = computed(() =>\n `${mergedConfig.value.customCss ?? ''}\\n${themeStyle.value}`.replace(\n /<\\/style/gi,\n '<\\\\/style',\n ),\n)\n\n// ---------------------------------------------------------------------------\n/** Navigation State Handling */\n\n// Collects every webhook entry in a navigation subtree, so old deep links can be\n// redirected from the legacy dot-dropped slug to the current one. Webhook ids are\n// only known once the document is loaded, so the redirect itself runs later, in\n// `changeSelectedDocument`.\nconst collectWebhooks = (entries: TraversedEntry[]): WebhookRedirectSource[] =>\n entries.flatMap((entry) => {\n const nested =\n 'children' in entry && entry.children\n ? collectWebhooks(entry.children)\n : []\n return entry.type === 'webhook'\n ? [{ name: entry.name, method: entry.method, id: entry.id }, ...nested]\n : nested\n })\n\n// Rewrite outdated `model/` and `models/` schema URLs to the current models\n// section slug so bookmarks from before the slug changed keep resolving. Webhook\n// deep links are handled separately once the document (and its navigation) loads.\nif (typeof window !== 'undefined') {\n const canonical = redirectUrl(\n window.location.href,\n slugify(\n mergedConfig.value.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL,\n ),\n activeSlug.value,\n isMultiDocument.value,\n mergedConfig.value.pathRouting?.basePath,\n )\n if (canonical) {\n window.history.replaceState({}, '', canonical.toString())\n }\n}\n\n// Front-end redirect\nif (mergedConfig.value.redirect && typeof window !== 'undefined') {\n const newPath = mergedConfig.value.redirect(\n (mergedConfig.value.pathRouting ? window.location.pathname : '') +\n window.location.hash,\n )\n if (newPath) {\n window.history.replaceState({}, '', newPath)\n }\n}\n\n/**\n * Sets the active slug and updates the URL with the selected document slug\n *\n * If an element ID is passed in we will configure the path or hash routing\n */\nfunction syncSlugAndUrlWithDocument(\n slug: string,\n elementId: string | undefined,\n config: ApiReferenceConfigurationRaw,\n) {\n // We create a new URL and go to the root element if an ID is not provided\n const url = makeUrlFromId(\n elementId || slug,\n config.pathRouting?.basePath,\n isMultiDocument.value,\n )\n\n if (url) {\n window.history.replaceState({}, '', url.toString())\n }\n\n // Update the active slug\n activeSlug.value = slug\n}\n\n// ---------------------------------------------------------------------------\n/** Workspace Store Initialization */\n\n/**\n * Initializes the new client workspace store.\n */\nconst workspaceStore = createWorkspaceStore({\n verbose: isDevelopment,\n})\n\n/**\n * We need to keep the client store separate from the workspace store\n * This is because we want the client store to be a playground where users can test out their requests without affecting the references store\n */\nconst clientStore = createWorkspaceStore({\n verbose: isDevelopment,\n plugins: [\n persistencePlugin({\n persistAuth: () => mergedConfig.value.persistAuth ?? false,\n }),\n ],\n})\n\n/**\n * Plugin injection is not reactive. All plugins must be provided at first render.\n *\n * Created after the client store so the auth accessor below can read from it — plugin `onInit`\n * hooks may call `auth` synchronously during `notifyInit`. The reference-side Authentication panel\n * (Content → Auth.vue) persists credentials into `clientStore.auth`, so plugins must read the same\n * store to see what the user entered.\n */\nconst pluginManager = createPluginManager({\n plugins: Object.values(configList.value).flatMap(\n (c) => c.config.plugins ?? [],\n ),\n /**\n * Read-only view of the global authentication state, so plugins can read stored secrets and\n * the selected security schemes without being able to mutate them. Wraps the client store's\n * auth methods (rather than passing the store directly) to keep the setters out of the plugin API.\n *\n * The getters return a deep copy (`export` already snapshots internally, the others go through\n * `toJsonCompatible`) so plugins receive plain data rather than the store's live reactive proxies —\n * mutating what they get back can never leak into the store.\n */\n auth: {\n export: () => clientStore.auth.export(),\n getAuthSecrets: (documentName, schemeName) =>\n toJsonCompatible(\n clientStore.auth.getAuthSecrets(documentName, schemeName),\n ),\n getAuthSelectedSchemas: (payload) =>\n toJsonCompatible(clientStore.auth.getAuthSelectedSchemas(payload)),\n },\n})\nprovide(PLUGIN_MANAGER_SYMBOL, pluginManager)\n\npluginManager.notifyInit(mergedConfig.value)\n\nwatch(mergedConfig, (config) => pluginManager.notifyConfigChange(config))\n\n// TODO: persistence should be hoisted into standalone\n// Client side integrations will want to handle dark mode externally\nconst { toggleColorMode, isDarkMode } = useColorMode({\n initialColorMode: {\n true: 'dark' as const,\n false: 'light' as const,\n undefined: 'system' as const,\n }[String(mergedConfig.value.darkMode)],\n overrideColorMode: mergedConfig.value.forceDarkModeState,\n})\n\n/**\n * The active document passed to the search modal. Both OpenAPI and AsyncAPI\n * documents are surfaced so the search index can pick up info.description\n * headings from either spec; AsyncAPI-specific entries (channels, operations,\n * messages) are not indexed yet.\n */\nconst activeSearchableDocument = computed(\n () => workspaceStore.workspace.activeDocument,\n)\n\n/**\n * Sidebar entries contributed by plugin views (content.start / content.end).\n *\n * Each entry reuses the same id as the rendered plugin component, so the existing\n * navigation and scroll-spy logic can scroll to and highlight it. Plugins are static for\n * the lifetime of the manager, so this only needs to be resolved once.\n */\nconst pluginSidebarEntries = computed(() =>\n pluginManager\n .getSidebarEntries(activeSlug.value)\n .reduce<Record<'content.start' | 'content.end', TraversedEntry[]>>(\n (grouped, entry) => {\n grouped[entry.viewName].push({\n id: entry.id,\n title: entry.label,\n type: 'text',\n })\n return grouped\n },\n { 'content.start': [], 'content.end': [] },\n ),\n)\n\n/**\n * Localize the synthetic labels we generate for the sidebar (introduction, webhooks, and the models\n * section). Entries are only cloned when a label actually changes, so the common English-default case\n * does not allocate a new navigation tree on every recompute.\n */\nconst localizeNavigationEntries = (\n entries: TraversedEntry[],\n): TraversedEntry[] => {\n const introductionTitle = apiReferenceLocalization.translate(\n 'navigation.introduction',\n )\n const webhooksTitle = apiReferenceLocalization.translate(\n 'navigation.webhooks',\n )\n const modelsSectionLabel =\n mergedConfig.value.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL\n\n const localize = (list: TraversedEntry[]): TraversedEntry[] => {\n let changed = false\n\n const result = list.map((entry) => {\n let localized = entry\n\n if (isIntroductionEntry(entry) && entry.title !== introductionTitle) {\n localized = { ...entry, title: introductionTitle } as TraversedEntry\n } else if (\n entry.type === 'tag' &&\n entry.isWebhooks === true &&\n (entry.title !== webhooksTitle || entry.name !== webhooksTitle)\n ) {\n localized = {\n ...entry,\n title: webhooksTitle,\n name: webhooksTitle,\n } as TraversedEntry\n } else if (\n entry.type === 'models' &&\n (entry.title !== modelsSectionLabel ||\n entry.name !== modelsSectionLabel)\n ) {\n localized = {\n ...entry,\n title: modelsSectionLabel,\n name: modelsSectionLabel,\n } as TraversedEntry\n }\n\n if ('children' in entry && entry.children) {\n const localizedChildren = localize(entry.children)\n\n if (localizedChildren !== entry.children) {\n localized =\n localized === entry ? ({ ...entry } as TraversedEntry) : localized\n ;(localized as { children?: TraversedEntry[] }).children =\n localizedChildren\n }\n }\n\n if (localized !== entry) {\n changed = true\n }\n\n return localized\n })\n\n // Preserve the original reference when nothing changed to avoid downstream re-renders.\n return changed ? result : list\n }\n\n return localize(entries)\n}\n\n/**\n * Create top level sidebar entries for each document\n * This allows sharing a single sidebar state for across the workspace\n */\nconst itemsFromWorkspace = computed<TraversedEntry[]>(() => {\n return Object.entries(workspaceStore.workspace.documents).map(\n ([slug, document]) => {\n // Both OpenAPI and AsyncAPI documents carry an `x-scalar-navigation` tree.\n const children = document['x-scalar-navigation']?.children ?? []\n\n // Plugin views render once for the active document, so only surface their sidebar\n // entries there. `content.start` sits above the Introduction, `content.end` below.\n const childrenWithPlugins =\n slug === activeSlug.value\n ? [\n ...pluginSidebarEntries.value['content.start'],\n ...localizeNavigationEntries(children),\n ...pluginSidebarEntries.value['content.end'],\n ]\n : localizeNavigationEntries(children)\n\n return {\n id: slug,\n type: 'document',\n description: document.info.description,\n name: document.info.title ?? slug,\n title: document.info.title ?? slug,\n children: childrenWithPlugins,\n }\n },\n )\n})\n\n/** Initialize the sidebar */\nconst sidebarState = createSidebarState<TraversedEntry>(itemsFromWorkspace, {\n hooks: {},\n})\n\n/** Recursively set all children of the given items to open */\nconst setChildrenOpen = (items: TraversedEntry[]): void => {\n items.forEach((item) => {\n if (item.type === 'tag' || item.type === 'models') {\n sidebarState.setExpanded(item.id, true)\n }\n if ('children' in item && item.children) {\n setChildrenOpen(item.children)\n }\n })\n}\n\n/** We get the sub items for the sidebar based on the configuration/document slug */\nconst sidebarItems = computed<TraversedEntry[]>(() => {\n const config = mergedConfig.value\n\n if (!config) {\n return []\n }\n\n const rawDocItems =\n sidebarState.items.value.find(\n (item): item is TraversedTag => item.id === activeSlug.value,\n )?.children ?? []\n\n // Apply the AsyncAPI protocol/server filters to the sidebar tree. This is a no-op\n // for OpenAPI documents and when no filter is selected.\n const docItems = activeAsyncApiDocument.value\n ? filterAsyncApiNavigation(rawDocItems, activeAsyncApiDocument.value, {\n protocol: selectedProtocol.value,\n server: selectedServer.value,\n })\n : rawDocItems\n\n // When the default open all tags configuration is enabled we open all the children of the document\n if (config.defaultOpenAllTags) {\n setChildrenOpen(docItems)\n }\n\n // When the expand all model sections configuration is enabled we open all the children of the models tag\n if (config.expandAllModelSections) {\n const models = docItems.find(\n (item): item is TraversedTag => item.type === 'models',\n )\n if (models) {\n sidebarState.setExpanded(models.id, true)\n models.children?.forEach((child) => {\n sidebarState.setExpanded(child.id, true)\n })\n }\n }\n\n return docItems\n})\n\n/** Find the sidebar entry that represents the introduction section */\nconst infoSectionId = computed(\n () =>\n sidebarItems.value.find(isIntroductionEntry)?.id ??\n `${activeSlug.value}${INTRODUCTION_ENTRY_ID_SUFFIX}`,\n)\n\n/** User for mobile navigation */\nconst breadcrumb = ref('')\n\nconst slotProps = computed(() => ({\n breadcrumb: breadcrumb.value,\n}))\n\nconst setBreadcrumb = (id: string) => {\n const item = sidebarState.getEntryById(id)\n\n if (!item || item.type === 'document') {\n breadcrumb.value = ''\n } else {\n breadcrumb.value = item.title\n }\n}\n\nconst scrollToLazyElement = (id: string) => {\n setBreadcrumb(id)\n sidebarState.setSelected(id)\n _scrollToLazy(id, sidebarState.setExpanded, sidebarState.getEntryById)\n}\n\n/**\n * Updates the browser tab title via the user-provided `setPageTitle` callback.\n *\n * Called whenever the section in view changes — on sidebar clicks, on scroll, and\n * when switching documents — so the tab title always reflects what the reader sees.\n */\nconst updatePageTitle = (id: string) => {\n const setPageTitle = mergedConfig.value?.setPageTitle\n const entry = sidebarState.getEntryById(id)\n\n if (!setPageTitle || typeof document === 'undefined' || !entry?.title) {\n return\n }\n\n const activeDocument = workspaceStore.workspace.activeDocument\n\n document.title = setPageTitle({\n title: entry.title,\n document: {\n title: activeDocument?.info?.title ?? activeSlug.value,\n slug: activeSlug.value,\n },\n })\n}\n\n/** Maps some config values to the workspace store to keep it reactive */\nmapConfigToWorkspaceStore({\n config: () => mergedConfig.value,\n store: workspaceStore,\n isDarkMode,\n})\n\nmapConfigToWorkspaceStore({\n config: () => mergedConfig.value,\n store: clientStore,\n isDarkMode,\n})\n\n/** Merged environment variables from workspace and document levels */\nconst environment = computed(\n () =>\n getActiveEnvironment(\n workspaceStore,\n workspaceStore.workspace.activeDocument ?? null,\n ).environment,\n)\n\nif (typeof window !== 'undefined') {\n // @ts-expect-error - For debugging purposes expose the store\n window.dataDumpWorkspace = () => workspaceStore\n}\n\n// For testing\ndefineExpose({\n eventBus,\n workspaceStore,\n sidebarItems,\n})\n\n/**\n * Computes a mapping from model names to their sidebar entry IDs.\n * This is used for quick lookups and navigation within the sidebar.\n */\nconst modelsIndex = computed(() => {\n return sidebarItems.value\n .filter((item) => item.type === 'models')\n .flatMap((item) => item.children ?? [])\n .filter((item) => item.type === 'model')\n .reduce(\n (acc, item) => {\n acc[item.name] = item.id\n return acc\n },\n {} as Record<string, string>,\n )\n})\n\neventBus.on('scroll-to:model-by-name', ({ name }) => {\n /** Find the model in the models index */\n const model = modelsIndex.value[name]\n\n if (model) {\n scrollToLazyElement(model)\n }\n})\n\nconst addDocument: typeof workspaceStore.addDocument = async (\n input,\n navigationOptions,\n) => {\n const result = await workspaceStore.addDocument(input, navigationOptions)\n\n // The selected server lives only on the client store document. The user picks it in the\n // reference, it is never part of the imported source. Reloading the freshly imported document\n // below would drop it, so any config update that rebases the document — a new auth token,\n // reordered servers, an edited spec — would otherwise reset the server back to the first one.\n // Capture it here and re-apply it after the reload so the user's choice survives. See #5071.\n const previousDocument = clientStore.workspace.documents[input.name]\n const selectedServer =\n previousDocument && typeof previousDocument === 'object'\n ? (previousDocument as Record<string, unknown>)[\n 'x-scalar-selected-server'\n ]\n : undefined\n\n // Now add it to the client store\n const state = workspaceStore.exportWorkspace()\n const nextDocument = safeDeepClone(state.documents[input.name]) ?? {\n 'openapi': '3.1.0',\n 'info': {\n title: '',\n version: '',\n },\n 'x-scalar-original-document-hash': '',\n }\n\n // Carry the user's server selection over to the reloaded document. An empty string is a\n // deliberate \"no server selected\" state, so it is preserved too; only `undefined` (a first\n // load with no prior selection) falls through to the default-server logic elsewhere.\n if (typeof selectedServer === 'string') {\n Object.assign(nextDocument, { 'x-scalar-selected-server': selectedServer })\n }\n\n clientStore.loadWorkspace({\n auth: {},\n documents: {\n [input.name]: nextDocument,\n },\n intermediateDocuments: {},\n originalDocuments: {},\n overrides: {},\n history: {},\n meta: {},\n })\n return result\n}\n\n// ---------------------------------------------------------------------------\n// Document Management\n\n/** In-flight document loads, so a background preload and a user selection never load the same document twice */\nconst documentLoadPromises = new Map<string, Promise<void>>()\n\n/**\n * Load a document into the workspace store by slug, fetching URL sources or using inline content.\n *\n * This does not change the active document, so it is safe to call in the background to warm up\n * documents the user has not selected yet. Repeated calls are deduplicated and it becomes a no-op\n * once the document is loaded.\n */\nconst ensureDocumentLoaded = (slug: string): Promise<void> => {\n // Already loaded, nothing to do\n if (workspaceStore.workspace.documents[slug]) {\n return Promise.resolve()\n }\n\n // A load is already in flight, reuse it\n const pending = documentLoadPromises.get(slug)\n if (pending) {\n return pending\n }\n\n const normalized = configList.value[slug]\n\n if (!normalized) {\n return Promise.resolve()\n }\n\n const config = withLocalizedConfigurationDefaults(\n {\n ...normalized.config,\n ...configurationOverrides.value,\n },\n normalized.config,\n )\n\n const promise = (async () => {\n const result = await addDocument(\n normalized.source.url\n ? {\n name: slug,\n url: normalized.source.url,\n fetch: config.customFetch,\n }\n : {\n name: slug,\n document: normalized.source.content ?? {},\n },\n config,\n )\n\n const document = clientStore.workspace.documents[slug]\n\n // If the document does not have a selected server we set it to the first server\n if (\n result === true &&\n isOpenApiDocument(document) &&\n document['x-scalar-selected-server'] === undefined\n ) {\n // Set the active server if the document is loaded successfully. Resolve relative servers\n // against this document's own base URL, not the active document's, so a background preload\n // does not derive its server from whichever document happens to be active.\n const servers = getServers(\n normalized.config.servers ?? document.servers,\n {\n baseServerUrl: config.baseServerURL,\n documentUrl: normalized.source.url,\n },\n )\n if (servers.length > 0) {\n clientStore.updateDocument(\n slug,\n 'x-scalar-selected-server',\n servers[0]!.url,\n )\n }\n }\n })().finally(() => {\n documentLoadPromises.delete(slug)\n })\n\n documentLoadPromises.set(slug, promise)\n\n return promise\n}\n\n/** Whether idle preloading has been stopped, for example when the component unmounts */\nlet isPreloadStopped = false\n/** Cancels the currently scheduled idle preload callback, if one is pending */\nlet cancelScheduledPreload: (() => void) | undefined\n\n/**\n * Stop any in-progress idle preloading. Without this, an orphaned instance (an Astro view\n * transition or a `createApiReference` remount) would keep fetching and parsing documents into\n * an abandoned store after unmount.\n */\nconst stopPreloadingDocuments = () => {\n isPreloadStopped = true\n cancelScheduledPreload?.()\n cancelScheduledPreload = undefined\n}\n\n/**\n * Warm up the documents the user has not selected yet while the browser is idle, so switching\n * between documents is instant. Runs on the client only and loads one document at a time to avoid\n * a burst of fetches and parsing work competing with the active document.\n */\nconst preloadDocumentsWhenIdle = () => {\n if (typeof window === 'undefined') {\n return\n }\n\n const pendingSlugs = Object.keys(configList.value).filter(\n (slug) => !workspaceStore.workspace.documents[slug],\n )\n\n const scheduleIdle = (callback: () => void) => {\n if (typeof window.requestIdleCallback === 'function') {\n const handle = window.requestIdleCallback(callback, { timeout: 1500 })\n cancelScheduledPreload = () => window.cancelIdleCallback(handle)\n } else {\n const handle = window.setTimeout(callback, 200)\n cancelScheduledPreload = () => window.clearTimeout(handle)\n }\n }\n\n const loadNext = () => {\n if (isPreloadStopped) {\n return\n }\n\n const slug = pendingSlugs.shift()\n\n if (!slug) {\n return\n }\n\n // Load one document, then queue the next once the browser is idle again\n void ensureDocumentLoaded(slug).finally(() => {\n if (!isPreloadStopped) {\n scheduleIdle(loadNext)\n }\n })\n }\n\n scheduleIdle(loadNext)\n}\n\n/**\n * Handle changing the active document\n *\n * 1. If the document has not be loaded to the workspace store we set it to empty and asynchronously load it\n * 2. If the document has been loaded to the workspace store we just set it to active\n * 3. If the content from the configuration has changes we need to update the document in the workspace store\n */\nconst changeSelectedDocument = async (\n slug: string,\n elementId?: string | undefined,\n) => {\n const normalized = configList.value[slug]\n\n if (!normalized) {\n console.warn(`Document ${slug} not found in configList`)\n return\n }\n\n const config = withLocalizedConfigurationDefaults(\n {\n ...normalized.config,\n ...configurationOverrides.value,\n },\n normalized.config,\n )\n\n // Store `onDocumentSelect` result to await its execution later, before calling `onLoaded`\n const onDocumentSelectPromise = config.onDocumentSelect?.()\n\n // Set the active slug and update any routing\n syncSlugAndUrlWithDocument(slug, elementId, config)\n\n // Update the document on the route as well, the method and path don't matter as we update them before opening\n apiClient.value?.route({\n documentSlug: slug,\n method: 'get',\n path: '/',\n })\n\n // Load the document if it is not in the store yet (a background preload may already be loading it)\n await ensureDocumentLoaded(slug)\n\n // Always set it to active; if the document is null we show a loading state\n workspaceStore.update('x-scalar-active-document', slug)\n clientStore.update('x-scalar-active-document', slug)\n\n // Now that the navigation is available, canonicalize a legacy webhook deep link:\n // old ids dropped the dot in the event name (`account-holdercreated`), so rewrite\n // the URL and the scroll target to the current slug before we scroll to it.\n if (elementId && typeof window !== 'undefined') {\n const canonical = redirectUrl(\n window.location.href,\n slugify(config.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL),\n slug,\n isMultiDocument.value,\n config.pathRouting?.basePath,\n collectWebhooks(\n workspaceStore.workspace.activeDocument?.['x-scalar-navigation']\n ?.children ?? [],\n ),\n )\n if (canonical) {\n window.history.replaceState({}, '', canonical.toString())\n elementId =\n getIdFromUrl(\n canonical.href,\n config.pathRouting?.basePath,\n isMultiDocument.value ? undefined : slug,\n ) || elementId\n }\n }\n\n // If the document has persistence enabled we load the auth schemes from storage\n if (config.persistAuth) {\n loadAuthFromStorage(clientStore, slug)\n }\n\n // ensure that `onLoaded` hook doesn't block execution but is executed after `onDocumentSelect`\n void (async () => {\n await onDocumentSelectPromise\n void config.onLoaded?.(slug)\n })()\n\n // When loading to a specified element we need to freeze and scroll\n if (elementId && elementId !== slug) {\n scrollToLazyElement(elementId)\n }\n // If there is no child element of the document specified and defaultOpenFirstTag is enabled, we expand the first tag\n else if (config.defaultOpenFirstTag) {\n const firstTag = sidebarItems.value.find((item) => item.type === 'tag')\n if (firstTag) {\n sidebarState.setExpanded(firstTag.id, true)\n }\n }\n\n // Reflect the freshly selected document in the browser tab title\n updatePageTitle(elementId && elementId !== slug ? elementId : slug)\n}\n\n/**\n * TODO:Move this to a dedicated updateDocument function in the future and\n * away from vue-reactivity based updates\n */\nwatch(\n () => Object.values(configList.value),\n async (newConfigList, oldConfigList) => {\n /**\n * Handles replacing and updating documents within the workspace store\n * when we detect configuration changes.\n */\n const updateSource = async (\n updated: NormalizedConfiguration,\n previous: NormalizedConfiguration | undefined,\n ) => {\n const config = withLocalizedConfigurationDefaults(\n {\n ...updated.config,\n ...configurationOverrides.value,\n },\n updated.config,\n )\n\n /**\n * A background preload may still be loading this document against the previous\n * configuration. Wait for it to finish so the update below rebases onto the loaded\n * document instead of being skipped, which would otherwise leave stale content in the store.\n */\n const pendingLoad = documentLoadPromises.get(updated.slug)\n if (pendingLoad) {\n await pendingLoad\n }\n\n /** If we have not loaded the document previously we don't need to handle any updates to store */\n if (!workspaceStore.workspace.documents[updated.slug]) {\n return\n }\n /** If the URL has changed we fetch and rebase */\n if (updated.source.url && updated.source.url !== previous?.source.url) {\n await addDocument(\n {\n name: updated.slug,\n url: updated.source.url,\n fetch: config.customFetch,\n },\n config,\n )\n\n return\n }\n\n // If the was not a URL change then we require a document to continue\n if (!updated.source.content) {\n return\n }\n\n /**\n * We need to deeply check for document changes. Parse documents and then only rebase\n * if we detect deep changes in the two sources\n */\n if (\n diff(\n updated.source.content,\n previous && 'content' in previous.source\n ? (previous.source.content ?? {})\n : {},\n ).length\n ) {\n await addDocument(\n {\n name: updated.slug,\n document: updated.source.content,\n },\n config,\n )\n }\n }\n\n newConfigList.forEach((newConfig, index) =>\n updateSource(newConfig, oldConfigList[index]),\n )\n\n const newSlugs = newConfigList.map((c) => c.slug)\n const oldSlugs = oldConfigList.map((c) => c.slug)\n\n // If the slugs have changed, we need to update the active document and the URL query param\n if (\n newSlugs.length !== oldSlugs.length ||\n !newSlugs.every((slug, index) => slug === oldSlugs[index])\n ) {\n await changeSelectedDocument(newSlugs[0] ?? '')\n }\n },\n {\n deep: true,\n },\n)\n\n/** Preload the first document during SSR */\nonServerPrefetch(() => changeSelectedDocument(activeSlug.value))\n\n/** Load the first document on page load */\nonBeforeMount(async () => {\n // We read the client from the client store so we need to set it to the client store\n loadClientFromStorage(clientStore)\n\n await changeSelectedDocument(\n activeSlug.value,\n getIdFromUrl(\n window.location.href,\n configList.value[activeSlug.value]?.config.pathRouting?.basePath,\n isMultiDocument.value ? undefined : activeSlug.value,\n ),\n )\n\n // Warm up the remaining documents in the background so switching between them is instant\n preloadDocumentsWhenIdle()\n})\n\nconst documentUrl = computed(() => {\n return configList.value[activeSlug.value]?.source?.url\n})\n\n// --------------------------------------------------------------------------- */\n// Agent Scalar\n\n/**\n * Determines if Agent Scalar should be enabled based on the configuration and the current URL\n *\n * - If the agent is disabled in the configuration, it should not be enabled\n * - If the current URL is a local URL, it should be enabled\n * - If the agent key is set, it should be enabled\n */\nconst agent = useAgent({\n agentEnabled: computed(() => {\n const currentConfiguration = configList.value[activeSlug.value]\n\n if (currentConfiguration?.agent?.disabled) {\n return false\n }\n\n if (typeof window !== 'undefined' && isLocalUrl(window.location.href)) {\n return true\n }\n\n return Boolean(configList.value[activeSlug.value]?.agent?.key)\n }),\n})\nprovide(AGENT_CONTEXT_SYMBOL, agent)\n\n// --------------------------------------------------------------------------- */\n// Api Client Modal\n\n// Setup the ApiClient on mount.\n// The modal is dynamic-imported so its dependency graph (CodeMirror, the request\n// editor, the response viewer, etc.) becomes a separate chunk that loads\n// asynchronously after the API reference paints.\nconst modal = useTemplateRef<HTMLElement>('modal')\nconst apiClient = ref<ApiClientModal | null>(null)\nonMounted(async () => {\n if (!modal.value) {\n return\n }\n\n const { createApiClientModal } = await import('@scalar/api-client/modal')\n\n // Bail if the component unmounted while the chunk was loading.\n if (!modal.value) {\n return\n }\n\n apiClient.value = createApiClientModal({\n el: modal.value,\n eventBus,\n workspaceStore: clientStore,\n options: mergedConfig,\n plugins: [\n ...pluginManager.getApiClientPlugins(),\n ...mapConfigPlugins(mergedConfig, environment),\n ],\n })\n})\nonBeforeUnmount(() => {\n stopPreloadingDocuments()\n pluginManager.notifyDestroy()\n apiClient.value?.app.unmount()\n})\n\n// ---------------------------------------------------------------------------\n// Top level event handlers and user specified callbacks\n\n/** Ensure we call the onServerChange callback */\neventBus.on('server:update:selected', ({ url }) =>\n mergedConfig.value.onServerChange?.(url),\n)\n\n/**\n * AsyncAPI servers are keyed by name, so resolve the selected name to its\n * constructed connection URL before firing onServerChange, keeping the callback\n * payload consistent with OpenAPI (a URL string).\n */\neventBus.on('asyncapi-server:update:selected', ({ name }) => {\n const document = clientStore.workspace.activeDocument\n if (!isAsyncApiDocument(document)) {\n return\n }\n\n const server = getAsyncApiServers(document, { webSocketOnly: false }).find(\n (s) => s.name === name,\n )\n mergedConfig.value.onServerChange?.(server?.url ?? name)\n})\n\n/** Download the document from the store */\neventBus.on('ui:download:document', ({ format }) => {\n const document = workspaceStore.exportActiveDocument(format)\n\n if (!document) {\n console.error('No document found to download')\n return\n }\n\n void downloadDocument(document, activeSlug.value ?? 'openapi', format)\n})\n\n// ---------------------------------------------------------------------------\n// Local event and scroll handling\n\n/**\n * Handler for a direct navigation event such as a sidebar or search click\n *\n * Depending on the item type we handle a selection event differently:\n *\n * - Tag: If a tag is closed we open it and all its parents and scroll to it\n * If a tag is open we just close the tag\n * - Operation:\n * Open all parents and scroll to the operation\n */\nconst handleSelectSidebarEntry = (id: string, caller?: 'sidebar') => {\n const item = sidebarState.getEntryById(id)\n\n updatePageTitle(id)\n\n if (\n (item?.type === 'tag' ||\n item?.type === 'models' ||\n item?.type === 'text') &&\n sidebarState.isExpanded(id) && // Only close if the item is expanded\n sidebarState.selectedItem.value === id // Only close if the item is not the currently selected item\n ) {\n // hack until we fix intersection logic\n const unblock = blockIntersection()\n\n sidebarState.setExpanded(id, false)\n\n unblock()\n\n return\n }\n\n // Close the mobile menu upon selecting any item that's not a tag or model\n if (item?.type !== 'tag' && item?.type !== 'models') {\n isSidebarOpen.value = false\n }\n\n scrollToLazyElement(id)\n\n const url = makeUrlFromId(id, basePath.value, isMultiDocument.value)\n if (url) {\n window.history.pushState({}, '', url)\n\n // Trigger the onSidebarClick callback if the caller is sidebar\n if (caller === 'sidebar') {\n mergedConfig.value.onSidebarClick?.(url.toString())\n }\n }\n\n if (agent.showAgent.value) {\n agent.closeAgent()\n }\n}\n\n/** Handle a navigation item selection event */\neventBus.on('select:nav-item', ({ id }) => handleSelectSidebarEntry(id))\n\n/** Handle a scroll to navigation item event */\neventBus.on('scroll-to:nav-item', ({ id }) => handleSelectSidebarEntry(id))\n\n/** Handle an intersecting navigation item event */\neventBus.on('intersecting:nav-item', ({ id }) => {\n if (!intersectionEnabled.value) {\n return\n }\n\n sidebarState.setSelected(id)\n setBreadcrumb(id)\n\n // Keep the browser tab title in sync with the section scrolled into view\n updatePageTitle(id)\n\n // Scroll the sidebar to keep the selected element near the top\n scrollSidebarToTop(id)\n\n const url = makeUrlFromId(id, basePath.value, isMultiDocument.value)\n if (url && workspaceStore.workspace.activeDocument) {\n window.history.replaceState({}, '', url.toString())\n }\n})\n\neventBus.on('toggle:nav-item', ({ id, open }) => {\n if (open) {\n mergedConfig.value.onShowMore?.(id)\n\n // Pre-queue first child so it renders immediately when the tag expands\n const entry = sidebarState.getEntryById(id)\n if (entry && 'children' in entry && entry.children) {\n const first = entry.children[0]\n\n if (first) {\n addToPriorityQueue(first.id)\n }\n }\n }\n sidebarState.setExpanded(id, open ?? !sidebarState.isExpanded(id))\n})\n\neventBus.on('copy-url:nav-item', ({ id }) => {\n const url = makeUrlFromId(\n id,\n basePath.value,\n isMultiDocument.value,\n )?.toString()\n return url && copyToClipboard(url)\n})\n\n// ---------------------------------------------------------------------------\n// History and scroll restoration\n\nonBeforeMount(() => {\n window.history.scrollRestoration = 'manual'\n // Ensure we add our scalar wrapper class to the headless ui root, mounted is too late\n addScalarClassesToHeadless()\n\n // When we detect a back button press we scroll to the new id\n window.addEventListener('popstate', () => {\n const id = getIdFromUrl(\n window.location.href,\n mergedConfig.value.pathRouting?.basePath,\n isMultiDocument.value ? undefined : activeSlug.value,\n )\n if (id) {\n scrollToLazyElement(id)\n }\n })\n})\n\n// ---------------------------------------------------------------------------\n// Document start intersection observer\n\nconst documentStartRef = useTemplateRef<HTMLElement>('documentStartRef')\n\n/**\n * Uses `immediate` so the sentinel fires as soon as it enters the viewport (not just at the center strip).\n * When the user scrolls away from the top, both this observer and the first section's center-strip\n * observer are intersecting simultaneously, so the section observer does not re-fire on its own.\n * The `onExit` callback bridges that gap by finding whichever section is at the viewport center\n * and re-emitting the nav event for it.\n *\n * We emit the Introduction entry rather than the document slug so this sentinel and the Introduction\n * section's own intersection observer resolve to the same entry. Otherwise the two race at the top of\n * the document and the tab title flickers between the section title and the document title.\n */\nuseIntersection(\n documentStartRef,\n () => {\n eventBus.emit('intersecting:nav-item', { id: infoSectionId.value })\n },\n {\n onExit: () => {\n const centerY = window.innerHeight / 2\n const section = document\n .elementsFromPoint(window.innerWidth / 2, centerY)\n .find((el) => el.tagName === 'SECTION' && el.id)\n\n if (section?.id) {\n eventBus.emit('intersecting:nav-item', { id: section.id })\n }\n },\n immediate: true,\n },\n)\n\nconst colorMode = computed(() => {\n const mode = workspaceStore.workspace['x-scalar-color-mode']\n\n if (mode === 'system') {\n return getSystemModePreference()\n }\n\n return mode\n})\n\nconst bodyScrollLocked = useScrollLock(\n typeof document !== 'undefined' ? document.body : null,\n)\n\nwatch(agent.showAgent, () => (bodyScrollLocked.value = agent.showAgent.value))\n\nconst showMCPButton = computed(() => {\n if (mergedConfig.value.mcp?.disabled) {\n return false\n }\n\n if (typeof window !== 'undefined' && isLocalUrl(window.location.href)) {\n return true\n }\n\n if (mergedConfig.value.mcp) {\n return true\n }\n\n return false\n})\n</script>\n\n<template>\n <!-- SingleApiReference -->\n <div>\n <!-- Inject any custom CSS directly into a style tag -->\n <!-- eslint-disable vue/no-v-text-v-html-on-component -->\n <component\n :is=\"'style'\"\n v-html=\"styleContent\" />\n <!-- eslint-enable vue/no-v-text-v-html-on-component -->\n <div\n ref=\"documentEl\"\n class=\"scalar-app scalar-api-reference references-layout\"\n :class=\"[\n {\n 'scalar-api-references-standalone-mobile': mergedConfig.showSidebar,\n 'scalar-scrollbars-obtrusive': obtrusiveScrollbars,\n 'references-editable': mergedConfig.isEditable,\n 'references-sidebar': mergedConfig.showSidebar,\n 'references-sidebar-mobile-open': isSidebarOpen,\n 'references-classic': mergedConfig.layout === 'classic',\n },\n $attrs.class,\n ]\"\n :dir=\"apiReferenceLocalization.direction.value\"\n :lang=\"documentLang\">\n <!-- Agent Scalar -->\n <AgentScalarDrawer\n v-if=\"agent.agentEnabled.value\"\n :agentScalarConfiguration=\"configList[activeSlug]?.agent\"\n :externalUrls=\"mergedConfig.externalUrls\"\n :workspaceStore />\n\n <!-- Mobile Header and Sidebar when in modern layout -->\n\n <MobileHeader\n v-if=\"mergedConfig.layout === 'modern'\"\n :breadcrumb=\"breadcrumb\"\n :isSidebarOpen=\"isSidebarOpen\"\n :showSidebar=\"mergedConfig.showSidebar\"\n @toggleSidebar=\"() => (isSidebarOpen = !isSidebarOpen)\">\n <template #search>\n <SearchButton\n v-if=\"!mergedConfig.hideSearch\"\n class=\"my-2\"\n :document=\"activeSearchableDocument\"\n :eventBus=\"eventBus\"\n :hideModels=\"mergedConfig.hideModels\"\n :modelsSectionLabel=\"mergedConfig.modelsSectionLabel\"\n :searchHotKey=\"mergedConfig.searchHotKey\"\n :showSidebar=\"mergedConfig.showSidebar\" />\n </template>\n <template #sidebar=\"{ sidebarClasses }\">\n <ScalarSidebar\n v-if=\"mergedConfig.showSidebar && mergedConfig.layout === 'modern'\"\n :aria-label=\"\n apiReferenceLocalization.translate('navigation.sidebarFor', {\n name:\n workspaceStore.workspace.activeDocument?.info?.title ?? '',\n })\n \"\n class=\"t-doc__sidebar\"\n :class=\"sidebarClasses\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items=\"sidebarItems\"\n layout=\"reference\"\n :options=\"sidebarOptions\"\n @selectItem=\"(id) => handleSelectSidebarEntry(id, 'sidebar')\"\n @toggleGroup=\"\n (id: string) =>\n sidebarState.setExpanded(id, !sidebarState.isExpanded(id))\n \">\n <template #header>\n <!-- Wrap in a div when slot is filled -->\n <DocumentSelector\n v-if=\"documentOptionList.length > 1\"\n :modelValue=\"activeSlug\"\n :options=\"documentOptionList\"\n @update:modelValue=\"changeSelectedDocument\" />\n\n <!-- Search -->\n <div\n v-if=\"!mergedConfig.hideSearch\"\n class=\"flex gap-1.5 px-3 pt-3\">\n <SearchButton\n :document=\"activeSearchableDocument\"\n :eventBus=\"eventBus\"\n :hideModels=\"mergedConfig.hideModels\"\n :modelsSectionLabel=\"mergedConfig.modelsSectionLabel\"\n :searchHotKey=\"mergedConfig.searchHotKey\" />\n\n <AgentScalarButton v-if=\"agent.agentEnabled.value\" />\n </div>\n\n <!-- Sidebar Start -->\n <slot\n name=\"sidebar-start\"\n v-bind=\"slotProps\" />\n </template>\n <template #before>\n <!-- AsyncAPI protocol + server filters (only render with >1 choice) -->\n <AsyncApiSidebarFilters\n v-model:protocol=\"selectedProtocol\"\n v-model:server=\"selectedServer\"\n :document=\"activeAsyncApiDocument\" />\n <ScalarSidebarSection\n v-if=\"activeAsyncApiDocument\"\n class=\"asyncapi-sidebar-document-section\">\n Document\n </ScalarSidebarSection>\n </template>\n <template #footer>\n <slot\n name=\"sidebar-end\"\n v-bind=\"slotProps\">\n <!-- We default the sidebar footer to the standard scalar elements -->\n <ScalarSidebarFooter class=\"darklight-reference\">\n <OpenApiClientButton\n v-if=\"!mergedConfig.hideClientButton && !showMCPButton\"\n buttonSource=\"sidebar\"\n :integration=\"mergedConfig._integration\"\n :isDevelopment=\"isDevelopment\"\n :url=\"documentUrl\" />\n <OpenMCPButton\n v-if=\"showMCPButton\"\n :config=\"mergedConfig.mcp\"\n :externalUrls=\"mergedConfig.externalUrls\"\n :isDevelopment=\"isDevelopment\"\n :url=\"documentUrl\"\n :workspace=\"workspaceStore\" />\n <template #description>\n <a\n class=\"no-underline hover:underline\"\n href=\"https://www.scalar.com\"\n rel=\"noopener noreferrer\"\n target=\"_blank\">\n {{\n apiReferenceLocalization.translate(\n 'footer.poweredByScalar',\n )\n }}\n </a>\n </template>\n <!-- Override the dark mode toggle slot to hide it -->\n <template #toggle>\n <ScalarColorModeToggleButton\n v-if=\"\n !mergedConfig.hideDarkModeToggle &&\n !mergedConfig.forceDarkModeState\n \"\n :modelValue=\"colorMode === 'dark'\"\n @update:modelValue=\"() => toggleColorMode()\" />\n <span v-else />\n </template>\n </ScalarSidebarFooter>\n </slot>\n </template>\n </ScalarSidebar>\n </template>\n </MobileHeader>\n\n <!-- Primary Content -->\n <main\n :aria-label=\"\n apiReferenceLocalization.translate('navigation.mainContent', {\n name: workspaceStore.workspace.activeDocument?.info?.title ?? '',\n })\n \"\n class=\"references-rendered\"\n :inert=\"agent.showAgent.value\">\n <Content\n :authStore=\"clientStore.auth\"\n :clientDocument=\"clientStore.workspace.activeDocument\"\n :document=\"workspaceStore.workspace.activeDocument\"\n :documentSlug=\"activeSlug\"\n :environment\n :eventBus\n :expandedItems=\"sidebarState.expandedItems.value\"\n :headingSlugGenerator=\"\n mergedConfig.generateHeadingSlug ??\n ((heading) => `${activeSlug}/description/${heading.slug}`)\n \"\n :infoSectionId\n :items=\"sidebarItems\"\n :options=\"mergedConfig\"\n :xScalarDefaultClient=\"\n clientStore.workspace['x-scalar-default-client']\n \"\n :xScalarDefaultExample=\"\n clientStore.workspace['x-scalar-default-example']\n \">\n <template #start>\n <!-- Placeholder intersection observer that emits an empty string to clear the hash when scrolled to the top -->\n <div ref=\"documentStartRef\" />\n\n <DeveloperTools\n v-if=\"workspaceStore.workspace.activeDocument\"\n v-model:overrides=\"configurationOverrides\"\n class=\"references-developer-tools\"\n :configuration=\"mergedConfig\"\n :externalUrls=\"mergedConfig.externalUrls\"\n :workspace=\"workspaceStore\" />\n\n <ClassicHeader v-if=\"mergedConfig.layout === 'classic'\">\n <div class=\"w-64 empty:hidden\">\n <DocumentSelector\n v-if=\"documentOptionList.length > 1\"\n :modelValue=\"activeSlug\"\n :options=\"documentOptionList\"\n @update:modelValue=\"changeSelectedDocument\" />\n </div>\n <SearchButton\n v-if=\"!mergedConfig.hideSearch\"\n class=\"t-doc__sidebar max-w-64\"\n :document=\"activeSearchableDocument\"\n :eventBus=\"eventBus\"\n :hideModels=\"mergedConfig.hideModels\"\n :modelsSectionLabel=\"mergedConfig.modelsSectionLabel\"\n :searchHotKey=\"mergedConfig.searchHotKey\" />\n <template #dark-mode-toggle>\n <ScalarColorModeToggleIcon\n v-if=\"\n !mergedConfig.hideDarkModeToggle &&\n !mergedConfig.forceDarkModeState\n \"\n class=\"text-c-2 hover:text-c-1\"\n :mode=\"colorMode\"\n style=\"transform: scale(1.4)\"\n variant=\"icon\"\n @click=\"() => toggleColorMode()\" />\n </template>\n </ClassicHeader>\n <slot\n name=\"content-start\"\n v-bind=\"slotProps\" />\n </template>\n <!-- TODO: Remove this; we no longer directly support an inline editor -->\n <template\n v-if=\"mergedConfig.isEditable\"\n #empty-state>\n <slot\n name=\"editor-placeholder\"\n v-bind=\"slotProps\" />\n </template>\n <template #end>\n <slot\n name=\"content-end\"\n v-bind=\"slotProps\" />\n </template>\n </Content>\n </main>\n <!-- Optional Footer -->\n <div\n v-if=\"$slots.footer\"\n class=\"references-footer\">\n <slot\n name=\"footer\"\n v-bind=\"slotProps\" />\n </div>\n <!-- Client Modal mount point -->\n <div ref=\"modal\" />\n </div>\n <ScalarToasts />\n </div>\n</template>\n\n<style>\n/* Add base styles to the body. Removed browser default margins for a better experience. */\n@layer scalar-base {\n body {\n margin: 0;\n background-color: var(--scalar-background-1);\n }\n}\n/** Used to check if css is loaded */\n:root {\n --scalar-loaded-api-reference: true;\n}\n\n.asyncapi-sidebar-document-section > .group\\/spacer-after {\n height: 0;\n}\n</style>\n<style scoped>\n/* Configurable Layout Variables */\n@layer scalar-config {\n .scalar-api-reference {\n /* The header height */\n --refs-header-height: calc(\n var(--scalar-custom-header-height, 0px) + var(--scalar-header-height, 0px)\n );\n /* The offset of visible references content (minus headers) */\n --refs-viewport-offset: calc(\n var(--refs-header-height, 0px) + var(--refs-content-offset, 0px)\n );\n /* The calculated height of visible references content (minus headers) */\n --refs-viewport-height: calc(\n var(--full-height, 100dvh) - var(--refs-viewport-offset, 0px)\n );\n /* The width of the sidebar */\n --refs-sidebar-width: var(--scalar-sidebar-width, 0px);\n /* The height of the sidebar */\n --refs-sidebar-height: calc(\n var(--full-height, 100dvh) - var(--refs-header-height, 0px)\n );\n /* The maximum width of the content column */\n --refs-content-max-width: var(--scalar-content-max-width, 1540px);\n }\n\n .scalar-api-reference.references-classic {\n /* Classic layout is wider */\n --refs-content-max-width: var(--scalar-content-max-width, 1420px);\n min-height: 100dvh;\n --refs-sidebar-width: 0;\n }\n}\n.t-doc__sidebar {\n z-index: 10;\n}\n\n/* ----------------------------------------------------- */\n/* References Layout */\n.references-layout {\n /* Try to fill the container */\n min-height: 100dvh;\n min-width: 100%;\n max-width: 100%;\n flex: 1;\n\n /*\n Calculated by a resize observer and set in the style attribute\n Falls back to the viewport height\n */\n --full-height: 100dvh;\n\n /* Grid layout */\n display: grid;\n grid-template-rows: var(--scalar-header-height, 0px) repeat(2, auto);\n grid-template-columns: auto 1fr;\n grid-template-areas:\n 'header header'\n 'navigation rendered'\n 'footer footer';\n\n background: var(--scalar-background-1);\n}\n\n.references-editor {\n grid-area: editor;\n display: flex;\n min-width: 0;\n background: var(--scalar-background-1);\n}\n\n.references-rendered {\n position: relative;\n grid-area: rendered;\n min-width: 0;\n background: var(--scalar-background-1);\n}\n.scalar-api-reference.references-classic,\n.references-classic .references-rendered {\n height: initial !important;\n max-height: initial !important;\n}\n\n@layer scalar-config {\n .references-sidebar {\n /* Set a default width if references are enabled */\n --refs-sidebar-width: var(--scalar-sidebar-width, 288px);\n }\n}\n\n/* Footer */\n.references-footer {\n grid-area: footer;\n}\n/* ----------------------------------------------------- */\n/* Responsive / Mobile Layout */\n\n/*\n * Stop just below the `lg` breakpoint (1000px). The sidebar visibility is driven\n * by Tailwind's `lg:` variant, which is `min-width: 1000px` and therefore treats\n * exactly 1000px as desktop. A `max-width: 1000px` query would make the grid\n * switch to the mobile (stacked) layout at the very same width, so the desktop\n * sidebar would render on top of the content. `width < 1000px` is the exact\n * complement of `lg:` (`width >= 1000px`), keeping the two in sync.\n */\n@media (width < 1000px) {\n /* Keep toolbar hidden on mobile without forcing desktop display mode. */\n .references-developer-tools {\n display: none;\n }\n\n /* Stack view on mobile */\n .references-layout {\n /* Adjust the sidebar height to the viewport height minus the header height */\n --refs-sidebar-height: calc(\n var(--full-height, 100dvh) - var(--scalar-custom-header-height, 0px)\n );\n\n grid-template-columns: 100%;\n grid-template-rows: var(--scalar-header-height, 0px) 0px auto auto;\n\n grid-template-areas:\n 'header'\n 'navigation'\n 'rendered'\n 'footer';\n }\n .references-editable {\n grid-template-areas:\n 'header'\n 'navigation'\n 'editor';\n }\n\n .references-rendered {\n position: static;\n }\n}\n</style>\n<style scoped>\n/**\n* Sidebar CSS for standalone\n* TODO: @brynn move this to the sidebar block OR the ApiReferenceStandalone component\n* when the new elements are available\n*/\n/* Match the layout breakpoint above so the mobile header height is only applied below `lg`. */\n@media (width < 1000px) {\n .scalar-api-references-standalone-mobile:not(.references-classic) {\n --scalar-header-height: 50px;\n }\n}\n</style>\n<style scoped>\n.darklight-reference {\n width: 100%;\n margin-top: auto;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,UAAA;AAEN,IAAe,OAAO,WAAW,aAC/B,QAAQ,KAAK,yBAAyB,SAAS;;;;;EAyHjD,MAAM,QAAQ;EAiBd,MAAM,EAAE,oBAAoB,aAAa;;;;;;EAOzC,MAAM,gBAAA;;;;;;;;EASN,MAAM,sBAAsB,IAAI,KAAK;EACrC,gBAAgB;GACd,oBAAoB,QAAQ,uBAAuB;EACrD,CAAC;EAED,MAAM,WAAW,wBAAwB,EAAE,OAAO,cAAc,CAAC;EACjE,MAAM,gBAAgB,IAAI,KAAK;;;;;;;EAQ/B,mBAAmB,MAAM,CAAC;;;;;;;EAS1B,MAAM,aAAa,eAAe,wBAAwB,MAAM,aAAa,CAAC;EAE9E,MAAM,kBAAkB,eAAe,OAAO,KAAK,WAAW,KAAK,CAAC,CAAC,SAAS,CAAC;;EAG/E,MAAM,aAAa,IACjB,OAAO,OAAO,WAAW,KAAK,CAAC,CAAC,MAAM,MAAM,EAAE,OAAO,CAAC,EAAE,QACtD,WAAW,MAAM,OAAO,KAAK,WAAW,KAAK,CAAC,GAAG,MAAM,GAAG,EAAE,QAC5D,EACJ;;;;;;EAOA,IAAI,OAAO,WAAW,aAAa;GACjC,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,IAAI;GAIxC,MAAM,WAAW,IAAI,aAAa,IAAI,KAAK;GAC3C,IAAI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BAAmB,OAAA;eAAV;MAAJ,KAAI;;;IAEX,YAAgB,MAAA,YAAA,CAAA"}
1
+ {"version":3,"file":"ApiReference.vue.script.js","names":["$attrs","$slots"],"sources":["../../src/components/ApiReference.vue"],"sourcesContent":["<script lang=\"ts\">\n/* global PACKAGE_VERSION */\n// Injected by Vite at build time (see vite.config.ts and vite.standalone.config.ts).\n// Read via process.env so the constant is replaced inline without pulling package.json\n// into the TypeScript program — that would expand rootDir and emit declarations under dist/src/.\nconst version = PACKAGE_VERSION\n\nif (version && typeof window !== 'undefined') {\n console.info(`@scalar/api-reference@${version}`)\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { provideUseId } from '@headlessui/vue'\nimport { OpenApiClientButton } from '@scalar/api-client/blocks/operation-block'\nimport type { ApiClientModal } from '@scalar/api-client/modal'\nimport {\n ScalarColorModeToggleButton,\n ScalarColorModeToggleIcon,\n} from '@scalar/components/color-mode-toggle'\nimport { addScalarClassesToHeadless } from '@scalar/components/helpers'\nimport {\n ScalarSidebarFooter,\n ScalarSidebarSection,\n} from '@scalar/components/sidebar'\nimport { toJsonCompatible } from '@scalar/helpers/object/to-json-compatible'\nimport { slugify } from '@scalar/helpers/string/slugify'\nimport { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport { apiReferenceConfigurationSchema } from '@scalar/schemas/api-reference'\nimport {\n createSidebarState,\n ScalarSidebar,\n scrollSidebarToTop,\n} from '@scalar/sidebar'\nimport { getThemeStyles, hasObtrusiveScrollbars } from '@scalar/themes'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfiguration,\n type ApiReferenceConfigurationRaw,\n} from '@scalar/types/api-reference'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { useColorMode } from '@scalar/use-hooks/useColorMode'\nimport { ScalarToasts } from '@scalar/use-toasts'\nimport { coerce } from '@scalar/validation'\nimport { getAsyncApiServers } from '@scalar/workspace-store/channel-example'\nimport { createWorkspaceStore } from '@scalar/workspace-store/client'\nimport { createWorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n getActiveEnvironment,\n getServers,\n} from '@scalar/workspace-store/request-example'\nimport type {\n TraversedEntry,\n TraversedTag,\n} from '@scalar/workspace-store/schemas/navigation'\nimport {\n isAsyncApiDocument,\n isOpenApiDocument,\n} from '@scalar/workspace-store/schemas/type-guards'\nimport { useScrollLock } from '@vueuse/core'\nimport diff from 'microdiff'\nimport {\n computed,\n onBeforeMount,\n onBeforeUnmount,\n onMounted,\n onServerPrefetch,\n provide,\n ref,\n useId,\n useTemplateRef,\n watch,\n} from 'vue'\n\nimport {\n AsyncApiSidebarFilters,\n filterAsyncApiNavigation,\n} from '@/blocks/scalar-asyncapi-sidebar-filters-block'\nimport {\n AgentScalarButton,\n AgentScalarDrawer,\n OpenMCPButton,\n} from '@/components/AgentScalar'\nimport ClassicHeader from '@/components/ClassicHeader.vue'\nimport Content from '@/components/Content/Content.vue'\nimport MobileHeader from '@/components/MobileHeader.vue'\nimport { DeveloperTools } from '@/features/developer-tools'\nimport {\n provideLocalization,\n resolveLocalization,\n} from '@/features/localization'\nimport DocumentSelector from '@/features/multiple-documents/DocumentSelector.vue'\nimport SearchButton from '@/features/Search/components/SearchButton.vue'\nimport { buildModelsIndex } from '@/helpers/build-models-index'\nimport { getSystemModePreference } from '@/helpers/color-mode'\nimport { downloadDocument } from '@/helpers/download'\nimport {\n getIdFromUrl,\n makeUrlFromId,\n matchesBasePath,\n redirectUrl,\n type WebhookRedirectSource,\n} from '@/helpers/id-routing'\nimport {\n INTRODUCTION_ENTRY_ID_SUFFIX,\n isIntroductionEntry,\n} from '@/helpers/is-introduction-entry'\nimport {\n scrollToLazy as _scrollToLazy,\n addToPriorityQueue,\n blockIntersection,\n intersectionEnabled,\n} from '@/helpers/lazy-bus'\nimport {\n loadAuthFromStorage,\n loadClientFromStorage,\n} from '@/helpers/load-from-perssistance'\nimport { mapConfigPlugins } from '@/helpers/map-config-plugins'\nimport { mapConfigToWorkspaceStore } from '@/helpers/map-config-to-workspace-store'\nimport {\n normalizeConfigurations,\n type NormalizedConfiguration,\n} from '@/helpers/normalize-configurations'\nimport { safeDeepClone } from '@/helpers/safe-deep-clone'\nimport { AGENT_CONTEXT_SYMBOL, useAgent } from '@/hooks/use-agent'\nimport { useIntersection } from '@/hooks/use-intersection'\nimport { createPluginManager, PLUGIN_MANAGER_SYMBOL } from '@/plugins'\nimport { persistencePlugin } from '@/plugins/persistence-plugin'\n\nconst props = defineProps<{\n /**\n * Configuration for the API reference.\n * Can be a single configuration or an array of configurations for multiple documents.\n */\n configuration?: AnyApiReferenceConfiguration\n}>()\n\ndefineSlots<{\n 'content-start'?(): { breadcrumb: string }\n 'content-end'?(): { breadcrumb: string }\n 'sidebar-start'?(): { breadcrumb: string }\n 'sidebar-end'?(): { breadcrumb: string }\n 'editor-placeholder'?(): { breadcrumb: string }\n footer?(): { breadcrumb: string }\n}>()\n\nconst { copyToClipboard } = useClipboard()\n\n/**\n * Used to inject the environment into built packages\n *\n * Primary use case is the open-in-client button\n */\nconst isDevelopment = import.meta.env.DEV\n\n/**\n * Whether scrollbars take up screen real estate.\n *\n * This defaults to `false` so the first client render matches the server (where\n * there is no DOM to measure). The real value is resolved in `onMounted` to\n * avoid a hydration mismatch on the root class.\n */\nconst obtrusiveScrollbars = ref(false)\nonMounted(() => {\n obtrusiveScrollbars.value = hasObtrusiveScrollbars()\n})\n\nconst eventBus = createWorkspaceEventBus({ debug: isDevelopment })\nconst isSidebarOpen = ref(false)\n\n/**\n * Due to a bug in headless UI, we need to set an ID here that can be shared across server/client\n * TODO remove this once the bug is fixed\n *\n * @see https://github.com/tailwindlabs/headlessui/issues/2979\n */\nprovideUseId(() => useId())\n\n// ---------------------------------------------------------------------------\n/**\n * Configuration Handling\n *\n * We will normalize the configurations and store them in a computed property.\n * The active configuration will be associated with the active document.\n */\nconst configList = computed(() => normalizeConfigurations(props.configuration))\n\nconst isMultiDocument = computed(() => Object.keys(configList.value).length > 1)\n\n/** Search for the source with a default attribute or use the first one */\nconst activeSlug = ref<string>(\n Object.values(configList.value).find((c) => c.default)?.slug ??\n configList.value[Object.keys(configList.value)?.[0] ?? '']?.slug ??\n '',\n)\n\n/**\n * On initial page load we need to determine if there is a valid document slug in the URL\n *\n * If there is we set the active slug to the document slug\n */\nif (typeof window !== 'undefined') {\n const url = new URL(window.location.href)\n\n // To handle legacy query parameter multi-document support we redirect\n // to the new path routing format\n const apiParam = url.searchParams.get('api')\n if (apiParam && configList.value[apiParam]) {\n activeSlug.value = apiParam\n const idFromUrl = getIdFromUrl(\n url,\n configList.value[apiParam].config.pathRouting?.basePath,\n apiParam,\n )\n const newUrl = makeUrlFromId(\n idFromUrl,\n configList.value[apiParam].config.pathRouting?.basePath,\n isMultiDocument.value,\n )\n if (newUrl) {\n newUrl.searchParams.delete('api')\n window.history.replaceState({}, '', newUrl.toString())\n }\n }\n\n /**\n * For path routing on initial load we do not know which basePath to check for\n * we need to search the configs to see if any of the base paths match the URL\n * and then use that basePath to get the initial id\n *\n * With this approach we cannot support multi-document mode with one of configs having\n * an empty basePath\n *\n * Other conflicts are possible.\n */\n const basePaths = Object.values(configList.value).map(\n (c) => c.config.pathRouting?.basePath,\n )\n\n const initialId = getIdFromUrl(\n url,\n basePaths.find((p) => (p ? matchesBasePath(url, p) : false)),\n isMultiDocument.value ? undefined : activeSlug.value,\n )\n const documentSlug = initialId.split('/')[0]\n\n if (documentSlug && configList.value[documentSlug]) {\n activeSlug.value = documentSlug\n }\n}\n\n/** Computed document options list for the selector logic */\nconst documentOptionList = computed(() =>\n Object.values(configList.value).map((c) => ({\n label: c.title,\n id: c.slug,\n })),\n)\n\n/**\n * AsyncAPI sidebar filters (protocol + server).\n *\n * These mirror the document picker: stacked dropdowns at the top of the sidebar\n * that narrow the visible operations. State resets whenever the active document\n * changes so a filter never leaks across documents.\n */\nconst selectedProtocol = ref<string>('')\nconst selectedServer = ref<string>('')\n\n/** The active document, narrowed to AsyncAPI (or `null` for OpenAPI documents). */\nconst activeAsyncApiDocument = computed(() => {\n const document = workspaceStore.workspace.activeDocument\n return isAsyncApiDocument(document) ? document : null\n})\n\n// Reset the filters when switching documents.\nwatch(activeSlug, () => {\n selectedProtocol.value = ''\n selectedServer.value = ''\n})\n\n/** Configuration overrides to apply to the selected document (from the localhost toolbar) */\nconst configurationOverrides = ref<\n Partial<Omit<ApiReferenceConfiguration, 'slug' | 'title' | ''>>\n>({})\n\nconst withLocalizedConfigurationDefaults = (\n config: ApiReferenceConfiguration,\n activeConfig: Partial<ApiReferenceConfiguration> | undefined,\n): ApiReferenceConfiguration => {\n const localization = resolveLocalization(config.localization)\n const configuredModelsSectionLabel =\n configurationOverrides.value.modelsSectionLabel ??\n (activeConfig?.modelsSectionLabel !== DEFAULT_MODELS_SECTION_LABEL\n ? activeConfig?.modelsSectionLabel\n : undefined)\n\n return {\n ...config,\n modelsSectionLabel:\n configuredModelsSectionLabel ??\n localization.translations.models.label ??\n DEFAULT_MODELS_SECTION_LABEL,\n }\n}\n\n/** Any dev toolbar modifications are merged with the active configuration */\nconst mergedConfig = computed<ApiReferenceConfiguration>(() => {\n const activeConfig = configList.value[activeSlug.value]?.config\n const merged = {\n // Provides a default set of values when the lookup fails\n ...coerce(apiReferenceConfigurationSchema, {}),\n // The active configuration based on the slug\n ...activeConfig,\n // Any overrides from the localhost toolbar\n ...configurationOverrides.value,\n }\n\n return withLocalizedConfigurationDefaults(merged, activeConfig)\n})\n\nconst apiReferenceLocalization = provideLocalization(\n () => mergedConfig.value.localization,\n)\n\nconst sidebarOptions = computed(() => ({\n ...mergedConfig.value,\n labels: {\n closeGroup: apiReferenceLocalization.translate('navigation.closeGroup'),\n httpMethod: apiReferenceLocalization.translate('common.httpMethod'),\n openGroup: apiReferenceLocalization.translate('navigation.openGroup'),\n },\n}))\n\n/**\n * Locale string for the `lang` attribute. We normalize underscores to hyphens so values like\n * `es_MX` become valid BCP-47 language tags (`es-MX`).\n */\nconst documentLang = computed(() =>\n apiReferenceLocalization.locale.value.replace('_', '-'),\n)\n\n/** Convenience break out var to determine which routing mode we are using */\nconst basePath = computed(() => mergedConfig.value.pathRouting?.basePath)\n\nconst themeStyle = computed(() =>\n getThemeStyles(mergedConfig.value.theme, {\n fonts: mergedConfig.value.withDefaultFonts,\n }),\n)\n\n/**\n * Custom CSS plus the theme styles, injected into a single `<style>` tag.\n *\n * This is rendered with `v-html` so the CSS is emitted verbatim. Interpolating\n * it as text content makes Vue HTML-escape characters like `\"` into `&quot;` on\n * the server while the client keeps `\"`, which both breaks the CSS and causes a\n * hydration mismatch.\n *\n * A closing `</style>` tag is neutralized first. It never appears in valid CSS,\n * but during server rendering the string lands in the HTML stream unescaped, so\n * `customCss` coming from a docs platform where readers can supply their own\n * theme would otherwise be able to close the tag and open a `<script>`.\n */\nconst styleContent = computed(() =>\n `${mergedConfig.value.customCss ?? ''}\\n${themeStyle.value}`.replace(\n /<\\/style/gi,\n '<\\\\/style',\n ),\n)\n\n// ---------------------------------------------------------------------------\n/** Navigation State Handling */\n\n// Collects every webhook entry in a navigation subtree, so old deep links can be\n// redirected from the legacy dot-dropped slug to the current one. Webhook ids are\n// only known once the document is loaded, so the redirect itself runs later, in\n// `changeSelectedDocument`.\nconst collectWebhooks = (entries: TraversedEntry[]): WebhookRedirectSource[] =>\n entries.flatMap((entry) => {\n const nested =\n 'children' in entry && entry.children\n ? collectWebhooks(entry.children)\n : []\n return entry.type === 'webhook'\n ? [{ name: entry.name, method: entry.method, id: entry.id }, ...nested]\n : nested\n })\n\n// Rewrite outdated `model/` and `models/` schema URLs to the current models\n// section slug so bookmarks from before the slug changed keep resolving. Webhook\n// deep links are handled separately once the document (and its navigation) loads.\nif (typeof window !== 'undefined') {\n const canonical = redirectUrl(\n window.location.href,\n slugify(\n mergedConfig.value.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL,\n ),\n activeSlug.value,\n isMultiDocument.value,\n mergedConfig.value.pathRouting?.basePath,\n )\n if (canonical) {\n window.history.replaceState({}, '', canonical.toString())\n }\n}\n\n// Front-end redirect\nif (mergedConfig.value.redirect && typeof window !== 'undefined') {\n const newPath = mergedConfig.value.redirect(\n (mergedConfig.value.pathRouting ? window.location.pathname : '') +\n window.location.hash,\n )\n if (newPath) {\n window.history.replaceState({}, '', newPath)\n }\n}\n\n/**\n * Sets the active slug and updates the URL with the selected document slug\n *\n * If an element ID is passed in we will configure the path or hash routing\n */\nfunction syncSlugAndUrlWithDocument(\n slug: string,\n elementId: string | undefined,\n config: ApiReferenceConfigurationRaw,\n) {\n // We create a new URL and go to the root element if an ID is not provided\n const url = makeUrlFromId(\n elementId || slug,\n config.pathRouting?.basePath,\n isMultiDocument.value,\n )\n\n if (url) {\n window.history.replaceState({}, '', url.toString())\n }\n\n // Update the active slug\n activeSlug.value = slug\n}\n\n// ---------------------------------------------------------------------------\n/** Workspace Store Initialization */\n\n/**\n * Initializes the new client workspace store.\n */\nconst workspaceStore = createWorkspaceStore({\n verbose: isDevelopment,\n})\n\n/**\n * We need to keep the client store separate from the workspace store\n * This is because we want the client store to be a playground where users can test out their requests without affecting the references store\n */\nconst clientStore = createWorkspaceStore({\n verbose: isDevelopment,\n plugins: [\n persistencePlugin({\n persistAuth: () => mergedConfig.value.persistAuth ?? false,\n }),\n ],\n})\n\n/**\n * Plugin injection is not reactive. All plugins must be provided at first render.\n *\n * Created after the client store so the auth accessor below can read from it — plugin `onInit`\n * hooks may call `auth` synchronously during `notifyInit`. The reference-side Authentication panel\n * (Content → Auth.vue) persists credentials into `clientStore.auth`, so plugins must read the same\n * store to see what the user entered.\n */\nconst pluginManager = createPluginManager({\n plugins: Object.values(configList.value).flatMap(\n (c) => c.config.plugins ?? [],\n ),\n /**\n * Read-only view of the global authentication state, so plugins can read stored secrets and\n * the selected security schemes without being able to mutate them. Wraps the client store's\n * auth methods (rather than passing the store directly) to keep the setters out of the plugin API.\n *\n * The getters return a deep copy (`export` already snapshots internally, the others go through\n * `toJsonCompatible`) so plugins receive plain data rather than the store's live reactive proxies —\n * mutating what they get back can never leak into the store.\n */\n auth: {\n export: () => clientStore.auth.export(),\n getAuthSecrets: (documentName, schemeName) =>\n toJsonCompatible(\n clientStore.auth.getAuthSecrets(documentName, schemeName),\n ),\n getAuthSelectedSchemas: (payload) =>\n toJsonCompatible(clientStore.auth.getAuthSelectedSchemas(payload)),\n },\n})\nprovide(PLUGIN_MANAGER_SYMBOL, pluginManager)\n\npluginManager.notifyInit(mergedConfig.value)\n\nwatch(mergedConfig, (config) => pluginManager.notifyConfigChange(config))\n\n// TODO: persistence should be hoisted into standalone\n// Client side integrations will want to handle dark mode externally\nconst { toggleColorMode, isDarkMode } = useColorMode({\n initialColorMode: {\n true: 'dark' as const,\n false: 'light' as const,\n undefined: 'system' as const,\n }[String(mergedConfig.value.darkMode)],\n overrideColorMode: mergedConfig.value.forceDarkModeState,\n})\n\n/**\n * The active document passed to the search modal. Both OpenAPI and AsyncAPI\n * documents are surfaced so the search index can pick up info.description\n * headings from either spec; AsyncAPI-specific entries (channels, operations,\n * messages) are not indexed yet.\n */\nconst activeSearchableDocument = computed(\n () => workspaceStore.workspace.activeDocument,\n)\n\n/**\n * Sidebar entries contributed by plugin views (content.start / content.end).\n *\n * Each entry reuses the same id as the rendered plugin component, so the existing\n * navigation and scroll-spy logic can scroll to and highlight it. Plugins are static for\n * the lifetime of the manager, so this only needs to be resolved once.\n */\nconst pluginSidebarEntries = computed(() =>\n pluginManager\n .getSidebarEntries(activeSlug.value)\n .reduce<Record<'content.start' | 'content.end', TraversedEntry[]>>(\n (grouped, entry) => {\n grouped[entry.viewName].push({\n id: entry.id,\n title: entry.label,\n type: 'text',\n })\n return grouped\n },\n { 'content.start': [], 'content.end': [] },\n ),\n)\n\n/**\n * Localize the synthetic labels we generate for the sidebar (introduction, webhooks, and the models\n * section). Entries are only cloned when a label actually changes, so the common English-default case\n * does not allocate a new navigation tree on every recompute.\n */\nconst localizeNavigationEntries = (\n entries: TraversedEntry[],\n): TraversedEntry[] => {\n const introductionTitle = apiReferenceLocalization.translate(\n 'navigation.introduction',\n )\n const webhooksTitle = apiReferenceLocalization.translate(\n 'navigation.webhooks',\n )\n const modelsSectionLabel =\n mergedConfig.value.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL\n\n const localize = (list: TraversedEntry[]): TraversedEntry[] => {\n let changed = false\n\n const result = list.map((entry) => {\n let localized = entry\n\n if (isIntroductionEntry(entry) && entry.title !== introductionTitle) {\n localized = { ...entry, title: introductionTitle } as TraversedEntry\n } else if (\n entry.type === 'tag' &&\n entry.isWebhooks === true &&\n (entry.title !== webhooksTitle || entry.name !== webhooksTitle)\n ) {\n localized = {\n ...entry,\n title: webhooksTitle,\n name: webhooksTitle,\n } as TraversedEntry\n } else if (\n entry.type === 'models' &&\n (entry.title !== modelsSectionLabel ||\n entry.name !== modelsSectionLabel)\n ) {\n localized = {\n ...entry,\n title: modelsSectionLabel,\n name: modelsSectionLabel,\n } as TraversedEntry\n }\n\n if ('children' in entry && entry.children) {\n const localizedChildren = localize(entry.children)\n\n if (localizedChildren !== entry.children) {\n localized =\n localized === entry ? ({ ...entry } as TraversedEntry) : localized\n ;(localized as { children?: TraversedEntry[] }).children =\n localizedChildren\n }\n }\n\n if (localized !== entry) {\n changed = true\n }\n\n return localized\n })\n\n // Preserve the original reference when nothing changed to avoid downstream re-renders.\n return changed ? result : list\n }\n\n return localize(entries)\n}\n\n/**\n * Create top level sidebar entries for each document\n * This allows sharing a single sidebar state for across the workspace\n */\nconst itemsFromWorkspace = computed<TraversedEntry[]>(() => {\n return Object.entries(workspaceStore.workspace.documents).map(\n ([slug, document]) => {\n // Both OpenAPI and AsyncAPI documents carry an `x-scalar-navigation` tree.\n const children = document['x-scalar-navigation']?.children ?? []\n\n // Plugin views render once for the active document, so only surface their sidebar\n // entries there. `content.start` sits above the Introduction, `content.end` below.\n const childrenWithPlugins =\n slug === activeSlug.value\n ? [\n ...pluginSidebarEntries.value['content.start'],\n ...localizeNavigationEntries(children),\n ...pluginSidebarEntries.value['content.end'],\n ]\n : localizeNavigationEntries(children)\n\n return {\n id: slug,\n type: 'document',\n description: document.info.description,\n name: document.info.title ?? slug,\n title: document.info.title ?? slug,\n children: childrenWithPlugins,\n }\n },\n )\n})\n\n/** Initialize the sidebar */\nconst sidebarState = createSidebarState<TraversedEntry>(itemsFromWorkspace, {\n hooks: {},\n})\n\n/** Recursively set all children of the given items to open */\nconst setChildrenOpen = (items: TraversedEntry[]): void => {\n items.forEach((item) => {\n if (item.type === 'tag' || item.type === 'models') {\n sidebarState.setExpanded(item.id, true)\n }\n if ('children' in item && item.children) {\n setChildrenOpen(item.children)\n }\n })\n}\n\n/** We get the sub items for the sidebar based on the configuration/document slug */\nconst sidebarItems = computed<TraversedEntry[]>(() => {\n const config = mergedConfig.value\n\n if (!config) {\n return []\n }\n\n const rawDocItems =\n sidebarState.items.value.find(\n (item): item is TraversedTag => item.id === activeSlug.value,\n )?.children ?? []\n\n // Apply the AsyncAPI protocol/server filters to the sidebar tree. This is a no-op\n // for OpenAPI documents and when no filter is selected.\n const docItems = activeAsyncApiDocument.value\n ? filterAsyncApiNavigation(rawDocItems, activeAsyncApiDocument.value, {\n protocol: selectedProtocol.value,\n server: selectedServer.value,\n })\n : rawDocItems\n\n // When the default open all tags configuration is enabled we open all the children of the document\n if (config.defaultOpenAllTags) {\n setChildrenOpen(docItems)\n }\n\n // When the expand all model sections configuration is enabled we open all the children of the models tag\n if (config.expandAllModelSections) {\n const models = docItems.find(\n (item): item is TraversedTag => item.type === 'models',\n )\n if (models) {\n sidebarState.setExpanded(models.id, true)\n models.children?.forEach((child) => {\n sidebarState.setExpanded(child.id, true)\n })\n }\n }\n\n return docItems\n})\n\n/** Find the sidebar entry that represents the introduction section */\nconst infoSectionId = computed(\n () =>\n sidebarItems.value.find(isIntroductionEntry)?.id ??\n `${activeSlug.value}${INTRODUCTION_ENTRY_ID_SUFFIX}`,\n)\n\n/** User for mobile navigation */\nconst breadcrumb = ref('')\n\nconst slotProps = computed(() => ({\n breadcrumb: breadcrumb.value,\n}))\n\nconst setBreadcrumb = (id: string) => {\n const item = sidebarState.getEntryById(id)\n\n if (!item || item.type === 'document') {\n breadcrumb.value = ''\n } else {\n breadcrumb.value = item.title\n }\n}\n\nconst scrollToLazyElement = (id: string) => {\n setBreadcrumb(id)\n sidebarState.setSelected(id)\n _scrollToLazy(id, sidebarState.setExpanded, sidebarState.getEntryById)\n}\n\n/**\n * Updates the browser tab title via the user-provided `setPageTitle` callback.\n *\n * Called whenever the section in view changes — on sidebar clicks, on scroll, and\n * when switching documents — so the tab title always reflects what the reader sees.\n */\nconst updatePageTitle = (id: string) => {\n const setPageTitle = mergedConfig.value?.setPageTitle\n const entry = sidebarState.getEntryById(id)\n\n if (!setPageTitle || typeof document === 'undefined' || !entry?.title) {\n return\n }\n\n const activeDocument = workspaceStore.workspace.activeDocument\n\n document.title = setPageTitle({\n title: entry.title,\n document: {\n title: activeDocument?.info?.title ?? activeSlug.value,\n slug: activeSlug.value,\n },\n })\n}\n\n/** Maps some config values to the workspace store to keep it reactive */\nmapConfigToWorkspaceStore({\n config: () => mergedConfig.value,\n store: workspaceStore,\n isDarkMode,\n})\n\nmapConfigToWorkspaceStore({\n config: () => mergedConfig.value,\n store: clientStore,\n isDarkMode,\n})\n\n/** Merged environment variables from workspace and document levels */\nconst environment = computed(\n () =>\n getActiveEnvironment(\n workspaceStore,\n workspaceStore.workspace.activeDocument ?? null,\n ).environment,\n)\n\nif (typeof window !== 'undefined') {\n // @ts-expect-error - For debugging purposes expose the store\n window.dataDumpWorkspace = () => workspaceStore\n}\n\n// For testing\ndefineExpose({\n eventBus,\n workspaceStore,\n sidebarItems,\n})\n\n/**\n * Computes a mapping from model names to their sidebar entry IDs.\n *\n * We collect model entries from the whole navigation tree, not just the top-level `models` group,\n * so that schemas grouped under a tag via `x-tags` are still reachable by name.\n *\n * @see https://github.com/scalar/scalar/issues/9854\n */\nconst modelsIndex = computed(() => buildModelsIndex(sidebarItems.value))\n\neventBus.on('scroll-to:model-by-name', ({ name }) => {\n /** Find the model in the models index */\n const model = modelsIndex.value[name]\n\n if (model) {\n scrollToLazyElement(model)\n }\n})\n\nconst addDocument: typeof workspaceStore.addDocument = async (\n input,\n navigationOptions,\n) => {\n const result = await workspaceStore.addDocument(input, navigationOptions)\n\n // The selected server lives only on the client store document. The user picks it in the\n // reference, it is never part of the imported source. Reloading the freshly imported document\n // below would drop it, so any config update that rebases the document — a new auth token,\n // reordered servers, an edited spec — would otherwise reset the server back to the first one.\n // Capture it here and re-apply it after the reload so the user's choice survives. See #5071.\n const previousDocument = clientStore.workspace.documents[input.name]\n const selectedServer =\n previousDocument && typeof previousDocument === 'object'\n ? (previousDocument as Record<string, unknown>)[\n 'x-scalar-selected-server'\n ]\n : undefined\n\n // Now add it to the client store\n const state = workspaceStore.exportWorkspace()\n const nextDocument = safeDeepClone(state.documents[input.name]) ?? {\n 'openapi': '3.1.0',\n 'info': {\n title: '',\n version: '',\n },\n 'x-scalar-original-document-hash': '',\n }\n\n // Carry the user's server selection over to the reloaded document. An empty string is a\n // deliberate \"no server selected\" state, so it is preserved too; only `undefined` (a first\n // load with no prior selection) falls through to the default-server logic elsewhere.\n if (typeof selectedServer === 'string') {\n Object.assign(nextDocument, { 'x-scalar-selected-server': selectedServer })\n }\n\n clientStore.loadWorkspace({\n auth: {},\n documents: {\n [input.name]: nextDocument,\n },\n intermediateDocuments: {},\n originalDocuments: {},\n overrides: {},\n history: {},\n meta: {},\n })\n return result\n}\n\n// ---------------------------------------------------------------------------\n// Document Management\n\n/** In-flight document loads, so a background preload and a user selection never load the same document twice */\nconst documentLoadPromises = new Map<string, Promise<void>>()\n\n/**\n * Load a document into the workspace store by slug, fetching URL sources or using inline content.\n *\n * This does not change the active document, so it is safe to call in the background to warm up\n * documents the user has not selected yet. Repeated calls are deduplicated and it becomes a no-op\n * once the document is loaded.\n */\nconst ensureDocumentLoaded = (slug: string): Promise<void> => {\n // Already loaded, nothing to do\n if (workspaceStore.workspace.documents[slug]) {\n return Promise.resolve()\n }\n\n // A load is already in flight, reuse it\n const pending = documentLoadPromises.get(slug)\n if (pending) {\n return pending\n }\n\n const normalized = configList.value[slug]\n\n if (!normalized) {\n return Promise.resolve()\n }\n\n const config = withLocalizedConfigurationDefaults(\n {\n ...normalized.config,\n ...configurationOverrides.value,\n },\n normalized.config,\n )\n\n const promise = (async () => {\n const result = await addDocument(\n normalized.source.url\n ? {\n name: slug,\n url: normalized.source.url,\n fetch: config.customFetch,\n }\n : {\n name: slug,\n document: normalized.source.content ?? {},\n },\n config,\n )\n\n const document = clientStore.workspace.documents[slug]\n\n // If the document does not have a selected server we set it to the first server\n if (\n result === true &&\n isOpenApiDocument(document) &&\n document['x-scalar-selected-server'] === undefined\n ) {\n // Set the active server if the document is loaded successfully. Resolve relative servers\n // against this document's own base URL, not the active document's, so a background preload\n // does not derive its server from whichever document happens to be active.\n const servers = getServers(\n normalized.config.servers ?? document.servers,\n {\n baseServerUrl: config.baseServerURL,\n documentUrl: normalized.source.url,\n },\n )\n if (servers.length > 0) {\n clientStore.updateDocument(\n slug,\n 'x-scalar-selected-server',\n servers[0]!.url,\n )\n }\n }\n })().finally(() => {\n documentLoadPromises.delete(slug)\n })\n\n documentLoadPromises.set(slug, promise)\n\n return promise\n}\n\n/** Whether idle preloading has been stopped, for example when the component unmounts */\nlet isPreloadStopped = false\n/** Cancels the currently scheduled idle preload callback, if one is pending */\nlet cancelScheduledPreload: (() => void) | undefined\n\n/**\n * Stop any in-progress idle preloading. Without this, an orphaned instance (an Astro view\n * transition or a `createApiReference` remount) would keep fetching and parsing documents into\n * an abandoned store after unmount.\n */\nconst stopPreloadingDocuments = () => {\n isPreloadStopped = true\n cancelScheduledPreload?.()\n cancelScheduledPreload = undefined\n}\n\n/**\n * Warm up the documents the user has not selected yet while the browser is idle, so switching\n * between documents is instant. Runs on the client only and loads one document at a time to avoid\n * a burst of fetches and parsing work competing with the active document.\n */\nconst preloadDocumentsWhenIdle = () => {\n if (typeof window === 'undefined') {\n return\n }\n\n const pendingSlugs = Object.keys(configList.value).filter(\n (slug) => !workspaceStore.workspace.documents[slug],\n )\n\n const scheduleIdle = (callback: () => void) => {\n if (typeof window.requestIdleCallback === 'function') {\n const handle = window.requestIdleCallback(callback, { timeout: 1500 })\n cancelScheduledPreload = () => window.cancelIdleCallback(handle)\n } else {\n const handle = window.setTimeout(callback, 200)\n cancelScheduledPreload = () => window.clearTimeout(handle)\n }\n }\n\n const loadNext = () => {\n if (isPreloadStopped) {\n return\n }\n\n const slug = pendingSlugs.shift()\n\n if (!slug) {\n return\n }\n\n // Load one document, then queue the next once the browser is idle again\n void ensureDocumentLoaded(slug).finally(() => {\n if (!isPreloadStopped) {\n scheduleIdle(loadNext)\n }\n })\n }\n\n scheduleIdle(loadNext)\n}\n\n/**\n * Handle changing the active document\n *\n * 1. If the document has not be loaded to the workspace store we set it to empty and asynchronously load it\n * 2. If the document has been loaded to the workspace store we just set it to active\n * 3. If the content from the configuration has changes we need to update the document in the workspace store\n */\nconst changeSelectedDocument = async (\n slug: string,\n elementId?: string | undefined,\n) => {\n const normalized = configList.value[slug]\n\n if (!normalized) {\n console.warn(`Document ${slug} not found in configList`)\n return\n }\n\n const config = withLocalizedConfigurationDefaults(\n {\n ...normalized.config,\n ...configurationOverrides.value,\n },\n normalized.config,\n )\n\n // Store `onDocumentSelect` result to await its execution later, before calling `onLoaded`\n const onDocumentSelectPromise = config.onDocumentSelect?.()\n\n // Set the active slug and update any routing\n syncSlugAndUrlWithDocument(slug, elementId, config)\n\n // Update the document on the route as well, the method and path don't matter as we update them before opening\n apiClient.value?.route({\n documentSlug: slug,\n method: 'get',\n path: '/',\n })\n\n // Load the document if it is not in the store yet (a background preload may already be loading it)\n await ensureDocumentLoaded(slug)\n\n // Always set it to active; if the document is null we show a loading state\n workspaceStore.update('x-scalar-active-document', slug)\n clientStore.update('x-scalar-active-document', slug)\n\n // Now that the navigation is available, canonicalize a legacy webhook deep link:\n // old ids dropped the dot in the event name (`account-holdercreated`), so rewrite\n // the URL and the scroll target to the current slug before we scroll to it.\n if (elementId && typeof window !== 'undefined') {\n const canonical = redirectUrl(\n window.location.href,\n slugify(config.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL),\n slug,\n isMultiDocument.value,\n config.pathRouting?.basePath,\n collectWebhooks(\n workspaceStore.workspace.activeDocument?.['x-scalar-navigation']\n ?.children ?? [],\n ),\n )\n if (canonical) {\n window.history.replaceState({}, '', canonical.toString())\n elementId =\n getIdFromUrl(\n canonical.href,\n config.pathRouting?.basePath,\n isMultiDocument.value ? undefined : slug,\n ) || elementId\n }\n }\n\n // If the document has persistence enabled we load the auth schemes from storage\n if (config.persistAuth) {\n loadAuthFromStorage(clientStore, slug)\n }\n\n // ensure that `onLoaded` hook doesn't block execution but is executed after `onDocumentSelect`\n void (async () => {\n await onDocumentSelectPromise\n void config.onLoaded?.(slug)\n })()\n\n // When loading to a specified element we need to freeze and scroll\n if (elementId && elementId !== slug) {\n scrollToLazyElement(elementId)\n }\n // If there is no child element of the document specified and defaultOpenFirstTag is enabled, we expand the first tag\n else if (config.defaultOpenFirstTag) {\n const firstTag = sidebarItems.value.find((item) => item.type === 'tag')\n if (firstTag) {\n sidebarState.setExpanded(firstTag.id, true)\n }\n }\n\n // Reflect the freshly selected document in the browser tab title\n updatePageTitle(elementId && elementId !== slug ? elementId : slug)\n}\n\n/**\n * TODO:Move this to a dedicated updateDocument function in the future and\n * away from vue-reactivity based updates\n */\nwatch(\n () => Object.values(configList.value),\n async (newConfigList, oldConfigList) => {\n /**\n * Handles replacing and updating documents within the workspace store\n * when we detect configuration changes.\n */\n const updateSource = async (\n updated: NormalizedConfiguration,\n previous: NormalizedConfiguration | undefined,\n ) => {\n const config = withLocalizedConfigurationDefaults(\n {\n ...updated.config,\n ...configurationOverrides.value,\n },\n updated.config,\n )\n\n /**\n * A background preload may still be loading this document against the previous\n * configuration. Wait for it to finish so the update below rebases onto the loaded\n * document instead of being skipped, which would otherwise leave stale content in the store.\n */\n const pendingLoad = documentLoadPromises.get(updated.slug)\n if (pendingLoad) {\n await pendingLoad\n }\n\n /** If we have not loaded the document previously we don't need to handle any updates to store */\n if (!workspaceStore.workspace.documents[updated.slug]) {\n return\n }\n /** If the URL has changed we fetch and rebase */\n if (updated.source.url && updated.source.url !== previous?.source.url) {\n await addDocument(\n {\n name: updated.slug,\n url: updated.source.url,\n fetch: config.customFetch,\n },\n config,\n )\n\n return\n }\n\n // If the was not a URL change then we require a document to continue\n if (!updated.source.content) {\n return\n }\n\n /**\n * We need to deeply check for document changes. Parse documents and then only rebase\n * if we detect deep changes in the two sources\n */\n if (\n diff(\n updated.source.content,\n previous && 'content' in previous.source\n ? (previous.source.content ?? {})\n : {},\n ).length\n ) {\n await addDocument(\n {\n name: updated.slug,\n document: updated.source.content,\n },\n config,\n )\n }\n }\n\n newConfigList.forEach((newConfig, index) =>\n updateSource(newConfig, oldConfigList[index]),\n )\n\n const newSlugs = newConfigList.map((c) => c.slug)\n const oldSlugs = oldConfigList.map((c) => c.slug)\n\n // If the slugs have changed, we need to update the active document and the URL query param\n if (\n newSlugs.length !== oldSlugs.length ||\n !newSlugs.every((slug, index) => slug === oldSlugs[index])\n ) {\n await changeSelectedDocument(newSlugs[0] ?? '')\n }\n },\n {\n deep: true,\n },\n)\n\n/** Preload the first document during SSR */\nonServerPrefetch(() => changeSelectedDocument(activeSlug.value))\n\n/** Load the first document on page load */\nonBeforeMount(async () => {\n // We read the client from the client store so we need to set it to the client store\n loadClientFromStorage(clientStore)\n\n await changeSelectedDocument(\n activeSlug.value,\n getIdFromUrl(\n window.location.href,\n configList.value[activeSlug.value]?.config.pathRouting?.basePath,\n isMultiDocument.value ? undefined : activeSlug.value,\n ),\n )\n\n // Warm up the remaining documents in the background so switching between them is instant\n preloadDocumentsWhenIdle()\n})\n\nconst documentUrl = computed(() => {\n return configList.value[activeSlug.value]?.source?.url\n})\n\n// --------------------------------------------------------------------------- */\n// Agent Scalar\n\n/**\n * Determines if Agent Scalar should be enabled based on the configuration and the current URL\n *\n * - If the agent is disabled in the configuration, it should not be enabled\n * - If the current URL is a local URL, it should be enabled\n * - If the agent key is set, it should be enabled\n */\nconst agent = useAgent({\n agentEnabled: computed(() => {\n const currentConfiguration = configList.value[activeSlug.value]\n\n if (currentConfiguration?.agent?.disabled) {\n return false\n }\n\n if (typeof window !== 'undefined' && isLocalUrl(window.location.href)) {\n return true\n }\n\n return Boolean(configList.value[activeSlug.value]?.agent?.key)\n }),\n})\nprovide(AGENT_CONTEXT_SYMBOL, agent)\n\n// --------------------------------------------------------------------------- */\n// Api Client Modal\n\n// Setup the ApiClient on mount.\n// The modal is dynamic-imported so its dependency graph (CodeMirror, the request\n// editor, the response viewer, etc.) becomes a separate chunk that loads\n// asynchronously after the API reference paints.\nconst modal = useTemplateRef<HTMLElement>('modal')\nconst apiClient = ref<ApiClientModal | null>(null)\nonMounted(async () => {\n if (!modal.value) {\n return\n }\n\n const { createApiClientModal } = await import('@scalar/api-client/modal')\n\n // Bail if the component unmounted while the chunk was loading.\n if (!modal.value) {\n return\n }\n\n apiClient.value = createApiClientModal({\n el: modal.value,\n eventBus,\n workspaceStore: clientStore,\n options: mergedConfig,\n plugins: [\n ...pluginManager.getApiClientPlugins(),\n ...mapConfigPlugins(mergedConfig, environment),\n ],\n })\n})\nonBeforeUnmount(() => {\n stopPreloadingDocuments()\n pluginManager.notifyDestroy()\n apiClient.value?.app.unmount()\n})\n\n// ---------------------------------------------------------------------------\n// Top level event handlers and user specified callbacks\n\n/** Ensure we call the onServerChange callback */\neventBus.on('server:update:selected', ({ url }) =>\n mergedConfig.value.onServerChange?.(url),\n)\n\n/**\n * AsyncAPI servers are keyed by name, so resolve the selected name to its\n * constructed connection URL before firing onServerChange, keeping the callback\n * payload consistent with OpenAPI (a URL string).\n */\neventBus.on('asyncapi-server:update:selected', ({ name }) => {\n const document = clientStore.workspace.activeDocument\n if (!isAsyncApiDocument(document)) {\n return\n }\n\n const server = getAsyncApiServers(document, { webSocketOnly: false }).find(\n (s) => s.name === name,\n )\n mergedConfig.value.onServerChange?.(server?.url ?? name)\n})\n\n/** Download the document from the store */\neventBus.on('ui:download:document', ({ format }) => {\n const document = workspaceStore.exportActiveDocument(format)\n\n if (!document) {\n console.error('No document found to download')\n return\n }\n\n void downloadDocument(document, activeSlug.value ?? 'openapi', format)\n})\n\n// ---------------------------------------------------------------------------\n// Local event and scroll handling\n\n/**\n * Handler for a direct navigation event such as a sidebar or search click\n *\n * Depending on the item type we handle a selection event differently:\n *\n * - Tag: If a tag is closed we open it and all its parents and scroll to it\n * If a tag is open we just close the tag\n * - Operation:\n * Open all parents and scroll to the operation\n */\nconst handleSelectSidebarEntry = (id: string, caller?: 'sidebar') => {\n const item = sidebarState.getEntryById(id)\n\n updatePageTitle(id)\n\n if (\n (item?.type === 'tag' ||\n item?.type === 'models' ||\n item?.type === 'text') &&\n sidebarState.isExpanded(id) && // Only close if the item is expanded\n sidebarState.selectedItem.value === id // Only close if the item is not the currently selected item\n ) {\n // hack until we fix intersection logic\n const unblock = blockIntersection()\n\n sidebarState.setExpanded(id, false)\n\n unblock()\n\n return\n }\n\n // Close the mobile menu upon selecting any item that's not a tag or model\n if (item?.type !== 'tag' && item?.type !== 'models') {\n isSidebarOpen.value = false\n }\n\n scrollToLazyElement(id)\n\n const url = makeUrlFromId(id, basePath.value, isMultiDocument.value)\n if (url) {\n window.history.pushState({}, '', url)\n\n // Trigger the onSidebarClick callback if the caller is sidebar\n if (caller === 'sidebar') {\n mergedConfig.value.onSidebarClick?.(url.toString())\n }\n }\n\n if (agent.showAgent.value) {\n agent.closeAgent()\n }\n}\n\n/** Handle a navigation item selection event */\neventBus.on('select:nav-item', ({ id }) => handleSelectSidebarEntry(id))\n\n/** Handle a scroll to navigation item event */\neventBus.on('scroll-to:nav-item', ({ id }) => handleSelectSidebarEntry(id))\n\n/** Handle an intersecting navigation item event */\neventBus.on('intersecting:nav-item', ({ id }) => {\n if (!intersectionEnabled.value) {\n return\n }\n\n sidebarState.setSelected(id)\n setBreadcrumb(id)\n\n // Keep the browser tab title in sync with the section scrolled into view\n updatePageTitle(id)\n\n // Scroll the sidebar to keep the selected element near the top\n scrollSidebarToTop(id)\n\n const url = makeUrlFromId(id, basePath.value, isMultiDocument.value)\n if (url && workspaceStore.workspace.activeDocument) {\n window.history.replaceState({}, '', url.toString())\n }\n})\n\neventBus.on('toggle:nav-item', ({ id, open }) => {\n if (open) {\n mergedConfig.value.onShowMore?.(id)\n\n // Pre-queue first child so it renders immediately when the tag expands\n const entry = sidebarState.getEntryById(id)\n if (entry && 'children' in entry && entry.children) {\n const first = entry.children[0]\n\n if (first) {\n addToPriorityQueue(first.id)\n }\n }\n }\n sidebarState.setExpanded(id, open ?? !sidebarState.isExpanded(id))\n})\n\neventBus.on('copy-url:nav-item', ({ id }) => {\n const url = makeUrlFromId(\n id,\n basePath.value,\n isMultiDocument.value,\n )?.toString()\n return url && copyToClipboard(url)\n})\n\n// ---------------------------------------------------------------------------\n// History and scroll restoration\n\nonBeforeMount(() => {\n window.history.scrollRestoration = 'manual'\n // Ensure we add our scalar wrapper class to the headless ui root, mounted is too late\n addScalarClassesToHeadless()\n\n // When we detect a back button press we scroll to the new id\n window.addEventListener('popstate', () => {\n const id = getIdFromUrl(\n window.location.href,\n mergedConfig.value.pathRouting?.basePath,\n isMultiDocument.value ? undefined : activeSlug.value,\n )\n if (id) {\n scrollToLazyElement(id)\n }\n })\n})\n\n// ---------------------------------------------------------------------------\n// Document start intersection observer\n\nconst documentStartRef = useTemplateRef<HTMLElement>('documentStartRef')\n\n/**\n * Uses `immediate` so the sentinel fires as soon as it enters the viewport (not just at the center strip).\n * When the user scrolls away from the top, both this observer and the first section's center-strip\n * observer are intersecting simultaneously, so the section observer does not re-fire on its own.\n * The `onExit` callback bridges that gap by finding whichever section is at the viewport center\n * and re-emitting the nav event for it.\n *\n * We emit the Introduction entry rather than the document slug so this sentinel and the Introduction\n * section's own intersection observer resolve to the same entry. Otherwise the two race at the top of\n * the document and the tab title flickers between the section title and the document title.\n */\nuseIntersection(\n documentStartRef,\n () => {\n eventBus.emit('intersecting:nav-item', { id: infoSectionId.value })\n },\n {\n onExit: () => {\n const centerY = window.innerHeight / 2\n const section = document\n .elementsFromPoint(window.innerWidth / 2, centerY)\n .find((el) => el.tagName === 'SECTION' && el.id)\n\n if (section?.id) {\n eventBus.emit('intersecting:nav-item', { id: section.id })\n }\n },\n immediate: true,\n },\n)\n\nconst colorMode = computed(() => {\n const mode = workspaceStore.workspace['x-scalar-color-mode']\n\n if (mode === 'system') {\n return getSystemModePreference()\n }\n\n return mode\n})\n\nconst bodyScrollLocked = useScrollLock(\n typeof document !== 'undefined' ? document.body : null,\n)\n\nwatch(agent.showAgent, () => (bodyScrollLocked.value = agent.showAgent.value))\n\nconst showMCPButton = computed(() => {\n if (mergedConfig.value.mcp?.disabled) {\n return false\n }\n\n if (typeof window !== 'undefined' && isLocalUrl(window.location.href)) {\n return true\n }\n\n if (mergedConfig.value.mcp) {\n return true\n }\n\n return false\n})\n</script>\n\n<template>\n <!-- SingleApiReference -->\n <div>\n <!-- Inject any custom CSS directly into a style tag -->\n <!-- eslint-disable vue/no-v-text-v-html-on-component -->\n <component\n :is=\"'style'\"\n v-html=\"styleContent\" />\n <!-- eslint-enable vue/no-v-text-v-html-on-component -->\n <div\n ref=\"documentEl\"\n class=\"scalar-app scalar-api-reference references-layout\"\n :class=\"[\n {\n 'scalar-api-references-standalone-mobile': mergedConfig.showSidebar,\n 'scalar-scrollbars-obtrusive': obtrusiveScrollbars,\n 'references-editable': mergedConfig.isEditable,\n 'references-sidebar': mergedConfig.showSidebar,\n 'references-sidebar-mobile-open': isSidebarOpen,\n 'references-classic': mergedConfig.layout === 'classic',\n },\n $attrs.class,\n ]\"\n :dir=\"apiReferenceLocalization.direction.value\"\n :lang=\"documentLang\">\n <!-- Agent Scalar -->\n <AgentScalarDrawer\n v-if=\"agent.agentEnabled.value\"\n :agentScalarConfiguration=\"configList[activeSlug]?.agent\"\n :externalUrls=\"mergedConfig.externalUrls\"\n :workspaceStore />\n\n <!-- Mobile Header and Sidebar when in modern layout -->\n\n <MobileHeader\n v-if=\"mergedConfig.layout === 'modern'\"\n :breadcrumb=\"breadcrumb\"\n :isSidebarOpen=\"isSidebarOpen\"\n :showSidebar=\"mergedConfig.showSidebar\"\n @toggleSidebar=\"() => (isSidebarOpen = !isSidebarOpen)\">\n <template #search>\n <SearchButton\n v-if=\"!mergedConfig.hideSearch\"\n class=\"my-2\"\n :document=\"activeSearchableDocument\"\n :eventBus=\"eventBus\"\n :hideModels=\"mergedConfig.hideModels\"\n :modelsSectionLabel=\"mergedConfig.modelsSectionLabel\"\n :searchHotKey=\"mergedConfig.searchHotKey\"\n :showSidebar=\"mergedConfig.showSidebar\" />\n </template>\n <template #sidebar=\"{ sidebarClasses }\">\n <ScalarSidebar\n v-if=\"mergedConfig.showSidebar && mergedConfig.layout === 'modern'\"\n :aria-label=\"\n apiReferenceLocalization.translate('navigation.sidebarFor', {\n name:\n workspaceStore.workspace.activeDocument?.info?.title ?? '',\n })\n \"\n class=\"t-doc__sidebar\"\n :class=\"sidebarClasses\"\n :isExpanded=\"sidebarState.isExpanded\"\n :isSelected=\"sidebarState.isSelected\"\n :items=\"sidebarItems\"\n layout=\"reference\"\n :options=\"sidebarOptions\"\n @selectItem=\"(id) => handleSelectSidebarEntry(id, 'sidebar')\"\n @toggleGroup=\"\n (id: string) =>\n sidebarState.setExpanded(id, !sidebarState.isExpanded(id))\n \">\n <template #header>\n <!-- Wrap in a div when slot is filled -->\n <DocumentSelector\n v-if=\"documentOptionList.length > 1\"\n :modelValue=\"activeSlug\"\n :options=\"documentOptionList\"\n @update:modelValue=\"changeSelectedDocument\" />\n\n <!-- Search -->\n <div\n v-if=\"!mergedConfig.hideSearch\"\n class=\"flex gap-1.5 px-3 pt-3\">\n <SearchButton\n :document=\"activeSearchableDocument\"\n :eventBus=\"eventBus\"\n :hideModels=\"mergedConfig.hideModels\"\n :modelsSectionLabel=\"mergedConfig.modelsSectionLabel\"\n :searchHotKey=\"mergedConfig.searchHotKey\" />\n\n <AgentScalarButton v-if=\"agent.agentEnabled.value\" />\n </div>\n\n <!-- Sidebar Start -->\n <slot\n name=\"sidebar-start\"\n v-bind=\"slotProps\" />\n </template>\n <template #before>\n <!-- AsyncAPI protocol + server filters (only render with >1 choice) -->\n <AsyncApiSidebarFilters\n v-model:protocol=\"selectedProtocol\"\n v-model:server=\"selectedServer\"\n :document=\"activeAsyncApiDocument\" />\n <ScalarSidebarSection\n v-if=\"activeAsyncApiDocument\"\n class=\"asyncapi-sidebar-document-section\">\n Document\n </ScalarSidebarSection>\n </template>\n <template #footer>\n <slot\n name=\"sidebar-end\"\n v-bind=\"slotProps\">\n <!-- We default the sidebar footer to the standard scalar elements -->\n <ScalarSidebarFooter class=\"darklight-reference\">\n <OpenApiClientButton\n v-if=\"!mergedConfig.hideClientButton && !showMCPButton\"\n buttonSource=\"sidebar\"\n :integration=\"mergedConfig._integration\"\n :isDevelopment=\"isDevelopment\"\n :url=\"documentUrl\" />\n <OpenMCPButton\n v-if=\"showMCPButton\"\n :config=\"mergedConfig.mcp\"\n :externalUrls=\"mergedConfig.externalUrls\"\n :isDevelopment=\"isDevelopment\"\n :url=\"documentUrl\"\n :workspace=\"workspaceStore\" />\n <template #description>\n <a\n class=\"no-underline hover:underline\"\n href=\"https://www.scalar.com\"\n rel=\"noopener noreferrer\"\n target=\"_blank\">\n {{\n apiReferenceLocalization.translate(\n 'footer.poweredByScalar',\n )\n }}\n </a>\n </template>\n <!-- Override the dark mode toggle slot to hide it -->\n <template #toggle>\n <ScalarColorModeToggleButton\n v-if=\"\n !mergedConfig.hideDarkModeToggle &&\n !mergedConfig.forceDarkModeState\n \"\n :modelValue=\"colorMode === 'dark'\"\n @update:modelValue=\"() => toggleColorMode()\" />\n <span v-else />\n </template>\n </ScalarSidebarFooter>\n </slot>\n </template>\n </ScalarSidebar>\n </template>\n </MobileHeader>\n\n <!-- Primary Content -->\n <main\n :aria-label=\"\n apiReferenceLocalization.translate('navigation.mainContent', {\n name: workspaceStore.workspace.activeDocument?.info?.title ?? '',\n })\n \"\n class=\"references-rendered\"\n :inert=\"agent.showAgent.value\">\n <Content\n :authStore=\"clientStore.auth\"\n :clientDocument=\"clientStore.workspace.activeDocument\"\n :document=\"workspaceStore.workspace.activeDocument\"\n :documentSlug=\"activeSlug\"\n :environment\n :eventBus\n :expandedItems=\"sidebarState.expandedItems.value\"\n :headingSlugGenerator=\"\n mergedConfig.generateHeadingSlug ??\n ((heading) => `${activeSlug}/description/${heading.slug}`)\n \"\n :infoSectionId\n :items=\"sidebarItems\"\n :options=\"mergedConfig\"\n :xScalarDefaultClient=\"\n clientStore.workspace['x-scalar-default-client']\n \"\n :xScalarDefaultExample=\"\n clientStore.workspace['x-scalar-default-example']\n \">\n <template #start>\n <!-- Placeholder intersection observer that emits an empty string to clear the hash when scrolled to the top -->\n <div ref=\"documentStartRef\" />\n\n <DeveloperTools\n v-if=\"workspaceStore.workspace.activeDocument\"\n v-model:overrides=\"configurationOverrides\"\n class=\"references-developer-tools\"\n :configuration=\"mergedConfig\"\n :externalUrls=\"mergedConfig.externalUrls\"\n :workspace=\"workspaceStore\" />\n\n <ClassicHeader v-if=\"mergedConfig.layout === 'classic'\">\n <div class=\"w-64 empty:hidden\">\n <DocumentSelector\n v-if=\"documentOptionList.length > 1\"\n :modelValue=\"activeSlug\"\n :options=\"documentOptionList\"\n @update:modelValue=\"changeSelectedDocument\" />\n </div>\n <SearchButton\n v-if=\"!mergedConfig.hideSearch\"\n class=\"t-doc__sidebar max-w-64\"\n :document=\"activeSearchableDocument\"\n :eventBus=\"eventBus\"\n :hideModels=\"mergedConfig.hideModels\"\n :modelsSectionLabel=\"mergedConfig.modelsSectionLabel\"\n :searchHotKey=\"mergedConfig.searchHotKey\" />\n <template #dark-mode-toggle>\n <ScalarColorModeToggleIcon\n v-if=\"\n !mergedConfig.hideDarkModeToggle &&\n !mergedConfig.forceDarkModeState\n \"\n class=\"text-c-2 hover:text-c-1\"\n :mode=\"colorMode\"\n style=\"transform: scale(1.4)\"\n variant=\"icon\"\n @click=\"() => toggleColorMode()\" />\n </template>\n </ClassicHeader>\n <slot\n name=\"content-start\"\n v-bind=\"slotProps\" />\n </template>\n <!-- TODO: Remove this; we no longer directly support an inline editor -->\n <template\n v-if=\"mergedConfig.isEditable\"\n #empty-state>\n <slot\n name=\"editor-placeholder\"\n v-bind=\"slotProps\" />\n </template>\n <template #end>\n <slot\n name=\"content-end\"\n v-bind=\"slotProps\" />\n </template>\n </Content>\n </main>\n <!-- Optional Footer -->\n <div\n v-if=\"$slots.footer\"\n class=\"references-footer\">\n <slot\n name=\"footer\"\n v-bind=\"slotProps\" />\n </div>\n <!-- Client Modal mount point -->\n <div ref=\"modal\" />\n </div>\n <ScalarToasts />\n </div>\n</template>\n\n<style>\n/* Add base styles to the body. Removed browser default margins for a better experience. */\n@layer scalar-base {\n body {\n margin: 0;\n background-color: var(--scalar-background-1);\n }\n}\n/** Used to check if css is loaded */\n:root {\n --scalar-loaded-api-reference: true;\n}\n\n.asyncapi-sidebar-document-section > .group\\/spacer-after {\n height: 0;\n}\n</style>\n<style scoped>\n/* Configurable Layout Variables */\n@layer scalar-config {\n .scalar-api-reference {\n /* The header height */\n --refs-header-height: calc(\n var(--scalar-custom-header-height, 0px) + var(--scalar-header-height, 0px)\n );\n /* The offset of visible references content (minus headers) */\n --refs-viewport-offset: calc(\n var(--refs-header-height, 0px) + var(--refs-content-offset, 0px)\n );\n /* The calculated height of visible references content (minus headers) */\n --refs-viewport-height: calc(\n var(--full-height, 100dvh) - var(--refs-viewport-offset, 0px)\n );\n /* The width of the sidebar */\n --refs-sidebar-width: var(--scalar-sidebar-width, 0px);\n /* The height of the sidebar */\n --refs-sidebar-height: calc(\n var(--full-height, 100dvh) - var(--refs-header-height, 0px)\n );\n /* The maximum width of the content column */\n --refs-content-max-width: var(--scalar-content-max-width, 1540px);\n }\n\n .scalar-api-reference.references-classic {\n /* Classic layout is wider */\n --refs-content-max-width: var(--scalar-content-max-width, 1420px);\n min-height: 100dvh;\n --refs-sidebar-width: 0;\n }\n}\n.t-doc__sidebar {\n z-index: 10;\n}\n\n/* ----------------------------------------------------- */\n/* References Layout */\n.references-layout {\n /* Try to fill the container */\n min-height: 100dvh;\n min-width: 100%;\n max-width: 100%;\n flex: 1;\n\n /*\n Calculated by a resize observer and set in the style attribute\n Falls back to the viewport height\n */\n --full-height: 100dvh;\n\n /* Grid layout */\n display: grid;\n grid-template-rows: var(--scalar-header-height, 0px) repeat(2, auto);\n grid-template-columns: auto 1fr;\n grid-template-areas:\n 'header header'\n 'navigation rendered'\n 'footer footer';\n\n background: var(--scalar-background-1);\n}\n\n.references-editor {\n grid-area: editor;\n display: flex;\n min-width: 0;\n background: var(--scalar-background-1);\n}\n\n.references-rendered {\n position: relative;\n grid-area: rendered;\n min-width: 0;\n background: var(--scalar-background-1);\n}\n.scalar-api-reference.references-classic,\n.references-classic .references-rendered {\n height: initial !important;\n max-height: initial !important;\n}\n\n@layer scalar-config {\n .references-sidebar {\n /* Set a default width if references are enabled */\n --refs-sidebar-width: var(--scalar-sidebar-width, 288px);\n }\n}\n\n/* Footer */\n.references-footer {\n grid-area: footer;\n}\n/* ----------------------------------------------------- */\n/* Responsive / Mobile Layout */\n\n/*\n * Stop just below the `lg` breakpoint (1000px). The sidebar visibility is driven\n * by Tailwind's `lg:` variant, which is `min-width: 1000px` and therefore treats\n * exactly 1000px as desktop. A `max-width: 1000px` query would make the grid\n * switch to the mobile (stacked) layout at the very same width, so the desktop\n * sidebar would render on top of the content. `width < 1000px` is the exact\n * complement of `lg:` (`width >= 1000px`), keeping the two in sync.\n */\n@media (width < 1000px) {\n /* Keep toolbar hidden on mobile without forcing desktop display mode. */\n .references-developer-tools {\n display: none;\n }\n\n /* Stack view on mobile */\n .references-layout {\n /* Adjust the sidebar height to the viewport height minus the header height */\n --refs-sidebar-height: calc(\n var(--full-height, 100dvh) - var(--scalar-custom-header-height, 0px)\n );\n\n grid-template-columns: 100%;\n grid-template-rows: var(--scalar-header-height, 0px) 0px auto auto;\n\n grid-template-areas:\n 'header'\n 'navigation'\n 'rendered'\n 'footer';\n }\n .references-editable {\n grid-template-areas:\n 'header'\n 'navigation'\n 'editor';\n }\n\n .references-rendered {\n position: static;\n }\n}\n</style>\n<style scoped>\n/**\n* Sidebar CSS for standalone\n* TODO: @brynn move this to the sidebar block OR the ApiReferenceStandalone component\n* when the new elements are available\n*/\n/* Match the layout breakpoint above so the mobile header height is only applied below `lg`. */\n@media (width < 1000px) {\n .scalar-api-references-standalone-mobile:not(.references-classic) {\n --scalar-header-height: 50px;\n }\n}\n</style>\n<style scoped>\n.darklight-reference {\n width: 100%;\n margin-top: auto;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,UAAA;AAEN,IAAe,OAAO,WAAW,aAC/B,QAAQ,KAAK,yBAAyB,SAAS;;;;;EA0HjD,MAAM,QAAQ;EAiBd,MAAM,EAAE,oBAAoB,aAAa;;;;;;EAOzC,MAAM,gBAAA;;;;;;;;EASN,MAAM,sBAAsB,IAAI,KAAK;EACrC,gBAAgB;GACd,oBAAoB,QAAQ,uBAAuB;EACrD,CAAC;EAED,MAAM,WAAW,wBAAwB,EAAE,OAAO,cAAc,CAAC;EACjE,MAAM,gBAAgB,IAAI,KAAK;;;;;;;EAQ/B,mBAAmB,MAAM,CAAC;;;;;;;EAS1B,MAAM,aAAa,eAAe,wBAAwB,MAAM,aAAa,CAAC;EAE9E,MAAM,kBAAkB,eAAe,OAAO,KAAK,WAAW,KAAK,CAAC,CAAC,SAAS,CAAC;;EAG/E,MAAM,aAAa,IACjB,OAAO,OAAO,WAAW,KAAK,CAAC,CAAC,MAAM,MAAM,EAAE,OAAO,CAAC,EAAE,QACtD,WAAW,MAAM,OAAO,KAAK,WAAW,KA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;;;IAEX,YAAgB,MAAA,YAAA,CAAA"}
@@ -1,2 +1,5 @@
1
1
  export { default as AsyncApiTraversedEntry } from './AsyncApiTraversedEntry.vue.js';
2
+ export { default as AsyncApiChannel } from './Channel.vue.js';
3
+ export { default as AsyncApiMessage } from './Message.vue.js';
4
+ export { default as AsyncApiOperation } from './Operation.vue.js';
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/AsyncApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/AsyncApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAymBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAMvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAErE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAS9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AA0BtE,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;IACtD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,YAAY,CAAA;IAClC,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,oFAAoF;IACpF,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA4nBJ,QAAA,MAAM,YAAY;cAppBH,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;6EAmpB1B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA6mBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAMvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAA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1B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import SchemaProperty_vue_vue_type_script_setup_true_lang_default from "./SchemaProperty.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Content/Schema/SchemaProperty.vue
5
- var SchemaProperty_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SchemaProperty_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-1ebde634"]]);
5
+ var SchemaProperty_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SchemaProperty_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-933ce0d5"]]);
6
6
  //#endregion
7
7
  export { SchemaProperty_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n isDynamicRef,\n resolveDynamicRef,\n} from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, type Component } from 'vue'\n\nimport { WithBreadcrumb } from '@/components/Anchor'\nimport {\n resolveDynamicSchema,\n useDynamicScope,\n} from '@/components/Content/Schema/helpers/dynamic-scope'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getCycleKey } from '@/components/Content/Schema/helpers/schema-cycle'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport { getCompositionsToRender } from './helpers/get-compositions-to-render'\nimport { getEnumValues } from './helpers/get-enum-values'\nimport { getPropertyDescription } from './helpers/get-property-description'\nimport { hasComplexArrayItems } from './helpers/has-complex-array-items'\nimport { optimizeValueForDisplay } from './helpers/optimize-value-for-display'\nimport type { CompositionKeyword } from './helpers/schema-composition'\nimport { shouldDisplayDescription } from './helpers/should-display-description'\nimport { shouldDisplayHeading } from './helpers/should-display-heading'\nimport Schema from './Schema.vue'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaEnums from './SchemaEnums.vue'\nimport SchemaPropertyHeading from './SchemaPropertyHeading.vue'\n\n/**\n * Note: We're taking in a prop called `value` which should be a JSON Schema.\n *\n * We're using `optimizeValueForDisplay` to merge null types in compositions (anyOf, allOf, oneOf, not).\n * So you should basically use the optimizedValue everywhere in the component.\n */\n\n/** Composition keywords that hold a list of schemas and can be flattened when they contain a single member. */\nconst SINGLE_ITEM_COMPOSITIONS = ['oneOf', 'anyOf', 'allOf'] as const\n\nconst props = withDefaults(\n defineProps<{\n is?: string | Component\n schema: SchemaObject | undefined\n noncollapsible?: boolean\n level?: number\n name?: string\n required?: boolean\n compact?: boolean\n discriminator?: DiscriminatorObject\n description?: string\n hideModelNames?: boolean\n hideHeading?: boolean\n /** When the root schema was resolved from a $ref, pass the ref name for display (e.g. \"Data\"). */\n modelName?: string | null\n variant?: 'additionalProperties' | 'patternProperties'\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n /** Enum values for property names (from JSON Schema propertyNames keyword). */\n propertyNamesEnum?: string[]\n /** Resolved propertyNames schema, used to show key constraints like `format`. */\n propertyNamesSchema?: SchemaObject\n /** When \"requestBody\", composition selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /** Internal path segment for this property when building nested composition keys */\n compositionPathSegment?: string\n /** Stable identity of this property's schema, used for cycle detection. */\n cycleKey?: unknown\n }>(),\n {\n level: 0,\n required: false,\n compact: false,\n hideModelNames: false,\n },\n)\n\n/** The dynamic scope inherited from the enclosing schema resources, used to bind `$dynamicRef`s. */\nconst dynamicScope = useDynamicScope()\n\n/**\n * Simplified composition with `null` type.\n *\n * A top-level `$dynamicRef` (e.g. a linked-list `next` node) is bound to its concrete type via the\n * dynamic scope first; for ordinary schemas this is a no-op.\n */\nconst optimizedValue = computed(() =>\n optimizeValueForDisplay(resolveDynamicSchema(props.schema, dynamicScope)),\n)\n\nconst childBreadcrumb = computed<string[] | undefined>(() =>\n props.breadcrumb\n ? // A named property extends the breadcrumb with its own name. A nameless\n // container (e.g. a response object, rendered without a name to avoid a\n // duplicate heading) passes its breadcrumb straight through so its\n // properties stay linkable.\n props.name\n ? [...props.breadcrumb, props.name]\n : props.breadcrumb\n : undefined,\n)\n\nconst currentCompositionPath = computed<string[]>(() =>\n props.compositionPathSegment\n ? [...(props.compositionPath ?? []), props.compositionPathSegment]\n : (props.compositionPath ?? []),\n)\n\nconst arrayItemsCompositionPath = computed<string[]>(() => [\n ...currentCompositionPath.value,\n 'items',\n])\n\nconst shouldHaveLink = computed(() => props.level <= 2)\n\n/**\n * The array schema used for item inspection, with a `$dynamicRef` item bound to its concrete type.\n *\n * Returns the schema unchanged unless `items` is a `$dynamicRef` that resolves against the dynamic\n * scope, so ordinary arrays (including `$ref` items) keep their existing behavior exactly.\n */\nconst arrayValueWithBoundItems = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || !isDynamicRef(value.items)) {\n return value\n }\n\n const bound = resolveDynamicRef(value.items.$dynamicRef, dynamicScope)\n return bound ? ({ ...value, items: bound } as SchemaObject) : value\n})\n\n/** Checks if array items have complex structure */\nconst hasComplexArrayItemsComputed = computed(() =>\n hasComplexArrayItems(arrayValueWithBoundItems.value),\n)\n\n/** Check if enum should be displayed (from value schema or from propertyNames) */\nconst hasEnum = computed(() => enumValues.value.length > 0)\n\n/** Determine if object properties should be displayed */\nconst shouldRenderObjectProperties = computed(() => {\n const value = optimizedValue.value\n if (!value) {\n return false\n }\n\n if (!('properties' in value || 'additionalProperties' in value)) {\n return false\n }\n\n // `allOf` already merges the factored-out sibling `properties` into its\n // rendered result (see `mergeAllOfSchemas`), so rendering a separate object\n // block here would show those properties twice. Let the composition handle it.\n if ('allOf' in value) {\n return false\n }\n\n // A schema may factor its common `properties` out to the top level alongside\n // a composition keyword (anyOf/oneOf/not), as described in the JSON Schema\n // \"factoring schemas\" guide. `isTypeObject` deliberately rejects such schemas\n // so the composition is rendered, but the factored-out properties must still\n // show. Unlike `allOf`, these compositions do not merge sibling properties.\n // Render them unless the schema is an explicit non-object (scalar or array)\n // type. See https://github.com/scalar/scalar/issues/8593\n const type = (value as { type?: unknown }).type\n const isExplicitNonObject = typeof type === 'string' && type !== 'object'\n\n return isTypeObject(value) || !isExplicitNonObject\n})\n\n/** Determine if array of objects should be rendered */\nconst shouldRenderArrayOfObjects = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n return hasComplexArrayItemsComputed.value\n})\n\n/** Extract enum values from schema or array items */\nconst enumValues = computed(() => getEnumValues(optimizedValue.value))\n\n/** Generate property description from type/format */\nconst propertyDescription = computed(() =>\n getPropertyDescription(optimizedValue.value),\n)\n\n/** Determine if description should be displayed */\nconst displayDescription = computed(() =>\n shouldDisplayDescription(optimizedValue.value, props.description),\n)\n\n/**\n * The schema used to render the object's own properties.\n *\n * Composition keywords are stripped so the nested object renders only its\n * properties. The compositions are rendered separately below; leaving them here\n * would route the nested `Schema` back through `SchemaProperty` and recurse.\n *\n * The `discriminator` is stripped too: its variant selector is part of the\n * composition rendered below (including the one inferred from a bare\n * `discriminator.mapping`), so keeping it here would make the nested `Schema`\n * infer and render a second, identical selector.\n *\n * When the property already renders the description, we also drop it to avoid\n * repeating it in the nested object schema card.\n */\nconst objectSchemaForChildren = computed(() => {\n const value = optimizedValue.value\n if (!value) {\n return value\n }\n\n const {\n oneOf: _oneOf,\n anyOf: _anyOf,\n allOf: _allOf,\n not: _not,\n discriminator: _discriminator,\n ...objectSchema\n } = value as Record<string, unknown>\n\n if (displayDescription.value && 'description' in objectSchema) {\n const { description: _description, ...schemaWithoutDescription } =\n objectSchema\n return schemaWithoutDescription as SchemaObject\n }\n\n return objectSchema as SchemaObject\n})\n\n/** Determine if property heading should be displayed */\nconst shouldDisplayHeadingComputed = computed(() =>\n shouldDisplayHeading(optimizedValue.value, props.name, props.required),\n)\n\n/** Computes which compositions should be rendered and with which values */\nconst compositionsToRender = computed(() =>\n getCompositionsToRender(optimizedValue.value, props.options.document),\n)\nconst getCompositionDiscriminator = (\n composition: CompositionKeyword,\n): DiscriminatorObject | undefined =>\n composition === 'allOf'\n ? (props.schema?.discriminator ?? props.discriminator)\n : props.schema?.discriminator\n\n/**\n * Get resolved array items for rendering (with any `$dynamicRef` bound to the concrete type).\n *\n * When the items are wrapped in a single-item composition (e.g. `items: { allOf: [{ type: 'object', ... }] }`), we\n * flatten that wrapper into its plain form. A composition with a single member is equivalent to that member, so\n * keeping the composition keyword only makes the items render through an extra schema layer, which adds an\n * unnecessary level of nesting and duplicates the item description. See https://github.com/scalar/scalar/issues/5900\n */\nconst resolvedArrayItems = computed(() => {\n const value = arrayValueWithBoundItems.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return undefined\n }\n\n const items = resolve.schema(value.items)\n const hasSingleItemComposition = SINGLE_ITEM_COMPOSITIONS.some(\n (keyword) =>\n Array.isArray(items?.[keyword]) && items[keyword]?.length === 1,\n )\n\n return hasSingleItemComposition ? optimizeValueForDisplay(items) : items\n})\n\n/**\n * Cycle key for the array items schema, derived from the raw (unresolved) items\n * so a self-referential array element is detected as a cycle.\n */\nconst arrayItemsCycleKey = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value)) {\n return undefined\n }\n return getCycleKey(value.items)\n})\n\n/** Check if discriminator matches current property */\nconst isDiscriminatorProperty = computed(() =>\n Boolean(props.name && props.discriminator?.propertyName === props.name),\n)\n</script>\n<template>\n <component\n :is=\"is ?? 'li'\"\n class=\"property\"\n :class=\"[\n `property--level-${level}`,\n {\n 'property--compact': compact,\n 'property--deprecated': optimizedValue?.deprecated,\n },\n ]\">\n <SchemaPropertyHeading\n v-if=\"shouldDisplayHeadingComputed\"\n class=\"group\"\n :enum=\"hasEnum\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :isDiscriminator=\"isDiscriminatorProperty\"\n :modelName=\"modelName\"\n :propertyNames=\"propertyNamesSchema\"\n :required\n :value=\"optimizedValue\">\n <template\n v-if=\"name\"\n #name>\n <WithBreadcrumb\n :breadcrumb=\"shouldHaveLink ? childBreadcrumb : undefined\"\n :eventBus=\"eventBus\">\n <span\n v-if=\"variant === 'patternProperties'\"\n class=\"property-name-pattern-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <span\n v-else-if=\"variant === 'additionalProperties'\"\n class=\"property-name-additional-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <ScalarWrappingText\n v-else\n preset=\"property\"\n :text=\"name\" />\n </WithBreadcrumb>\n </template>\n <template\n v-if=\"optimizedValue?.example !== undefined\"\n #example>\n Example:\n {{ optimizedValue.example }}\n </template>\n </SchemaPropertyHeading>\n\n <!-- Description -->\n <div\n v-if=\"displayDescription || propertyDescription\"\n class=\"property-description\">\n <ScalarMarkdown\n :value=\"displayDescription || propertyDescription || ''\" />\n </div>\n\n <!-- Enum for property names -->\n <SchemaEnums\n v-if=\"propertyNamesEnum && propertyNamesEnum.length > 0\"\n propertyNames\n :value=\"{ enum: propertyNamesEnum } as SchemaObject\" />\n\n <!-- Enum values -->\n <!-- The array items card rendered below already lists these same values. -->\n <SchemaEnums\n v-if=\"enumValues.length > 0 && !shouldRenderArrayOfObjects\"\n :value=\"optimizedValue\" />\n\n <!-- Object -->\n <div\n v-if=\"shouldRenderObjectProperties\"\n class=\"children\">\n <Schema\n :breadcrumb=\"childBreadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"currentCompositionPath\"\n :cycleKey=\"cycleKey\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"objectSchemaForChildren\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Array of objects or nested arrays -->\n <div\n v-if=\"shouldRenderArrayOfObjects && resolvedArrayItems\"\n class=\"children\">\n <Schema\n :compact=\"compact\"\n :compositionPath=\"arrayItemsCompositionPath\"\n :cycleKey=\"arrayItemsCycleKey\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"resolve.schema(resolvedArrayItems)\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Compositions -->\n <SchemaComposition\n v-for=\"compositionData in compositionsToRender\"\n :key=\"compositionData.composition\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"compositionData.composition\"\n :compositionPath=\"currentCompositionPath\"\n :discriminator=\"getCompositionDiscriminator(compositionData.composition)\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"compositionData.value\"\n :schemaContext=\"schemaContext\" />\n <SpecificationExtension :value=\"optimizedValue\" />\n </component>\n</template>\n\n<style scoped>\n.property {\n color: var(--scalar-color-1);\n display: flex;\n flex-direction: column;\n padding: 10px;\n font-size: var(--scalar-small);\n position: relative;\n}\n\n/** Remove top padding for top level schema card */\n.property.property--level-0:has(\n > .property-rule\n > .schema-card\n > .schema-properties.schema-properties-open\n > ul\n > li.property\n ) {\n padding-top: 0;\n}\n\n.property--compact.property--level-0,\n.property--compact.property--level-1 {\n padding: 10px 0;\n}\n\n.composition-panel .property.property.property.property--level-0 {\n padding: 0px;\n}\n\n.property--compact.property--level-0\n .composition-panel\n .property--compact.property--level-1 {\n padding: 8px;\n}\n\n/* if a property doesn't have a heading, remove the top padding */\n.property:has(> .property-rule:nth-of-type(1)):not(.property--compact) {\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n.property--deprecated {\n background: repeating-linear-gradient(\n -45deg,\n var(--scalar-background-2) 0,\n var(--scalar-background-2) 2px,\n transparent 2px,\n transparent 5px\n );\n background-size: 100%;\n}\n\n.property--deprecated > * {\n opacity: 0.75;\n}\n\n.property-description {\n margin-top: 6px;\n line-height: 1.4;\n font-size: var(--scalar-small);\n}\n\n.property-description:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n:deep(.property-description) * {\n color: var(--scalar-color-2) !important;\n}\n\n.property:not(:last-of-type) {\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-description + .children,\n.children + .property-rule {\n margin-top: 9px;\n}\n\n.children {\n display: flex;\n flex-direction: column;\n}\n\n.children .property--compact.property--level-1 {\n padding: 12px;\n}\n\n.property-example-value {\n all: unset;\n font-family: var(--scalar-font-code);\n padding: 6px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-rule {\n border-radius: var(--scalar-radius-lg);\n display: flex;\n flex-direction: column;\n}\n\n.property--level-2 :deep(.relative > button) {\n left: -2rem;\n}\n\n.property-rule\n :deep(\n .composition-panel\n .schema-card--level-1\n > .schema-properties.schema-properties-open\n ) {\n border-radius: 0 0 var(--scalar-radius-lg) var(--scalar-radius-lg);\n}\n\n.property-rule\n :deep(.composition-panel > .schema-card > .schema-card-description) {\n padding: 10px;\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n\n & + .schema-properties {\n margin-top: 0;\n }\n}\n\n.property-example {\n background: transparent;\n border: none;\n display: flex;\n flex-direction: row;\n gap: 8px;\n}\n\n.property-example-label,\n.property-example-value {\n padding: 3px 0 0 0;\n}\n\n.property-example-value {\n background: var(--scalar-background-2);\n border-top: 0;\n border-radius: var(--scalar-radius);\n padding: 3px 4px;\n}\n\n.property-name {\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-semibold);\n}\n\n.property-name-additional-properties::before,\n.property-name-pattern-properties::before {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n display: inline-block;\n padding: 2px 4px;\n border-radius: var(--scalar-radius);\n color: var(--scalar-color-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n background-color: var(--scalar-background-2);\n margin-right: 4px;\n}\n\n.property-name-pattern-properties::before {\n content: 'regex';\n}\n\n.property-name-additional-properties,\n.property-name-pattern-properties {\n border: 1px dashed var(--scalar-border-color);\n color: var(--scalar-color-accent);\n display: inline-block;\n padding: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaProperty.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport {\n isDynamicRef,\n resolveDynamicRef,\n} from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, type Component } from 'vue'\n\nimport { WithBreadcrumb } from '@/components/Anchor'\nimport {\n resolveDynamicSchema,\n useDynamicScope,\n} from '@/components/Content/Schema/helpers/dynamic-scope'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getCycleKey } from '@/components/Content/Schema/helpers/schema-cycle'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport { getCompositionsToRender } from './helpers/get-compositions-to-render'\nimport { getEnumValues } from './helpers/get-enum-values'\nimport { getPropertyDescription } from './helpers/get-property-description'\nimport { hasComplexArrayItems } from './helpers/has-complex-array-items'\nimport { optimizeValueForDisplay } from './helpers/optimize-value-for-display'\nimport type { CompositionKeyword } from './helpers/schema-composition'\nimport { shouldDisplayDescription } from './helpers/should-display-description'\nimport { shouldDisplayHeading } from './helpers/should-display-heading'\nimport Schema from './Schema.vue'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaEnums from './SchemaEnums.vue'\nimport SchemaPropertyHeading from './SchemaPropertyHeading.vue'\n\n/**\n * Note: We're taking in a prop called `value` which should be a JSON Schema.\n *\n * We're using `optimizeValueForDisplay` to merge null types in compositions (anyOf, allOf, oneOf, not).\n * So you should basically use the optimizedValue everywhere in the component.\n */\n\n/** Composition keywords that hold a list of schemas and can be flattened when they contain a single member. */\nconst SINGLE_ITEM_COMPOSITIONS = ['oneOf', 'anyOf', 'allOf'] as const\n\nconst props = withDefaults(\n defineProps<{\n is?: string | Component\n schema: SchemaObject | undefined\n noncollapsible?: boolean\n level?: number\n name?: string\n required?: boolean\n compact?: boolean\n discriminator?: DiscriminatorObject\n description?: string\n hideModelNames?: boolean\n hideHeading?: boolean\n /** When the root schema was resolved from a $ref, pass the ref name for display (e.g. \"Data\"). */\n modelName?: string | null\n variant?: 'additionalProperties' | 'patternProperties'\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n /** Enum values for property names (from JSON Schema propertyNames keyword). */\n propertyNamesEnum?: string[]\n /** Resolved propertyNames schema, used to show key constraints like `format`. */\n propertyNamesSchema?: SchemaObject\n /** When \"requestBody\", composition selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /** Internal path segment for this property when building nested composition keys */\n compositionPathSegment?: string\n /** Stable identity of this property's schema, used for cycle detection. */\n cycleKey?: unknown\n }>(),\n {\n level: 0,\n required: false,\n compact: false,\n hideModelNames: false,\n },\n)\n\n/** The dynamic scope inherited from the enclosing schema resources, used to bind `$dynamicRef`s. */\nconst dynamicScope = useDynamicScope()\n\n/**\n * Simplified composition with `null` type.\n *\n * A top-level `$dynamicRef` (e.g. a linked-list `next` node) is bound to its concrete type via the\n * dynamic scope first; for ordinary schemas this is a no-op.\n */\nconst optimizedValue = computed(() =>\n optimizeValueForDisplay(resolveDynamicSchema(props.schema, dynamicScope)),\n)\n\nconst childBreadcrumb = computed<string[] | undefined>(() =>\n props.breadcrumb\n ? // A named property extends the breadcrumb with its own name. A nameless\n // container (e.g. a response object, rendered without a name to avoid a\n // duplicate heading) passes its breadcrumb straight through so its\n // properties stay linkable.\n props.name\n ? [...props.breadcrumb, props.name]\n : props.breadcrumb\n : undefined,\n)\n\nconst currentCompositionPath = computed<string[]>(() =>\n props.compositionPathSegment\n ? [...(props.compositionPath ?? []), props.compositionPathSegment]\n : (props.compositionPath ?? []),\n)\n\nconst arrayItemsCompositionPath = computed<string[]>(() => [\n ...currentCompositionPath.value,\n 'items',\n])\n\nconst shouldHaveLink = computed(() => props.level <= 2)\n\n/**\n * The array schema used for item inspection, with a `$dynamicRef` item bound to its concrete type.\n *\n * Returns the schema unchanged unless `items` is a `$dynamicRef` that resolves against the dynamic\n * scope, so ordinary arrays (including `$ref` items) keep their existing behavior exactly.\n */\nconst arrayValueWithBoundItems = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || !isDynamicRef(value.items)) {\n return value\n }\n\n const bound = resolveDynamicRef(value.items.$dynamicRef, dynamicScope)\n return bound ? ({ ...value, items: bound } as SchemaObject) : value\n})\n\n/** Checks if array items have complex structure */\nconst hasComplexArrayItemsComputed = computed(() =>\n hasComplexArrayItems(arrayValueWithBoundItems.value),\n)\n\n/** Check if enum should be displayed (from value schema or from propertyNames) */\nconst hasEnum = computed(() => enumValues.value.length > 0)\n\n/** Determine if object properties should be displayed */\nconst shouldRenderObjectProperties = computed(() => {\n const value = optimizedValue.value\n if (!value) {\n return false\n }\n\n if (!('properties' in value || 'additionalProperties' in value)) {\n return false\n }\n\n // `allOf` already merges the factored-out sibling `properties` into its\n // rendered result (see `mergeAllOfSchemas`), so rendering a separate object\n // block here would show those properties twice. Let the composition handle it.\n if ('allOf' in value) {\n return false\n }\n\n // A schema may factor its common `properties` out to the top level alongside\n // a composition keyword (anyOf/oneOf/not), as described in the JSON Schema\n // \"factoring schemas\" guide. `isTypeObject` deliberately rejects such schemas\n // so the composition is rendered, but the factored-out properties must still\n // show. Unlike `allOf`, these compositions do not merge sibling properties.\n // Render them unless the schema is an explicit non-object (scalar or array)\n // type. See https://github.com/scalar/scalar/issues/8593\n const type = (value as { type?: unknown }).type\n const isExplicitNonObject = typeof type === 'string' && type !== 'object'\n\n return isTypeObject(value) || !isExplicitNonObject\n})\n\n/** Determine if array of objects should be rendered */\nconst shouldRenderArrayOfObjects = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n return hasComplexArrayItemsComputed.value\n})\n\n/** Extract enum values from schema or array items */\nconst enumValues = computed(() => getEnumValues(optimizedValue.value))\n\n/** Generate property description from type/format */\nconst propertyDescription = computed(() =>\n getPropertyDescription(optimizedValue.value),\n)\n\n/** Determine if description should be displayed */\nconst displayDescription = computed(() =>\n shouldDisplayDescription(optimizedValue.value, props.description),\n)\n\n/**\n * The schema used to render the object's own properties.\n *\n * Composition keywords are stripped so the nested object renders only its\n * properties. The compositions are rendered separately below; leaving them here\n * would route the nested `Schema` back through `SchemaProperty` and recurse.\n *\n * The `discriminator` is stripped too: its variant selector is part of the\n * composition rendered below (including the one inferred from a bare\n * `discriminator.mapping`), so keeping it here would make the nested `Schema`\n * infer and render a second, identical selector.\n *\n * When the property already renders the description, we also drop it to avoid\n * repeating it in the nested object schema card.\n */\nconst objectSchemaForChildren = computed(() => {\n const value = optimizedValue.value\n if (!value) {\n return value\n }\n\n const {\n oneOf: _oneOf,\n anyOf: _anyOf,\n allOf: _allOf,\n not: _not,\n discriminator: _discriminator,\n ...objectSchema\n } = value as Record<string, unknown>\n\n if (displayDescription.value && 'description' in objectSchema) {\n const { description: _description, ...schemaWithoutDescription } =\n objectSchema\n return schemaWithoutDescription as SchemaObject\n }\n\n return objectSchema as SchemaObject\n})\n\n/** Determine if property heading should be displayed */\nconst shouldDisplayHeadingComputed = computed(() =>\n shouldDisplayHeading(optimizedValue.value, props.name, props.required),\n)\n\n/** Computes which compositions should be rendered and with which values */\nconst compositionsToRender = computed(() =>\n getCompositionsToRender(optimizedValue.value, props.options.document),\n)\nconst getCompositionDiscriminator = (\n composition: CompositionKeyword,\n): DiscriminatorObject | undefined =>\n composition === 'allOf'\n ? (props.schema?.discriminator ?? props.discriminator)\n : props.schema?.discriminator\n\n/**\n * Get resolved array items for rendering (with any `$dynamicRef` bound to the concrete type).\n *\n * When the items are wrapped in a single-item composition (e.g. `items: { allOf: [{ type: 'object', ... }] }`), we\n * flatten that wrapper into its plain form. A composition with a single member is equivalent to that member, so\n * keeping the composition keyword only makes the items render through an extra schema layer, which adds an\n * unnecessary level of nesting and duplicates the item description. See https://github.com/scalar/scalar/issues/5900\n */\nconst resolvedArrayItems = computed(() => {\n const value = arrayValueWithBoundItems.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return undefined\n }\n\n const items = resolve.schema(value.items)\n const hasSingleItemComposition = SINGLE_ITEM_COMPOSITIONS.some(\n (keyword) =>\n Array.isArray(items?.[keyword]) && items[keyword]?.length === 1,\n )\n\n return hasSingleItemComposition ? optimizeValueForDisplay(items) : items\n})\n\n/**\n * Cycle key for the array items schema, derived from the raw (unresolved) items\n * so a self-referential array element is detected as a cycle.\n */\nconst arrayItemsCycleKey = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value)) {\n return undefined\n }\n return getCycleKey(value.items)\n})\n\n/** Check if discriminator matches current property */\nconst isDiscriminatorProperty = computed(() =>\n Boolean(props.name && props.discriminator?.propertyName === props.name),\n)\n</script>\n<template>\n <component\n :is=\"is ?? 'li'\"\n class=\"property\"\n :class=\"[\n `property--level-${level}`,\n {\n 'property--compact': compact,\n 'property--deprecated': optimizedValue?.deprecated,\n },\n ]\">\n <SchemaPropertyHeading\n v-if=\"shouldDisplayHeadingComputed\"\n class=\"group\"\n :enum=\"hasEnum\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :isDiscriminator=\"isDiscriminatorProperty\"\n :modelLinkOptions=\"{\n hideModels: options.hideModels,\n document: options.document,\n }\"\n :modelName=\"modelName\"\n :propertyNames=\"propertyNamesSchema\"\n :required\n :value=\"optimizedValue\">\n <template\n v-if=\"name\"\n #name>\n <WithBreadcrumb\n :breadcrumb=\"shouldHaveLink ? childBreadcrumb : undefined\"\n :eventBus=\"eventBus\">\n <span\n v-if=\"variant === 'patternProperties'\"\n class=\"property-name-pattern-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <span\n v-else-if=\"variant === 'additionalProperties'\"\n class=\"property-name-additional-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <ScalarWrappingText\n v-else\n preset=\"property\"\n :text=\"name\" />\n </WithBreadcrumb>\n </template>\n <template\n v-if=\"optimizedValue?.example !== undefined\"\n #example>\n Example:\n {{ optimizedValue.example }}\n </template>\n </SchemaPropertyHeading>\n\n <!-- Description -->\n <div\n v-if=\"displayDescription || propertyDescription\"\n class=\"property-description\">\n <ScalarMarkdown\n :value=\"displayDescription || propertyDescription || ''\" />\n </div>\n\n <!-- Enum for property names -->\n <SchemaEnums\n v-if=\"propertyNamesEnum && propertyNamesEnum.length > 0\"\n propertyNames\n :value=\"{ enum: propertyNamesEnum } as SchemaObject\" />\n\n <!-- Enum values -->\n <!-- The array items card rendered below already lists these same values. -->\n <SchemaEnums\n v-if=\"enumValues.length > 0 && !shouldRenderArrayOfObjects\"\n :value=\"optimizedValue\" />\n\n <!-- Object -->\n <div\n v-if=\"shouldRenderObjectProperties\"\n class=\"children\">\n <Schema\n :breadcrumb=\"childBreadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"currentCompositionPath\"\n :cycleKey=\"cycleKey\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"objectSchemaForChildren\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Array of objects or nested arrays -->\n <div\n v-if=\"shouldRenderArrayOfObjects && resolvedArrayItems\"\n class=\"children\">\n <Schema\n :compact=\"compact\"\n :compositionPath=\"arrayItemsCompositionPath\"\n :cycleKey=\"arrayItemsCycleKey\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"resolve.schema(resolvedArrayItems)\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Compositions -->\n <SchemaComposition\n v-for=\"compositionData in compositionsToRender\"\n :key=\"compositionData.composition\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"compositionData.composition\"\n :compositionPath=\"currentCompositionPath\"\n :discriminator=\"getCompositionDiscriminator(compositionData.composition)\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"compositionData.value\"\n :schemaContext=\"schemaContext\" />\n <SpecificationExtension :value=\"optimizedValue\" />\n </component>\n</template>\n\n<style scoped>\n.property {\n color: var(--scalar-color-1);\n display: flex;\n flex-direction: column;\n padding: 10px;\n font-size: var(--scalar-small);\n position: relative;\n}\n\n/** Remove top padding for top level schema card */\n.property.property--level-0:has(\n > .property-rule\n > .schema-card\n > .schema-properties.schema-properties-open\n > ul\n > li.property\n ) {\n padding-top: 0;\n}\n\n.property--compact.property--level-0,\n.property--compact.property--level-1 {\n padding: 10px 0;\n}\n\n.composition-panel .property.property.property.property--level-0 {\n padding: 0px;\n}\n\n.property--compact.property--level-0\n .composition-panel\n .property--compact.property--level-1 {\n padding: 8px;\n}\n\n/* if a property doesn't have a heading, remove the top padding */\n.property:has(> .property-rule:nth-of-type(1)):not(.property--compact) {\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n.property--deprecated {\n background: repeating-linear-gradient(\n -45deg,\n var(--scalar-background-2) 0,\n var(--scalar-background-2) 2px,\n transparent 2px,\n transparent 5px\n );\n background-size: 100%;\n}\n\n.property--deprecated > * {\n opacity: 0.75;\n}\n\n.property-description {\n margin-top: 6px;\n line-height: 1.4;\n font-size: var(--scalar-small);\n}\n\n.property-description:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n:deep(.property-description) * {\n color: var(--scalar-color-2) !important;\n}\n\n.property:not(:last-of-type) {\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-description + .children,\n.children + .property-rule {\n margin-top: 9px;\n}\n\n.children {\n display: flex;\n flex-direction: column;\n}\n\n.children .property--compact.property--level-1 {\n padding: 12px;\n}\n\n.property-example-value {\n all: unset;\n font-family: var(--scalar-font-code);\n padding: 6px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-rule {\n border-radius: var(--scalar-radius-lg);\n display: flex;\n flex-direction: column;\n}\n\n.property--level-2 :deep(.relative > button) {\n left: -2rem;\n}\n\n.property-rule\n :deep(\n .composition-panel\n .schema-card--level-1\n > .schema-properties.schema-properties-open\n ) {\n border-radius: 0 0 var(--scalar-radius-lg) var(--scalar-radius-lg);\n}\n\n.property-rule\n :deep(.composition-panel > .schema-card > .schema-card-description) {\n padding: 10px;\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n\n & + .schema-properties {\n margin-top: 0;\n }\n}\n\n.property-example {\n background: transparent;\n border: none;\n display: flex;\n flex-direction: row;\n gap: 8px;\n}\n\n.property-example-label,\n.property-example-value {\n padding: 3px 0 0 0;\n}\n\n.property-example-value {\n background: var(--scalar-background-2);\n border-top: 0;\n border-radius: var(--scalar-radius);\n padding: 3px 4px;\n}\n\n.property-name {\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-semibold);\n}\n\n.property-name-additional-properties::before,\n.property-name-pattern-properties::before {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n display: inline-block;\n padding: 2px 4px;\n border-radius: var(--scalar-radius);\n color: var(--scalar-color-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n background-color: var(--scalar-background-2);\n margin-right: 4px;\n}\n\n.property-name-pattern-properties::before {\n content: 'regex';\n}\n\n.property-name-additional-properties,\n.property-name-pattern-properties {\n border: 1px dashed var(--scalar-border-color);\n color: var(--scalar-color-accent);\n display: inline-block;\n padding: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":""}
@@ -212,6 +212,10 @@ var SchemaProperty_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
212
212
  eventBus: __props.eventBus,
213
213
  hideModelNames: __props.hideModelNames,
214
214
  isDiscriminator: isDiscriminatorProperty.value,
215
+ modelLinkOptions: {
216
+ hideModels: __props.options.hideModels,
217
+ document: __props.options.document
218
+ },
215
219
  modelName: __props.modelName,
216
220
  propertyNames: __props.propertyNamesSchema,
217
221
  required: __props.required,
@@ -245,6 +249,7 @@ var SchemaProperty_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
245
249
  "eventBus",
246
250
  "hideModelNames",
247
251
  "isDiscriminator",
252
+ "modelLinkOptions",
248
253
  "modelName",
249
254
  "propertyNames",
250
255
  "required",