function normalizeScopeValue(value) {
  if (typeof value !== "string") return value ?? null;
  const trimmed = value.trim();
  return trimmed.length > 0 ? trimmed : null;
}
function isValidAttachmentScopePair(candidate) {
  const organizationId = normalizeScopeValue(candidate.organizationId);
  const tenantId = normalizeScopeValue(candidate.tenantId);
  return organizationId === null === (tenantId === null);
}
function resolveAttachmentScopePair(...candidates) {
  for (const candidate of candidates) {
    if (!candidate) continue;
    const organizationId = normalizeScopeValue(candidate.organizationId);
    const tenantId = normalizeScopeValue(candidate.tenantId);
    if (organizationId === null === (tenantId === null)) {
      return { organizationId, tenantId };
    }
  }
  return null;
}
export {
  isValidAttachmentScopePair,
  resolveAttachmentScopePair
};
//# sourceMappingURL=scope.js.map
