//#region src/channels/security-helpers.ts
function createScopedDmSecurityResolver(params) {
	return (ctx) => {
		const policy = params.resolvePolicy(ctx.account) ?? params.defaultPolicy ?? "pairing";
		const allowFrom = params.resolveAllowFrom(ctx.account) ?? [];
		return {
			policy,
			allowFrom: allowFrom.map(String),
			isAllowed: (senderId) => {
				if (policy === "open") return true;
				if (policy === "disabled") return false;
				const normalized = params.normalizeEntry ? params.normalizeEntry(senderId) : senderId;
				return allowFrom.some((entry) => String(entry) === normalized);
			}
		};
	};
}
//#endregion
export { createScopedDmSecurityResolver };

//# sourceMappingURL=security-helpers.js.map