import Operation_default from "../../operation/Operation.vue.js";
import { workspaceStorage } from "../../../helpers/storage.js";
import Authentication_default from "../../collection/components/Authentication.vue.js";
import Cookies_default from "../../collection/components/Cookies.vue.js";
import Editor_default from "../../collection/components/Editor/Editor.vue.js";
import Environment_default from "../../collection/components/Environment.vue.js";
import Overview_default from "../../collection/components/Overview.vue.js";
import Servers_default from "../../collection/components/Servers.vue.js";
import Settings_default from "../../collection/components/Settings.vue.js";
import DocumentCollection_default from "../../collection/DocumentCollection.vue.js";
import OperationCollection_default from "../../collection/OperationCollection.vue.js";
import WorkspaceCollection_default from "../../collection/WorkspaceCollection.vue.js";
import { mergeSearchParams } from "@scalar/helpers/url/merge-urls";
//#region src/v2/features/app/helpers/routes.ts
/** Routes for the API client app and web, the same as modal + workspace routes */
var ROUTES = [{
	path: "/@:namespace/:workspaceSlug",
	children: [{
		path: "document/:documentSlug",
		children: [{
			path: "path/:pathEncoded/method/:method",
			children: [{
				name: "example",
				path: "example/:exampleName",
				component: Operation_default
			}, {
				name: "operation",
				path: "",
				component: OperationCollection_default,
				redirect: { name: "operation.overview" },
				children: [
					{
						name: "operation.overview",
						path: "overview",
						component: Overview_default
					},
					{
						name: "operation.servers",
						path: "servers",
						component: Servers_default
					},
					{
						name: "operation.authentication",
						path: "authentication",
						component: Authentication_default
					},
					{
						name: "operation.editor",
						path: "editor",
						component: Editor_default
					}
				]
			}]
		}, {
			name: "document",
			path: "",
			component: DocumentCollection_default,
			children: [
				{
					name: "document.redirect",
					path: "",
					redirect: { name: "document.overview" }
				},
				{
					name: "document.overview",
					path: "overview",
					component: Overview_default
				},
				{
					name: "document.servers",
					path: "servers",
					component: Servers_default
				},
				{
					name: "document.environment",
					path: "environment",
					component: Environment_default
				},
				{
					name: "document.authentication",
					path: "authentication",
					component: Authentication_default
				},
				{
					name: "document.cookies",
					path: "cookies",
					component: Cookies_default
				},
				{
					name: "document.settings",
					path: "settings",
					component: Settings_default
				}
			]
		}]
	}, {
		name: "workspace",
		path: "",
		component: WorkspaceCollection_default,
		children: [
			{
				name: "workspace.environment",
				path: "environment",
				component: Environment_default
			},
			{
				name: "workspace.cookies",
				path: "cookies",
				component: Cookies_default
			},
			{
				name: "workspace.settings",
				path: "settings",
				component: Settings_default
			}
		]
	}]
}, {
	path: "/:pathMatch(.*)*",
	redirect: () => {
		const DEFAULT_PATH = "/@local/default/document/drafts/overview";
		const lastPath = workspaceStorage.getLastPath() ?? DEFAULT_PATH;
		workspaceStorage.setCurrentPath(DEFAULT_PATH);
		const url = new URL(lastPath, "http://example.com");
		const queryParameters = new URLSearchParams(window.location.search);
		const mergedSearchParams = mergeSearchParams(url.searchParams, queryParameters);
		return `${url.pathname}?${mergedSearchParams.toString()}`;
	}
}];
//#endregion
export { ROUTES };

//# sourceMappingURL=routes.js.map