var d = Object.defineProperty;
var f = (i, s, e) => s in i ? d(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e;
var l = (i, s, e) => (f(i, typeof s != "symbol" ? s + "" : s, e), e);
import { F as m, hU as c, fx as y, hV as E, hW as p, dq as a, b$ as C, c0 as Q, M as g } from "./603b75d9.js";
import { Fragment as x } from "react";
import "react-dom";
const A = new g({}, (i) => i).build();
class I extends A {
  constructor(e) {
    super(e);
    l(this, "params", {});
    l(this, "inputs", []);
    this.params = e;
  }
  getView() {
    return this.children;
  }
  getPropertyView() {
    return this.inputs.length === 0 ? null : this.inputs.map(({
      name: e,
      description: t
    }) => {
      const u = this.children[e];
      return u ? /* @__PURE__ */ m(x, {
        children: u.propertyView({
          label: e,
          tooltip: t,
          layout: "vertical"
        })
      }, e) : null;
    });
  }
  setInputs(e) {
    const t = {};
    e.forEach(({
      name: n,
      type: r
    }) => {
      c[r] && (t[n] = c[r]);
    });
    const u = y(this.params, t);
    return E(this, {
      children: u,
      inputs: e
    });
  }
  getInputNodes() {
    const e = {};
    return this.inputs.forEach(({
      name: t,
      type: u
    }) => {
      const n = this.children[t];
      if (n) {
        if (u === p.Query) {
          const r = n.children.value.getView();
          if (!r)
            return;
          e[t] = r;
          return;
        }
        if (n.unevaledValue) {
          const r = n.node();
          r && (e[t] = r);
        }
      }
    }), e;
  }
  getInputQueryExecAction(e) {
    var r;
    if (e.type !== a.ROUTE_BY_NAME || e.action.type !== a.EXECUTE_QUERY)
      return null;
    const t = e.name;
    if (!this.inputs.some(({
      name: o,
      type: h
    }) => t === o && h === p.Query))
      return null;
    const n = (r = Object.entries(this.children).find(([o]) => o === t)) == null ? void 0 : r[1];
    return n ? C(n.getView().value, Q(e.action)) : null;
  }
}
export {
  I as default
};
