'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-1141a245.js');
const dataApi = require('./dataApi-f2405711.js');
const index$2 = require('./index-a2e99c85.js');
const index$1 = require('./index-c7be53b8.js');
const cookie = require('./cookie-135bf612.js');
const uye = require('./uye-43a67ce8.js');
const env = require('./env-fcda6e03.js');
require('./apiBase-e4ebaf8b.js');
require('./data-transfer-field-e8417d5f.js');
require('./BaseField-381327a9.js');
require('./filter-d5040f65.js');
require('./kimlik-api-d3c479a3.js');
require('./_commonjsHelpers-206db00d.js');
require('./utils-f5bf4fbb.js');
require('./User-e889279b.js');
require('./data-model-9afb7f54.js');
require('./membership-ed8d3277.js');
require('./table-config-8b14c7d3.js');
require('./FieldModelGenerator-1900d81a.js');
require('./reference-field-1239b0c3.js');
require('./index-2eea69a0.js');
require('./FieldGenerator-279a646b.js');
require('./date-a24d7714.js');
require('./index-0783d14f.js');
require('./index-e8e4d80b.js');
require('./index-9d3d3d15.js');
require('./index-9fd84b93.js');
require('./index-61f9621a.js');
require('./string-de672b69.js');
require('./app-config-cb7e78a4.js');
require('./spaces-560c9786.js');
require('./raw-data-34f1739c.js');
require('./detail-view-config-4fe32db3.js');
require('./view-config-7972654b.js');
require('./index-e751cab0.js');
require('./attachment-b0acc4c1.js');
require('./models-8b357ee7.js');
require('./InterceptorHandler-09a1e84b.js');
require('./ModifierTrimmer-1463d100.js');
require('./ValidatorLength-06e5c6f8.js');
require('./ValidatorRegex-2120bfb5.js');
require('./form-view-config-36569bb4.js');
require('./actions-d7eabd95.js');
require('./instance-36d7564f.js');
require('./nested-d75d7d5f.js');
require('./index-e99b474f.js');
require('./list-fetch-state-a9e880b1.js');
require('./ValidatorEmail-4449f08a.js');
require('./table-list-view-config-5eaa0344.js');
require('./DvnDataAdapter-8f89f436.js');
require('./DvnDataProvider-6f26d1f7.js');
require('./time-zones-5b212929.js');

const MentornityConsoleApp = class {
  constructor(hostRef) {
    index.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 (index$1.getSessionData().token) {
      defaultHeaders['Authorization'] = `Bearer ${index$1.getSessionData().token}`;
    }
    this.path = location.pathname;
    this.apiSozluk = new index$2.SozlukApi();
    this.storage = new cookie.CookieStorage();
    this.logger = new index$2.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 dataApi.DataApiImpl(env.dataApiEndpoint);
    this.apiKimlik = new uye.KimlikApiMentornity(env.mentornityApiEndpoint, defaultHeaders);
    this.apiUye = new uye.UyeApiMentornity(env.mentornityApiEndpoint, defaultHeaders);
    this.apiSozluk = new index$2.SozlukApi();
  }
  render() {
    return (index.h(index.Host, null, index.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"]; }
};

exports.mentornity_console_app = MentornityConsoleApp;
