import{e as a,i as o,g as u}from"./KHR_interactivity-BtMudStn.js";import{R as c}from"./declarationMapper-Lanf6XPr.js";import{R as l}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";import"./objectModelMapping-CGWnurZP.js";class r extends a{constructor(t){super(t),this.config=t,this.default=this._registerSignalOutput("default"),this._caseToOutputFlow=new Map,this.case=this.registerDataInput("case",c);const e=this.config.cases||[];for(const s of e)this._caseToOutputFlow.set(s,this._registerSignalOutput(`out_${s}`))}_execute(t,e){const s=this.case.getValue(t);let i;o(s)?i=this._getOutputFlowForCase(u(s)):i=this._getOutputFlowForCase(s),i?i._activateSignal(t):this.default._activateSignal(t)}addCase(t){this.config.cases.includes(t)||(this.config.cases.push(t),this._caseToOutputFlow.set(t,this._registerSignalOutput(`out_${t}`)))}removeCase(t){if(!this.config.cases.includes(t))return;const e=this.config.cases.indexOf(t);this.config.cases.splice(e,1),this._caseToOutputFlow.delete(t)}_getOutputFlowForCase(t){return this._caseToOutputFlow.get(t)}getClassName(){return"FlowGraphSwitchBlock"}serialize(t){super.serialize(t),t.cases=this.config.cases}}l("FlowGraphSwitchBlock",r);export{r as FlowGraphSwitchBlock};
