// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../../chunks/tslib.es6 ../../core/Evented ../../core/Logger ../../core/promiseUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(b,a,g,e,c,m,n,h){const k={first:!0},l={first:!1};a=class extends a.EventedAccessor{constructor(d){super(d);this._animationController=null;this.disabled=!1;this.layout="horizontal";this.loop=!1;this.playRate=1E3;this.values=null}destroy(){this._pause()}get state(){return this._animationController? "playing":"ready"}next(){this.emit("next")}pause(){this.emit("pause");this._pause()}play(){this.emit("play");this._play()}previous(){this.emit("previous")}_pause(){this._animationController?.abort();this._animationController=null}_play(){this._pause();this._animationController=new AbortController;this._animate(k)}async _animate(d){this.emit("animate",d);if(this._animationController){try{await e.after(this.playRate,null,this._animationController.signal)}catch(f){e.isAbortError(f)||g.getLogger(this).error(f); this._pause();return}this._animate(l)}}};b.__decorate([c.property()],a.prototype,"_animationController",void 0);b.__decorate([c.property({nonNullable:!0})],a.prototype,"disabled",void 0);b.__decorate([c.property({nonNullable:!0})],a.prototype,"layout",void 0);b.__decorate([c.property({nonNullable:!0})],a.prototype,"loop",void 0);b.__decorate([c.property({nonNullable:!0})],a.prototype,"playRate",void 0);b.__decorate([c.property({readOnly:!0})],a.prototype,"state",null);b.__decorate([c.property()], a.prototype,"values",void 0);b.__decorate([c.property()],a.prototype,"next",null);b.__decorate([c.property()],a.prototype,"pause",null);b.__decorate([c.property()],a.prototype,"play",null);b.__decorate([c.property()],a.prototype,"previous",null);return a=b.__decorate([h.subclass("esri.widgets.ValuePicker.ValuePickerViewModel")],a)});