import { r as registerInstance, h, H as Host } from './index-102043e0.js';
import { D as DataApiImpl } from './dataApi-8221972c.js';
import { S as SozlukApi, L as Logger } from './index-1e9f4c53.js';
import { g as getSessionData } from './index-ef2fbee6.js';
import { C as CookieStorage } from './cookie-647f9dc7.js';
import { d as dataApiEndpoint, K as KimlikApiMentornity, m as mentornityApiEndpoint, U as UyeApiMentornity } from './uye-4936a586.js';
import './kimlikApi-ac700c81.js';
import './data-transfer-field-918730a3.js';
import './BaseField-461b6d0c.js';
import './filter-cbaa3d7d.js';
import './_commonjsHelpers-27f122dd.js';
import './utils-2c1db0af.js';
import './User-d2ee8b71.js';
import './data-model-f5160369.js';
import './membership-821de3c5.js';
import './membership-config-68ed7772.js';
import './table-config-720f8ea0.js';
import './FieldModelGenerator-ee438a53.js';
import './index-ef734a5e.js';
import './index-336ef773.js';
import './date-ce777316.js';
import './index-0e8b9ea2.js';
import './index-c3eacf05.js';
import './string-3065a411.js';
import './app-config-d490f9ae.js';
import './spaces-c4b46e5e.js';
import './table-list-view-config-ff8c1b78.js';
import './index-a1675f50.js';
import './attachment-32decf79.js';
import './InterceptorHandler-6474bcf4.js';
import './view-config-efdeed6d.js';
import './detail-view-config-e2344d5e.js';
import './models-22fcdeab.js';
import './form-view-config-fb04db06.js';
import './ValidatorLength-f56a7c14.js';
import './actions-b9a0f808.js';
import './instance-fe40f49f.js';
import './nested-395a4cd4.js';
import './index-47dfc023.js';
import './list-fetch-state-623a5ba4.js';
import './time-zones-cf1e6113.js';

let MentornityConsoleApp = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.path = '/';
    this.navigate = (config) => {
      this.logger.debugGroup('navigate', {
        from: this.path,
        to: config.path,
      });
      this.path = config.path;
    };
  }
  componentWillLoad() {
    const defaultHeaders = {
      'Session-Token': 'NTdiMzY3NjBlNjNiY2UxZWViMDAwMDA0',
    };
    if (getSessionData().token) {
      defaultHeaders['Authorization'] = `Bearer ${getSessionData().token}`;
    }
    this.path = location.pathname;
    this.apiSozluk = new SozlukApi();
    this.storage = new CookieStorage();
    this.logger = new Logger('MentornityConsoleApp').setLevel('debug');
    this.logger.infoGroup('componentWillLoad');
    // TODO these are also set in mentornity-console-app-context-injector. WFT? I'm too tired to refactor it now.
    // this.apiAtama = new AtamaApiImpl('', defaultHeaders);
    this.apiData = new DataApiImpl(dataApiEndpoint);
    this.apiKimlik = new KimlikApiMentornity(mentornityApiEndpoint, defaultHeaders);
    this.apiUye = new UyeApiMentornity(mentornityApiEndpoint, defaultHeaders);
    this.apiSozluk = new SozlukApi();
  }
  render() {
    return (h(Host, null, h("dvn-app-root", { apiAtama: this.apiAtama, apiData: this.apiData, apiKimlik: this.apiKimlik, apiSozluk: this.apiSozluk, apiUye: this.apiUye, navigate: this.navigate, path: this.path, logger: this.logger, storage: this.storage })));
  }
  static get assetsDirs() { return ["assets"]; }
};

export { MentornityConsoleApp as mentornity_console_app };
