/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{NoParameters as t}from"../../../../webgl/NoParameters.js";class r extends t{constructor(){super(...arguments),this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){if(this._dirty=!1,null!=this._parameterBlocks)for(const t of this._parameterBlocks)this[t]._setClean()}get dirty(){return this._dirty||this._checkParameterBlocksDirty()}_checkParameterBlocksDirty(){if(null==this._parameterBlocks)return!1;for(const t of this._parameterBlocks)if(this[t].dirty)return!0;return!1}}class e{constructor(){this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1}get dirty(){return this._dirty}}function s(t={}){return(r,e)=>{const s=r._parameterCount??0;r._parameterCount=s+1;const i=t.vectorOps;i?Object.defineProperty(r,e,{get(){return this[s]},set(t){const r=this[s];if(null==r)this[s]=Array.from(t);else{if(i.equals(r,t))return;i.copy(r,t)}this._setDirty()}}):Object.defineProperty(r,e,{get(){return this[s]},set(r){this[s]!==r&&(t.dispose&&this[s]&&this[s].dispose(),this[s]=r,this._setDirty())}})}}function i(){return(t,r)=>{const e=t._parameterCount??0;t._parameterCount=e+1,t._parameterBlocks=t._parameterBlocks||[],t._parameterBlocks.push(e),Object.defineProperty(t,r,{get(){return this[e]},set(t){this[e]!==t&&(this[e]=t,this._setDirty())}})}}export{r as MaterialBase,e as MaterialParameterBlock,s as parameter,i as parameterBlock};
