/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
import{a as E}from"./VK24LKXI.js";import{a as r}from"./LL7T22QC.js";import b from"./DTE4O2DP.js";import{e as p}from"./LYMDZ73M.js";import"./MG6XDMQJ.js";import"./HITJFSBP.js";import{B as m,P as d,Q as i,S as f,U as h,a,c as o,j as u,k as l}from"./3VKC6PRK.js";export default $geoscene.t(([{a:g}])=>{var y=u`geoscene-fullscreen{display:block}`,$={base:"geoscene-fullscreen"};function v(s){return s.includes("#")||s.includes(".")||s.includes("[")?s:`#${s}`}var c=class extends d{constructor(){super(),this.messages=E(),this.view=g(this),this.position="top-left",this.geoscenePropertyChange=p()("state"),this.geosceneReady=m(),this.listenOn(document,"fullscreenchange",()=>this.fullscreenElement=document.fullscreenElement)}static{this.properties={fullscreenElement:16,element:1,label:1,messageOverrides:0,position:3,referenceElement:1,state:35}}static{this.styles=y}get fullscreenTitle(){let e=this.state;return e==="active"?this.messages.exit:e==="ready"?this.messages.enter:""}#e;get element(){return this.#e}set element(e){if(typeof e=="string"){let t=v(e),n=o(this.el,t);this.#e=n||void 0}else this.#e=e}get state(){if(!document.fullscreenEnabled)return"unsupported";let e=this._getElement();return e?this.fullscreenElement===e?"active":"ready":"disabled"}connectedCallback(){super.connectedCallback(),this.fullscreenElement=document.fullscreenElement}_getElement(){return this.element??this.view?.container?.parentElement??null}_toggle(){document.fullscreenElement?document.exitFullscreen():this._getElement()?.requestFullscreen()}render(){let{fullscreenTitle:e,state:t}=this,n=t==="unsupported",b=t==="ready"||t==="disabled"||t==="unsupported"?"zoom-out-fixed":"zoom-in-fixed";return l`<div class=${i(a($.base,r.widget))}>${!n&&l`<calcite-button class=${i(r.widgetButton)} .disabled=${t==="disabled"} .iconStart=${b} kind=neutral .label=${e} @click=${this._toggle} title=${e??f}></calcite-button>`||""}</div>`}};h("geoscene-fullscreen",c);return c},b)