import { sql } from "kysely";
async function batchLoadTranslations(db, entityType, entityIds, scope) {
  if (!entityIds.length) return /* @__PURE__ */ new Map();
  const rows = await db.selectFrom("entity_translations").select(["entity_id", "translations"]).where("entity_type", "=", entityType).where("entity_id", "in", entityIds).where(sql`tenant_id is not distinct from ${scope.tenantId ?? null}`).where(sql`organization_id is not distinct from ${scope.organizationId ?? null}`).execute();
  const map = /* @__PURE__ */ new Map();
  for (const row of rows) {
    map.set(row.entity_id, row.translations ?? {});
  }
  return map;
}
export {
  batchLoadTranslations
};
//# sourceMappingURL=batch.js.map
