/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../core/Accessor","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../../../chunks/mat4"],(function(t,r,e,o,i,s,n,a,c){"use strict";var p;let u=p=function(r){function e(){var t;return(t=r.apply(this,arguments)||this).from=null,t.to=null,t.duration=4e3,t.repeat=!0,t.done=!1,t}t._inheritsLoose(e,r);var o=e.prototype;return o.getColorMatrix=function(){if(this.done=!1,null==this._lastTime)this._currentStep=0,this._lastTime=Date.now();else{const t=this._lastTime,r=Date.now(),e=r-t;this._currentStep=this._currentStep+e,this._currentStep>=2147483647&&(this._currentStep=0),this._lastTime=r}const t=this._currentStep%this.duration/(this.duration/2),r=t<=1?t:2-t,e=this.from.getColorMatrix(),o=this.to.getColorMatrix();return c.multiplyScalar(e,e,1-r),c.multiplyScalar(o,o,r),!this.repeat&&this._currentStep>=this.duration&&(this.done=!0),c.add(e,e,o)},o.getOpacity=function(){throw new Error("No getOpacity definition for Transition")},o.clone=function(){const t=new p({from:this.from.clone(),to:this.to.clone(),duration:this.duration});return t._lastTime=this._lastTime,t._currentStep=this._currentStep,t},e}(e);r.__decorate([o.property()],u.prototype,"from",void 0),r.__decorate([o.property()],u.prototype,"to",void 0),r.__decorate([o.property({type:Number})],u.prototype,"duration",void 0),r.__decorate([o.property({type:Boolean})],u.prototype,"repeat",void 0),u=p=r.__decorate([a.subclass("esri.views.layers.support.Transition")],u);return u}));
