UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 1.23 kB
import{b as e}from"./KHR_interactivity-CKt1TdMW.esm.min.js";import{R as t}from"./declarationMapper-13w1YGqM.esm.min.js";import{L as s,R as a}from"./index-Bw2N6w1y.esm.min.js";import"./objectModelMapping-DX92iJ8M.esm.min.js";class o extends e{constructor(e){if(super(e),this.message=this.registerDataInput("message",t),this.logType=this.registerDataInput("logType",t,"log"),e?.messageTemplate){const s=this._getTemplateMatches(e.messageTemplate);for(const e of s)this.registerDataInput(e,t)}}_execute(e){const t=this.logType.getValue(e),a=this._getMessageValue(e);"warn"===t?s.Warn(a):"error"===t?s.Error(a):s.Log(a),this.out._activateSignal(e)}getClassName(){return"FlowGraphConsoleLogBlock"}_getMessageValue(e){if(this.config?.messageTemplate){let t=this.config.messageTemplate;const s=this._getTemplateMatches(t);for(const a of s){const s=this.getDataInput(a)?.getValue(e);void 0!==s&&(t=t.replace(new RegExp(`\\{${a}\\}`,"g"),s.toString()))}return t}return this.message.getValue(e)}_getTemplateMatches(e){const t=/\{([^}]+)\}/g,s=[];let a;for(;null!==(a=t.exec(e));)s.push(a[1]);return s}}a("FlowGraphConsoleLogBlock",o);export{o as FlowGraphConsoleLogBlock}; //# sourceMappingURL=flowGraphConsoleLogBlock-xid_l2aY.esm.min.js.map