// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/has ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./handlers/DoubleClickZoom ./handlers/DragRotate ./handlers/DragZoom ./handlers/GamepadNavigation ./handlers/KeyboardNavigation ./handlers/MouseWheelZoom ./handlers/PinchAndPanNavigation ./handlers/PointerDownCancelAnimation ./handlers/SingleKeyResetHeading ./handlers/SingleKeyResetTilt ./handlers/TwoFingerTilt ../../input/BrowserEventSource ../../input/InputManager ../../input/handlers/PreventContextMenu ../../input/recognizers/Drag ../../input/recognizers/ImmediateDoubleClick ../../input/recognizers/PointerClickHoldAndDrag ../../input/recognizers/SingleAndDoubleClick ../../input/recognizers/VerticalTwoFingerDrag ../state/controllers/RotateController".split(" "), function(b,c,I,n,l,d,J,K,p,q,f,r,t,u,v,m,w,x,y,z,A,g,B,C,D,E,F,G,h){c=class extends c{destroy(){this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(a){"pan"!==a&&"rotate"!==a||a===this._get("primaryDragAction")||(this._set("primaryDragAction",a),this._updateMode())}get mode(){return this._get("mode")}set mode(a){"default"!==a&&"pro"!==a||a===this._get("mode")||(this._set("mode",a),this._updateMode())}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive?? !1}disconnect(){this.view.viewEvents.disconnect();this._inputManager=n.destroyMaybe(this._inputManager)}connect(){const a=this.view;this._source=new A.BrowserEventSource(this.view.surface,a.input);var e=[new D.ImmediateDoubleClick,new E.PointerClickHoldAndDrag,new F.SingleAndDoubleClick,new C.Drag(this.view.navigation),new G.VerticalTwoFingerDrag];this._inputManager=e=new g.InputManager({eventSource:this._source,recognizers:e});e.installHandlers("prevent-context-menu",[new B.PreventContextMenu],g.ViewEventPriorities.INTERNAL); this._modeDragPan=new m.PinchAndPanNavigation(a,"primary");this._modeDragRotate=new f.DragRotate(a,"secondary",h.PivotPoint.CENTER);this._modeDragZoom=new r.DragZoom(a,"tertiary");e.installHandlers("navigation",[new w.PointerDownCancelAnimation(a),new q.DoubleClickZoom(a),new t.GamepadNavigation(a),new u.KeyboardNavigation(a,{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j",headingLeft:"a",headingRight:"d",tiltUp:"w",tiltDown:"s",zoomIn:"+",zoomOut:"-"}), new v.MouseWheelZoom(a),new y.SingleKeyResetTilt(a,"p"),new x.SingleKeyResetHeading(a,"n"),new f.DragRotate(a,"primary",h.PivotPoint.EYE,["b"]),new f.DragRotate(a,"secondary",h.PivotPoint.CENTER,["b"]),new m.PinchAndPanNavigation(a,"tertiary",["b"]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,new z.TwoFingerTilt(a)],g.ViewEventPriorities.INTERNAL);this.view.viewEvents.connect(e);this._updateMode();this.addHandles(l.watch(()=>this.view.navigation?.browserTouchPanEnabled,H=>{this._source.browserTouchPanningEnabled= !H},l.initial))}isModifierKeyDown(a){return this._inputManager?.isModifierKeyDown(a)??!1}_updateMode(){var a=this.primaryDragAction;if(a=k.get(this.mode)?.get(a))this._modeDragPan&&(this._modeDragPan.pointerAction=a.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=a.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=a.zoom)}get test(){}};b.__decorate([d.property()],c.prototype,"view",void 0);b.__decorate([d.property({value:"pan"})],c.prototype,"primaryDragAction",null);b.__decorate([d.property({value:"default"})], c.prototype,"mode",null);b.__decorate([d.property({readOnly:!0})],c.prototype,"updating",null);b.__decorate([d.property()],c.prototype,"latestPointerType",null);b.__decorate([d.property()],c.prototype,"latestPointerLocation",null);b.__decorate([d.property()],c.prototype,"multiTouchActive",null);b.__decorate([d.property()],c.prototype,"_inputManager",void 0);c=b.__decorate([p.subclass("esri.views.3d.input.SceneInputManager")],c);const k=new Map;b=new Map;d=new Map;b.set("pan",{pan:"primary",rotate:"secondary", zoom:"tertiary"});b.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"});d.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"});d.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"});k.set("default",b);k.set("pro",d);return c});