import { ResponsiveSize, ResponsiveUIHelper } from '@dvn/alaca/utils/ui';
import { SingleChoiceField, SingleChoiceFieldOption } from '@dvn/core/doldurma/src/fields/single-choice';
import { TextField } from '@dvn/core/doldurma/src/fields/text';
import { ConcealerConditional, Equal } from '@dvn/core/doldurma/src/interceptors/concealers/ConcealerGenericRule';
import { capitalize } from '@dvn/core/util/string';
import { User } from '@dvn/kimlik/api/models';
import { generateAvailabilities, getTimeFrameOfAvailabilities } from '@dvn/takvim/components/utils';
import { Component, Element, Event, h, Host, Prop, State } from '@stencil/core';
import moment from 'moment-timezone';
import { DvnDataProvider } from "@dvn/core/providers/DvnDataProvider";
import { DvnMemberDataAdapter } from "@dvn/core/adapters/DvnMemberDataAdapter";
import { DataTransferField } from "@dvn/core/doldurma/src/fields/query-include/data-transfer-field";
import { SozlukApi } from '@dvn/sozluk/api';
import { getSessionDetails } from 'src/modules/mentornity/src/util/session';
import { mentornityApiEndpoint } from 'src/modules/mentornity/src/constants/env';
import { createMentornityApiInstance } from 'src/modules/mentornity-js-client';
import { Config } from 'src/modules/mentornity-js-client/models';
import CalendarUtils from '@dvn/core/util/calendar';
import { CookieStorage } from "@dvn/kimlik/storage/cookie";
const meetingLocationTypes = [
  {
    name: 'Custom',
    value: 'custom',
  },
  {
    name: 'Jitsi Meet',
    value: 'jitsi',
  },
  {
    name: 'Zoom',
    value: 'zoom',
  },
  {
    name: 'Google Meet',
    value: 'google',
  },
  {
    name: 'Microsoft Teams',
    value: 'microsoftbusiness',
  },
];
const formErrors = (error) => {
  if (!error)
    return [];
  // TODO show proper error messages from apiSozluk
  return [
    capitalize(`${error.data.message.split('-').join(' ')}.`, false),
  ];
};
export class TakvimAvailableTimePicker {
  constructor() {
    this.storage = new CookieStorage();
    this.meetingsByMeetingTypes = {};
    /**
     * Raw availabilities fetched from the api.
     */
    this.availabilities = [];
    this.meetingLocationType = 'jitsi';
    this.meetingLocation = '';
    this.isProgressing = true;
    this.weekStartDay = 'monday';
    this.onSizeChange = (size) => {
      this.size = size;
      this.selectedTime = undefined;
      if (this.isMobileUI()) {
        // reset the date otherwise the slot list dialog will pop when switched to mobile
        this.selectedDate = undefined;
      }
      else {
        // set the date otherwise the slot list will keep showing progress
        this.selectedDate = new Date();
      }
    };
    this.isMobileUI = () => this.size < ResponsiveSize.Small;
    this.formFields = () => {
      const { calendarConfig, guests, guestMetadata, meetingsByMeetingTypes, meetingTypes, selectedTime, userSettings, strings, } = this;
      const isMenteeCreateMeeting = !(selectedTime === null || selectedTime === void 0 ? void 0 : selectedTime.locationType);
      const authPlatforms = userSettings.authPlatforms;
      let maxFieldCount = isMenteeCreateMeeting ? 2 : 0;
      const fields = [];
      const availableMeetingTypes = meetingTypes === null || meetingTypes === void 0 ? void 0 : meetingTypes.filter(meetingType => {
        var _a;
        return ((((_a = meetingsByMeetingTypes[meetingType.id]) === null || _a === void 0 ? void 0 : _a.length) || 0) < meetingType.maxCount);
      });
      calendarConfig.guestDefinitions.forEach((guestDefinition, i) => {
        // TODO use the 'membershipFieldIdInTable' in guestDefinition for the relational guests
        const dataConfig = this.dataConfigs.find(dataConfig => dataConfig._id === guestDefinition.tableId);
        const guestIndex = guestMetadata.findIndex(gm => gm.membershipConfigId === guestDefinition.tableId);
        const guest = guests[guestIndex];
        fields.push(new SingleChoiceField('guest_' + guestDefinition.tableId + '_' + i, i === 0 ? strings.guests : '', undefined, '', 'select', capitalize(dataConfig.roleName)).setDataProvider(new DvnDataProvider(this.apiData, guestDefinition.tableId, {}, guest ? [{ user: guest }] : [], {
          fields: [
            { fieldId: 'email' },
            { fieldId: 'firstName' },
            { fieldId: 'lastName' },
          ]
        })).setDataAdapter(new DvnMemberDataAdapter(true))
          .setValue(guest === null || guest === void 0 ? void 0 : guest._id)
          .setDisabled(!!guest)
          .setVisibility(false)
          .setRequired(guestDefinition.minCount > 0));
      });
      if (meetingTypes && meetingTypes.length > 0) {
        maxFieldCount += 1;
        fields.push(new SingleChoiceField('meetingType', strings.selectSession, availableMeetingTypes.map(meetingType => new SingleChoiceFieldOption(meetingType.name, meetingType.id)), '', 'select').setErrorTitle('Session').require());
      }
      const meetingLocationTypesLanguage = meetingLocationTypes.map(meetingType => ({
        name: strings[meetingType.value],
        value: meetingType.value,
      }));
      fields.push(...[
        new SingleChoiceField('locationType', strings.location, meetingLocationTypesLanguage
          // filter out the location types if user doesn't have the corresponding auth platform (zoom, google, microsoftbusiness)
          .filter(locationType => {
          if (locationType.value === 'custom' || locationType.value === 'jitsi') {
            return true;
          }
          return !!authPlatforms.some(authPlatform => authPlatform.id === locationType.value);
        })
          .map(locationType => new SingleChoiceFieldOption(locationType.name, locationType.value)), '', 'select').setValue(this.storage.get('mt_lt') || (selectedTime === null || selectedTime === void 0 ? void 0 : selectedTime.locationType))
          .setVisibility(isMenteeCreateMeeting)
          .require()
      ]);
      if (isMenteeCreateMeeting) {
        fields.push(...[
          new TextField('location', strings.meetingLocation)
            .addInterceptor('onFormChange', new ConcealerConditional(new Equal('locationType', 'custom')))
            .require()
            .hide()
        ]);
      }
      return { fields, maxFieldCount };
    };
    this.onSelectTime = async (e) => {
      this.selectedTime = e.detail;
      const showMeetingDetailsForm = !!this.selectedDate && !!this.selectedTime;
      this.selectedAvailability = this.availabilities.find(availability => availability._id === e.detail.availabilityId);
      if (showMeetingDetailsForm && !this.meetings && this.meetingTypes) {
        // get the meetings of the users to filter out the meeting types based on the number of meetings they have
        const { viewedUserId, calendarConfigId, userId } = this;
        this.isProgressing = true;
        const meetings = await this.apiTakvim.getMeetingsOfUser(calendarConfigId, [userId, viewedUserId]).catch(e => {
          this.error = e;
        }).finally(() => this.isProgressing = false);
        if (!meetings)
          return;
        this.meetings = meetings.results;
        const meetingsByMeetingTypes = {};
        this.meetings.forEach(meeting => {
          if (meetingsByMeetingTypes[meeting.meetingType]) {
            meetingsByMeetingTypes[meeting.meetingType].push(meeting);
          }
          else {
            meetingsByMeetingTypes[meeting.meetingType] = [meeting];
          }
        });
        this.meetingsByMeetingTypes = meetingsByMeetingTypes;
      }
    };
    this.onSubmitForm = async (event) => {
      var _a, _b, _c;
      const data = event.detail.values;
      const { location, locationType, meetingType } = data;
      const { startHour, endHour, availabilityId } = this.selectedTime;
      const hasMeetingGoals = ((_b = (_a = this.meetingGoalConfig) === null || _a === void 0 ? void 0 : _a.meetingGoals) === null || _b === void 0 ? void 0 : _b.length) > 0;
      const selectedSession = hasMeetingGoals && ((_c = this.meetingGoalConfig) === null || _c === void 0 ? void 0 : _c.meetingGoals.find(goal => goal.identifier === this.meetingType));
      const hasCreationRule = !!((selectedSession === null || selectedSession === void 0 ? void 0 : selectedSession.periodStartDate) || (selectedSession === null || selectedSession === void 0 ? void 0 : selectedSession.periodEndDate));
      const periodStartDate = selectedSession.periodStartDate * 1000;
      const periodEndDate = selectedSession.periodEndDate * 1000;
      const allowToCreateMeeting = periodStartDate <= startHour.getTime() && periodEndDate >= startHour.getTime();
      if (hasCreationRule && !allowToCreateMeeting) {
        this.errorMessage = `${SozlukApi.build(this.strings.selectMeetingBetween, { startDate: CalendarUtils.format((selectedSession === null || selectedSession === void 0 ? void 0 : selectedSession.periodStartDate) * 1000, 'DD/MM/YYYY'), endDate: CalendarUtils.format(selectedSession.periodEndDate * 1000, 'DD/MM/YYYY') })}`;
        return;
      }
      const guestsObject = {};
      const guestsMetadataObject = {};
      Object.keys(data).forEach(fieldId => {
        if (fieldId.startsWith('guest_')) {
          // this is a guest selection in the form. the value is the user id
          const [_, membershipConfigId, index] = fieldId.split('_');
          guestsMetadataObject[index] = { membershipConfigId };
          guestsObject[index] = User.generateRef(data[fieldId]);
        }
      });
      const meeting = {
        locations: [{
            address: location,
            type: locationType,
          }],
        meetingType,
        startDate: startHour.toISOString(),
        endDate: endHour.toISOString(),
        // guests: [
        //   User.generateRef(this.viewedUserId),
        //   User.generateRef(this.userId),
        // ],
        guests: Object.values(guestsObject),
        guestMetadata: Object.values(guestsMetadataObject),
        createdBy: User.generateRef(this.userId),
        status: 'active',
        calendar: { _ref: 'takvim-calendar-configs', _id: this.calendarConfigId },
      };
      if (availabilityId) {
        meeting.availability = {
          _ref: 'takvim-availabilities',
          _id: availabilityId
        };
      }
      this.createMeetingError = undefined;
      this.isProgressing = true;
      const createMeetingResponse = await this.apiTakvim.createMeeting(meeting).catch(e => {
        this.createMeetingError = e;
      }).finally(() => this.isProgressing = false);
      if (!createMeetingResponse)
        return;
      this.meetings = undefined;
      this.selectedTime = undefined;
      this.meetingType = undefined;
      this.selectedDate = new Date(this.selectedDate.toISOString());
      // store lastest location type = lt
      this.storage.save('mt_lt', locationType);
      this.createMeeting.emit(Object.assign(Object.assign({}, createMeetingResponse), meeting));
    };
    this.displayMeetingDetails = (meetingDetailsFormFields, dialogTitle) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
      const timeZone = this.userSettings.timeZone;
      const hourFormat = this.userSettings.timeFormat === '12-hour' ? 'hh:mm A' : 'HH:mm';
      const location = ((_a = this.selectedAvailability) === null || _a === void 0 ? void 0 : _a.locationType) === 'custom' ? (_b = this.selectedAvailability) === null || _b === void 0 ? void 0 : _b.location : `${this.strings[(_c = this.selectedAvailability) === null || _c === void 0 ? void 0 : _c.locationType]}`;
      const isCustom = !((_d = this.selectedTime) === null || _d === void 0 ? void 0 : _d.availabilityId);
      const hasMeetingGoals = ((_f = (_e = this.meetingGoalConfig) === null || _e === void 0 ? void 0 : _e.meetingGoals) === null || _f === void 0 ? void 0 : _f.length) > 0;
      const selectedSession = hasMeetingGoals && ((_g = this.meetingGoalConfig) === null || _g === void 0 ? void 0 : _g.meetingGoals.find(goal => goal.identifier === this.meetingType));
      const hasCreationRule = !!((selectedSession === null || selectedSession === void 0 ? void 0 : selectedSession.periodStartDate) || (selectedSession === null || selectedSession === void 0 ? void 0 : selectedSession.periodEndDate));
      return (h("div", { class: "ml-3 mr-3 mt-3" },
        this.errorMessage &&
          h("p", { class: "error-message" }, this.errorMessage),
        h("h3", { class: "mb-0" }, dialogTitle),
        h("p", { style: { fontWeight: '600' }, class: "mt-0" }, moment(this.selectedDate).tz(timeZone).format('MMMM/DD/YYYY, ddd')),
        h("h4", { style: {
            marginBottom: '0'
          } },
          moment((_h = this.selectedTime) === null || _h === void 0 ? void 0 : _h.startHour).tz(timeZone).format(hourFormat),
          " - ",
          moment((_j = this.selectedTime) === null || _j === void 0 ? void 0 : _j.endHour).tz(timeZone).format(hourFormat)),
        h("p", { style: {
            color: 'var(--color-neutral)',
            marginTop: '0'
          } },
          timeZone,
          h("dvn-icon", { iconName: 'uil uil-clock' })),
        hasMeetingGoals && selectedSession && hasCreationRule &&
          h("div", null,
            h("h4", { style: {
                marginBottom: '0'
              } }, this.strings.allowMeetingCreation),
            h("p", { style: {
                color: 'var(--color-neutral)',
                marginTop: '0'
              } },
              CalendarUtils.format((selectedSession === null || selectedSession === void 0 ? void 0 : selectedSession.periodStartDate) * 1000, 'DD/MM/YYYY'),
              " - ",
              CalendarUtils.format(selectedSession.periodEndDate * 1000, 'DD/MM/YYYY'))),
        !isCustom && h("p", { style: { fontWeight: '600' }, class: "m-0" },
          this.strings.location,
          ": ",
          location),
        h("doldurma-form", { key: `${(_k = this.selectedTime) === null || _k === void 0 ? void 0 : _k.startHour}-${(_l = this.selectedTime) === null || _l === void 0 ? void 0 : _l.endHour}`, fields: meetingDetailsFormFields, onSubmit: this.onSubmitForm, submitButtonLabel: this.strings.scheduleMeeting, progressing: this.isProgressing, formErrors: formErrors(this.createMeetingError), width: '100%', onChange: (e) => {
            this.meetingType = e.detail.meetingType;
            this.errorMessage = undefined;
          } })));
    };
  }
  async componentWillLoad() {
    this.uiHelper = new ResponsiveUIHelper(this.el, this.onSizeChange);
    this.size = ResponsiveUIHelper.getSize(this.el.parentElement.clientWidth);
  }
  async componentDidLoad() {
    const { viewedUserId, calendarConfigId } = this;
    const { context, headers } = getSessionDetails();
    const mentornityApi = createMentornityApiInstance(mentornityApiEndpoint, headers);
    mentornityApi.getOrganisationConfig(context.organisationId)
      .then((response) => {
      this.organisationConfig = Config.decode(response);
    });
    this.meetingGoalConfig = await mentornityApi.getOrganisationMeetingGoalConfig(context.organisationDomain);
    const calendarConfig = await this.apiTakvim.getCalendarConfig(calendarConfigId).catch(e => {
      this.error = e;
    });
    if (!calendarConfig)
      return;
    this.calendarConfig = calendarConfig;
    // get all data configs that are used in the calendar config
    // this is needed to query the guests and properly display them in the guest selection
    const promises = [];
    calendarConfig.guestDefinitions.forEach(guestDefinition => {
      promises.push(this.apiData.get('data-configs', guestDefinition.tableId, { fields: new DataTransferField('fields') }));
      if (guestDefinition.membershipFieldIdInTable) {
        promises.push(this.apiData.get('data-configs', guestDefinition.membershipFieldIdInTable, { fields: new DataTransferField('fields') }));
      }
    });
    const dataConfigs = await Promise.all(promises);
    if (!dataConfigs)
      return;
    this.dataConfigs = dataConfigs;
    const availabilities = await this.apiTakvim.getAvailabilitiesOfUser(viewedUserId).catch(e => {
      this.error = e;
    }).finally(() => this.isProgressing = false);
    if (!availabilities)
      return;
    this.availabilities = availabilities.results;
    // get the earliest start time and latest end time of the availabilities to fetch the unavailabilities for that time period
    const { startDate, endDate } = getTimeFrameOfAvailabilities(availabilities.results);
    if (startDate && endDate) {
      const unavailabilitiesOfOtherUser = await this.apiTakvim.getUnavailabilitiesOfUser(calendarConfigId, viewedUserId, startDate.toISOString(), endDate.toISOString()).catch(e => {
        this.error = e;
      }).finally(() => this.isProgressing = false);
      if (!unavailabilitiesOfOtherUser)
        return;
      this.generatedAvailabilities = generateAvailabilities(availabilities.results, unavailabilitiesOfOtherUser.results);
    }
    else {
      this.generatedAvailabilities = generateAvailabilities(availabilities.results, []);
    }
    if (!this.isMobileUI()) {
      // invoke onSelectDate for generating initial slots
      if (this.generatedAvailabilities.length > 0) {
        // focus on the date with the first availability
        this.selectedDate = new Date(this.generatedAvailabilities[0].startDate);
      }
      else {
        // focus on today
        this.selectedDate = new Date();
      }
    }
  }
  render() {
    const { calendarConfigId, calendarConfig, generatedAvailabilities, selectedDate, selectedTime, strings, userId, membershipConfigId, viewedUserId, viewedUserMembershipConfigId, weekStartDay, } = this;
    if (!calendarConfig) {
      return null;
    }
    const showMeetingDetailsForm = !!selectedDate && !!selectedTime;
    const { fields: meetingDetailsFormFields } = this.formFields();
    const userMeetingWith = this.guests[1];
    const dialogTitle = SozlukApi.build(strings.meetingWith, {
      fullName: userMeetingWith.firstName + ' ' + userMeetingWith.lastName
    });
    if (this.isMobileUI()) {
      return (h(Host, { class: "d-flex mobile" },
        h("dvn-card", { class: "date-picker-container", bodyLeaned: true, leaned: true, elevation: 0, width: "100%" },
          h("div", { class: "d-flex justify-content-center" },
            h("dvn-date-picker", { embedded: true, leaned: true, value: generatedAvailabilities === null || generatedAvailabilities === void 0 ? void 0 : generatedAvailabilities.map(ca => new Date(ca.startDate)), onChange: (e) => this.selectedDate = e.detail, strings: strings, weekStartDay: weekStartDay }))),
        h("dvn-dialog", { class: "confirmation-dialog", shown: !!selectedDate || showMeetingDetailsForm, onDismiss: (e) => {
            e.preventDefault();
            e.stopImmediatePropagation();
            this.createMeetingError = undefined;
            this.selectedAvailability = undefined;
            if (selectedTime) {
              this.selectedTime = undefined;
            }
            else {
              this.selectedDate = undefined;
            }
          }, raw: !!selectedDate && !showMeetingDetailsForm },
          (selectedDate && !showMeetingDetailsForm) &&
            h("takvim-available-time-picker-selected-day", { availabilities: this.generatedAvailabilities, calenderConfig: calendarConfig, selectedDate: selectedDate, userId: userId, membershipConfigId: membershipConfigId, userSettings: this.userSettings, viewedUserId: viewedUserId, viewedUserMembershipConfigId: viewedUserMembershipConfigId, calendarConfigId: calendarConfigId, apiTakvim: this.apiTakvim, onSelectTime: this.onSelectTime, strings: strings }),
          showMeetingDetailsForm &&
            this.displayMeetingDetails(meetingDetailsFormFields, dialogTitle))));
    }
    return (h(Host, { class: "d-flex desktop" },
      h("dvn-date-picker", { embedded: true, leaned: true, value: generatedAvailabilities === null || generatedAvailabilities === void 0 ? void 0 : generatedAvailabilities.map(ca => new Date(ca.startDate)), highlightedDay: this.selectedDate, onChange: (e) => this.selectedDate = e.detail, strings: strings, weekStartDay: weekStartDay }),
      h("takvim-available-time-picker-selected-day", { availabilities: this.generatedAvailabilities, calenderConfig: calendarConfig, selectedDate: selectedDate, userId: userId, membershipConfigId: membershipConfigId, userSettings: this.userSettings, viewedUserId: viewedUserId, viewedUserMembershipConfigId: viewedUserMembershipConfigId, calendarConfigId: calendarConfigId, apiTakvim: this.apiTakvim, onSelectTime: this.onSelectTime, strings: strings }),
      h("dvn-dialog", { class: "confirmation-dialog", shown: showMeetingDetailsForm, onDismiss: (e) => {
          e.preventDefault();
          e.stopImmediatePropagation();
          this.selectedTime = undefined;
          this.createMeetingError = undefined;
          this.selectedAvailability = undefined;
          this.errorMessage = undefined;
          this.meetingType = undefined;
        }, minHeight: '240px' }, this.displayMeetingDetails(meetingDetailsFormFields, dialogTitle))));
  }
  static get is() { return "takvim-available-time-picker"; }
  static get originalStyleUrls() { return {
    "$": ["takvim-available-time-picker.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["takvim-available-time-picker.css"]
  }; }
  static get properties() { return {
    "userId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "user-id",
      "reflect": false
    },
    "membershipConfigId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "membership-config-id",
      "reflect": false
    },
    "userSettings": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "UserSettings",
        "resolved": "UserSettings",
        "references": {
          "UserSettings": {
            "location": "import",
            "path": "@dvn/kimlik/api/models/UserSettings"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "viewedUserId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "viewed-user-id",
      "reflect": false
    },
    "viewedUserMembershipConfigId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "viewed-user-membership-config-id",
      "reflect": false
    },
    "calendarConfigId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "calendar-config-id",
      "reflect": false
    },
    "meetingTypes": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "MeetingType[]",
        "resolved": "MeetingType[]",
        "references": {
          "MeetingType": {
            "location": "import",
            "path": "@dvn/takvim/models/MeetingType"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "weekStartDay": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "'monday' | 'saturday' | 'sunday'",
        "resolved": "\"monday\" | \"saturday\" | \"sunday\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "week-start-day",
      "reflect": false,
      "defaultValue": "'monday'"
    },
    "apiTakvim": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "TakvimApi",
        "resolved": "TakvimApi",
        "references": {
          "TakvimApi": {
            "location": "import",
            "path": "@dvn/takvim/api/takvimApi"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "apiData": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "DataApi",
        "resolved": "DataApi",
        "references": {
          "DataApi": {
            "location": "import",
            "path": "@dvn/core/api"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "strings": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "TakvimAvailableTimePickerI18n",
        "resolved": "TakvimAvailableTimePickerI18n",
        "references": {
          "TakvimAvailableTimePickerI18n": {
            "location": "import",
            "path": "@dvn/takvim/components/takvim-available-time-picker/i18n"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "guests": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Ref[] | User[]",
        "resolved": "Ref[] | User[]",
        "references": {
          "Ref": {
            "location": "import",
            "path": "@dvn/core/models/ref"
          },
          "User": {
            "location": "import",
            "path": "@dvn/kimlik/api/models"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "guestMetadata": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n    membershipConfigId: string\n  }[]",
        "resolved": "{ membershipConfigId: string; }[]",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "calendarConfig": {},
    "dataConfigs": {},
    "meetings": {},
    "meetingsByMeetingTypes": {},
    "availabilities": {},
    "generatedAvailabilities": {},
    "selectedDate": {},
    "selectedTime": {},
    "selectedAvailability": {},
    "meetingLocationType": {},
    "meetingLocation": {},
    "isProgressing": {},
    "error": {},
    "errorMessage": {},
    "createMeetingError": {},
    "size": {},
    "organisationConfig": {},
    "meetingGoalConfig": {},
    "meetingType": {}
  }; }
  static get events() { return [{
      "method": "createMeeting",
      "name": "createMeeting",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
  static get elementRef() { return "el"; }
}
