import{b as u}from"./KHR_interactivity-BtMudStn.js";import{R as a}from"./declarationMapper-Lanf6XPr.js";import{R as l}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";import"./objectModelMapping-CGWnurZP.js";class c extends u{constructor(t){super(t),this.config=t,this.object=this.registerDataInput("object",a,t.target),this.value=this.registerDataInput("value",a),this.propertyName=this.registerDataInput("propertyName",a,t.propertyName),this.customSetFunction=this.registerDataInput("customSetFunction",a)}_execute(t,s){try{const o=this.object.getValue(t),e=this.value.getValue(t),i=this.propertyName.getValue(t);this._stopRunningAnimations(t,o,i);const r=this.customSetFunction.getValue(t);r?r(o,i,e,t):this._setPropertyValue(o,i,e)}catch(o){this._reportError(t,o)}this.out._activateSignal(t)}_stopRunningAnimations(t,s,o){const e=t._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const i of e){const r=t.assetsContext.animationGroups.find(n=>n.uniqueId===i);if(r){for(const n of r.targetedAnimations)if(n.target===s&&n.animation.targetProperty===o){r.stop(!0),r.dispose();const p=e.indexOf(i);p!==-1&&(e.splice(p,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",e))}}}}_setPropertyValue(t,s,o){const e=s.split(".");let i=t;for(let r=0;r<e.length-1;r++){const n=e[r];i[n]===void 0&&(i[n]={}),i=i[n]}i[e[e.length-1]]=o}getClassName(){return"FlowGraphSetPropertyBlock"}}l("FlowGraphSetPropertyBlock",c);export{c as FlowGraphSetPropertyBlock};
