'use strict';

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

const index = require('./index-7cdf1df1.js');
require('./BaseField-f50bb8f0.js');
require('./_commonjsHelpers-206db00d.js');
require('./kimlikApi-6a581864.js');
require('./data-transfer-field-025bce2f.js');
require('./filter-52876f3c.js');
require('./cookie-8a49bf23.js');
const index$1 = require('./index-6e5eb542.js');
const colors = require('./colors-933d05c1.js');
const light = require('./light-1e057c6e.js');

// export const dark: AlacaTheme = {
//   colorPrimary: colors.green,
//   colorPrimaryLight: colors.greenLight,
//   colorSecondary: colors.secondary,
//   colorSecondaryLight: colors.secondaryLight,
//   colorDanger: colors.danger,
//   colorDangerLight: colors.dangerLight,
//   colorWarning: colors.warning,
//   colorWarningLight: colors.warningLight,
//   colorNeutral: colors.neutral,
//   colorNeutralLight: colors.neutralLight,
//   colorDisabled: '#5e696a',
//
//   fontFamily: 'Ubuntu',
//   fontFamilyTitle: 'Ubuntu',
//   fontFamilySrc: 'https://fonts.googleapis.com/css?family=Ubuntu:400,700',
//   lineHeight: '1.1em',
//
//   colorText: colors.grey200,
//   colorTextTitle: colors.grey100,
//   colorTextSecondary: colors.grey500,
//
//   colorBackgroundPrimary: '#34495e',
//   colorBackgroundSecondary: '#3e4f61',
//   colorElevatedItemBackground: '#2c3e50',
//   colorElevatedItemShadow: '255, 255, 255',
//
//   colorTooltipBackground: colors.grey200,
//   colorTooltipTextColor: '#34495e',
//
//   colorHighlightedCodeBackground: '#212a32',
//
//   cornerRadius: '16px',
//   colorBorder: '#3e4f61',
//   colorBorderSecondary: '#3e4f61',
//
//   spacingUnit: '6px',
//
//   datePicker: {
//     height: '156px',
//   }
// };
const dark = {
  name: 'dvn-dark',
  colorPrimary: colors.colors.green,
  colorPrimaryLight: colors.colors.greenLight,
  colorPrimaryLightest: colors.colors.greenLightest,
  colorSecondary: colors.colors.blue,
  colorSecondaryLight: colors.colors.blueLight,
  colorSecondaryLightest: colors.colors.blueLightest,
  colorDanger: colors.colors.danger,
  colorDangerLight: colors.colors.dangerLight,
  colorDangerLightest: colors.colors.dangerLightest,
  colorWarning: colors.colors.warning,
  colorWarningLight: colors.colors.warningLight,
  colorWarningLightest: colors.colors.warningLightest,
  colorNeutral: colors.colors.neutral,
  colorNeutralLight: colors.colors.neutralLight,
  colorNeutralLightest: colors.colors.neutralLightest,
  colorDisabled: '#5e696a',
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
  fontFamilyTitle: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
  fontFamilySrc: '',
  colorText: colors.colors.grey200,
  colorTextTitle: colors.colors.grey100,
  colorTextSecondary: colors.colors.grey500,
  colorBackgroundPrimary: '#34495e',
  colorBackgroundSecondary: '#3e4f61',
  colorElevatedItemBackground: '#2c3e50',
  colorElevatedItemShadow: '255, 255, 255',
  colorInputBackground: '#2e4153',
  colorTooltipBackground: colors.colors.grey200,
  colorTooltipTextColor: '#34495e',
  colorHighlightedCodeBackground: '#212a32',
  cornerRadius: '6px',
  colorBorder: '#3e4f61',
  colorBorderSecondary: '#3e4f61',
  spacingUnit: '4px',
  datePicker: {
    height: '124px',
  }
};

function wrapContent(theme, content) {
  return (index.h(index.Host, null, index.h("mentornity-console-app-context-injector", { theme: theme }, index.h("dvn-theme-provider", { colorBackground: true, fitHeight: true, theme: theme }, index.h("dvn-global-table", null), index.h("dvn-global-grid", null), index.h("dvn-global-text", null), index.h("notifier-wrapper", null, content)))));
}
const MentornityConsoleAppRoot = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.navigate = (config) => {
      this.path = config.path;
      history.pushState({}, '', this.path);
    };
  }
  onThemeChange(event) {
    if (event.detail === 'dvn-dark') {
      this.theme = dark;
    }
    else {
      this.theme = light.light;
    }
  }
  componentWillLoad() {
    const hour = new Date().getHours();
    const isSunGone = 6 > hour || hour > 18;
    this.theme = isSunGone ? dark : light.light;
    this.path = location.pathname;
  }
  render() {
    if (!index$1.isUserLoggedIn()) {
      return wrapContent(this.theme, index.h("dvn-app-anonymous", { navigate: this.navigate, path: this.path }));
    }
    return wrapContent(this.theme, index.h("dvn-app", { navigate: this.navigate, path: this.path }));
  }
};

exports.mentornity_console_app_root = MentornityConsoleAppRoot;
