// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define(["exports","../../geometry/GeometryCursor","./CurveHelper"],function(e,k,h){class l{constructor(){this._values=[];this._currentValue=this._length=this.ctrlPtGap=this.extPtGap=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(a,b,c=!0){this._setEmpty();if(!a||0===a.length)return!1;for(let f=0;fd&&(d=1E-7);this._values.push(d);this._length+=d}b&&a.length&1&&(this._length*=2);if(0===this._length)return!1;this.ctrlPtGap= this.extPtGap=0;this._currentValue=-1;return!0}scale(a){const b=this._values?this._values.length:0;for(let c=0;cb.segmentLength+this._tolerance;)if(c&&(0===c.pathSize&&(0===d?(d=b.segment[0],c.pushXY(d[0],d[1])):c.pushPoint(this.getSegCoord2D(b.segment,d))),d=b.segment[1],c.pushXY(d[0],d[1])),d=0,a-=(b.segmentLength-b.abscissa)/this._partLengthRatio,this._partSegCount)b.segment=this._nextSegment(),b.segmentLength=this.getSegLength(b.segment),b.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart()){if(f=== e.EndType.FAIL)return!1;b.segmentLength=this.getSegLength(b.segment);b.isPartEnd=!0;f===e.EndType.END?(b.abscissa=b.segmentLength,b.isPathEnd=!0):b.abscissa=b.segmentLength+a;return!0}this._currentPosition.copyTo(b)}b.abscissa+=a*this._partLengthRatio;c&&(0===c.pathSize&&(0===d?c.pushPoint(b.segment[0]):c.pushPoint(this.getSegCoord2D(b.segment,d))),a=b.abscissa/b.segmentLength,1===a?c.pushPoint(b.segment[1]):c.pushPoint(this.getSegCoord2D(b.segment,a)));!this._partSegCount&&Math.abs(b.abscissa-b.segmentLength)< this._tolerance&&(b.isPathEnd=this._partIsLast,b.isPartEnd=!0);return!0}_getPoint(a){return this.getSegCoord2D(this._currentPosition.segment,0>=a.segmentLength?0:a.abscissa/a.segmentLength)}_getAngleCS(a){return this.getSegAngleCS(this._currentPosition.segment,0>=a.segmentLength?0:a.abscissa/a.segmentLength)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;this._partLength=0;this._partIsLast=!0;for(this._partSegCount= 0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}for(var a=this._partSegCount;a;)this._previousSegment(),--a;this._currentPosition.segment=this._nextSegment();this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment);this._currentPosition.abscissa=0;this._currentPosition.isPathEnd=this._currentPosition.isPartEnd= !1;--this._partSegCount;a=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(a);a=a+this._partSegCount+1;a>=this._pathCursor.pathSize&&(a=0);this._ctrlPtEnd=this._pathCursor.getControlPointAt(a);if(0=c&&(c=0this._partLengthRatio&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg