/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./mathUtils"],(function(n,i){"use strict";let t=function(){function n(n,i){this.min=n,this.max=i,this.range=i-n}var t=n.prototype;return t.ndiff=function(n,i=0){return Math.ceil((n-i)/this.range)*this.range+i},t._normalize=function(n,i,t,o=0,e=!1){return(t-=o)<n?t+=this.ndiff(n-t):t>i&&(t-=this.ndiff(t-i)),e&&t===i&&(t=n),t+o},t.normalize=function(n,i=0,t=!1){return this._normalize(this.min,this.max,n,i,t)},t.clamp=function(n,t=0){return i.clamp(n-t,this.min,this.max)+t},t.monotonic=function(n,i,t){return n<i?i:i+this.ndiff(n-i,t)},t.minimalMonotonic=function(n,i,t){return this._normalize(n,n+this.range,i,t)},t.center=function(n,i,t){return i=this.monotonic(n,i,t),this.normalize((n+i)/2,t)},t.diff=function(n,i,t){return this.monotonic(n,i,t)-n},t.shortestSignedDiff=function(n,i){n=this.normalize(n);const t=(i=this.normalize(i))-n,o=i<n?this.minimalMonotonic(n,i)-n:i-this.minimalMonotonic(i,n);return Math.abs(t)<Math.abs(o)?t:o},t.contains=function(n,i,t){return i=this.minimalMonotonic(n,i),(t=this.minimalMonotonic(n,t))>n&&t<i},n}();function o(n){for(const i in n){const t=n[i];t instanceof Function&&(n[i]=t.bind(n))}return n}const e=o(new t(0,2*Math.PI)),c=o(new t(-Math.PI,Math.PI)),r=o(new t(0,360));n.Cyclical=t,n.cyclical2PI=e,n.cyclicalDegrees=r,n.cyclicalPI=c,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
