| 1 |
var y=Object.defineProperty;var b=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var j=(e,l,s)=>l in e?y(e,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[l]=s,m=(e,l)=>{for(var s in l||(l={}))k.call(l,s)&&j(e,s,l[s]);if(b)for(var s of b(l))v.call(l,s)&&j(e,s,l[s]);return e};import{u as _,j as r,_ as d,y as $,$ as M}from"./main-248.js";import{S as P}from"./bf-206-122.js";const F=(e,l,s,t)=>{const o=m({},s);o[e].splice(l,0,{}),t(m({},o))},S=(e,l,s,t)=>{const o=m({},s);o[e].length>1&&o[e].splice(l,1),t(m({},o))},f=(e,l,s,t,o)=>{const i=m({},t);i[e][s][l.target.name]=l.target.value,o(m({},i))},T=e=>!((e!=null&&e.post_map?e.post_map.filter(s=>!s.formField&&s.postFormField&&s.required):[]).length>0),C=e=>!((e!=null&&e.pod_map?e.pod_map.filter(s=>!s.formField&&s.podFormField&&s.required):[]).length>0);function z({i:e,type:l,formFields:s,field:t,dataConf:o,setDataConf:i,podFields:p}){var x;const g={pod:{propName:"pod_map",fldName:"podFormField"},post:{propName:"post_map",fldName:"postFormField"}},N=_(M),{isPro:u}=N,{propName:c,fldName:a}=g[l],h=!!p.find(n=>n.key===t[a]&&n.required);return r.jsxs("div",{className:"flx mt-2 mr-1",children:[r.jsxs("div",{className:"flx integ-fld-wrp",children:[r.jsxs("select",{className:"btcd-paper-inp mr-2",name:"formField",value:t.formField||"",onChange:n=>f(c,n,e,o,i),children:[r.jsx("option",{value:"",children:d("Select Field")}),r.jsx("optgroup",{label:"Form Fields",children:s.map(n=>n.type!=="file-up"&&r.jsx("option",{value:n.key,children:n.name},`ff-zhcrm-${n.key}`))}),r.jsx("option",{value:"custom",children:d("Custom...")}),r.jsx("optgroup",{label:`General Smart Codes ${u?"":"(PRO)"}`,children:u&&((x=P)==null?void 0:x.map(n=>r.jsx("option",{value:n.name,children:n.label},`ff-rm-${n.name}`)))})]}),r.jsxs("select",{className:"btcd-paper-inp",name:a,value:t[a]||"",onChange:n=>f(c,n,e,o,i),disabled:h,children:[r.jsx("option",{value:"",children:d("Select Field")}),p==null?void 0:p.map(n=>r.jsx("option",{value:n.key,children:`${n.name}`},`${n.key}-1`))]})]}),h?r.jsx("button",{onClick:()=>F(c,e,o,i),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}):r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>F(c,e,o,i),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}),r.jsx("button",{onClick:()=>S(c,e,o,i),className:"icn-btn sh-sm ml-1",type:"button","aria-label":"btn",children:r.jsx($,{})})]})]})}export{z as P,F as a,C as b,T as c}; |