/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{a as g}from"./P5EZZH6S.js";import{a as v}from"./DHVEHATY.js";import c from"./7PXQ5F5K.js";import{g as f}from"./EH5576ZY.js";import"./7QZVR2UR.js";import b from"./KTDXN3YM.js";import{b as d,d as h}from"./ZNBKMZP7.js";import{O as i,P as a,R as u,U as m,a as n,b as r,x as o}from"./GRFF5Y4R.js";import"./ALDX5YZO.js";export default $arcgis.t(([,{a:p}])=>{var E=n`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}`;function x(s){return s.includes("#")||s.includes(".")||s.includes("[")?s:`#${s}`}var c=class extends i{constructor(){super(),this.messages=g(),this.view=p(this),this.visualScale="m",this.arcgisPropertyChange=f()("state"),this.arcgisReady=o(),this.listenOn(document,"fullscreenchange",()=>this.fullscreenElement=document.fullscreenElement)}static{this.properties={fullscreenElement:16,view:0,element:1,label:1,messageOverrides:0,referenceElement:1,visualScale:1,state:35}}static{this.styles=E}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=x(e),l=h(this.el,t);this.#e=l||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(){let e=this.view?.container,t=e?.getRootNode(),l=t instanceof ShadowRoot?t.host:null;return this.element??e?.parentElement??l??null}_toggle(){document.fullscreenElement?document.exitFullscreen():this._getElement()?.requestFullscreen()}render(){let{fullscreenTitle:e,state:t}=this,l=t==="unsupported",b=t==="ready"||t==="disabled"||t==="unsupported"?"zoom-out-fixed":"zoom-in-fixed";return r`<div class=${a(d("root",v.arcgisButton))}>${!l&&r`<calcite-button .disabled=${t==="disabled"} .iconStart=${b} kind=neutral .label=${e} @click=${this._toggle} .scale=${this.visualScale} title=${e??u}></calcite-button>`||""}</div>`}};m("arcgis-fullscreen",c);return c},b,c)