const e=window.webmapgl.h;import{a as n}from"./chunk-cf921ba9.js";import{a as l}from"./chunk-53560ba7.js";var r=l(function(e){var n,l,r,t,s,c;n="undefined"!=typeof window&&void 0!==window.document?window.document:{},l=e.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,t=function(){for(var e,l=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,t=l.length,s={};r<t;r++)if((e=l[r])&&e[1]in n){for(r=0;r<e.length;r++)s[l[0][r]]=e[r];return s}return!1}(),s={change:t.fullscreenchange,error:t.fullscreenerror},c={request:function(e){return new Promise(function(l){var s=t.requestFullscreen,c=function(){this.off("change",c),l()}.bind(this);e=e||n.documentElement,/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)?e[s]():e[s](r?Element.ALLOW_KEYBOARD_INPUT:{}),this.on("change",c)}.bind(this))},exit:function(){return new Promise(function(e){var l=function(){this.off("change",l),e()}.bind(this);n[t.exitFullscreen](),this.on("change",l)}.bind(this))},toggle:function(e){return this.isFullscreen?this.exit():this.request(e)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,l){var r=s[e];r&&n.addEventListener(r,l,!1)},off:function(e,l){var r=s[e];r&&n.removeEventListener(r,l,!1)},raw:t},t?(Object.defineProperties(c,{isFullscreen:{get:function(){return Boolean(n[t.fullscreenElement])}},element:{enumerable:!0,get:function(){return n[t.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(n[t.fullscreenEnabled])}}}),l?e.exports=c:window.screenfull=c):l?e.exports=!1:window.screenfull=!1});class t{constructor(){this.fullscreen=!1}componentDidLoad(){r.on("change",()=>this.fullscreen=r.isFullscreen)}toggleFullscreen(){r.isFullscreen?r.exit():r.request()}render(){let l=n(this.fullscreen?"webmapgl.fullscreen.exit":"webmapgl.fullscreen.enter");if(r.enabled)return e("ion-button",{onClick:this.toggleFullscreen.bind(this),title:l},e("ion-icon",{slot:"icon-only",name:this.fullscreen?"contract":"expand"}))}static get is(){return"gl-fullscreen"}static get properties(){return{fullscreen:{state:!0}}}}export{t as GlFullscreen};