import _extends from "@babel/runtime/helpers/extends";
import { t } from "../../src/locale";
import { CRuleNodeListSetter, CStringOnlySetter } from "../_setters";
import { uuid } from "../_utils/utils";
import loopData from "../_com-props/loopData";
import componentKey from "../_com-props/componentKey";
import componentName from "../_com-props/componentName";
import { getFlowEventConfig } from "../_com-props/flowEventConfig";
var Meta = {
  componentName: "EngineRuleUltra",
  title: "EngineRuleUltra",
  docUrl: "",
  screenshot: "",
  devMode: "proCode",
  group: t("engine-rule-ultra.key_utlsyUH9u6VC"),
  category: "Business",
  props: [loopData, componentKey, componentName, {
    name: "pluginId",
    title: {
      label: t("engine-rule-ultra.key_ZBXO1tm6SXLA"),
      tip: "pluginId"
    },
    setter: CStringOnlySetter,
    defaultValue: function defaultValue() {
      return 58;
    },
    condition: function condition() {
      return false;
    }
  }, getFlowEventConfig({
    label: t("engine-rule-ultra.key_VWhPwIWkeDIq"),
    tip: t("engine-rule-ultra.key_tzBPxhOyF5Xh"),
    props: {
      // 如果插件中需要配置规则，则需要给定pluginId
      pluginId: 58
    }
  }), {
    name: "ruleNodeGroupConfig",
    title: {
      label: t("engine-rule-ultra.key_XyPFNTHOw5XD"),
      tip: t("engine-rule-ultra.key_KwKZlyrWKEC2")
    },
    setter: CRuleNodeListSetter
  }, {
    title: t("engine-rule-ultra.buttonStatusText"),
    display: "block",
    type: "group",
    items: [{
      name: "buttonTextDictionaryKey",
      title: {
        label: t("engine-rule-ultra.buttonTextMulLang"),
        tip: t("engine-rule-ultra.buttonTextMulLang")
      },
      setter: "DictionarySetter",
      props: {
        type: "text"
      }
    }, {
      name: "buttonText",
      title: {
        label: t("engine-rule-ultra.buttonText"),
        tip: t("engine-rule-ultra.buttonTextTip")
      },
      propType: "string",
      setter: "StringSetter"
    }, {
      name: "buttonLoadingTextDictionaryKey",
      title: {
        label: t("engine-rule-ultra.buttonLoadingTextMulLang"),
        tip: t("engine-rule-ultra.buttonLoadingTextMulLang")
      },
      setter: "DictionarySetter",
      props: {
        type: "text"
      }
    }, {
      name: "buttonLoadingText",
      title: {
        label: t("engine-rule-ultra.buttonLoadingText"),
        tip: t("engine-rule-ultra.buttonLoadingText")
      },
      propType: "string",
      setter: "StringSetter"
    }, {
      name: "buttonExecutingTextDictionaryKey",
      title: {
        label: t("engine-rule-ultra.buttonExecutingTextMulLang"),
        tip: t("engine-rule-ultra.buttonExecutingTextMulLang")
      },
      setter: "DictionarySetter",
      props: {
        type: "text"
      }
    }, {
      name: "buttonExecutingText",
      title: {
        label: t("engine-rule-ultra.buttonExecutingText"),
        tip: t("engine-rule-ultra.buttonExecutingText")
      },
      propType: "string",
      setter: "StringSetter"
    }, {
      name: "buttonWalletNotConnectedTextDictionaryKey",
      title: {
        label: t("engine-rule-ultra.buttonNotConnectedTextMulLang"),
        tip: t("engine-rule-ultra.buttonNotConnectedTextMulLang")
      },
      setter: "DictionarySetter",
      props: {
        type: "text"
      }
    }, {
      name: "buttonWalletNotConnectedText",
      title: {
        label: t("engine-rule-ultra.buttonNotConnectedText"),
        tip: t("engine-rule-ultra.buttonNotConnectedText")
      },
      propType: "string",
      setter: "StringSetter"
    }],
    condition: function condition(target) {
      var _ruleNodeGroupConfig$, _ruleNodeGroupConfig$2, _ruleNodeGroupConfig$3, _ruleNodeGroupConfig$4;
      var ruleNodeGroupConfig = target.parent.getPropValue("ruleNodeGroupConfig");
      return (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$ = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$ === void 0 ? void 0 : (_ruleNodeGroupConfig$2 = _ruleNodeGroupConfig$.config) === null || _ruleNodeGroupConfig$2 === void 0 ? void 0 : _ruleNodeGroupConfig$2.pageKey) === "inputButton" || (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$3 = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$3 === void 0 ? void 0 : (_ruleNodeGroupConfig$4 = _ruleNodeGroupConfig$3.config) === null || _ruleNodeGroupConfig$4 === void 0 ? void 0 : _ruleNodeGroupConfig$4.pageKey) === "executeButton";
    }
  }, {
    name: "inputCheckSwitch",
    title: {
      label: t("engine-rule-ultra.inputCheck"),
      tip: t("engine-rule-ultra.inputCheckTip")
    },
    propType: {
      type: "oneOf",
      value: [1, 2, 3]
    },
    setter: [{
      componentName: "RadioGroupSetter",
      props: {
        options: [{
          title: t("engine-rule-ultra.inputCheckNone"),
          value: 1
        }, {
          title: t("engine-rule-ultra.inputCheckPrev"),
          value: 2
        }, {
          title: t("engine-rule-ultra.inputCheckCalling"),
          value: 3
        }]
      }
    }, "VariableSetter"],
    defaultValue: 1,
    condition: function condition(target) {
      var _ruleNodeGroupConfig$5, _ruleNodeGroupConfig$6;
      var ruleNodeGroupConfig = target.parent.getPropValue("ruleNodeGroupConfig");
      return (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$5 = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$5 === void 0 ? void 0 : (_ruleNodeGroupConfig$6 = _ruleNodeGroupConfig$5.config) === null || _ruleNodeGroupConfig$6 === void 0 ? void 0 : _ruleNodeGroupConfig$6.pageKey) === "inputButton";
    }
  }, {
    name: "stepQueryPopSwitch",
    title: {
      label: t("engine-rule-ultra.requireStepBar"),
      tip: t("engine-rule-ultra.requireStepBarTip")
    },
    propType: "bool",
    setter: "BoolSetter",
    defaultValue: false,
    condition: function condition(target) {
      var _ruleNodeGroupConfig$7, _ruleNodeGroupConfig$8, _ruleNodeGroupConfig$9, _ruleNodeGroupConfig$10;
      var ruleNodeGroupConfig = target.parent.getPropValue("ruleNodeGroupConfig");
      return (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$7 = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$7 === void 0 ? void 0 : (_ruleNodeGroupConfig$8 = _ruleNodeGroupConfig$7.config) === null || _ruleNodeGroupConfig$8 === void 0 ? void 0 : _ruleNodeGroupConfig$8.pageKey) === "inputButton" || (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$9 = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$9 === void 0 ? void 0 : (_ruleNodeGroupConfig$10 = _ruleNodeGroupConfig$9.config) === null || _ruleNodeGroupConfig$10 === void 0 ? void 0 : _ruleNodeGroupConfig$10.pageKey) === "executeButton";
    }
  }, {
    title: t("engine-rule-ultra.buttonStatus"),
    display: "block",
    type: "group",
    items: [{
      name: "ruleLoadingStyle",
      title: t("engine-rule-ultra.loadingStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleLoadingStyle",
        title: {
          label: t("engine-rule-ultra.loadingStyle"),
          tip: t("engine-rule-ultra.loadingStyleTip")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }, {
      name: "ruleWalletNotConnectedStyle",
      title: t("engine-rule-ultra.notConnectedStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleWalletNotConnectedStyle",
        title: {
          label: t("engine-rule-ultra.notConnectedStyle"),
          tip: t("engine-rule-ultra.notConnectedStyleTip")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }, {
      name: "ruleHoverStyle",
      title: t("engine-rule-ultra.hoverStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleHoverStyle",
        title: {
          label: t("engine-rule-ultra.hoverStyle"),
          tip: t("engine-rule-ultra.hoverStyleTip")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }, {
      name: "ruleActiveStyle",
      title: t("engine-rule-ultra.activeStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleActiveStyle",
        title: {
          label: t("engine-rule-ultra.activeStyle"),
          tip: t("engine-rule-ultra.activeStyle")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }, {
      name: "ruleExecutingStyle",
      title: t("engine-rule-ultra.executingStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleExecutingStyle",
        title: {
          label: t("engine-rule-ultra.executingStyle"),
          tip: t("engine-rule-ultra.executingStyleTip")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }, {
      name: "ruleDisableStyle",
      title: t("engine-rule-ultra.disableStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleDisableStyle",
        title: {
          label: t("engine-rule-ultra.disableStyle"),
          tip: t("engine-rule-ultra.disableStyleTip")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }, {
      name: "ruleTipStyle",
      title: t("engine-rule-ultra.tipStyle"),
      type: "group",
      extraProps: {
        display: "entry"
      },
      items: [{
        name: "ruleTipStyle",
        title: {
          label: t("engine-rule-ultra.tipStyle"),
          tip: t("engine-rule-ultra.tipStyle")
        },
        setter: "CStyleSetter",
        extraProps: {
          display: "block"
        }
      }]
    }],
    condition: function condition(target) {
      var _ruleNodeGroupConfig$11, _ruleNodeGroupConfig$12, _ruleNodeGroupConfig$13, _ruleNodeGroupConfig$14;
      var ruleNodeGroupConfig = target.parent.getPropValue("ruleNodeGroupConfig");
      return (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$11 = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$11 === void 0 ? void 0 : (_ruleNodeGroupConfig$12 = _ruleNodeGroupConfig$11.config) === null || _ruleNodeGroupConfig$12 === void 0 ? void 0 : _ruleNodeGroupConfig$12.pageKey) === "inputButton" || (ruleNodeGroupConfig === null || ruleNodeGroupConfig === void 0 ? void 0 : (_ruleNodeGroupConfig$13 = ruleNodeGroupConfig.ruleConfig) === null || _ruleNodeGroupConfig$13 === void 0 ? void 0 : (_ruleNodeGroupConfig$14 = _ruleNodeGroupConfig$13.config) === null || _ruleNodeGroupConfig$14 === void 0 ? void 0 : _ruleNodeGroupConfig$14.pageKey) === "executeButton";
    }
  }],
  configure: {
    supports: {
      style: true,
      events: false,
      loop: false,
      condition: false
    }
  }
};
var snippets = [{
  title: t("engine-rule-pro.key_pJdXSat87UcS"),
  screenshot: "https://s3.ap-east-1.amazonaws.com/res.os/icon/comp/EngineRule.png",
  schema: {
    componentName: "EngineRuleUltra",
    props: {
      componentKey: "cr_" + uuid()
    }
  }
}];
export default _extends({}, Meta, {
  snippets: snippets
});