import{__awaiter,__generator}from"tslib";import{r as registerInstance,h,H as Host,g as getElement}from"./index-e04a7bc5.js";import{b as balBrowser}from"./browser-a623d3a0.js";import{b as balDevice}from"./device-85159a44.js";import{h as debounce,k as rIC}from"./helpers-2253b115.js";import{L as Logger}from"./log-cf8e52ef.js";import{b as updateBalAnimated}from"./config.utils-8fe5be10.js";import"./icons.constant-47b0ca12.js";var balAppCss=":root{--bal-app-height:100%}.bal-app{position:relative;display:block}";var __decorate=undefined&&undefined.__decorate||function(e,t,r,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)if(a=e[s])o=(n<3?a(o):n>3?a(t,r,o):a(t,r))||o;return n>3&&o&&Object.defineProperty(t,r,o),o};var App=function(){function e(e){var t=this;registerInstance(this,e);this.debouncedNotify=debounce((function(){return t.notifyResize()}),100);this.notifyResize=function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){if(balBrowser.hasDocument&&balBrowser.hasWindow){e=document.documentElement;e.style.setProperty("--bal-app-height","".concat(window.innerHeight,"px"))}return[2]}))}))};this.animated=true;this.ready=false}e.prototype.createLogger=function(e){this.log=e};e.prototype.connectedCallback=function(){updateBalAnimated(this.animated);if(balBrowser.hasWindow){window.addEventListener("resize",this.debouncedNotify);this.debouncedNotify()}};e.prototype.componentDidLoad=function(){var e=this;rIC((function(){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.ready=true;import("./focus-visible-0d06bcc3.js").then((function(t){return e.focusVisible=t.startFocusVisible()}));return[2]}))}))}))};e.prototype.disconnectedCallback=function(){if(balBrowser.hasWindow){window.removeEventListener("resize",this.debouncedNotify)}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.focusVisible){this.focusVisible.setFocus(e)}return[2]}))}))};e.prototype.render=function(){return h(Host,{role:"application",class:{"bal-app":true,"bal-app--safari":balBrowser.isSafari,"bal-app--touch":balDevice.hasTouchScreen}},h("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();__decorate([Logger("bal-app")],App.prototype,"createLogger",null);App.style=balAppCss;export{App as bal_app};