import{d as R,u as U,aa as k,R as v,a as e,w as a,b as t,j as _,$ as j,a5 as F,o as E,e as u,f as c,g as d,t as p,h as f,n as g,_ as m,a4 as b,a6 as N,a7 as $}from"./index-CWMhB7z4.js";const B={class:"flex flex-col gap-3"},D={class:"flex items-start gap-2"},H={class:"grid grid-cols-2 gap-3"},q=R({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const l=U(h,"modelValue"),x=k(()=>{}),i=o=>N(x,o)??o,n=o=>$(x,o),S=["onSuccess","onWarning","onError","onInfo"];function y(o){const s={...l.value};o.length===0?delete s.messageExpression:s.messageExpression=o,l.value=s}function z(o){const s={...l.value};o.length===0?delete s.resultExpression:s.resultExpression=o,l.value=s}function T(o,s){const r={...l.value};s.length===0?Reflect.deleteProperty(r,o):r[o]=s,l.value=r}function V(o){const s={...l.value};o.length===0?Reflect.deleteProperty(s,"before"):s.before=o,l.value=s}return(o,s)=>(E(),v("div",B,[e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.expression,multiline:"",placeholder:"例：http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":s[0]||(s[0]=r=>l.value={...l.value,expression:r})},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value.before??[],"onUpdate:triggers":s[1]||(s[1]=r=>V(r))},null,8,["triggers"])]),_:1}),_("div",D,[e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.messageExpression??"",placeholder:"例：string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体（已解析 JSON）"}},"onUpdate:modelValue":y},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.resultExpression??"",placeholder:"例：json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体（已解析 JSON）"}},"onUpdate:modelValue":z},null,8,["model-value"])]),_:1})]),_("div",H,[(E(),v(j,null,F(S,r=>e(t(m),{key:r,orientation:"vertical",class:"min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i(r)),1)]),_:2},[n(r)?{name:"tooltip",fn:a(()=>[e(t(f),{source:n(r),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value[r]??[],"onUpdate:triggers":w=>T(r,w)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{q as default};
