import { r as registerInstance, h, H as Host } from './index-ecdfb761.js';
import { T as TakvimAvailabilitySettingsViewConfig } from './takvim-availability-settings-view-config-cc2cfd9f.js';
import { b as generateMentornitySessionContext } from './session-2a491341.js';
import './pair-config-13b5a7c1.js';
import './table-config-d73a72ab.js';
import './FieldModelGenerator-378c8613.js';
import './reference-field-a5b414d1.js';
import './BaseField-0b01dc2c.js';
import './index-61dcd269.js';
import './FieldGenerator-3ae403b2.js';
import './date-1bc489bd.js';
import './index-4e451db4.js';
import './index-23baeeef.js';
import './index-09efdc01.js';
import './index-150b6a59.js';
import './data-model-88af49fc.js';
import './view-config-1ed8c59f.js';
import './membership-b6639471.js';
import './string-3065a411.js';
import './User-72c4643a.js';
import './UserSettings-7e4170a7.js';
import './cookie-5d9f5819.js';
import './kimlik-api-fddeac81.js';
import './apiBase-6015f41f.js';
import './data-transfer-field-2f305919.js';
import './filter-cbaa3d7d.js';
import './_commonjsHelpers-27f122dd.js';
import './index-d3bd30bd.js';
import './mentorinty-bridge-api-5ca2d652.js';
import './index-e66e8eca.js';
import './attachment-961dd228.js';
import './CalendarConfig-412d1b0f.js';
import './index-3bf9b308.js';
import './sozluk-entries-1e8f5234.js';
import './i18n-09a07b97.js';
import './i18n-0e757ca5.js';
import './calendar-470c802a.js';
import './index-a3ca021c.js';
import './moment-65eca6b3.js';

const MentornityAvailabilitySettingsWrapper = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    const { contextParams, extraProps } = this;
    const contextParamsToUse = Object.assign({}, contextParams);
    if (extraProps === null || extraProps === void 0 ? void 0 : extraProps.userIdToManageAvailabilitiesOf) {
      contextParamsToUse.userId = extraProps.userIdToManageAvailabilitiesOf;
    }
    // fetch the context async to unblock the component render
    generateMentornitySessionContext(contextParamsToUse, { fetchMentorship: true })
      .then((mentornitySessionContext) => {
      this.mentornitySessionContext = mentornitySessionContext;
      this.view = TakvimAvailabilitySettingsViewConfig.decode({
        i18nEntryId: 'availability-settings-view',
      });
    })
      .catch(error => this.error = error);
  }
  render() {
    const { error, mentornitySessionContext, view } = this;
    if (!!error) {
      return (h("dvn-card", { leanedSides: true, tint: "danger" }, "Failed to get data."));
    }
    if (!mentornitySessionContext) {
      return (h("div", { class: "d-flex justify-content-center pt-3" }, h("dvn-progress", { indefinite: true })));
    }
    const { apiSozluk, mentornityBridgeApi, user, userSettings } = mentornitySessionContext;
    return (h(Host, { class: "d-flex flex-column flex-grow-1", style: { overflow: 'hidden', width: '100%' } }, h("dvn-app-view-takvim-availability-settings-view", { apiSozluk: apiSozluk, apiTakvim: mentornityBridgeApi, view: view, user: user, userSettings: userSettings })));
  }
};

export { MentornityAvailabilitySettingsWrapper as mentornity_availability_settings_wrapper };
