//#region src/infrastructure/auth/InAppCallbackUrlPolicy.ts
/**
* Restricts post-login navigation targets to same-origin relative paths (no open redirects).
*/
var InAppCallbackUrlPolicy = class InAppCallbackUrlPolicy {
	static fallbackPath = "/";
	resolveSafeRelativeCallbackUrl(raw) {
		if (raw === void 0 || raw === null) return InAppCallbackUrlPolicy.fallbackPath;
		if (this.containsAsciiControl(raw)) return InAppCallbackUrlPolicy.fallbackPath;
		const trimmed = raw.trim();
		if (trimmed.length === 0) return InAppCallbackUrlPolicy.fallbackPath;
		if (!trimmed.startsWith("/")) return InAppCallbackUrlPolicy.fallbackPath;
		if (trimmed.startsWith("//")) return InAppCallbackUrlPolicy.fallbackPath;
		if (trimmed.includes("\\")) return InAppCallbackUrlPolicy.fallbackPath;
		return trimmed;
	}
	containsAsciiControl(value) {
		for (let index = 0; index < value.length; index += 1) {
			const code = value.charCodeAt(index);
			if (code <= 31 || code === 127) return true;
		}
		return false;
	}
};

//#endregion
//#region src/presentation/http/ApiPaths.ts
var ApiPaths = class {
	static apiBasePath = "/api";
	static workflowsBasePath = `${this.apiBasePath}/workflows`;
	static runsBasePath = `${this.apiBasePath}/runs`;
	static credentialsBasePath = `${this.apiBasePath}/credentials`;
	static oauth2BasePath = `${this.apiBasePath}/oauth2`;
	static webhooksBasePath = `${this.apiBasePath}/webhooks`;
	static usersBasePath = `${this.apiBasePath}/users`;
	static telemetryBasePath = `${this.apiBasePath}/telemetry`;
	static whitelabelBasePath = `${this.apiBasePath}/whitelabel`;
	static bootstrapBasePath = `${this.apiBasePath}/bootstrap`;
	static authBasePath = `${this.apiBasePath}/auth`;
	static collectionsBasePath = `${this.apiBasePath}/collections`;
	static collections() {
		return this.collectionsBasePath;
	}
	static collection(name) {
		return `${this.collectionsBasePath}/${encodeURIComponent(name)}`;
	}
	static collectionRows(name) {
		return `${this.collection(name)}/rows`;
	}
	static collectionRow(name, id) {
		return `${this.collectionRows(name)}/${encodeURIComponent(id)}`;
	}
	static syncCollections() {
		return `${this.collectionsBasePath}/sync`;
	}
	static workflows() {
		return this.workflowsBasePath;
	}
	static workflow(workflowId) {
		return `${this.workflowsBasePath}/${encodeURIComponent(workflowId)}`;
	}
	static workflowActivation(workflowId) {
		return `${this.workflow(workflowId)}/activation`;
	}
	static workflowRuns(workflowId) {
		return `${this.workflow(workflowId)}/runs`;
	}
	static workflowTestSuiteRuns(workflowId) {
		return `${this.workflow(workflowId)}/test-suite-runs`;
	}
	/**
	* `GET` returns per-assertion-metric trends across the workflow's recent suite runs. With
	* no `names` arg, every distinct assertion name is returned (so the multi-select can populate);
	* with `names`, only the requested subset is returned (order preserved).
	*/
	static workflowAssertionMetricTrends(workflowId, names) {
		const base = `${this.workflow(workflowId)}/assertion-metric-trends`;
		if (!names || names.length === 0) return base;
		return `${base}?names=${names.map((n) => encodeURIComponent(n)).join(",")}`;
	}
	static testSuiteRun(testSuiteRunId) {
		return `${this.apiBasePath}/test-suite-runs/${encodeURIComponent(testSuiteRunId)}`;
	}
	static testSuiteRunAssertions(testSuiteRunId) {
		return `${this.testSuiteRun(testSuiteRunId)}/assertions`;
	}
	static testSuiteRunChildRuns(testSuiteRunId) {
		return `${this.testSuiteRun(testSuiteRunId)}/runs`;
	}
	static runAssertions(runId) {
		return `${this.runState(runId)}/assertions`;
	}
	static workflowCredentialHealth(workflowId) {
		return `${this.workflow(workflowId)}/credential-health`;
	}
	static workflowDebuggerOverlay(workflowId) {
		return `${this.workflow(workflowId)}/debugger-overlay`;
	}
	static workflowDebuggerOverlayCopyRun(workflowId) {
		return `${this.workflowDebuggerOverlay(workflowId)}/copy-run`;
	}
	static workflowDebuggerOverlayBinaryUpload(workflowId) {
		return `${this.workflowDebuggerOverlay(workflowId)}/binary/upload`;
	}
	static workflowOverlayBinaryContent(workflowId, binaryId) {
		return `${this.workflow(workflowId)}/debugger-overlay/binary/${encodeURIComponent(binaryId)}/content`;
	}
	static runs() {
		return this.runsBasePath;
	}
	static run() {
		return this.runs();
	}
	static credentialTypes() {
		return `${this.credentialsBasePath}/types`;
	}
	static credentialsEnvStatus() {
		return `${this.credentialsBasePath}/env-status`;
	}
	static credentialInstances() {
		return `${this.credentialsBasePath}/instances`;
	}
	static credentialApps() {
		return `${this.credentialsBasePath}/apps`;
	}
	static credentialInstance(instanceId, withSecrets) {
		const base = `${this.credentialInstances()}/${encodeURIComponent(instanceId)}`;
		return withSecrets ? `${base}?withSecrets=1` : base;
	}
	static credentialInstanceTest(instanceId) {
		return `${this.credentialInstance(instanceId)}/test`;
	}
	static credentialBindings() {
		return `${this.apiBasePath}/credential-bindings`;
	}
	static oauth2RedirectUri() {
		return `${this.oauth2BasePath}/redirect-uri`;
	}
	static oauth2Disconnect(instanceId) {
		return `${this.oauth2BasePath}/disconnect?instanceId=${encodeURIComponent(instanceId)}`;
	}
	static credentialOAuthStart() {
		return `${this.credentialsBasePath}/oauth/start`;
	}
	static workflowWebsocket() {
		return `${this.workflowsBasePath}/ws`;
	}
	/** Dev gateway: stable browser WebSocket for build lifecycle (CLI → gateway → browser). */
	static devGatewaySocket() {
		return `${this.apiBasePath}/dev/socket`;
	}
	/** Dev gateway: HTTP notify endpoint used by the Codemation CLI during consumer rebuilds. */
	static devGatewayNotify() {
		return `${this.apiBasePath}/dev/notify`;
	}
	static webhooks() {
		return this.webhooksBasePath;
	}
	static users() {
		return this.usersBasePath;
	}
	static telemetryDashboardSummary() {
		return `${this.telemetryBasePath}/dashboard/summary`;
	}
	static telemetryDashboardTimeseries() {
		return `${this.telemetryBasePath}/dashboard/timeseries`;
	}
	static telemetryDashboardDimensions() {
		return `${this.telemetryBasePath}/dashboard/dimensions`;
	}
	static telemetryDashboardRuns() {
		return `${this.telemetryBasePath}/dashboard/runs`;
	}
	static telemetryRunTrace(runId) {
		return `${this.telemetryBasePath}/runs/${runId}/trace`;
	}
	static authSession() {
		return `${this.authBasePath}/session`;
	}
	static authLogin() {
		return `${this.authBasePath}/login`;
	}
	static authLogout() {
		return `${this.authBasePath}/logout`;
	}
	static authOAuthStart(providerId, callbackUrl) {
		const base = `${this.authBasePath}/oauth/${encodeURIComponent(providerId)}/start`;
		if (!callbackUrl) return base;
		return `${base}?callbackUrl=${encodeURIComponent(callbackUrl)}`;
	}
	static authOAuthCallback(providerId) {
		return `${this.authBasePath}/oauth/${encodeURIComponent(providerId)}/callback`;
	}
	static userInviteVerify() {
		return `${this.usersBasePath}/invites/verify`;
	}
	static userInviteAccept() {
		return `${this.usersBasePath}/invites/accept`;
	}
	static userInvites() {
		return `${this.usersBasePath}/invites`;
	}
	static userInviteRegenerate(userId) {
		return `${this.usersBasePath}/${encodeURIComponent(userId)}/invites/regenerate`;
	}
	static userStatus(userId) {
		return `${this.usersBasePath}/${encodeURIComponent(userId)}/status`;
	}
	static runState(runId) {
		return `${this.runsBasePath}/${encodeURIComponent(runId)}`;
	}
	static runDetail(runId) {
		return `${this.runState(runId)}/detail`;
	}
	static runWorkflowSnapshot(runId) {
		return `${this.runState(runId)}/workflow-snapshot`;
	}
	static runNodePin(runId, nodeId) {
		return `${this.runState(runId)}/nodes/${encodeURIComponent(nodeId)}/pin`;
	}
	static runNode(runId, nodeId) {
		return `${this.runState(runId)}/nodes/${encodeURIComponent(nodeId)}/run`;
	}
	static runBinaryContent(runId, binaryId) {
		return `${this.runState(runId)}/binary/${encodeURIComponent(binaryId)}/content`;
	}
	/** Anonymous: consumer logo from `codemation.config.ts` whitelabel.logoPath. */
	static whitelabelLogo() {
		return `${this.whitelabelBasePath}/logo`;
	}
	static frontendBootstrap() {
		return `${this.bootstrapBasePath}/frontend`;
	}
	static internalAuthBootstrap() {
		return `${this.bootstrapBasePath}/auth/internal`;
	}
	/** Token-authenticated: resume a suspended HITL task. */
	static hitlTaskResume(taskId) {
		return `${this.apiBasePath}/hitl/tasks/${encodeURIComponent(taskId)}/resume`;
	}
	/** Session-authenticated: record a decision on a suspended HITL task. */
	static hitlTaskDecide(taskId) {
		return `${this.apiBasePath}/hitl/tasks/${encodeURIComponent(taskId)}/decide`;
	}
};

//#endregion
export { InAppCallbackUrlPolicy as n, ApiPaths as t };
//# sourceMappingURL=ApiPaths-DCvrlIjg.js.map