import { r as registerInstance, c as createEvent, h, H as Host } from './index-ecdfb761.js';
import { t as takvimDailyCalendarI18nDefault } from './i18n-a73eeab0.js';
import { I as InvalidationAction, N as NotificationAction } from './actions-b9a0f808.js';
import { g as generateActionEmitData } from './action-util-f72a13be.js';
import './i18n-745d0676.js';
import './i18n-27a6b633.js';
import './i18n-02d8c6e2.js';

const DvnAppViewTakvimDailyCalendarView = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.invalidation = createEvent(this, "invalidation", 7);
    this.notification = createEvent(this, "notification", 7);
    this.action = createEvent(this, "action", 7);
  }
  async componentWillLoad() {
    this.strings = await this.apiSozluk.getContent(this.view.i18nEntryId, takvimDailyCalendarI18nDefault);
  }
  // TODO this event should be defined in config or the meeting detail should be shown in this view
  // @Listen('viewMeeting')
  // onViewMeeting(event: CustomEvent) {
  //   console.log('onViewMeeting');
  //   console.log(event.detail);
  // }
  onAction(event) {
    var _a, _b;
    const { view } = this;
    if (view.availableTimePickerConfig.successNavigationAction) {
      // show go to meeting page action confirmation dialog
      this.createdMeeting = event.detail;
    }
    (_b = (_a = view.availableTimePickerConfig.events) === null || _a === void 0 ? void 0 : _a.success) === null || _b === void 0 ? void 0 : _b.forEach(eventToEmit => {
      if (eventToEmit instanceof InvalidationAction) {
        this.invalidation.emit(eventToEmit);
      }
      if (eventToEmit instanceof NotificationAction) {
        this.notification.emit(eventToEmit);
      }
    });
  }
  render() {
    const { strings } = this;
    return (h(Host, { class: "d-flex flex-grow-1", style: { overflow: 'hidden' } }, h("takvim-daily-calendar", { apiData: this.apiData, apiTakvim: this.apiTakvim, strings: this.strings, user: this.user, userSettings: this.userSettings, membershipConfigId: this.membership.config._id, calendarConfigId: this.view.table._id, membershipConfigIdToGroupMeetings: this.view.membershipConfigIdToGroupMeetings, membershipConfigIdToViewOnMeetings: this.view.membershipConfigIdToViewOnMeetings }), h("dvn-dialog", { title: strings.meetingIsScheduled, shown: !!this.createdMeeting, onDismiss: () => this.createdMeeting = undefined }, h("div", { slot: "actions" }, h("dvn-button", { view: "flat", onClick: () => this.createdMeeting = undefined }, strings.stayOnPage), h("dvn-button", { tint: "primary", view: "flat", onClick: () => {
        this.action.emit(generateActionEmitData({}, this.createdMeeting, this.view.availableTimePickerConfig.successNavigationAction));
        this.createdMeeting = undefined;
      } }, strings.goToMeetingPage)))));
  }
};

export { DvnAppViewTakvimDailyCalendarView as dvn_app_view_takvim_daily_calendar_view };
