import { d as defineEventHandler, l as APUser, I as Instance, E as Event, R as Resource } from '../../../nitro/nitro.mjs';
import { Op } from '@sequelize/core';
import 'luxon';
import 'html-to-text';
import 'zod';
import 'crypto';
import 'node:fs';
import 'sharp';
import 'path';
import 'node:stream';
import 'jsdom';
import 'dompurify';
import 'mime-types';
import 'fs';
import 'fs/promises';
import 'linkify-html';
import '@peertube/http-signature';
import 'jsonld';
import 'lodash.intersection';
import 'email-templates';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'node:events';
import 'node:buffer';
import 'node:path';
import 'vue';
import 'vue-router';
import 'dotenv';
import 'url';
import 'bcryptjs';
import 'slugify';
import 'umzug';
import 'consola';
import '@sequelize/core/decorators-legacy';
import 'util';
import 'mitt';
import 'ical.js';
import 'node:url';
import 'fast-xml-parser';

const stats_get = defineEventHandler(async () => {
  const n_followers = await APUser.count({ where: { follower: true }, include: [Instance] });
  const n_events = await Event.count({ where: { ap_id: { [Op.not]: null } } });
  const n_resources = await Resource.count();
  return { n_followers, n_events, n_resources };
});

export { stats_get as default };
