/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../../chunks/_rollupPluginBabelHelpers","../../../../../core/Error","../../../../../core/maybe","../../../../../core/promiseUtils","../definitions","./utils"],(function(e,t,r,i,a,n,o){"use strict";let s=function(){function e(e){this._requestRender=e,this._frameData=null}var s=e.prototype;return s.destroy=function(){this._playHandle.remove()},s.bindFrame=function(e,t,r){e.bindTexture(t,r),i.isNone(this._frameData)||(t.updateData(0,n.SPRITE_PADDING,n.SPRITE_PADDING,this._frameData.width,this._frameData.height,this._frameData),this._frameData=null)},s._load=function(){var e=t._asyncToGenerator((function*(e,t,i,n){try{const r=e=>{this._frameData=e,this._requestRender.requestRender()},a=yield this._loadAnimation(e,r,n);this.frameCount=a.frameDurations.length,this.width=a.width,this.height=a.height,this._playHandle=o.play(a,t,i)}catch(s){if(!a.isAbortError(s))return new r("invalid-resource","Could not parse animated resource.")}}));function i(t,r,i,a){return e.apply(this,arguments)}return i}(),e}();e.BaseAnimatableTextureResource=s,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
