/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/tslib.es6","../../../../geometry","../../../../Viewpoint","../../../../core/Accessor","../../../../core/accessorSupport/decorators/property","../../../../core/arrayUtils","../../../../core/has","../../../../core/accessorSupport/ensureType","../../../../core/accessorSupport/decorators/subclass","../../../../chunks/vec2","../../../../chunks/vec2f64","../../viewpointUtils","../../../../geometry/Point"],(function(e,t,o,r,n,i,s,c,a,p,u,v,d,h){"use strict";const l=v.create(),y=v.create();let g=function(t){function o(e){var o;return(o=t.call(this,e)||this)._previousCenter=v.create(),o.viewpoint=new r({targetGeometry:new h,scale:0,rotation:0}),o}e._inheritsLoose(o,t);var n=o.prototype;return n.begin=function(e,t){this.navigation.begin(),u.set(this._previousCenter,t.center.x,t.center.y)},n.update=function(e,t){const{state:{size:o,padding:r}}=e;u.set(l,t.center.x,t.center.y),d.getAnchor(y,o,r),e.viewpoint=d.rotateBy(this.viewpoint,e.state.paddedViewState.viewpoint,d.angleBetween(y,this._previousCenter,l)),u.copy(this._previousCenter,l)},n.end=function(){this.navigation.end()},o}(n);t.__decorate([i.property()],g.prototype,"viewpoint",void 0),t.__decorate([i.property()],g.prototype,"navigation",void 0),g=t.__decorate([p.subclass("esri.views.2d.actions.Rotate")],g);return g}));
