import { r as registerInstance, c as createEvent, h, H as Host } from './index-853c3f3f.js';
import { b as balBrowser } from './browser-9199b5e2.js';
import { b as balDevice } from './device-c28cde6d.js';
import { b as updateBalAnimated } from './index-8b8ed6bd.js';
import { r as rIC } from './helpers-697ce790.js';
import { L as Logger } from './log-01623e2c.js';
import { i as initStyleMode } from './mode-3ae7be9a.js';
import './icons.constant-0d61e703.js';

const balAppCss = ".bal-app{position:relative;display:block}.bal-body.is-ready{visibility:inherit}";

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
    r = Reflect.decorate(decorators, target, key, desc);
  else
    for (var i = decorators.length - 1; i >= 0; i--)
      if (d = decorators[i])
        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const App = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.balAppLoad = createEvent(this, "balAppLoad", 7);
    this.mode = 'css';
    this.animated = true;
    this.ready = false;
  }
  createLogger(log) {
    this.log = log;
  }
  connectedCallback() {
    initStyleMode(this.mode);
    updateBalAnimated(this.animated);
  }
  componentDidLoad() {
    rIC(async () => {
      this.balAppLoad.emit(true);
      this.ready = true;
      import('./focus-visible-ffc6760d.js').then(module => (this.focusVisible = module.startFocusVisible()));
    });
  }
  async setFocus(elements) {
    if (this.focusVisible) {
      this.focusVisible.setFocus(elements);
    }
  }
  render() {
    return (h(Host, { role: "application", class: {
        'bal-app': true,
        'bal-app--safari': balBrowser.isSafari,
        'bal-app--touch': balDevice.hasTouchScreen,
      } }, h("slot", null)));
  }
};
__decorate([
  Logger('bal-app')
], App.prototype, "createLogger", null);
App.style = {
  css: balAppCss
};

export { App as bal_app };
