import { v4 } from "uuid";
import { g as getAppKeysFromSlug } from "./getAppKeysFromSlug-Td0Hkihg.js";
import { m as metadata } from "./CalEventParser-gVLQw-Bk.js";
const JitsiVideoApiAdapter = () => {
  return {
    getAvailability: () => {
      return Promise.resolve([]);
    },
    createMeeting: async (eventData) => {
      const appKeys = await getAppKeysFromSlug(metadata.slug);
      const meetingPattern = appKeys.jitsiPathPattern || "{uuid}";
      const hostUrl = appKeys.jitsiHost || "https://meet.jit.si/cal";
      const meetingID = meetingPattern.replaceAll("{uuid}", v4()).replaceAll("{Title}", eventData.title).replaceAll("{Event Type Title}", eventData.type).replaceAll("{Scheduler}", eventData.attendees.map((a) => a.name).join("-")).replaceAll("{Organizer}", eventData.organizer.name).replaceAll("{Location}", eventData.location || "").replaceAll("{Team}", eventData.team?.name || "").replaceAll(" ", "-");
      return Promise.resolve({
        type: metadata.type,
        id: meetingID,
        password: "",
        url: `${hostUrl}/${encodeURIComponent(meetingID)}`
      });
    },
    deleteMeeting: async () => {
      Promise.resolve();
    },
    updateMeeting: (bookingRef) => {
      return Promise.resolve({
        type: "jitsi_video",
        id: bookingRef.meetingId,
        password: bookingRef.meetingPassword,
        url: bookingRef.meetingUrl
      });
    }
  };
};
export {
  JitsiVideoApiAdapter as default
};
