import { n as e } from "./chunk-TYymryXo.mjs";
import { t } from "./_plugin-vue_export-helper-C_T2la-V.mjs";
import { t as n } from "./HttpRequestBodySetting-COrZAzVP.mjs";
import { t as r } from "./HttpRequestHeaderSetting-BhLSeg33.mjs";
import { t as i } from "./HttpResponseSetting-yqeOy80T.mjs";
import { createBlock as a, createCommentVNode as o, createElementBlock as s, createVNode as c, defineComponent as l, openBlock as u, ref as d, toRefs as f, unref as p, watch as m, withCtx as h } from "vue";
import { Alert as g, Form as _, FormItem as v, Input as y } from "ant-design-vue/es";
import './httpRequestSetting.css';//#region src/pages/flow-create/flow-model/createComponents/step4/components/httpRequestSetting.vue?vue&type=script&setup=true&lang.ts
var b = { key: 0 }, x = /* @__PURE__ */ l({
	__name: "httpRequestSetting",
	props: {
		setting: {
			type: Object,
			required: !0
		},
		responseEnable: {
			type: Boolean,
			required: !0
		},
		formItemPrefix: {
			type: String,
			required: !0
		}
	},
	emits: ["update:setting"],
	setup(e, { expose: t, emit: l }) {
		let x = e, S = l, { setting: C } = f(x);
		m(() => C, (e) => {
			S("update:setting", e);
		});
		let w = d();
		function T() {
			return w.value.validate();
		}
		return t({ validateSetting: T }), (t, l) => {
			let d = g, f = v, m = y, x = _;
			return u(), a(x, {
				ref_key: "formRef",
				ref: w,
				model: p(C),
				layout: "vertical"
			}, {
				default: h(() => [
					c(f, null, {
						default: h(() => [c(d, {
							message: "仅支持 POST 请求，以请求体方式接收参数",
							type: "warning",
							"show-icon": ""
						})]),
						_: 1
					}),
					c(f, {
						label: "请求地址",
						name: "url",
						rules: {
							required: !0,
							message: "请求地址不能为空",
							trigger: ["blur", "change"]
						}
					}, {
						default: h(() => [c(m, {
							value: p(C).url,
							"onUpdate:value": l[0] ||= (e) => p(C).url = e,
							placeholder: "请输入请求地址，以https://或者http://开头"
						}, null, 8, ["value"])]),
						_: 1
					}),
					c(f, { label: "请求头" }, {
						default: h(() => [c(r, {
							header: p(C).header,
							bind: e.formItemPrefix
						}, null, 8, ["header", "bind"])]),
						_: 1
					}),
					c(f, { label: "请求体" }, {
						default: h(() => [c(n, {
							body: p(C).body,
							bind: e.formItemPrefix
						}, null, 8, ["body", "bind"])]),
						_: 1
					}),
					e.responseEnable ? (u(), s("div", b, [c(f, { label: "返回值" }, {
						default: h(() => [c(d, {
							message: "通过请求返回值, 可以修改流程表单的值",
							type: "warning",
							"show-icon": ""
						}), c(i, {
							class: "mt-8px",
							response: p(C).response,
							bind: e.formItemPrefix
						}, null, 8, ["response", "bind"])]),
						_: 1
					})])) : o("", !0)
				]),
				_: 1
			}, 8, ["model"]);
		};
	}
}), S = /* @__PURE__ */ e({ default: () => C }), C = /* @__PURE__ */ t(x, [["__scopeId", "data-v-4288cca5"]]);
//#endregion
export { S as n, C as t };
