import { r as registerInstance, h, H as Host } from './index-b6f10a81.js';
import './BaseField-d94c5b14.js';
import './_commonjsHelpers-63c253cd.js';
import './kimlikApi-81acfec6.js';
import './data-transfer-field-1ad95e08.js';
import './filter-cbaa3d7d.js';
import './cookie-d9098150.js';
import { i as isUserLoggedIn } from './index-3a5c6fef.js';
import { c as colors } from './colors-2ff1cd72.js';
import { l as light } from './light-fffa8d8e.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.green,
  colorPrimaryLight: colors.greenLight,
  colorPrimaryLightest: colors.greenLightest,
  colorSecondary: colors.blue,
  colorSecondaryLight: colors.blueLight,
  colorSecondaryLightest: colors.blueLightest,
  colorDanger: colors.danger,
  colorDangerLight: colors.dangerLight,
  colorDangerLightest: colors.dangerLightest,
  colorWarning: colors.warning,
  colorWarningLight: colors.warningLight,
  colorWarningLightest: colors.warningLightest,
  colorNeutral: colors.neutral,
  colorNeutralLight: colors.neutralLight,
  colorNeutralLightest: 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.grey200,
  colorTextTitle: colors.grey100,
  colorTextSecondary: colors.grey500,
  colorBackgroundPrimary: '#34495e',
  colorBackgroundSecondary: '#3e4f61',
  colorElevatedItemBackground: '#2c3e50',
  colorElevatedItemShadow: '255, 255, 255',
  colorInputBackground: '#2e4153',
  colorTooltipBackground: colors.grey200,
  colorTooltipTextColor: '#34495e',
  colorHighlightedCodeBackground: '#212a32',
  cornerRadius: '6px',
  colorBorder: '#3e4f61',
  colorBorderSecondary: '#3e4f61',
  spacingUnit: '4px',
  datePicker: {
    height: '124px',
  }
};

function wrapContent(theme, content) {
  return (h(Host, null, h("mentornity-console-app-context-injector", { theme: theme }, h("dvn-theme-provider", { colorBackground: true, fitHeight: true, theme: theme }, h("dvn-global-table", null), h("dvn-global-grid", null), h("dvn-global-text", null), h("notifier-wrapper", null, content)))));
}
const MentornityConsoleAppRoot = class {
  constructor(hostRef) {
    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;
    }
  }
  componentWillLoad() {
    const hour = new Date().getHours();
    const isSunGone = 6 > hour || hour > 18;
    this.theme = isSunGone ? dark : light;
    this.path = location.pathname;
  }
  render() {
    if (!isUserLoggedIn()) {
      return wrapContent(this.theme, h("dvn-app-anonymous", { navigate: this.navigate, path: this.path }));
    }
    return wrapContent(this.theme, h("dvn-app", { navigate: this.navigate, path: this.path }));
  }
};

export { MentornityConsoleAppRoot as mentornity_console_app_root };
