/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
class t{constructor(t){this.moments=[],this.forwardMoments=[],this.moments.push(t)}push(t){return this.forwardMoments.length,this.moments.push(t)}pop(){if(!(this.forwardMoments.length>0))return this.moments.pop()}undo(){if(!this.canUndo())return;const t=this.moments.pop();return this.forwardMoments.push(t),t}peek(){return this.moments.at(-1)}canUndo(){return this.moments.length>1}canRedo(){return this.hasForwardEdits()}redo(){if(!this.canRedo())return;const t=this.forwardMoments.pop();return this.moments.push(t),t}size(){return this.moments.length+this.forwardMoments.length}hasForwardEdits(){return this.forwardMoments.length>0}clearForwardEdits(){this.forwardMoments=[]}}export{t as default};
