/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../../chunks/_rollupPluginBabelHelpers","../../../../../core/maybe","../../../analysis/Slice/sliceToolUtils","../../../../interactive/dragEventPipeline"],(function(t,e,a,n,s){"use strict";let i=function(){function t(){this.lastDragEvent=null,this.next=new s.EventPipeline,this._enabled=!1}var i=t.prototype;return i.createDragEventPipelineStep=function(){return this.lastDragEvent=null,t=>(this.lastDragEvent="end"!==t.action?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)},i._adjustScaleFactors=function(t){const e=n.isDiagonalResizeHandle(t.handle)?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):0===t.handle.direction[0]?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-e:e,t.factor2=t.factor2<0?-e:e},e._createClass(t,[{key:"enabled",get:function(){return this._enabled},set:function(t){if(this._enabled!==t&&a.isSome(this.lastDragEvent)){const e={...this.lastDragEvent,action:"update"};t&&this._adjustScaleFactors(e),this.next.execute(e)}this._enabled=t}},{key:"test",get:function(){return{_adjustScaleFactors:t=>this._adjustScaleFactors(t)}}}]),t}();t.PreserveAspectRatio=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
