import{h as d,g as j,$ as C,k as b,i as v,j as t,_ as l}from"./main.2.8.10.js";import{u as w,e as I,b as f}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import{S as _,I as N,s as y}from"./Integrations.BFhED4ck.js";import{v as A,h as F,W as k}from"./WCAffiliateIntegLayout.DJoD5CWb.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./ProUtilHelpers.CtRYkgop.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.Belqr4OT.js";function J({allIntegURL:c}){const p=w(),{id:E,formID:g}=I(),[e,a]=d(j),[o,x]=d(C),n=b(v),[r,m]=f.useState(!1),[u,s]=f.useState({show:!1}),i=A(e);return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:u,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:l("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:h=>F(h,e,a),name:"name",value:e.name,type:"text",placeholder:l("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(_,{entity:o.triggered_entity,setSnackbar:s}),t.jsx(k,{formID:g,formFields:n,wcAffiliateConf:e,setWCAffiliateConf:a,setSnackbar:s,setIsLoading:m,isLoading:r}),t.jsx(N,{edit:!0,saveConfig:()=>{if(!i.isValid){s({show:!0,msg:i.message});return}y({flow:o,setFlow:x,allIntegURL:c,conf:e,navigate:p,edit:1,setIsLoading:m,setSnackbar:s})},disabled:!i.isValid,isLoading:r,dataConf:e,setDataConf:a,formFields:n}),t.jsx("br",{})]})}export{J as default};
