import{__awaiter,__generator}from"tslib";import{L as Logger,H as registerInstance,I as debounce,a as balBrowser,j as updateBalAnimated,J as rIC,K as rOnLoad,M as h,N as Host,O as getElement}from"./index-CklISCW5.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as balDevice}from"./device-B3l1awwp.js";import{s as startFocusVisible}from"./focus-visible-DqCbGYzv.js";var balAppCss=":root{--bal-app-height:100%}.bal-app{position:relative}.lcp-wait{opacity:0;visibility:hidden;display:none}.lcp-ready .lcp-wait{opacity:inherit;visibility:inherit;display:inherit}";var App=function(){function e(e){var t=this;registerInstance(this,e);this.debouncedNotify=debounce((function(){return t.notifyResize()}),100);this.animated=true;this.ready=false;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]}))}))}}e.prototype.createLogger=function(e){this.log=e};e.prototype.connectedCallback=function(){if(this.animated===false){updateBalAnimated(this.animated)}if(balBrowser.hasWindow){window.addEventListener("resize",this.debouncedNotify);this.debouncedNotify()}};e.prototype.componentDidLoad=function(){var e=this;rIC((function(){e.ready=true;startFocusVisible()}));rOnLoad((function(){if(balBrowser.hasDocument&&balBrowser.hasWindow){var e=document.documentElement;e.classList.add("lcp-ready")}}))};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,{key:"8aa3c989125e06e500597db9773fca378e4b7467",class:{"bal-app":true,"bal-app--safari":balBrowser.isSafari,"bal-app--touch":balDevice.hasTouchScreen}},h("slot",{key:"c0e432a988e29f653198ed4eeead7f18fa447035"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();__decorate([Logger("bal-app"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],App.prototype,"createLogger",null);App.style=balAppCss;export{App as bal_app};