1import{a as I,q as L,g as d,j as t,L as M,p as b,h as N}from"./index-c29e44e2.js";import{u as k}from"./useUserInfo-8989e4f6.js";import{a as w}from"./Module-563f8a6a.js";import{u as D}from"./useIsNewoaks-7af8214c.js";import{u as E}from"./useGetChatbotDetails-fb208648.js";import{F as s}from"./index-44a79835.js";import{S as r}from"./index-2297e430.js";import{I as u}from"./index-2950d4ba.js";import"./antd-icons-66946c44.js";import"./UpgradePlanMask-8f5b3c9f.js";import"./useForm-25122bf2.js";import"./index-d69cedca.js";import"./useVariants-cee23fa5.js";import"./ResizeObserver.es-0f9f8adb.js";import"./colors-3cf421cb.js";import"./Input-44f97ff8.js";import"./statusUtils-22830c4a.js";import"./TextArea-0f863c0d.js";function Q(){const{t:e}=I(),{chatbotId:l}=L(),{userInfo:p}=k(),h=p.ProductConfigJson||{},[a]=s.useForm(),g=D(),{data:C={}}=E(),o=C.IsShare,n=s.useWatch("LiveChatEnable",a),x=s.useWatch("DisableStepInChatMsg",a),f=s.useWatch("DisableStepOutChatMsg",a),{data:c={},refresh:v,loading:m}=d(()=>b("/Chatbot/GetChatbotLiveChat",{serialNumber:l}),{onSuccess:i=>{a.setFieldsValue(i)}}),{run:S,loading:j}=d((i={})=>b("/Chatbot/EditChatbotLiveChat",{...i,serialNumber:l}),{manual:!0,onSuccess:()=>{v(),N.success(e("common.successfulOperation"))}});return h.LiveChat?t.jsx("div",{className:"max-w-4xl mx-auto px-2 pt-6",children:t.jsxs(w,{isAuthorized:!h.LiveChatUp,title:e("chatbot.settings.customLiveChat"),disabled:m,loading:j,onSave:o?void 0:a.submit,children:[t.jsxs("p",{className:"text-sm font-medium text-gray-700",children:[e("chatbot.settings.enableLiveChat"),g&&t.jsx(M,{target:"_blank",className:"text-blue-500 ml-10",to:"/guides/user/getting-started/livechat",children:e("chatbot.settings.liveChatGuide")})]}),t.jsxs(s,{form:a,layout:"vertical",onFinish:i=>S(i),children:[t.jsx(s.Item,{name:"LiveChatEnable",valuePropName:"checked",children:t.jsx(r,{className:"bg-slate-300 block",disabled:o})}),t.jsx(s.Item,{hidden:!n,name:"StepInChatMsg",label:e("chatbot.settings.stepInChatMessage"),children:t.jsx(u.TextArea,{disabled:o||x,rows:3,placeholder:e("chatbot.settings.pleaseEnterTheStepInChatMessage")})}),t.jsx(s.Item,{hidden:!n,name:"DisableStepInChatMsg",valuePropName:"checked",label:e("chatbot.settings.disableStepInChatMessage"),children:t.jsx(r,{disabled:o,size:"small"})}),t.jsx(s.Item,{hidden:!n,name:"StepOutChatMsg",label:e("chatbot.settings.stepOutChatMessage"),children:t.jsx(u.TextArea,{disabled:o||f,rows:3,placeholder:e("chatbot.settings.pleaseEnterTheStepOutChatMessage")})}),t.jsx(s.Item,{hidden:!n,name:"DisableStepOutChatMsg",valuePropName:"checked",label:e("chatbot.settings.disableStepOutChatMessage"),children:t.jsx(r,{disabled:o,size:"small"})}),t.jsx("div",{className:"py-2",children:m?e("chatbot.settings.loading"):c.LiveChatEnable?t.jsx("a",{className:`text-lg px-2 font-bold bg-gradient-to-r from-[#0069ff] to-[#0069ff] bg-bottom bg-repeat-x bg-[length:1px_1px] text-[#0069ff] 2 hover:bg-gradient-to-r hover:from-[#1433d6]] hover:to-[#1433d6] hover:bg-[length:100%_100%] hover:text-white 3 ease-in-out duration-300`,onClick:()=>{window.open(c.LiveChatWebLink)},children:e("chatbot.settings.clickToStartLiveChat")}):""})]})]})}):null}export{Q as default};
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.