"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InlineValue = void 0;
const core_1 = require("@flyde/core");
exports.InlineValue = {
    id: "InlineValue",
    mode: "advanced",
    defaultConfig: {
        value: (0, core_1.macroConfigurableValue)("string", "Hello, {{name}}"),
    },
    inputs: (config) => (0, core_1.extractInputsFromValue)(config.value, "value"),
    outputs: {
        value: {
            description: "Emits the value configured",
        },
    },
    menuDisplayName: "Inline Value",
    menuDescription: "Emits a value each time it's called. Supports dynamic variables",
    icon: "pencil",
    displayName: (config) => JSON.stringify(config.value.value),
    description: (config) => `Emits the value \`${JSON.stringify(config.value.value)}\``,
    run: (inputs, outputs, ctx) => {
        const value = (0, core_1.replaceInputsInValue)(inputs, ctx.context.config.value, "value");
        outputs.value.next(value);
    },
    editorConfig: {
        type: "custom",
        editorComponentBundlePath: "../../dist/ui/InlineValue.js",
    },
};
