/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import{b as c}from"./RFGSSUZF.js";import{F as l,G as n,H as r,h as s,i,r as a}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([h,d])=>{var m=s`:host{display:block}`,t=class extends r{constructor(){super(...arguments),this._fullscreenElement=l(),this.fullscreenStateChange=a()}static{this.properties={mapView:0,fullscreenWidget:0}}static{this.styles=m}willUpdate(e){e.has("mapView")&&this.mapViewWatchHandler()}async mapViewWatchHandler(){await this.mapView?.when(async()=>{await this._initFullscreenWidget()})}render(){return i`<div class="fullscreen-widget" ${n(this._fullscreenElement)}></div>`}async updated(){this.hasUpdated||await this._initFullscreenWidget()}async loaded(){await this._initFullscreenWidget()}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement.value&&!this.fullscreenWidget?(this.fullscreenWidget=new h({view:this.mapView}),await this.fullscreenWidget?.when(()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=d?.watch(()=>this.fullscreenWidget?.viewModel.state,e=>e&&this.fullscreenStateChange.emit(e))})):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}};c("map-fullscreen",t);return t},"widgets/Fullscreen","core/reactiveUtils")