1"use strict";(globalThis.webpackChunkcom_bot||=[]).push([[1868],{21868(e,a,l){l.r(a);var t=l(9950),n=l(98362),s=l(97176),i=l(46114),o=l(8081),r=l(61340),d=l(10877),c=l(6754),u=l(65488),h=l(91646),p=l(30615),m=l(87696),b=l(73878),g=l(89956),A=l(50677),f=l(44414);const N=e=>{const{t:a}=(0,n.B)(),l=[{label:a("Sign up"),value:"SIGN_UP"},{label:a("Sign in"),value:"SIGN_IN"},{label:a("Appointment Booking"),value:"APPOINTMENT_BOOKING"},{label:a("Lead Generation"),value:"LEAD_GENERATION"},{label:a("Contact Us"),value:"CONTACT_US"},{label:a("Customer Support"),value:"CUSTOMER_SUPPORT"},{label:a("Survey"),value:"SURVEY"},{label:a("Other"),value:"OTHER"}],N=(0,b.wA)(),{wappFlowApiResponse:v,isChannelListed:C}=(0,b.d4)(e=>({wappFlowApiResponse:e.WappFlow.apiResponse,isChannelListed:e.WappFlow.isChannelListed})),[x,j]=(0,t.useState)(!1),[w,S]=(0,t.useState)(""),[_,F]=(0,t.useState)([]),[y,O]=(0,t.useState)(null),[E,R]=(0,t.useState)([]);return(0,t.useEffect)(()=>{j(!0),N((0,g.O)())},[N]),(0,t.useEffect)(()=>{"edit"!=e.action&&"clone"!=e.action||(S(e.data.name),F(l.filter(a=>-1!==e.data.category.indexOf(a.value))))},[]),(0,t.useEffect)(()=>{C&&(j(!1),v.success?R(v.data.map(a=>(-1!==["edit","clone"].indexOf(e.action)&&a._id==e.data.channel._id&&O({label:a.name,value:a._id}),{label:a.name,value:a._id}))):m.A.error(a("No Channel Found")),N((0,g.gz)("apiResponse",{})),N((0,g.gz)("isChannelListed",!1)))},[C]),(0,f.jsxs)(t.Fragment,{children:[(0,f.jsx)("div",{className:"page-content",children:(0,f.jsxs)(o.A,{id:"showModal",isOpen:e.open,toggle:e.handleClose,centered:!0,children:[(0,f.jsx)(r.A,{className:"bg-light p-3 py-1",toggle:e.handleClose,children:"edit"===e.action?a("Edit Flow Meta Details"):a("Create Flow")}),(0,f.jsx)(d.A,{className:"py-1",children:(0,f.jsx)(s.A,{className:"g-3",children:(0,f.jsxs)(i.A,{lg:12,children:[(0,f.jsxs)("div",{className:"mb-3",children:[(0,f.jsx)(h.A,{htmlFor:"name-field",className:"form-label",children:a("Name")}),(0,f.jsx)(u.A,{type:"text",value:w,maxLength:200,id:"customername-field",className:"form-control",placeholder:a("Enter Flow Name"),onChange:e=>{S(e.target.value)}})]}),(0,f.jsxs)("div",{className:"mb-3",children:[(0,f.jsx)(h.A,{htmlFor:"name-field",className:"form-label",children:a("Categories")}),(0,f.jsx)(p.Ay,{options:l,placeholder:a("Select Flow Categories"),isMulti:!0,onChange:e=>F(e),value:_})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)(h.A,{htmlFor:"name-field",className:"form-label",children:a("WhatsApp Channel")}),(0,f.jsx)(p.Ay,{options:E,placeholder:a("Select WhatsApp Channel"),onChange:e=>O(e),value:y,isDisabled:"edit"==e.action})]})]})})}),(0,f.jsx)(c.A,{className:"mt-2",children:(0,f.jsx)("div",{className:"hstack gap-2 justify-content-end",children:(0,f.jsx)("button",{type:"button",className:"btn btn-primary btn-sm",id:"edit-btn",onClick:()=>{!function(){if(0===w.trim().length)return m.A.error(a("Name is required"));if(0===_.length)return m.A.error(a("Category is required"));if(null===y)return m.A.error(a("Channel is required"));
1let l={channel:y.value,name:w.trim(),categories:_.map(e=>e.value)};"edit"===e.action?e.cb("update_flow",{payload:l,id:e.data._id}):"clone"===e.action?e.cb("clone_flow",{payload:l,id:e.data._id}):e.cb("create_flow",l)}()},children:"edit"===e.action?a("Save Flow"):a("Create Flow")})})})]})}),x&&(0,f.jsx)(A.A,{})]})};l.d(a,["default",0,N])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.