1"use strict";(globalThis.webpackChunkcometchat_dashboard=globalThis.webpackChunkcometchat_dashboard||[]).push([[9323],{11479(e,a,s){s.d(a,{A:()=>l});s(65043);const l=s.p+"static/media/form-info.cff323178e2aa7ead48fdca1e84a7c5e.svg"},61539(e,a,s){s.d(a,{A:()=>n});s(65043);var l=s(48677);var t=s(70579);const r=e=>{let{children:a,className:s="",...r}=e;return(0,t.jsx)(l.A,{className:`cc-drawer ${s}`,...r,children:a})};r.displayName="CometChatDrawer";const n=r},78203(e,a,s){s.d(a,{Y:()=>l.A});var l=s(61539)},76985(e,a,s){s.d(a,{A:()=>o});var l=s(65043),t=s(6658),r=s(11479),n=s(6265);var c=s(70579);const i=(0,l.forwardRef)((e,a)=>{let{label:s,required:l=!1,helpText:i,hintText:o,error:d,className:m="",disabled:u=!1,size:p="md",...h}=e;const x=!!d,v=x?"cc-input-field-destructive":"",f=u?"cc-input-field-disabled":"",_="sm"===p?"cc-input-field-sm":"";return(0,c.jsxs)("div",{className:`cc-input-field ${v} ${f} ${_} ${m}`,children:[s&&(0,c.jsxs)("div",{className:"cc-input-field__label",children:[(0,c.jsxs)("span",{className:"cc-input-field__label-text",children:[s,l&&(0,c.jsx)("span",{className:"cc-input-field__label-required",children:" *"})]}),i&&(0,c.jsx)(n.C,{title:i,children:(0,c.jsx)("span",{className:"cc-input-field__label-help",children:(0,c.jsx)("img",{src:r.A,alt:"info"})})})]}),(0,c.jsx)(t.A,{ref:a,className:"cc-input-field__input",disabled:u,status:x?"error":void 0,...h}),x&&(0,c.jsx)("div",{className:"cc-input-field__error",children:d}),!x&&o&&(0,c.jsx)("div",{className:"cc-input-field__hint",children:o})]})});i.displayName="CometChatInput";const o=i},5808(e,a,s){s.d(a,{A:()=>n});var l=s(65043),t=s(97914);var r=s(70579);const n=(0,l.forwardRef)((e,a)=>{let{Form:s,label:l,name:n,onChange:c,placeholder:i,rules:o=[],formItemStyles:d={},validateStatus:m,help:u,onFocusHandler:p=()=>{},onBlurHandler:h=()=>{},autoFocus:x=!1,subTextCustom:v="",disabled:f=!1,smallText:_=!1,onKeyDown:j=()=>{},value:b="",customFormError:N=!1,...A}=e,C="v2FormInput";return v&&(C="v2FormInput withSubtextCustom"),f&&(C="v2FormInput disabledInput"),_&&(C="v2FormInput smallText"),(0,r.jsxs)("div",{className:"__formInputWrapper",children:[(0,r.jsx)(s.Item,{className:C,label:l,name:n,rules:o,style:d,validateStatus:m,help:u,children:(0,r.jsx)(t.A,{autoFocus:x,onFocus:p,onBlur:h,size:"large",placeholder:i,onChange:c,onKeyDown:j,disabled:f,value:b,...A,ref:a})}),v?(0,r.jsx)("div",{className:"subTextCustom",children:v}):"",N?(0,r.jsx)("div",{className:"customFormError",children:N}):""]})})},87184(e,a,s){s.d(a,{A:()=>i});var l=s(65043),t=s(52480),r=s(49859),n=s(6658);var c=s(70579);const i=(0,l.forwardRef)((e,a)=>{let{Form:s,label:l,name:i,onChange:o,placeholder:d,rules:m=[],formItemStyles:u={},validateStatus:p,help:h,...x}=e;return(0,c.jsx)(s.Item,{className:"v2FormInput",label:l,name:i,rules:m,style:u,validateStatus:p,help:h,children:(0,c.jsx)(n.A.Password,{size:"large",placeholder:d,ref:a,onChange:o,...x,iconRender:e=>e?(0,c.jsx)(t.A,{twoToneColor:"#6852D6"}):(0,c.jsx)(r.A,{})})})})},24300(e,a,s){s.d(a,{l$:()=>l.A,RM:()=>m});var l=s(76985),t=s(65043),r=s(36497),n=s(11479),c=s(6265);var i=s(70579);const o=[",","\n","\t"],d=(0,t.forwardRef)((e,a)=>{let{label:s,required:l=!1,helpText:t,hintText:d,error:m,maxTags:u=25,onlyUnique:p=!0,tokenSeparators:h=o,className:x="",disabled:v=!1,placeholder:f="Add a tag",value:_,onChange:j,options:b,...N}=e;const A=!!m,C=Array.isArray(b)&&b.length>0,g=["cc-tag-input",A?"cc-tag-input-error":"",x].filter(Boolean).join(" ");return(0,i.jsxs)("div",{className:g,children:[s&&(0,i.jsxs)("div",{className:"cc-tag-input__label-wrapper",children:[(0,i.jsxs)("span",{className:"cc-tag-input__label",children:[s,l&&(0,i.jsx)("span",{className:"cc-tag-input__required",children:" *"})]}),t&&(0,i.jsx)(c.C,{title:t,children:(0,i.jsx)("span",{className:"cc-tag-input__help-icon",children:(0,i.jsx)("img",{src:n.A,alt:"info"})})})]}),(0,i.jsx)(r.A,{ref:a,mode:"tags",className:"cc-tag-input__input",popupClassName:"cc-tag-input__dropdown",tokenSeparators:h,value:_,onChange:(e,a)=>{const s=(Array.isArray(e)?e:[]).map(e=>"string"===typeof e?e.trim():e).filter(e=>Boolean(e)),l=(p?Array.from(new Set(s)):s).slice(0,u);null===j||void 0===j||j(l,a)},disabled:v,placeholder:f,status:A?"error":void 0,options:b,suffixIcon:null,dropdownStyle:C?void 0:{display:"none"},notFoundContent:null,...N}),(m||d)&&(0,i.jsx)("span",{className:"cc-tag-input__hint "+(A?"cc-tag-input__hint-error":""),children:m||d})]})});d.displayName="CometChatTagInput";const m=d;
1s(6501),s(5808),s(87184),s(68567),s(60376),s(97916)},99792(e,a,s){s.d(a,{j:()=>d});var l=s(65043),t=s(6658),r=s(11479),n=s(6265);var c=s(70579);const{TextArea:i}=t.A,o=(0,l.forwardRef)((e,a)=>{let{label:s,required:l=!1,helpText:t,hintText:o,error:d,className:m="",disabled:u=!1,...p}=e;const h=!!d,x=h?"cc-textarea-field-destructive":"",v=u?"cc-textarea-field-disabled":"";return(0,c.jsxs)("div",{className:`cc-textarea-field ${x} ${v} ${m}`,children:[s&&(0,c.jsxs)("div",{className:"cc-textarea-field__label",children:[(0,c.jsxs)("span",{className:"cc-textarea-field__label-text",children:[s,l&&(0,c.jsx)("span",{className:"cc-textarea-field__label-required",children:" *"})]}),t&&(0,c.jsx)(n.C,{title:t,children:(0,c.jsx)("span",{className:"cc-textarea-field__label-help",children:(0,c.jsx)("img",{src:r.A,alt:"info"})})})]}),(0,c.jsx)(i,{ref:a,className:"cc-textarea-field__input",disabled:u,status:h?"error":void 0,...p}),h&&(0,c.jsx)("div",{className:"cc-textarea-field__error",children:d}),!h&&o&&(0,c.jsx)("div",{className:"cc-textarea-field__hint",children:o})]})});o.displayName="CometChatTextArea";const d=o},16339(e,a,s){s.d(a,{A:()=>n});s(65043);var l=s(96651);var t=s(70579);const r=e=>{let{children:a,overlayClassName:s="",...r}=e;return(0,t.jsx)(l.A,{overlayClassName:`cc-tooltip ${s}`,...r,children:a})};r.displayName="CometChatTooltip";const n=r},6265(e,a,s){s.d(a,{C:()=>l.A});var l=s(16339)},97525(e,a,s){s.r(a),s.d(a,{default:()=>f});var l=s(65043),t=s(97508),r=s(28108),n=s(53536),c=s.n(n),i=s(57646),o=s(78203),d=s(99792),m=s(24300),u=s(57346);const p="style_cc-ai-instruction-form__RL2K8",h="style_cc-ai-instruction-form__fields__nh513",x="style_cc-ai-instruction-form__footer__wna5n";var v=s(70579);const f=e=>{let{mode:a,id:s,onClose:n,previewMode:f=!1,onPreviewInteraction:_}=e;const[j]=r.A.useForm(),b=(0,t.wA)(),N=(0,t.d4)(e=>e.customBots.aiInstructionsActive),A=(0,t.d4)(e=>e.customBots.areAiInstructionsLoading),C=(0,u.A)(n),g="edit"===a;(0,l.useEffect)(()=>{g&&s&&b({type:"customBots/GET_AI_INSTRUCTION",payload:{id:s}})},[b,g,s]),(0,l.useEffect)(()=>{g&&(null===N||void 0===N?void 0:N.id)===s&&j.setFieldsValue({name:N.name,prompt:N.prompt})},[N,j,g,s]);return(0,v.jsx)(o.Y,{title:g?"Edit Instruction":"Add Instruction",placement:"right",closable:!0,open:C.open,afterOpenChange:C.onAfterOpenChange,width:400,className:"moduleFormDrawer",onClose:C.close,maskClosable:!1,children:(0,v.jsx)("div",{className:p,children:(0,v.jsxs)(r.A,{form:j,hideRequiredMark:!0,onFinish:e=>{if(f)return void(null===_||void 0===_||_());const a={name:c().trim(e.name),prompt:c().trim(e.prompt)};b(g&&s?{type:"customBots/UPDATE_AI_INSTRUCTION",id:s,payload:a,onComplete:C.closeOnSaved}:{type:"customBots/ADD_AI_INSTRUCTION",payload:a,onComplete:C.closeOnSaved})},initialValues:{name:"",prompt:""},children:[(0,v.jsxs)("div",{className:h,children:[(0,v.jsx)(r.A.Item,{name:"name",rules:[{required:!0,message:"Please enter the instruction name"}],children:(0,v.jsx)(m.l$,{placeholder:"Enter instruction name",label:"Instruction Name",disabled:f})}),(0,v.jsx)(r.A.Item,{name:"prompt",rules:[{required:!0,message:"Please enter the prompt"}],children:(0,v.jsx)(d.j,{label:"Prompt",helpText:"Describes how the bot should behave in a conversation",rows:6,disabled:f,placeholder:"Enter prompt"})})]}),(0,v.jsxs)("div",{className:x,children:[(0,v.jsx)(i.jP,{hierarchy:"secondary",size:"lg",htmlType:"button",onClick:C.close,children:"Cancel"}),(0,v.jsx)(i.jP,{hierarchy:"black",size:"lg",htmlType:"submit",loading:A,children:g?"Save":"Add"})]})]})})})}},57346(e,a,s){s.d(a,{A:()=>t});var l=s(65043);function t(e){const[a,s]=(0,l.useState)(!1);(0,l.useEffect)(()=>{s(!0)},[]);return{open:a,close:(0,l.useCallback)(()=>s(!1),[]),onAfterOpenChange:(0,l.useCallback)(a=>{a||e()},[e]),closeOnSaved:(0,l.useCallback)(e=>{var a;null!==e&&void 0!==e&&e.error||null!==e&&void 0!==e&&e.cancelled||null!==e&&void 0!==e&&null!==(a=e.data)&&void 0!==a&&a.data&&s(!1)},[])}}}}]); 2//# sourceMappingURL=9323.b24ec1da.chunk.js.map
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.