@scalar/api-reference 1.31.3 → 1.31.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/browser/standalone.js +15752 -15637
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.js +6 -6
  5. package/dist/components/ApiReferenceLayout.vue.d.ts +6 -3
  6. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.js +4 -2
  8. package/dist/components/ApiReferenceLayout.vue2.js +230 -153
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +1 -1
  11. package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Introduction/Description.vue.js +2 -2
  13. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  15. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaComposition.vue.js +81 -101
  17. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  19. package/dist/components/Content/Schema/SchemaProperty.vue2.js +114 -105
  20. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +35 -35
  21. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
  22. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +17 -15
  23. package/dist/components/Content/Schema/helpers/schema-name.js +13 -21
  24. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
  26. package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
  27. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  28. package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
  29. package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
  30. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Tag/TagList.vue.js +35 -34
  32. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
  33. package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
  34. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  35. package/dist/components/GettingStarted.vue.js +3 -3
  36. package/dist/components/GettingStarted.vue2.js +23 -23
  37. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
  38. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  39. package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
  40. package/dist/components/Section/CompactSection.vue.js +2 -2
  41. package/dist/components/Section/CompactSection.vue2.js +6 -6
  42. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  44. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  45. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  46. package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
  47. package/dist/esm.d.ts.map +1 -1
  48. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
  49. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
  50. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  51. package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
  52. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  53. package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
  54. package/dist/features/DownloadLink/DownloadLink.vue2.js +21 -21
  55. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  56. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  57. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
  58. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  59. package/dist/features/Search/SearchButton.vue.js +2 -2
  60. package/dist/features/Search/SearchButton.vue2.js +16 -16
  61. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  62. package/dist/features/Search/SearchModal.vue.js +2 -2
  63. package/dist/features/Search/SearchModal.vue2.js +1 -1
  64. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  65. package/dist/features/Search/useSearchIndex.js +29 -28
  66. package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
  67. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
  68. package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
  69. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
  70. package/dist/features/sidebar/index.d.ts +2 -0
  71. package/dist/features/sidebar/index.d.ts.map +1 -0
  72. package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
  73. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
  74. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
  75. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
  76. package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
  77. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
  78. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
  79. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
  80. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
  81. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
  82. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
  83. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
  84. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
  85. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
  86. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
  87. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
  88. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
  89. package/dist/features/traverse-schema/index.d.ts +4 -0
  90. package/dist/features/traverse-schema/index.d.ts.map +1 -0
  91. package/dist/features/traverse-schema/types.d.ts +51 -0
  92. package/dist/features/traverse-schema/types.d.ts.map +1 -0
  93. package/dist/helpers/parse.d.ts.map +1 -1
  94. package/dist/helpers/parse.js +16 -16
  95. package/dist/hooks/useNavState.d.ts +9 -4
  96. package/dist/hooks/useNavState.d.ts.map +1 -1
  97. package/dist/hooks/useNavState.js +31 -29
  98. package/dist/hooks/useSidebar.d.ts.map +1 -1
  99. package/dist/hooks/useSidebar.js +69 -68
  100. package/dist/index.d.ts +0 -3
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +37 -44
  103. package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
  104. package/dist/libs/openapi.js +32 -32
  105. package/dist/stores/useHttpClientStore.js +9 -8
  106. package/dist/style.css +1 -1
  107. package/dist/types.d.ts +0 -1
  108. package/dist/types.d.ts.map +1 -1
  109. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +40 -0
  110. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -0
  111. package/dist/v2/ApiReferenceWorkspace.vue.js +65 -0
  112. package/dist/v2/ApiReferenceWorkspace.vue3.js +5 -0
  113. package/dist/v2/events/definitions.d.ts +35 -0
  114. package/dist/v2/events/definitions.d.ts.map +1 -0
  115. package/dist/v2/events/index.d.ts +3 -0
  116. package/dist/v2/events/index.d.ts.map +1 -0
  117. package/dist/v2/events/listeners.d.ts +8 -0
  118. package/dist/v2/events/listeners.d.ts.map +1 -0
  119. package/dist/v2/events/listeners.js +15 -0
  120. package/dist/v2/styles.d.ts +2 -0
  121. package/dist/v2/styles.d.ts.map +1 -0
  122. package/package.json +13 -11
  123. package/dist/components/HttpMethod/constants.d.ts +0 -9
  124. package/dist/components/HttpMethod/constants.d.ts.map +0 -1
  125. package/dist/components/HttpMethod/constants.js +0 -36
  126. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
  127. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
  128. package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
  129. package/dist/components/Layouts/ClassicLayout.vue.d.ts +0 -23
  130. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +0 -1
  131. package/dist/components/Layouts/ClassicLayout.vue.js +0 -67
  132. package/dist/components/Layouts/ClassicLayout.vue2.js +0 -4
  133. package/dist/components/Layouts/Layouts.vue.d.ts +0 -26
  134. package/dist/components/Layouts/Layouts.vue.d.ts.map +0 -1
  135. package/dist/components/Layouts/Layouts.vue.js +0 -35
  136. package/dist/components/Layouts/Layouts.vue2.js +0 -4
  137. package/dist/components/Layouts/ModernLayout.vue.d.ts +0 -23
  138. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +0 -1
  139. package/dist/components/Layouts/ModernLayout.vue.js +0 -8
  140. package/dist/components/Layouts/ModernLayout.vue2.js +0 -102
  141. package/dist/components/Layouts/index.d.ts +0 -2
  142. package/dist/components/Layouts/index.d.ts.map +0 -1
  143. package/dist/components/SingleApiReference.vue.d.ts +0 -29
  144. package/dist/components/SingleApiReference.vue.d.ts.map +0 -1
  145. package/dist/components/SingleApiReference.vue.js +0 -57
  146. package/dist/components/SingleApiReference.vue3.js +0 -5
  147. package/dist/helpers/freeze-element.d.ts +0 -11
  148. package/dist/helpers/freeze-element.d.ts.map +0 -1
  149. package/dist/helpers/freeze-element.js +0 -20
  150. package/dist/helpers/is-mac-os.d.ts +0 -5
  151. package/dist/helpers/is-mac-os.d.ts.map +0 -1
  152. package/dist/helpers/is-mac-os.js +0 -4
  153. package/dist/helpers/measure.d.ts +0 -21
  154. package/dist/helpers/measure.d.ts.map +0 -1
  155. package/dist/helpers/measure.js +0 -7
  156. package/dist/helpers/scroll-to-id.d.ts +0 -7
  157. package/dist/helpers/scroll-to-id.d.ts.map +0 -1
  158. package/dist/helpers/scroll-to-id.js +0 -21
  159. package/dist/helpers/sleep.d.ts +0 -6
  160. package/dist/helpers/sleep.d.ts.map +0 -1
  161. package/dist/helpers/sleep.js +0 -4
  162. package/dist/legacy/helpers/index.d.ts +0 -2
  163. package/dist/legacy/helpers/index.d.ts.map +0 -1
  164. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
  165. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
  166. package/dist/legacy/helpers/normalizeRequestMethod.js +0 -10
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tag.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/get-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,qEAAqE;AACrE,eAAO,MAAM,MAAM,aAAc,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,MAAM,wDAWhF,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { TransformedOperation } from '@scalar/types/legacy';
3
+ /** Temp helper for converting transformed operation to operationId payload */
4
+ export declare const operationIdParams: (transformedOperation: TransformedOperation) => {
5
+ path: string;
6
+ method: OpenAPIV3_1.HttpMethods;
7
+ } & OpenAPIV3_1.OperationObject;
8
+ //# sourceMappingURL=operation-id-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-id-params.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/operation-id-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,yBACN,oBAAoB,KACzC;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,CAAC,WAAW,CAAA;CAChC,GAAG,WAAW,CAAC,eAId,CAAA"}
@@ -0,0 +1,8 @@
1
+ const o = (t) => ({
2
+ ...t.information,
3
+ path: t.path,
4
+ method: t.httpVerb.toLowerCase()
5
+ });
6
+ export {
7
+ o as operationIdParams
8
+ };
@@ -0,0 +1,9 @@
1
+ import type { TraversedDescription } from '../../../features/traverse-schema/types';
2
+ import type { Heading } from '@scalar/types/legacy';
3
+ export declare const DEFAULT_INTRODUCTION_SLUG = "introduction";
4
+ /**
5
+ * Creates sidebar entries from markdown headings in the OpenAPI description.
6
+ * Only includes the top two levels of headings for a clean hierarchy.
7
+ */
8
+ export declare const traverseDescription: (description: string | undefined, titlesMap: Map<string, string>, getHeadingId: (heading: Heading) => string) => TraversedDescription[];
9
+ //# sourceMappingURL=traverse-description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-description.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAE5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gBACjB,MAAM,GAAG,SAAS,aAEpB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAChB,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,KACzC,oBAAoB,EAmDtB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { TraverseSpecOptions, TraversedEntry } from '../../../features/traverse-schema/types';
3
+ /**
4
+ * Travers the OpenAPI Document and ensure we only do it once
5
+ *
6
+ * We are generating the following:
7
+ * - the sidebar
8
+ * - the search index (todo)
9
+ *
10
+ * Currently its called by createSidebar, but we can move this into the de-reference process as a plugin for even more gains
11
+ */
12
+ export declare const traverseDocument: (document: OpenAPIV3_1.Document, { config, getHeadingId, getOperationId, getWebhookId, getModelId, getTagId }: TraverseSpecOptions) => {
13
+ entries: TraversedEntry[];
14
+ titles: Map<string, string>;
15
+ };
16
+ //# sourceMappingURL=traverse-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-document.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAOxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAE3F;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,aACjB,WAAW,CAAC,QAAQ,gFACgD,mBAAmB;;;CA6ClG,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { TraversedOperation } from '../../../features/traverse-schema/types';
3
+ import type { UseNavState } from '../../../hooks/useNavState.js';
4
+ /**
5
+ * Traverse the paths of the spec and build a map of tags and operations
6
+ *
7
+ * Default tag is to match what we have now we can improve later
8
+ * TODO: filter out internal and scalar-ignore tags
9
+ */
10
+ export declare const traversePaths: (content: OpenAPIV3_1.Document, tagsDict: Map<string, OpenAPIV3_1.TagObject>, titlesMap: Map<string, string>, getOperationId: UseNavState["getOperationId"]) => Map<string, TraversedOperation[]>;
11
+ //# sourceMappingURL=traverse-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-paths.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAuBtD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YACf,WAAW,CAAC,QAAQ,YAEnB,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,aAEjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,kBACd,WAAW,CAAC,gBAAgB,CAAC,KAC5C,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAiClC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { TraversedSchema } from '../../../features/traverse-schema/types';
2
+ import type { UseNavState } from '../../../hooks/useNavState.js';
3
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
4
+ /** Traverse components.schemas to create entries for models */
5
+ export declare const traverseSchemas: (content: OpenAPIV3_1.Document, titlesMap: Map<string, string>, getModelId: UseNavState["getModelId"]) => TraversedSchema[];
6
+ //# sourceMappingURL=traverse-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAoBxD,+DAA+D;AAC/D,eAAO,MAAM,eAAe,YACjB,WAAW,CAAC,QAAQ,aAElB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAClB,WAAW,CAAC,YAAY,CAAC,KACpC,eAAe,EAcjB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
3
+ import type { TraversedEntry } from '../../../features/traverse-schema/types';
4
+ import type { UseNavState } from '../../../hooks/useNavState.js';
5
+ type Options = Pick<UseNavState, 'getTagId'> & Pick<ApiReferenceConfiguration, 'tagsSorter' | 'operationsSorter'>;
6
+ /** Traverses our tags map creates entries, also handles sorting and tagGroups */
7
+ export declare const traverseTags: (content: OpenAPIV3_1.Document, tagsMap: Map<string, TraversedEntry[]>, tagsDict: Map<string, OpenAPIV3_1.TagObject>, titlesMap: Map<string, string>, { getTagId, tagsSorter, operationsSorter }: Options) => TraversedEntry[];
8
+ export {};
9
+ //# sourceMappingURL=traverse-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-tags.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,kCAAkC,CAAA;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGtD,KAAK,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC,yBAAyB,EAAE,YAAY,GAAG,kBAAkB,CAAC,CAAA;AAuGjH,iFAAiF;AACjF,eAAO,MAAM,YAAY,YACd,WAAW,CAAC,QAAQ,WAEpB,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,YAE5B,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,aAEjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,8CACc,OAAO,KAClD,cAAc,EAyBhB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { TraversedEntry, TraversedWebhook } from '../../../features/traverse-schema/types';
3
+ import type { UseNavState } from '../../../hooks/useNavState.js';
4
+ /** When traversing webhooks, we pass in the tags in from operations to save on memory */
5
+ export declare const traverseWebhooks: (content: OpenAPIV3_1.Document, tagsMap: Map<string, TraversedEntry[]>, tagsDict: Map<string, OpenAPIV3_1.TagObject>, titlesMap: Map<string, string>, getWebhookId: UseNavState["getWebhookId"]) => TraversedWebhook[];
6
+ //# sourceMappingURL=traverse-webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-webhooks.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAyBtD,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,YAClB,WAAW,CAAC,QAAQ,WAEpB,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,YAE5B,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,aAEjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAChB,WAAW,CAAC,cAAc,CAAC,KACxC,gBAAgB,EA+BlB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export type { TraverseSpecOptions } from './types';
2
+ export { traverseDocument } from './helpers/traverse-document';
3
+ export { operationIdParams } from './helpers/operation-id-params.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/traverse-schema/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA"}
@@ -0,0 +1,51 @@
1
+ import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
+ import type { UseNavState } from '../../hooks/useNavState.js';
3
+ import type { Ref } from 'vue';
4
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
5
+ /** Description entry returned form traversing the document */
6
+ export type TraversedDescription = {
7
+ id: string;
8
+ title: string;
9
+ children?: TraversedDescription[];
10
+ };
11
+ /** Operation entry returned form traversing the document */
12
+ export type TraversedOperation = {
13
+ id: string;
14
+ title: string;
15
+ method: OpenAPIV3_1.HttpMethods;
16
+ path: string;
17
+ operation: OpenAPIV3_1.OperationObject;
18
+ };
19
+ /** Model entry returned form traversing the document */
20
+ export type TraversedSchema = {
21
+ id: string;
22
+ title: string;
23
+ name: string;
24
+ schema: OpenAPIV3_1.SchemaObject;
25
+ };
26
+ /** Tag entry returned form traversing the document, includes tagGroups */
27
+ export type TraversedTag = {
28
+ id: string;
29
+ title: string;
30
+ name: string;
31
+ children?: TraversedEntry[];
32
+ tag: OpenAPIV3_1.TagObject;
33
+ isGroup: boolean;
34
+ };
35
+ /** Webhook entry returned form traversing the document, basically the same as an operaation but with name instead of path */
36
+ export type TraversedWebhook = {
37
+ id: string;
38
+ title: string;
39
+ method: OpenAPIV3_1.HttpMethods;
40
+ name: string;
41
+ webhook: OpenAPIV3_1.OperationObject;
42
+ };
43
+ /** Entries returned form traversing the document */
44
+ export type TraversedEntry = TraversedDescription | TraversedOperation | TraversedSchema | TraversedTag | TraversedWebhook;
45
+ /** Create sidebar options */
46
+ export type TraverseSpecOptions = {
47
+ config: Ref<ApiReferenceConfiguration>;
48
+ /** You can optionally pass in these refs in case you need them before the hook is instantiated */
49
+ isSidebarOpen?: Ref<boolean>;
50
+ } & Pick<UseNavState, 'getHeadingId' | 'getModelId' | 'getOperationId' | 'getSectionId' | 'getTagId' | 'getWebhookId'>;
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/traverse-schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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AAA;IACZ,OAAO,EAAE,WAAW,CAAC,eAAe,CAAA;CACrC,CAAA;AAED,oDAAoD;AACpD,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,gBAAgB,CAAA;AAEpB,6BAA6B;AAC7B,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,GAAG,CAAC,yBAAyB,CAAC,CAAA;IACtC,kGAAkG;IAClG,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CAC7B,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,YAAY,GAAG,gBAAgB,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAOhD;;;;GAIG;AACH,eAAO,MAAM,KAAK,yBAA0B,WAAW,CAAC,QAAQ,KAAG,OAAO,CAAC,IAAI,CAmB9E,CAAA"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD;;;;GAIG;AACH,eAAO,MAAM,KAAK,yBAA0B,WAAW,CAAC,QAAQ,KAAG,OAAO,CAAC,IAAI,CAmB9E,CAAA"}
@@ -1,7 +1,7 @@
1
- import { shouldIgnoreEntity as u } from "@scalar/oas-utils/helpers";
1
+ import { shouldIgnoreEntity as m } from "@scalar/oas-utils/helpers";
2
2
  import { createEmptySpecification as w } from "../libs/openapi.js";
