//#region src/application/mapping/WorkflowPolicyUiPresentationFactory.ts
/** UI-facing policy labels derived from workflow/node definitions (live or hydrated snapshot). */
var WorkflowPolicyUiPresentationFactory = class {
	workflowHasErrorHandler(workflow) {
		return workflow.workflowErrorHandler !== void 0;
	}
	nodeRetrySummary(config) {
		const spec = config.retryPolicy;
		if (!spec) return void 0;
		if (spec.kind === "none") return "Retry: off";
		if (spec.kind === "fixed") return `Retry: ${spec.maxAttempts}x @ ${spec.delayMs}ms`;
		if (spec.kind === "exponential") {
			const jitter = spec.jitter ? ", jitter" : "";
			return `Retry: exp ${spec.maxAttempts}x from ${spec.initialDelayMs}ms (x${spec.multiplier}${jitter})`;
		}
	}
	nodeHasErrorHandler(config) {
		return config.nodeErrorHandler !== void 0;
	}
	snapshotNodeRetrySummary(config) {
		const spec = this.asRecord(config).retryPolicy;
		if (!spec || typeof spec !== "object") return void 0;
		return this.nodeRetrySummary({ retryPolicy: spec });
	}
	snapshotNodeHasErrorHandler(config) {
		return this.asRecord(config).nodeErrorHandler !== void 0;
	}
	asRecord(value) {
		return value !== null && typeof value === "object" ? value : {};
	}
};

//#endregion
export { WorkflowPolicyUiPresentationFactory as t };
//# sourceMappingURL=WorkflowPolicyUiPresentationFactory-DfvD2VHk.js.map