"use strict";
const index = require("./i18n-Bs8xJzoY.cjs");
const CalEventParser = require("./CalEventParser-mh8lC_8R.cjs");
const CalendarServiceMap = process.env.NEXT_PUBLIC_IS_E2E ? {} : {
  applecalendar: Promise.resolve().then(() => require("./CalendarService-2NmeX26w.cjs")),
  caldavcalendar: Promise.resolve().then(() => require("./CalendarService-66pPv6Im.cjs")),
  exchange2013calendar: Promise.resolve().then(() => require("./CalendarService-dwZrQQWR.cjs")),
  exchange2016calendar: Promise.resolve().then(() => require("./CalendarService-rPpZ0NZz.cjs")),
  exchangecalendar: Promise.resolve().then(() => require("./CalendarService-Y_0QTA6b.cjs")),
  feishucalendar: Promise.resolve().then(() => require("./CalendarService-tAJhhiJr.cjs")),
  googlecalendar: Promise.resolve().then(() => require("./CalendarService-eY7KIFcV.cjs")),
  "ics-feedcalendar": Promise.resolve().then(() => require("./CalendarService-xOmyTlu5.cjs")),
  larkcalendar: Promise.resolve().then(() => require("./CalendarService-RlKU4X_u.cjs")),
  office365calendar: Promise.resolve().then(() => require("./CalendarService-pySF08dI.cjs")),
  zohocalendar: Promise.resolve().then(() => require("./CalendarService-wTNCD1YP.cjs"))
};
const log = index.logger.getSubLogger({ prefix: ["CalendarManager"] });
const getCalendar = async (credential) => {
  if (!credential || !credential.key)
    return null;
  let { type: calendarType } = credential;
  if (calendarType?.endsWith("_other_calendar")) {
    calendarType = calendarType.split("_other_calendar")[0];
  }
  if (calendarType?.endsWith("_crm")) {
    calendarType = calendarType.split("_crm")[0];
  }
  const calendarAppImportFn = CalendarServiceMap[calendarType.split("_").join("")];
  if (!calendarAppImportFn) {
    log.warn(`calendar of type ${calendarType} is not implemented`);
    return null;
  }
  const calendarApp = await calendarAppImportFn;
  const CalendarService = calendarApp.default;
  if (!CalendarService || typeof CalendarService !== "function") {
    log.warn(`calendar of type ${calendarType} is not implemented`);
    return null;
  }
  return new CalendarService(credential);
};
const $schema$1 = "https://json.schemastore.org/package.json";
const name$1 = "@calcom/googlecalendar";
const version$1 = "0.0.0";
const main$1 = "./index.ts";
const description$1 = "Google Calendar is a time management and scheduling service developed by Google. Allows users to create and edit events, with options available for type and time. Available to anyone that has a Gmail account on both mobile and web versions.";
const dependencies$1 = {
  "@calcom/prisma": "*",
  "@googleapis/calendar": "^9.7.9"
};
const devDependencies$1 = {
  "@calcom/types": "*"
};
const _package$1 = {
  $schema: $schema$1,
  "private": true,
  name: name$1,
  version: version$1,
  main: main$1,
  description: description$1,
  dependencies: dependencies$1,
  devDependencies: devDependencies$1
};
const metadata$2 = {
  name: "Google Calendar",
  description: _package$1.description,
  installed: !!(process.env.GOOGLE_API_CREDENTIALS && CalEventParser.validJson(process.env.GOOGLE_API_CREDENTIALS)),
  type: "google_calendar",
  title: "Google Calendar",
  variant: "calendar",
  category: "calendar",
  categories: ["calendar"],
  logo: "icon.svg",
  publisher: "Cal.com",
  slug: "google-calendar",
  url: "https://cal.com/",
  email: "help@cal.com",
  dirName: "googlecalendar",
  isOAuth: true,
  delegationCredential: {
    // This is unused at the moment but should be used in future
    // For now, we have hardcoded imports in the codebase that are supported with Google Workspace(i.e. Google Calendar and Google Meet)
    workspacePlatformSlug: "google"
  }
};
const $schema = "https://json.schemastore.org/package.json";
const name = "@calcom/office365calendar";
const version = "0.0.0";
const main = "./index.ts";
const description = "Microsoft Office 365 is a suite of apps that helps you stay connected with others and get things done. It includes but is not limited to Microsoft Word, PowerPoint, Excel, Teams, OneNote and OneDrive. Office 365 allows you to work remotely with others on a team and collaborate in an online environment. Both web versions and desktop/mobile applications are available.";
const dependencies = {
  "@calcom/lib": "*",
  "@calcom/prisma": "*",
  msw: "^2.7.0"
};
const devDependencies = {
  "@calcom/types": "*"
};
const _package = {
  $schema,
  "private": true,
  name,
  version,
  main,
  description,
  dependencies,
  devDependencies
};
const metadata = {
  name: "Outlook Calendar",
  description: _package.description,
  type: "office365_calendar",
  title: "Outlook Calendar",
  variant: "calendar",
  category: "calendar",
  categories: ["calendar"],
  logo: "icon.svg",
  publisher: "Cal.com",
  slug: "office365-calendar",
  dirName: "office365calendar",
  url: "https://cal.com/",
  email: "help@cal.com",
  isOAuth: true
};
const metadata$1 = metadata;
exports.getCalendar = getCalendar;
exports.metadata = metadata$1;
exports.metadata$1 = metadata;
exports.metadata$2 = metadata$2;