3
- import { normalizeRequestMethod as R } from "../legacy/helpers/normalizeRequestMethod.js";
4
- import { validRequestMethods as q } from "../legacy/fixtures/httpRequestMethods.js";
3
+ import { normalizeHttpMethod as P } from "@scalar/helpers/http/normalize-http-method";
4
+ import { validRequestMethods as A } from "../legacy/fixtures/httpRequestMethods.js";
5
5
  const C = (c) => new Promise(async (t, p) => {
6
6
  try {
7
7
  return t(b(c || w()));
@@ -17,22 +17,22 @@ const C = (c) => new Promise(async (t, p) => {
17
17
  return Object.keys(t.webhooks ?? {}).forEach((s) => {
18
18
  var d;
19
19
  Object.keys(((d = t.webhooks) == null ? void 0 : d[s]) ?? {}).forEach((r) => {
20
- var n, m, h, g;
20
+ var n, u, h, g;
21
21
  const e = (n = t.webhooks) == null ? void 0 : n[s][r];
22
- if (!(!e || u(e))) {
22
+ if (!(!e || m(e))) {
23
23
  if (Array.isArray(e.tags)) {
24
- const o = (m = e.tags) == null ? void 0 : m.map(
24
+ const o = (u = e.tags) == null ? void 0 : u.map(
25
25
  (a) => {
26
26
  var y;
27
27
  return (y = t.tags) == null ? void 0 : y.find((i) => i.name === a);
28
28
  }
29
29
  );
30
- if (e.tags = o == null ? void 0 : o.filter((a) => !u(a)), o != null && o.some((a) => u(a)))
30
+ if (e.tags = o == null ? void 0 : o.filter((a) => !m(a)), o != null && o.some((a) => m(a)))
31
31
  return;
32
32
  }
33
33
  p[s] === void 0 && (p[s] = {}), p[s][r] = {
34
34
  // Transformed data
35
- httpVerb: R(r),
35
+ httpVerb: P(r),
36
36
  path: s,
37
37
  operationId: (e == null ? void 0 : e.operationId) || s,
38
38
  name: (e == null ? void 0 : e.summary) || s || "",
@@ -47,17 +47,17 @@ const C = (c) => new Promise(async (t, p) => {
47
47
  });
48
48
  }), Object.keys(((E = t.components) == null ? void 0 : E.schemas) ?? {}).forEach((s) => {
49
49
  var d, r, e, n;
50
- u((r = (d = t.components) == null ? void 0 : d.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
50
+ m((r = (d = t.components) == null ? void 0 : d.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
51
51
  }), Object.keys(t.paths).forEach((s) => {
52
52
  Object.keys(t.paths[s]).filter(
53
- (r) => q.includes(r.toUpperCase())
53
+ (r) => A.includes(r.toUpperCase())
54
54
  ).forEach((r) => {
55
- var m, h, g, o, a, y;
55
+ var u, h, g, o, a, y;
56
56
  const e = t.paths[s][r];
57
- if (e === void 0 || u(e))
57
+ if (e === void 0 || m(e))
58
58
  return;
59
59
  const n = {
60
- httpVerb: R(r),
60
+ httpVerb: P(r),
61
61
  path: s,
62
62
  operationId: e.operationId || s,
63
63
  name: e.summary || s || "",
@@ -65,7 +65,7 @@ const C = (c) => new Promise(async (t, p) => {
65
65
  information: {
66
66
  ...e
67
67
  },
68
- pathParameters: (h = (m = t.paths) == null ? void 0 : m[s]) == null ? void 0 : h.parameters
68
+ pathParameters: (h = (u = t.paths) == null ? void 0 : u[s]) == null ? void 0 : h.parameters
69
69
  };
70
70
  if (!e.tags || e.tags.length === 0) {
71
71
  (g = t.tags) != null && g.find((f) => f.name === "default") || (o = t.tags) == null || o.push({
@@ -78,7 +78,7 @@ const C = (c) => new Promise(async (t, p) => {
78
78
  } else
79
79
  e.tags.forEach((i) => {
80
80
  var k, x, j;
81
- const f = (k = t.tags) == null ? void 0 : k.findIndex((P) => P.name === i);
81
+ const f = (k = t.tags) == null ? void 0 : k.findIndex((R) => R.name === i);
82
82
  f === -1 && ((x = t.tags) == null || x.push({
83
83
  name: i,
84
84
  description: ""
@@ -87,7 +87,7 @@ const C = (c) => new Promise(async (t, p) => {
87
87
  typeof ((j = t.tags[I]) == null ? void 0 : j.operations) > "u" && (t.tags[I].operations = []), t.tags[I].operations.push(n);
88
88
  });
89
89
  });
90
- }), t.tags = (O = t.tags) == null ? void 0 : O.filter((s) => !u(s)), {
90
+ }), t.tags = (O = t.tags) == null ? void 0 : O.filter((s) => !m(s)), {
91
91
  ...t,
92
92
  webhooks: p
93
93
  };
@@ -1,5 +1,5 @@
1
1
  import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
- import type { Heading, Tag, TransformedOperation } from '@scalar/types/legacy';
2
+ import type { Heading, OpenAPIV3_1 } from '@scalar/types/legacy';
3
3
  import { type InjectionKey, type Ref } from 'vue';
4
4
  export type NavState = {
5
5
  /** The URL hash without the #, also the "hash" pulled from pathRouting */
@@ -45,16 +45,21 @@ export declare const useNavState: (_config?: Ref<ApiReferenceConfiguration>) =>
45
45
  getWebhookId: (webhook?: {
46
46
  name: string;
47
47
  method?: string;
48
- }) => string;
48
+ }, parentTag?: OpenAPIV3_1.TagObject) => string;
49
49
  getModelId: (model?: {
50
50
  name: string;
51
51
  }) => string;
52
52
  getHeadingId: (heading: Heading) => string;
53
- getOperationId: (operation: TransformedOperation, parentTag: Tag) => string;
53
+ getOperationId: (operation: {
54
+ path: string;
55
+ method: OpenAPIV3_1.HttpMethods;
56
+ } & OpenAPIV3_1.OperationObject, parentTag: OpenAPIV3_1.TagObject) => string;
54
57
  getPathRoutingId: (pathName: string) => string;
55
58
  getSectionId: (hashStr?: string) => string;
56
- getTagId: (tag: Tag) => string;
59
+ getTagId: (tag: OpenAPIV3_1.TagObject) => string;
57
60
  isIntersectionEnabled: Ref<boolean, boolean>;
58
61
  updateHash: () => string;
59
62
  };
63
+ /** Whats returned from the hook */
64
+ export type UseNavState = ReturnType<typeof useNavState>;
60
65
  //# sourceMappingURL=useNavState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAe,MAAM,KAAK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CAAA;CACpC,CAAA;AACD,eAAO,MAAM,gBAAgB,EAAe,YAAY,CAAC,QAAQ,CAAC,CAAA;AAOlE;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,aAAc,GAAG,CAAC,yBAAyB,CAAC;;IAiJhE,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BA/E4B,MAAM;IAiFrC;;;;;OAKG;oCArGkC,MAAM;IAuG3C;;;OAGG;uCA5HqC,MAAM;;6BAwFhB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,cAAc,WAAW,CAAC,SAAS;yBArCxE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;4BAXb,OAAO;gCA8BzB;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,WAAW,CAAC,WAAW,CAAA;KAChC,GAAG,WAAW,CAAC,eAAe,aACpB,WAAW,CAAC,SAAS;iCA1GE,MAAM;;oBA8FnB,WAAW,CAAC,SAAS;;;CA2E7C,CAAA;AAED,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA"}
@@ -1,32 +1,32 @@
1
1
  import { useConfig as b } from "./useConfig.js";
2
- import { combineUrlAndPath as d } from "@scalar/oas-utils/helpers";
2
+ import { combineUrlAndPath as d } from "@scalar/helpers/url/merge-urls";
3
3
  import { slug as i } from "github-slugger";
4
4
  import { inject as y, ref as l } from "vue";
5
- const P = Symbol(), U = l(!1), k = l(""), x = l(""), T = (f) => {
5
+ const P = Symbol(), U = l(!1), x = l(""), k = l(""), T = (f) => {
6
6
  const { isIntersectionEnabled: p, hash: r, hashPrefix: u } = y(P, {
7
7
  isIntersectionEnabled: U,
8
- hash: k,
9
- hashPrefix: x
8
+ hash: x,
9
+ hashPrefix: k
10
10
  }), t = f ?? b(), g = (e) => {
11
- var n;
11
+ var a;
12
12
  if (!t.value.pathRouting)
13
13
  return "";
14
- const a = new RegExp("^" + ((n = t.value.pathRouting) == null ? void 0 : n.basePath) + "/?");
15
- return decodeURIComponent(e.replace(a, ""));
14
+ const n = new RegExp("^" + ((a = t.value.pathRouting) == null ? void 0 : a.basePath) + "/?");
15
+ return decodeURIComponent(e.replace(n, ""));
16
16
  }, v = (e = r.value) => {
17
17
  var h;
18
- const a = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], n = e.startsWith("model") ? "models" : "", o = e.startsWith("webhook") ? "webhooks" : "";
19
- return a || n || o;
18
+ const n = (h = e.match(/(tag\/[^/]+)/)) == null ? void 0 : h[0], a = e.startsWith("model") ? "models" : "", o = e.startsWith("webhook") ? "webhooks" : "";
19
+ return n || a || o;
20
20
  }, c = () => t.value.pathRouting ? g(window.location.pathname) : (
21
21
  // Must remove the prefix from the hash as the internal hash value should be pure
22
22
  decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
23
- ), m = () => r.value = c(), I = (e, a = window.location.href) => {
24
- const n = new URL(a);
25
- t.value.pathRouting ? n.pathname = d(t.value.pathRouting.basePath, e) : n.hash = u.value + e, r.value = e, window.history.replaceState({}, "", n);
26
- }, w = (e, a = window.location.href, n = window.location.search) => {
27
- const o = new URL(a);
28
- return t.value.pathRouting ? o.pathname = d(t.value.pathRouting.basePath, e) : o.hash = u.value + e, o.search = n, o.toString();
29
- }, S = (e = r.value) => `${u.value}${e}`, $ = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", R = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${i(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name)}`;
23
+ ), m = () => r.value = c(), I = (e, n = window.location.href) => {
24
+ const a = new URL(n);
25
+ t.value.pathRouting ? a.pathname = d(t.value.pathRouting.basePath, e) : a.hash = u.value + e, r.value = e, window.history.replaceState({}, "", a);
26
+ }, $ = (e, n = window.location.href, a = window.location.search) => {
27
+ const o = new URL(n);
28
+ return t.value.pathRouting ? o.pathname = d(t.value.pathRouting.basePath, e) : o.hash = u.value + e, o.search = a, o.toString();
29
+ }, w = (e = r.value) => `${u.value}${e}`, S = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", R = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${i(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${i(e.name ?? "")}`;
30
30
  return {
31
31
  hash: r,
32
32
  /** Sets the prefix for the hash */
@@ -38,32 +38,34 @@ const P = Symbol(), U = l(!1), k = l(""), x = l(""), T = (f) => {
38
38
  * @param hashTarget The hash to target with the return
39
39
  * @returns The full hash
40
40
  */
41
- getFullHash: S,
41
+ getFullHash: w,
42
42
  /**
43
43
  * Gets the hashed url with the prefix
44
44
  * @param replacementHash The hash to replace the current hash with
45
45
  * @param url The url to get the hashed url from
46
46
  * @returns The hashed url
47
47
  */
48
- getHashedUrl: w,
48
+ getHashedUrl: $,
49
49
  /**
50
50
  * Replaces the URL state with the new url and hash
51
51
  * Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
52
52
  */
53
53
  replaceUrlState: I,
54
54
  getReferenceId: c,
55
- getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${i(e.name)}` : "webhooks",
56
- getModelId: R,
57
- getHeadingId: $,
58
- getOperationId: (e, a) => {
59
- var n;
60
- return typeof t.value.generateOperationSlug == "function" ? `${s(a)}/${t.value.generateOperationSlug({
61
- path: e.path,
62
- operationId: e.operationId,
63
- method: e.httpVerb,
64
- summary: (n = e.information) == null ? void 0 : n.summary
65
- })}` : `${s(a)}/${e.httpVerb}${e.path}`;
55
+ getWebhookId: (e, n) => {
56
+ if (!(e != null && e.name))
57
+ return "webhooks";
58
+ const a = n ? `${s(n)}/` : "";
59
+ return typeof t.value.generateWebhookSlug == "function" ? `${a}webhook/${t.value.generateWebhookSlug(e)}` : `${a}webhook/${e.method}/${i(e.name)}`;
66
60
  },
61
+ getModelId: R,
62
+ getHeadingId: S,
63
+ getOperationId: (e, n) => typeof t.value.generateOperationSlug == "function" ? `${s(n)}/${t.value.generateOperationSlug({
64
+ path: e.path,
65
+ operationId: e.operationId,
66
+ method: e.method,
67
+ summary: e.summary
68
+ })}` : `${s(n)}/${e.method}${e.path}`,
67
69
  getPathRoutingId: g,
68
70
  getSectionId: v,
69
71
  getTagId: s,
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG3E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAcvD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QA0ChC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAIpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,i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