/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import{a as m}from"./H47NPYUM.js";import{a as y}from"./JD74LG7K.js";import b from"./ZUXQKICJ.js";import{h as u}from"./JCTU3MST.js";import"./BXKNMJRR.js";import a from"./FT7ETWDM.js";import"./IJQZON2Z.js";import{O as h,P as p,R as e,U as v,a as l,b as d,x as g}from"./IXZEUVT2.js";import"./H6RQVSYM.js";export default $arcgis.t(([{when:b},,{a:f}])=>{var $=l`.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);calcite-button{--calcite-offset-invert-focus: 1}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)}}:host{display:flex;inline-size:fit-content;block-size:fit-content}.root{--calcite-internal-action-bar-padding: 0;--calcite-internal-action-bar-gap: 0;--calcite-action-corner-radius: 0}`,o={pan:"move",rotate:"rotate"},c=class extends h{constructor(){super(...arguments),this._messages=m(),this._state="disabled",this.autoDestroyDisabled=!1,this.view=f(this),this.icon=o.pan,this.layout="vertical",this.navigationMode="pan",this.visualScale="m",this.arcgisPropertyChange=u()("layout","state"),this.arcgisReady=g()}static{this.properties={_state:16,autoDestroyDisabled:5,view:0,icon:1,label:1,layout:3,messageOverrides:0,navigationMode:3,referenceElement:1,state:35,visualScale:1}}static{this.styles=$}get state(){return this._state}async destroy(){await this.manager.destroy()}async toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}load(){this.manager.onLifecycle(()=>[b(()=>this.view?.navigation?.actionMap,()=>this._updateNavigationActionMap()),b(()=>{let{view:t}=this;return t?.ready&&t?.type==="3d"?"ready":"disabled"},t=>{this._state=t},{sync:!0,initial:!0})])}willUpdate(t){t.has("navigationMode")&&this._updateNavigationActionMap()}_onPanClick(){this.navigationMode="pan"}_onRotateClick(){this.navigationMode="rotate"}_updateNavigationActionMap(){let t=this.view?.navigation?.actionMap;if(!t)return;let a=this.navigationMode==="pan";t.dragPrimary=a?"pan":"rotate",t.dragSecondary=a?"rotate":"pan"}render(){let{_messages:t,navigationMode:a,state:M}=this,s=t.pan??"",n=t.rotate??"",i=M==="disabled",r=a==="pan";return d`<calcite-action-bar class=${p({root:!0,[y.disabled]:i})} expand-disabled .layout=${this.layout}><calcite-action .active=${r} .disabled=${i} .icon=${o.pan} @click=${this._onPanClick} .scale=${this.visualScale} .text=${s} title=${s??e}></calcite-action><calcite-action .active=${!r} .disabled=${i} .icon=${o.rotate} @click=${this._onRotateClick} .scale=${this.visualScale} .text=${n} title=${n??e}></calcite-action></calcite-action-bar>`}};v("arcgis-navigation-toggle",c);return c},"core/reactiveUtils",a,b)