mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-13 10:52:37 +00:00
1 line
45 KiB
JavaScript
1 line
45 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[6902],{2890:function(e,t,n){n.d(t,{IH:function(){return v},RB:function(){return w},SJ:function(){return h},Xy:function(){return k},iO:function(){return y},u9:function(){return c},wU:function(){return p}});var i=n(90819),r=n.n(i),s=n(73193),a=n.n(s),o=n(89933),u=n.n(o),l=n(39497),d=n(14906);function c(e){return g.apply(this,arguments)}function g(){return(g=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/query/org",{method:"GET",params:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return f.apply(this,arguments)}function f(){return(f=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/create",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return S.apply(this,arguments)}function S(){return(S=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/update",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return m.apply(this,arguments)}function m(){return(m=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/delete",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(e){return b.apply(this,arguments)}function b(){return(b=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/enable",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return x.apply(this,arguments)}function x(){return(x=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/disable",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return j.apply(this,arguments)}function j(){return(j=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/agent/settings/publish",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},43167:function(e,t,n){n.d(t,{Dm:function(){return w},Y2:function(){return p},jT:function(){return v},zN:function(){return h},zc:function(){return c}});var i=n(90819),r=n.n(i),s=n(73193),a=n.n(s),o=n(89933),u=n.n(o),l=n(39497),d=n(14906);function c(e){return g.apply(this,arguments)}function g(){return(g=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/workgroup/settings/query/org",{method:"GET",params:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return f.apply(this,arguments)}function f(){return(f=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/workgroup/settings/create",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return S.apply(this,arguments)}function S(){return(S=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/workgroup/settings/update",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return m.apply(this,arguments)}function m(){return(m=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/workgroup/settings/delete",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(e){return b.apply(this,arguments)}function b(){return(b=u()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.request)("/api/v1/workgroup/settings/publish",{method:"POST",data:a()(a()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},84262:function(e,t,n){n(90819),n(89933),n(73193),n(45332),n(10404),n(8938),n(24388),n(39497),n(14906),n(44194),n(28427),n(99665),n(73614),n(31549)},27153:function(e,t,n){var i=n(73193),r=n.n(i),s=n(90819),a=n.n(s),o=n(89933),u=n.n(o),l=n(45332),d=n.n(l),c=n(99665),g=n(39497),v=(n(71256),n(25784)),f=n(42491),p=n(14906),S=n(44194),h=(n(11329),n(91361)),m=n(31549);t.Z=function(e){var t=e.type,n=(0,p.useIntl)(),i=v.A.useForm(),s=d()(i,1)[0],o=(0,h.Z)().translateString,l=(0,S.useState)(!1),w=d()(l,2),b=(w[0],w[1]),y=(0,S.useState)(""),x=d()(y,2),k=(x[0],x[1]),j=(0,c.z)((function(e){return{currentRobotSettings:e.currentRobotSettings,currentAgentSettings:e.currentAgentSettings,currentWorkgroupSettings:e.currentWorkgroupSettings,setCurrentRobotSettings:e.setCurrentRobotSettings,setCurrentAgentSettings:e.setCurrentAgentSettings,setCurrentWorkgroupSettings:e.setCurrentWorkgroupSettings}})),C=j.currentRobotSettings,T=j.currentAgentSettings,q=j.currentWorkgroupSettings,R=j.setCurrentRobotSettings,M=j.setCurrentAgentSettings,U=j.setCurrentWorkgroupSettings,F=(0,S.useState)(!1),A=d()(F,2),Z=A[0];A[1];(0,S.useEffect)((function(){var e,n,i,r;if(t===g.Njn)s.setFieldValue("showRateBtn",null==T||null===(e=T.serviceSettings)||void 0===e?void 0:e.showRateBtn),s.setFieldValue("autoInviteRate",null==T||null===(n=T.serviceSettings)||void 0===n?void 0:n.autoInviteRate),k(o(null==T||null===(i=T.serviceSettings)||void 0===i?void 0:i.inviteRateTip)),b(!(null==T||null===(r=T.serviceSettings)||void 0===r||!r.showRateBtn));else if(t===g.aZD){var a,u,l,d;s.setFieldValue("showRateBtn",null==q||null===(a=q.serviceSettings)||void 0===a?void 0:a.showRateBtn),s.setFieldValue("autoInviteRate",null==q||null===(u=q.serviceSettings)||void 0===u?void 0:u.autoInviteRate),k(o(null==q||null===(l=q.serviceSettings)||void 0===l?void 0:l.inviteRateTip)),b(!(null==q||null===(d=q.serviceSettings)||void 0===d||!d.showRateBtn))}else if(t===g._X4){var c,v,f,p;s.setFieldValue("showRateBtn",null==C||null===(c=C.serviceSettings)||void 0===c?void 0:c.showRateBtn),s.setFieldValue("autoInviteRate",null==C||null===(v=C.serviceSettings)||void 0===v?void 0:v.autoInviteRate),k(o(null==C||null===(f=C.serviceSettings)||void 0===f?void 0:f.inviteRateTip)),b(!(null==C||null===(p=C.serviceSettings)||void 0===p||!p.showRateBtn))}}),[null==C?void 0:C.uid,null==T?void 0:T.uid,null==q?void 0:q.uid]);var N=function(){var e=u()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("onFinish:",t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(){var e=u()(a()().mark((function e(n){var i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("TabRating handleChange autoInviteRate",n),s.setFieldValue("autoInviteRate",n),i={autoInviteRate:n},t===g.Njn&&T?M(r()(r()({},T),{},{serviceSettings:r()(r()({},T.serviceSettings),i),draftServiceSettings:r()(r()({},T.draftServiceSettings||{}),i)})):t===g._X4&&C?R(r()(r()({},C),{},{serviceSettings:r()(r()({},C.serviceSettings),i),draftServiceSettings:r()(r()({},C.draftServiceSettings||{}),i)})):t===g.aZD&&q&&U(r()(r()({},q),{},{serviceSettings:r()(r()({},q.serviceSettings),i),draftServiceSettings:r()(r()({},q.draftServiceSettings||{}),i)}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(v.A,{form:s,onFinish:N,submitter:!1,style:{marginLeft:"20px"},children:[(0,m.jsx)(f.Z,{width:"md",name:"autoInviteRate",label:n.formatMessage({id:"rate.auto.invite.rate"}),tooltip:n.formatMessage({id:"rate.auto.invite.rate.tooltip"}),fieldProps:{onChange:I,disabled:Z}}),!1]})})}},66547:function(e,t,n){var i=n(73193),r=n.n(i),s=n(90819),a=n.n(s),o=n(89933),u=n.n(o),l=n(45332),d=n.n(l),c=n(19433),g=n(2890),v=n(88894),f=n(43167),p=n(12864),S=n(7704),h=n(10404),m=n(8938),w=n(24388),b=n(99665),y=n(98830),x=n(91361),k=n(39497),j=n(25784),C=n(42491),T=n(89965),q=n(2250),R=n(14906),M=n(44194),U=n(77033),F=n(67738),A=n(13847),Z=n(41466),N=n(44929),I=n(40795),X=n(5932),L=n(73614),_=n(33019),W=n(75580),P=n(2077),V=n(31549);t.Z=function(e){var t,n,i,s,o,l,D,K,E=e.type,O=e.settingsUid,B=e.isActive,J=void 0===B||B,z=(0,R.useIntl)(),Q=j.A.useForm(),$=d()(Q,1)[0],H=(0,y.u)((function(e){return e.currentOrg})),Y=(0,x.Z)().translateString,G=(0,M.useState)(),ee=d()(G,2),te=ee[0],ne=ee[1],ie=(0,M.useState)(),re=d()(ie,2),se=re[0],ae=re[1],oe=(0,M.useState)(),ue=d()(oe,2),le=ue[0],de=ue[1],ce=(0,M.useState)("iframe"),ge=d()(ce,2),ve=ge[0],fe=ge[1],pe=(0,M.useState)(0),Se=d()(pe,2),he=Se[0],me=Se[1],we=(0,M.useState)(!1),be=d()(we,2),ye=be[0],xe=be[1],ke=(0,M.useRef)(Promise.resolve()),je=(0,M.useState)("desktop"),Ce=d()(je,2),Te=Ce[0],qe=Ce[1],Re=(0,M.useState)(),Me=d()(Re,2),Ue=Me[0],Fe=Me[1],Ae=(0,M.useState)(),Ze=d()(Ae,2),Ne=Ze[0],Ie=Ze[1],Xe=(0,M.useState)(),Le=d()(Xe,2),_e=Le[0],We=Le[1],Pe=(0,M.useCallback)((function(){var e=(null==H?void 0:H.uid)||"unknown",t=E===k.Njn?"agent":E===k._X4?"robot":"workgroup";return"admin.preview.selected.".concat(t,".").concat(e)}),[null==H?void 0:H.uid,E]),Ve=(0,M.useCallback)((function(){try{return localStorage.getItem(Pe())||void 0}catch(e){return}}),[Pe]),De=(0,M.useCallback)((function(e){try{var t=Pe();e?localStorage.setItem(t,e):localStorage.removeItem(t)}catch(e){}}),[Pe]),Ke=(0,m.V)((function(e){return{robotResult:e.robotResult,setRobotResult:e.setRobotResult}})),Ee=Ke.robotResult,Oe=Ke.setRobotResult,Be=(0,h.E)((function(e){return{agentResult:e.agentResult,setAgentResult:e.setAgentResult}})),Je=Be.agentResult,ze=Be.setAgentResult,Qe=(0,w.$)((function(e){return{workgroupResult:e.workgroupResult,setWorkgroupResult:e.setWorkgroupResult}})),$e=Qe.workgroupResult,He=Qe.setWorkgroupResult,Ye=(0,b.z)((function(e){return{currentRobotSettings:e.currentRobotSettings,currentAgentSettings:e.currentAgentSettings,currentWorkgroupSettings:e.currentWorkgroupSettings,setCurrentRobotSettings:e.setCurrentRobotSettings,setCurrentAgentSettings:e.setCurrentAgentSettings,setCurrentWorkgroupSettings:e.setCurrentWorkgroupSettings}})),Ge=Ye.currentRobotSettings,et=Ye.currentAgentSettings,tt=Ye.currentWorkgroupSettings,nt=Ye.setCurrentRobotSettings,it=Ye.setCurrentAgentSettings,rt=Ye.setCurrentWorkgroupSettings,st=((0,M.useCallback)(function(){var e=u()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[]),(0,M.useMemo)((function(){if(E===k._X4){var e,t=Ue||(null==Ee||null===(e=Ee.data)||void 0===e||null===(e=e.content)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.uid)||"";return{chatType:k.ACv,chatSid:t}}if(E===k.Njn){var n,i=Ne||(null==Je||null===(n=Je.data)||void 0===n||null===(n=n.content)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.uid)||"";return{chatType:k._0X,chatSid:i}}if(E===k.aZD){var r,s=_e||(null==$e||null===(r=$e.data)||void 0===r||null===(r=r.content)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.uid)||"";return{chatType:k.I$6,chatSid:s}}return{chatType:k.ACv,chatSid:""}}),[E,Ue,null==Ee||null===(t=Ee.data)||void 0===t?void 0:t.content,Ne,null==Je||null===(n=Je.data)||void 0===n?void 0:n.content,_e,null==$e||null===(i=$e.data)||void 0===i?void 0:i.content])),at=st.chatType,ot=st.chatSid,ut=function(){var e=u()(a()().mark((function e(){var t,n,i,r,s,o,u;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c.yw.loading(z.formatMessage({id:"loading",defaultMessage:"Loading"})),t={pageNumber:0,pageSize:50,type:k.QPQ,orgUid:null==H?void 0:H.uid},e.prev=2,e.next=5,(0,S.AP)(t);case 5:n=e.sent,console.log("TabRight.getKbases response:",t,n),c.yw.destroy(),200===n.code?(r={code:n.code,message:n.message,data:{content:n.data.content.map((function(e){return{uid:e.uid,name:e.name,type:e.type,orgUid:e.orgUid}})),totalElements:n.data.totalElements,totalPages:n.data.totalPages,number:n.data.number}},ae(r),o=E===k._X4?null==Ge?void 0:Ge.draftServiceSettings:E===k.Njn?null==et?void 0:et.draftServiceSettings:null==tt?void 0:tt.draftServiceSettings,u=E===k._X4?null==Ge?void 0:Ge.serviceSettings:E===k.Njn?null==et?void 0:et.serviceSettings:null==tt?void 0:tt.serviceSettings,null!=o&&o.faqKbUid?s=o.faqKbUid:null!=u&&u.faqKbUid?s=u.faqKbUid:(null===(i=r.data)||void 0===i||null===(i=i.content)||void 0===i?void 0:i.length)>0&&(s=r.data.content[0].uid),s&&(de(s),$.setFieldValue("faqKbUid",s),lt(s))):c.yw.error(n.message),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),c.yw.destroy(),console.error("TabRight 获取知识库失败:",e.t0),c.yw.error("获取知识库失败");case 16:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(){return e.apply(this,arguments)}}(),lt=function(){var e=u()(a()().mark((function e(t){var n,i,r,s,o,u,l,d;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||le){e.next=4;break}return console.log("TabRight: 没有选择知识库,无法获取FAQ"),ne(void 0),e.abrupt("return");case 4:return c.yw.loading(z.formatMessage({id:"loading",defaultMessage:"Loading"})),n={pageNumber:0,pageSize:100,orgUid:null==H?void 0:H.uid,kbUid:t||le},e.prev=6,e.next=9,(0,p.pf)(n);case 9:i=e.sent,console.log("TabRight.getFaqs response:",n,i),c.yw.destroy(),200===i.code?(r={code:i.code,message:i.message,data:{content:i.data.content.map((function(e){return{uid:e.uid,question:e.question,answer:e.answer,kbUid:e.kbUid,orgUid:e.orgUid}})),totalElements:i.data.totalElements,totalPages:i.data.totalPages,number:i.data.number}},ne(r),s=t||le,o=$.getFieldValue("faqUids")||[],s&&o.length>0&&(l=(null===(u=r.data.content)||void 0===u?void 0:u.map((function(e){return e.uid})))||[],(d=o.filter((function(e){return l.includes(e)}))).length!==o.length&&$.setFieldValue("faqUids",d))):c.yw.error(i.message),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(6),c.yw.destroy(),console.error("TabRight 获取FAQ失败:",e.t0),c.yw.error("获取FAQ失败");case 20:case"end":return e.stop()}}),e,null,[[6,15]])})));return function(t){return e.apply(this,arguments)}}();(0,M.useEffect)((function(){if(E===k._X4){var e=(null==Ge?void 0:Ge.draftServiceSettings)||(null==Ge?void 0:Ge.serviceSettings),t=null==e?void 0:e.showRightIframe,n=null==e?void 0:e.showFaqs;$.setFieldsValue({showRightIframe:t,rightIframeUrl:null==e?void 0:e.rightIframeUrl,showFaqs:n,faqKbUid:null==e?void 0:e.faqKbUid,faqUids:Array.isArray(null==e?void 0:e.faqUids)?null==e?void 0:e.faqUids:Array.isArray(null==e?void 0:e.faqs)?(null==e?void 0:e.faqs).map((function(e){return null==e?void 0:e.uid})).filter(Boolean):[]})}else if(E===k.Njn){var i=(null==et?void 0:et.draftServiceSettings)||(null==et?void 0:et.serviceSettings),r=null==i?void 0:i.showRightIframe,s=null==i?void 0:i.showFaqs;$.setFieldsValue({showRightIframe:r,rightIframeUrl:null==i?void 0:i.rightIframeUrl,showFaqs:s,faqKbUid:null==i?void 0:i.faqKbUid,faqUids:Array.isArray(null==i?void 0:i.faqUids)?null==i?void 0:i.faqUids:Array.isArray(null==i?void 0:i.faqs)?(null==i?void 0:i.faqs).map((function(e){return null==e?void 0:e.uid})).filter(Boolean):[]})}else if(E===k.aZD){var a=(null==tt?void 0:tt.draftServiceSettings)||(null==tt?void 0:tt.serviceSettings),o=null==a?void 0:a.showRightIframe,u=null==a?void 0:a.showFaqs;$.setFieldsValue({showRightIframe:o,rightIframeUrl:null==a?void 0:a.rightIframeUrl,showFaqs:u,faqKbUid:null==a?void 0:a.faqKbUid,faqUids:Array.isArray(null==a?void 0:a.faqUids)?null==a?void 0:a.faqUids:Array.isArray(null==a?void 0:a.faqs)?(null==a?void 0:a.faqs).map((function(e){return null==e?void 0:e.uid})).filter(Boolean):[]})}}),[Ge,et,tt,at,ot,null==H?void 0:H.uid]),(0,M.useEffect)((function(){null!=H&&H.uid&&ut()}),[null==H?void 0:H.uid,E]),(0,M.useEffect)((function(){var e=function(){var e=u()(a()().mark((function e(){var t,n,i,r,s,o,u,l,d,c,g,v,f,p,S,h,m,w,b,y,x;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=H&&H.uid){e.next=2;break}return e.abrupt("return");case 2:if(e.prev=2,E!==k.Njn){e.next=11;break}return t={pageNumber:0,pageSize:100,orgUid:H.uid},e.next=7,(0,_._t)(t);case 7:200===(n=e.sent).code&&(ze(n),r=(null===(i=n.data)||void 0===i?void 0:i.content)||[],s=Ve(),(o=s?r.find((function(e){return(null==e?void 0:e.uid)===s})):void 0)?Ie(o.uid):!Ne&&r.length&&(u=r[0],Ie(null==u?void 0:u.uid),De(null==u?void 0:u.uid))),e.next=25;break;case 11:if(E!==k._X4){e.next=19;break}return l={pageNumber:0,pageSize:100,level:k.whQ,type:k.f4h,orgUid:H.uid},e.next=15,(0,W.p0)(l);case 15:200===(d=e.sent).code&&(Oe(d),g=(null===(c=d.data)||void 0===c?void 0:c.content)||[],v=Ve(),(f=v?g.find((function(e){return(null==e?void 0:e.uid)===v})):void 0)?Fe(f.uid):!Ue&&g.length&&(p=g[0],Fe(null==p?void 0:p.uid),De(null==p?void 0:p.uid))),e.next=25;break;case 19:if(E!==k.aZD){e.next=25;break}return S={pageNumber:0,pageSize:100,orgUid:H.uid},e.next=23,(0,P.LE)(S);case 23:200===(h=e.sent).code&&(He(h),w=(null===(m=h.data)||void 0===m?void 0:m.content)||[],b=Ve(),(y=b?w.find((function(e){return(null==e?void 0:e.uid)===b})):void 0)?We(y.uid):!_e&&w.length&&(x=w[0],We(null==x?void 0:x.uid),De(null==x?void 0:x.uid)));case 25:e.next=30;break;case 27:e.prev=27,e.t0=e.catch(2),console.warn("加载预览实体失败(忽略):",e.t0);case 30:case"end":return e.stop()}}),e,null,[[2,27]])})));return function(){return e.apply(this,arguments)}}();e()}),[null==H?void 0:H.uid,E,ze,Oe,He,Ne,Ue,_e,Ve,De]),(0,M.useEffect)((function(){void 0!==O&&ct("switch-settings")}),[O]);var dt=function(){var e=u()(a()().mark((function e(){var t,n,i,s,o,u;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E===k.Njn?null==et?void 0:et.uid:E===k._X4?null==Ge?void 0:Ge.uid:null==tt?void 0:tt.uid){e.next=3;break}return e.abrupt("return",!0);case 3:return e.prev=3,e.next=6,$.validateFields();case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),c.yw.warning(z.formatMessage({id:"form.validate.failed",defaultMessage:"请先修正表单校验错误"})),e.abrupt("return",!1);case 12:if(t=$.getFieldsValue(),n={showRightIframe:t.showRightIframe,rightIframeUrl:t.rightIframeUrl,showFaqs:t.showFaqs,faqKbUid:t.faqKbUid,faqUids:Array.isArray(t.faqUids)?t.faqUids:void 0},e.prev=14,xe(!0),i=function(e,t,n){return r()(r()(r()({},e||{}),t||{}),n||{})},E!==k.Njn||!et){e.next=23;break}return s=i(et.serviceSettings,et.draftServiceSettings,n),e.next=21,(0,g.wU)({uid:et.uid,serviceSettings:s});case 21:case 27:e.next=33;break;case 23:if(E!==k._X4||!Ge){e.next=29;break}return o=i(Ge.serviceSettings,Ge.draftServiceSettings,n),e.next=27,(0,v.sK)({uid:Ge.uid,serviceSettings:o});case 29:if(E!==k.aZD||!tt){e.next=33;break}return u=i(tt.serviceSettings,tt.draftServiceSettings,n),e.next=33,(0,f.Y2)({uid:tt.uid,serviceSettings:u});case 33:return e.abrupt("return",!0);case 36:return e.prev=36,e.t1=e.catch(14),console.warn("保存右侧配置失败(忽略刷新):",e.t1),c.yw.error(z.formatMessage({id:"save.failed",defaultMessage:"保存失败"})),e.abrupt("return",!1);case 41:return e.prev=41,xe(!1),e.finish(41);case 44:case"end":return e.stop()}}),e,null,[[3,8],[14,36,41,44]])})));return function(){return e.apply(this,arguments)}}(),ct=function(){var e=u()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke.current;case 2:if(!ye){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,dt();case 6:e.sent&&J&&me((function(e){return e+1}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),gt=function(){var e=u()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("onFinish:",t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),vt=function(){var e=u()(a()().mark((function e(t){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("TabRight handleChange showRightIframe",t),$.setFieldValue("showRightIframe",t),n={showRightIframe:t},E===k.Njn&&et?it(r()(r()({},et),{},{serviceSettings:r()(r()({},et.serviceSettings),n),draftServiceSettings:r()(r()({},et.draftServiceSettings||{}),n)})):E===k._X4&&Ge?nt(r()(r()({},Ge),{},{serviceSettings:r()(r()({},Ge.serviceSettings),n),draftServiceSettings:r()(r()({},Ge.draftServiceSettings||{}),n)})):E===k.aZD&&tt&&rt(r()(r()({},tt),{},{serviceSettings:r()(r()({},tt.serviceSettings),n),draftServiceSettings:r()(r()({},tt.draftServiceSettings||{}),n)}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ft=function(){var e=u()(a()().mark((function e(t){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("TabRight handleChange showFaqs",t),$.setFieldValue("showFaqs",t),n={showFaqs:t},E===k.Njn&&et?it(r()(r()({},et),{},{serviceSettings:r()(r()({},et.serviceSettings),n),draftServiceSettings:r()(r()({},et.draftServiceSettings||{}),n)})):E===k._X4&&Ge?nt(r()(r()({},Ge),{},{serviceSettings:r()(r()({},Ge.serviceSettings),n),draftServiceSettings:r()(r()({},Ge.draftServiceSettings||{}),n)})):E===k.aZD&&tt&&rt(r()(r()({},tt),{},{serviceSettings:r()(r()({},tt.serviceSettings),n),draftServiceSettings:r()(r()({},tt.draftServiceSettings||{}),n)}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pt=(0,M.useMemo)((function(){return O||(E===k.Njn?null==et?void 0:et.uid:E===k._X4?null==Ge?void 0:Ge.uid:E===k.aZD?null==tt?void 0:tt.uid:void 0)}),[O,E,null==et?void 0:et.uid,null==Ge?void 0:Ge.uid,null==tt?void 0:tt.uid]);(0,M.useEffect)((function(){J&&ct("tab-activated")}),[J]);var St=(0,M.useMemo)((function(){if(!J)return"";var e=(0,X.Cn)(),t=new URLSearchParams({org:(null==H?void 0:H.uid)||"",t:at,sid:ot,debug:"1",k:String(he)});pt&&t.set("settingsUid",pt);var n="".concat(e,"?").concat(t.toString());return console.log("Chat Preview URL Right:",n),n}),[null==H?void 0:H.uid,at,ot,he,pt,J]),ht=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(C.Z,{width:"md",name:"showRightIframe",label:(0,V.jsxs)("span",{children:[z.formatMessage({id:"showRightIframe"}),(0,V.jsx)(L.Z,{type:"service",keys:["showRightIframe"],live:E===k.Njn?null==et?void 0:et.serviceSettings:E===k._X4?null==Ge?void 0:Ge.serviceSettings:null==tt?void 0:tt.serviceSettings,draft:E===k.Njn?null==et?void 0:et.draftServiceSettings:E===k._X4?null==Ge?void 0:Ge.draftServiceSettings:null==tt?void 0:tt.draftServiceSettings})]}),fieldProps:{onChange:vt,disabled:ye}}),(0,V.jsx)(T.Z,{width:"md",name:"rightIframeUrl",label:(0,V.jsxs)("span",{children:[z.formatMessage({id:"rightIframeUrl"}),(0,V.jsx)(L.Z,{type:"service",keys:["rightIframeUrl"],live:E===k.Njn?null==et?void 0:et.serviceSettings:E===k._X4?null==Ge?void 0:Ge.serviceSettings:null==tt?void 0:tt.serviceSettings,draft:E===k.Njn?null==et?void 0:et.draftServiceSettings:E===k._X4?null==Ge?void 0:Ge.draftServiceSettings:null==tt?void 0:tt.draftServiceSettings})]}),placeholder:z.formatMessage({id:"rightIframeUrl.placeholder",defaultMessage:"请输入以 http:// 或 https:// 开头的URL"}),rules:[{type:"url",message:z.formatMessage({id:"rightIframeUrl.invalid",defaultMessage:"请输入有效的URL地址"})},{pattern:/^https?:\/\/[^\s]+$/i,message:z.formatMessage({id:"rightIframeUrl.scheme.required",defaultMessage:"必须以 http:// 或 https:// 开头"})}],fieldProps:{type:"url",inputMode:"url",allowClear:!0,disabled:ye}})]}),mt=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(C.Z,{width:"md",name:"showFaqs",label:(0,V.jsxs)("span",{children:[z.formatMessage({id:"faq.show.faqs"}),(0,V.jsx)(L.Z,{type:"service",keys:["showFaqs"],live:E===k.Njn?null==et?void 0:et.serviceSettings:E===k._X4?null==Ge?void 0:Ge.serviceSettings:null==tt?void 0:tt.serviceSettings,draft:E===k.Njn?null==et?void 0:et.draftServiceSettings:E===k._X4?null==Ge?void 0:Ge.draftServiceSettings:null==tt?void 0:tt.draftServiceSettings})]}),fieldProps:{onChange:ft,disabled:ye}}),(0,V.jsx)(q.Z,{name:"faqKbUid",width:"md",label:(0,V.jsxs)("span",{children:[z.formatMessage({id:"faq.kbase.select",defaultMessage:"选择侧边栏常见问题知识库"}),(0,V.jsx)(L.Z,{type:"service",keys:["faqKbUid"],live:E===k.Njn?null==et?void 0:et.serviceSettings:E===k._X4?null==Ge?void 0:Ge.serviceSettings:null==tt?void 0:tt.serviceSettings,draft:E===k.Njn?null==et?void 0:et.draftServiceSettings:E===k._X4?null==Ge?void 0:Ge.draftServiceSettings:null==tt?void 0:tt.draftServiceSettings})]}),options:null==se||null===(s=se.data)||void 0===s||null===(s=s.content)||void 0===s?void 0:s.map((function(e){return{label:Y(e.name),value:e.uid}})),fieldProps:{onChange:function(e){console.log("TabRight selected kbase:",e),de(e),$.setFieldValue("faqUids",[]),lt(e);var t={faqKbUid:e,faqs:void 0,faqUids:[]};E===k.Njn&&et?it(r()(r()({},et),{},{serviceSettings:r()(r()({},et.serviceSettings),t),draftServiceSettings:r()(r()({},et.draftServiceSettings||{}),t)})):E===k._X4&&Ge?nt(r()(r()({},Ge),{},{serviceSettings:r()(r()({},Ge.serviceSettings),t),draftServiceSettings:r()(r()({},Ge.draftServiceSettings||{}),t)})):E===k.aZD&&tt&&rt(r()(r()({},tt),{},{serviceSettings:r()(r()({},tt.serviceSettings),t),draftServiceSettings:r()(r()({},tt.draftServiceSettings||{}),t)}))},allowClear:!0,placeholder:z.formatMessage({id:"choose",defaultMessage:"Choose"}),disabled:ye}}),(0,V.jsx)(q.Z,{name:"faqUids",width:"md",label:(0,V.jsxs)("span",{children:[z.formatMessage({id:"menu.kbase.faq"}),(0,V.jsx)(L.Z,{type:"service",keys:["faqUids"],live:E===k.Njn?null==et?void 0:et.serviceSettings:E===k._X4?null==Ge?void 0:Ge.serviceSettings:null==tt?void 0:tt.serviceSettings,draft:E===k.Njn?null==et?void 0:et.draftServiceSettings:E===k._X4?null==Ge?void 0:Ge.draftServiceSettings:null==tt?void 0:tt.draftServiceSettings})]}),options:null==te||null===(o=te.data)||void 0===o||null===(o=o.content)||void 0===o?void 0:o.map((function(e){return{label:Y(e.question),value:e.uid}})),fieldProps:{mode:"multiple",allowClear:!0,placeholder:z.formatMessage({id:"choose",defaultMessage:"Choose"}),disabled:ye}})]});return(0,V.jsxs)(U.Z,{children:[(0,V.jsx)(U.Z.Panel,{defaultSize:"30%",min:"20%",max:"50%",children:(0,V.jsx)("div",{style:{padding:"0 16px",height:"100%",overflowY:"auto"},children:(0,V.jsx)(j.A,{form:$,onFinish:gt,onValuesChange:function(e,t){var n={rightIframeUrl:t.rightIframeUrl,faqKbUid:t.faqKbUid,faqUids:t.faqUids,showRightIframe:t.showRightIframe,showFaqs:t.showFaqs};E===k.Njn&&et?it(r()(r()({},et),{},{serviceSettings:r()(r()({},et.serviceSettings),n),draftServiceSettings:r()(r()({},et.draftServiceSettings||{}),n)})):E===k._X4&&Ge?nt(r()(r()({},Ge),{},{serviceSettings:r()(r()({},Ge.serviceSettings),n),draftServiceSettings:r()(r()({},Ge.draftServiceSettings||{}),n)})):E===k.aZD&&tt&&rt(r()(r()({},tt),{},{serviceSettings:r()(r()({},tt.serviceSettings),n),draftServiceSettings:r()(r()({},tt.draftServiceSettings||{}),n)}))},submitter:!1,children:(0,V.jsx)(F.Z,{activeKey:ve,onChange:fe,items:[{key:"iframe",label:z.formatMessage({id:"showRightIframe",defaultMessage:"右侧iframe"}),children:ht},{key:"faq",label:z.formatMessage({id:"faq.show.faqs",defaultMessage:"常见问题"}),children:mt}]})})})}),(0,V.jsx)(U.Z.Panel,{children:(0,V.jsxs)("div",{style:{height:"100%",padding:"16px",background:"#f0f2f5",display:"flex",flexDirection:"column"},children:[(0,V.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8,gap:12},children:[E===k.Njn&&(0,V.jsx)(A.Z,{style:{minWidth:220},value:Ne,placeholder:z.formatMessage({id:"preview.select.agent",defaultMessage:"选择预览客服"}),options:((null==Je||null===(l=Je.data)||void 0===l?void 0:l.content)||[]).map((function(e){return{value:e.uid,label:Y(e.nickname)}})),onChange:function(e){Ie(e),De(e),ct("switch-agent")},allowClear:!0,disabled:ye}),E===k._X4&&(0,V.jsx)(A.Z,{style:{minWidth:220},value:Ue,placeholder:z.formatMessage({id:"preview.select.robot",defaultMessage:"选择预览机器人"}),options:((null==Ee||null===(D=Ee.data)||void 0===D?void 0:D.content)||[]).map((function(e){return{value:e.uid,label:Y(e.nickname)}})),onChange:function(e){Fe(e),De(e),ct("switch-robot")},allowClear:!0,disabled:ye}),E===k.aZD&&(0,V.jsx)(A.Z,{style:{minWidth:220},value:_e,placeholder:z.formatMessage({id:"preview.select.workgroup",defaultMessage:"选择预览工作组"}),options:((null==$e||null===(K=$e.data)||void 0===K?void 0:K.content)||[]).map((function(e){return{value:e.uid,label:Y(e.nickname)}})),onChange:function(e){We(e),De(e),ct("switch-workgroup")},allowClear:!0,disabled:ye}),(0,V.jsx)(Z.Z,{value:Te,onChange:function(e){return qe(e)},options:[{value:"desktop",icon:(0,V.jsx)(N.Z,{})},{value:"mobile",icon:(0,V.jsx)(I.Z,{})}],disabled:ye})]}),(0,V.jsx)("div",{style:{flex:1,minHeight:720,display:"flex",justifyContent:"center"},children:(0,V.jsx)("div",{style:{width:"mobile"===Te?390:"100%",height:"100%",border:"1px solid #d9d9d9",borderRadius:4,overflow:"hidden",background:"#fff"},children:(0,V.jsx)("iframe",{src:St,style:{width:"100%",height:"100%",border:"none"},title:"Chat Preview"},he)})})]})})]})}},90631:function(e,t,n){var i=n(73193),r=n.n(i),s=n(45332),a=n.n(s),o=n(99665),u=n(10404),l=n(39497),d=n(25784),c=n(60796),g=n(14906),v=n(44194),f=n(73614),p=n(31549);t.Z=function(e){var t=e.type,n=d.A.useForm(),i=a()(n,1)[0],s=(0,g.useIntl)(),S=(0,o.z)((function(e){return{currentRobotSettings:e.currentRobotSettings,currentAgentSettings:e.currentAgentSettings,currentWorkgroupSettings:e.currentWorkgroupSettings,setCurrentRobotSettings:e.setCurrentRobotSettings,setCurrentAgentSettings:e.setCurrentAgentSettings,setCurrentWorkgroupSettings:e.setCurrentWorkgroupSettings}})),h=S.currentRobotSettings,m=S.currentAgentSettings,w=S.currentWorkgroupSettings,b=S.setCurrentRobotSettings,y=S.setCurrentAgentSettings,x=S.setCurrentWorkgroupSettings,k=(0,u.E)((function(e){return{currentAgent:e.currentAgent}})).currentAgent;(0,v.useEffect)((function(){if(t===l._X4&&(null!=h&&h.draftServiceSettings||null!=h&&h.serviceSettings)){var e=(null==h?void 0:h.draftServiceSettings)||(null==h?void 0:h.serviceSettings);i.setFieldValue("autoCloseMin",null==e?void 0:e.autoCloseMin),i.setFieldValue("showLogo",null==e?void 0:e.showLogo)}else if(t===l.Njn&&(null!=m&&m.draftServiceSettings||null!=m&&m.serviceSettings)){var n=(null==m?void 0:m.draftServiceSettings)||(null==m?void 0:m.serviceSettings);i.setFieldValue("autoCloseMin",null==n?void 0:n.autoCloseMin),i.setFieldValue("showLogo",null==n?void 0:n.showLogo),i.setFieldValue("maxThreadCount",null==m?void 0:m.maxThreadCount),i.setFieldValue("timeoutRemindTime",null==m?void 0:m.timeoutRemindTime)}else if(t===l.aZD&&(null!=w&&w.draftServiceSettings||null!=w&&w.serviceSettings)){var r=(null==w?void 0:w.draftServiceSettings)||(null==w?void 0:w.serviceSettings);i.setFieldValue("autoCloseMin",null==r?void 0:r.autoCloseMin),i.setFieldValue("showLogo",null==r?void 0:r.showLogo)}}),[null==h?void 0:h.uid,null==m?void 0:m.uid,null==w?void 0:w.uid,null==k?void 0:k.uid]);return(0,p.jsxs)(d.A,{form:i,submitter:!1,style:{marginLeft:"20px"},children:[t===l.Njn&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c.Z,{width:"md",name:"maxThreadCount",label:s.formatMessage({id:"agent.settings.max.thread"}),min:0,fieldProps:{onChange:function(e){t===l.Njn&&m&&y(r()(r()({},m),{},{maxThreadCount:e}))}}}),(0,p.jsx)(c.Z,{width:"md",name:"timeoutRemindTime",label:s.formatMessage({id:"agent.settings.timeout.remind",defaultMessage:"超时提醒时间"}),tooltip:s.formatMessage({id:"agent.settings.timeout.remind.tooltip",defaultMessage:"超过设定时间未回复客户将收到提醒"}),min:1,fieldProps:{addonAfter:s.formatMessage({id:"time.minute",defaultMessage:"分钟"}),onChange:function(e){t===l.Njn&&m&&y(r()(r()({},m),{},{timeoutRemindTime:e}))}}})]}),(0,p.jsx)(c.Z,{width:"md",name:"autoCloseMin",label:(0,p.jsxs)("span",{children:[s.formatMessage({id:"agent.settings.auto.close.time"}),(0,p.jsx)(f.Z,{type:"service",keys:["autoCloseMin"],live:t===l.Njn?null==m?void 0:m.serviceSettings:t===l._X4?null==h?void 0:h.serviceSettings:null==w?void 0:w.serviceSettings,draft:t===l.Njn?null==m?void 0:m.draftServiceSettings:t===l._X4?null==h?void 0:h.draftServiceSettings:null==w?void 0:w.draftServiceSettings})]}),tooltip:s.formatMessage({id:"agent.settings.auto.close.time.tooltip"}),min:1,fieldProps:{onChange:function(e){t===l.Njn&&m?y(r()(r()({},m),{},{serviceSettings:r()(r()({},m.serviceSettings),{},{autoCloseMin:e}),draftServiceSettings:r()(r()({},m.draftServiceSettings||{}),{},{autoCloseMin:e})})):t===l._X4&&h?b(r()(r()({},h),{},{serviceSettings:r()(r()({},h.serviceSettings),{},{autoCloseMin:e}),draftServiceSettings:r()(r()({},h.draftServiceSettings||{}),{},{autoCloseMin:e})})):t===l.aZD&&w&&x(r()(r()({},w),{},{serviceSettings:r()(r()({},w.serviceSettings),{},{autoCloseMin:e}),draftServiceSettings:r()(r()({},w.draftServiceSettings||{}),{},{autoCloseMin:e})}))}}})]})}},1460:function(e,t,n){var i=n(73193),r=n.n(i),s=n(45332),a=n.n(s),o=n(91361),u=n(99665),l=n(39497),d=n(25784),c=n(10434),g=n(14906),v=n(44194),f=n(11329),p=n(71256),S=n(73614),h=n(31549);t.Z=function(e){var t=e.type,n=d.A.useForm(),i=a()(n,1)[0],s=(0,g.useIntl)(),m=(0,o.Z)().translateString,w=(0,v.useState)(!1),b=a()(w,2),y=b[0],x=b[1],k=(0,u.z)((function(e){return{currentAgentSettings:e.currentAgentSettings,currentRobotSettings:e.currentRobotSettings,currentWorkgroupSettings:e.currentWorkgroupSettings,setCurrentAgentSettings:e.setCurrentAgentSettings,setCurrentRobotSettings:e.setCurrentRobotSettings,setCurrentWorkgroupSettings:e.setCurrentWorkgroupSettings}})),j=k.currentAgentSettings,C=k.currentRobotSettings,T=k.currentWorkgroupSettings,q=k.setCurrentAgentSettings,R=k.setCurrentRobotSettings,M=k.setCurrentWorkgroupSettings,U=(0,v.useState)(""),F=a()(U,2),A=F[0],Z=F[1],N=(0,v.useState)(""),I=a()(N,2),X=I[0],L=I[1],_=(0,v.useState)(""),W=a()(_,2),P=W[0],V=W[1],D=(0,v.useState)(""),K=a()(D,2),E=K[0],O=K[1];(0,v.useEffect)((function(){if(t===l._X4&&(null!=C&&C.draftServiceSettings||null!=C&&C.serviceSettings)){var e=(null==C?void 0:C.draftServiceSettings)||(null==C?void 0:C.serviceSettings);L(m(null==e?void 0:e.topTip)),O(m(null==e?void 0:e.autoCloseTip)),x(!(null==e||!e.showTopTip)),i.setFieldValue("showTopTip",null==e?void 0:e.showTopTip)}else if(t===l.Njn&&(null!=j&&j.draftServiceSettings||null!=j&&j.serviceSettings)){var n=(null==j?void 0:j.draftServiceSettings)||(null==j?void 0:j.serviceSettings);L(m(null==n?void 0:n.topTip)),V(m(null==n?void 0:n.agentCloseTip)),O(m(null==n?void 0:n.autoCloseTip));var r=(null==j?void 0:j.draftMessageLeaveSettings)||(null==j?void 0:j.messageLeaveSettings);Z(m(null==r?void 0:r.messageLeaveTip)),x(!(null==n||!n.showTopTip)),i.setFieldValue("showTopTip",null==n?void 0:n.showTopTip)}else if(t===l.aZD&&(null!=T&&T.draftServiceSettings||null!=T&&T.serviceSettings)){var s=(null==T?void 0:T.draftServiceSettings)||(null==T?void 0:T.serviceSettings);L(m(null==s?void 0:s.topTip)),V(m(null==s?void 0:s.agentCloseTip)),O(m(null==s?void 0:s.autoCloseTip));var a=(null==T?void 0:T.draftMessageLeaveSettings)||(null==T?void 0:T.messageLeaveSettings);Z(m(null==a?void 0:a.messageLeaveTip)),x(!(null==s||!s.showTopTip)),i.setFieldValue("showTopTip",null==s?void 0:s.showTopTip)}}),[t,null==C?void 0:C.uid,null==j?void 0:j.uid,null==T?void 0:T.uid]);return(0,h.jsxs)(d.A,{form:i,submitter:!1,style:{marginLeft:"20px"},children:[(0,h.jsx)(c.Z,{name:"showTopTip",width:"md",label:(0,h.jsxs)("span",{children:[s.formatMessage({id:"agent.settings.show.top.tip"}),(0,h.jsx)(S.Z,{type:"service",keys:["showTopTip"],live:t===l.Njn?null==j?void 0:j.serviceSettings:t===l._X4?null==C?void 0:C.serviceSettings:null==T?void 0:T.serviceSettings,draft:t===l.Njn?null==j?void 0:j.draftServiceSettings:t===l._X4?null==C?void 0:C.draftServiceSettings:null==T?void 0:T.draftServiceSettings})]}),fieldProps:{onChange:function(e){var n;if(x(e.target.checked),e.target.checked)if(t===l._X4)L(m(null==C||null===(n=C.serviceSettings)||void 0===n?void 0:n.topTip));else if(t===l.Njn){var i;L(m(null==j||null===(i=j.serviceSettings)||void 0===i?void 0:i.topTip))}else if(t===l.aZD){var s;L(m(null==T||null===(s=T.serviceSettings)||void 0===s?void 0:s.topTip))}t===l.Njn&&j?q(r()(r()({},j),{},{serviceSettings:r()(r()({},j.serviceSettings),{},{showTopTip:e.target.checked}),draftServiceSettings:r()(r()({},j.draftServiceSettings||{}),{},{showTopTip:e.target.checked})})):t===l._X4&&C?R(r()(r()({},C),{},{serviceSettings:r()(r()({},C.serviceSettings),{},{showTopTip:e.target.checked}),draftServiceSettings:r()(r()({},C.draftServiceSettings||{}),{},{showTopTip:e.target.checked})})):t===l.aZD&&T&&M(r()(r()({},T),{},{serviceSettings:r()(r()({},T.serviceSettings),{},{showTopTip:e.target.checked}),draftServiceSettings:r()(r()({},T.draftServiceSettings||{}),{},{showTopTip:e.target.checked})}))}}}),y&&(0,h.jsx)(d.A.Item,{name:"topTip",label:(0,h.jsxs)("span",{children:[s.formatMessage({id:"agent.settings.top.tip"}),(0,h.jsx)(S.Z,{type:"service",keys:["topTip"],live:t===l.Njn?null==j?void 0:j.serviceSettings:t===l._X4?null==C?void 0:C.serviceSettings:null==T?void 0:T.serviceSettings,draft:t===l.Njn?null==j?void 0:j.draftServiceSettings:t===l._X4?null==C?void 0:C.draftServiceSettings:null==T?void 0:T.draftServiceSettings})]}),rules:[{required:!0,message:s.formatMessage({id:"agent.settings.top.tip.required"})}],children:(0,h.jsx)(f.Z,{placeholder:s.formatMessage({id:"agent.settings.top.tip.placeholder"}),value:X,toolbarKeys:(0,p.eD)(),style:{height:"200px",width:"600px"},maxLength:200,onChange:function(e){console.log("topTip onchange:",e),i.setFieldValue("topTip",e),t===l.Njn&&j?q(r()(r()({},j),{},{serviceSettings:r()(r()({},j.serviceSettings),{},{topTip:e}),draftServiceSettings:r()(r()({},j.draftServiceSettings||{}),{},{topTip:e})})):t===l._X4&&C?R(r()(r()({},C),{},{serviceSettings:r()(r()({},C.serviceSettings),{},{topTip:e}),draftServiceSettings:r()(r()({},C.draftServiceSettings||{}),{},{topTip:e})})):t===l.aZD&&T&&M(r()(r()({},T),{},{serviceSettings:r()(r()({},T.serviceSettings),{},{topTip:e}),draftServiceSettings:r()(r()({},T.draftServiceSettings||{}),{},{topTip:e})}))}},"topTipEditor")}),t!==l._X4&&(0,h.jsx)(d.A.Item,{name:"messageLeaveTip",label:(0,h.jsxs)("span",{children:[s.formatMessage({id:"agent.settings.leave.msg"}),(0,h.jsx)(S.Z,{type:"messageLeave",keys:["messageLeaveTip"],live:t===l.Njn?null==j?void 0:j.messageLeaveSettings:null==T?void 0:T.messageLeaveSettings,draft:t===l.Njn?null==j?void 0:j.draftMessageLeaveSettings:null==T?void 0:T.draftMessageLeaveSettings})]}),rules:[{required:!0,message:s.formatMessage({id:"agent.settings.leave.msg.required"})}],children:(0,h.jsx)(f.Z,{placeholder:s.formatMessage({id:"agent.settings.leave.msg.placeholder"}),value:A,toolbarKeys:(0,p.eD)(),style:{height:"200px",width:"600px"},maxLength:200,onChange:function(e){console.log("messageLeaveTip onchange:",e),i.setFieldValue("messageLeaveTip",e),t===l.Njn&&j?q(r()(r()({},j),{},{messageLeaveSettings:r()(r()({},j.messageLeaveSettings),{},{messageLeaveTip:e}),draftMessageLeaveSettings:r()(r()({},j.draftMessageLeaveSettings||{}),{},{messageLeaveTip:e})})):t===l.aZD&&T&&M(r()(r()({},T),{},{messageLeaveSettings:r()(r()({},T.messageLeaveSettings),{},{messageLeaveTip:e}),draftMessageLeaveSettings:r()(r()({},T.draftMessageLeaveSettings||{}),{},{messageLeaveTip:e})}))}},"leaveMsgEditor")}),t===l.Njn&&(0,h.jsx)(d.A.Item,{name:"agentCloseTip",label:(0,h.jsxs)("span",{children:[s.formatMessage({id:"agent.settings.agent.close.tip"}),(0,h.jsx)(S.Z,{type:"service",keys:["agentCloseTip"],live:t===l.Njn?null==j?void 0:j.serviceSettings:null==T?void 0:T.serviceSettings,draft:t===l.Njn?null==j?void 0:j.draftServiceSettings:null==T?void 0:T.draftServiceSettings})]}),tooltip:s.formatMessage({id:"agent.settings.agent.close.tip.tooltip"}),rules:[{required:!0,message:s.formatMessage({id:"agent.settings.agent.close.tip.required"})}],children:(0,h.jsx)(f.Z,{placeholder:s.formatMessage({id:"agent.settings.agent.close.tip.placeholder"}),value:P,toolbarKeys:(0,p.eD)(),style:{height:"200px",width:"600px"},maxLength:200,onChange:function(e){console.log("agentCloseTip onchange:",e),i.setFieldValue("agentCloseTip",e),t===l.Njn&&j&&q(r()(r()({},j),{},{serviceSettings:r()(r()({},j.serviceSettings),{},{agentCloseTip:e}),draftServiceSettings:r()(r()({},j.draftServiceSettings||{}),{},{agentCloseTip:e})}))}},"agentCloseTipEditor")}),(0,h.jsx)(d.A.Item,{name:"autoCloseTip",label:(0,h.jsxs)("span",{children:[s.formatMessage({id:"agent.settings.auto.close.tip"}),(0,h.jsx)(S.Z,{type:"service",keys:["autoCloseTip"],live:t===l.Njn?null==j?void 0:j.serviceSettings:t===l._X4?null==C?void 0:C.serviceSettings:null==T?void 0:T.serviceSettings,draft:t===l.Njn?null==j?void 0:j.draftServiceSettings:t===l._X4?null==C?void 0:C.draftServiceSettings:null==T?void 0:T.draftServiceSettings})]}),tooltip:s.formatMessage({id:"agent.settings.auto.close.tip.tooltip"}),rules:[{required:!0,message:s.formatMessage({id:"agent.settings.auto.close.tip.required"})}],children:(0,h.jsx)(f.Z,{placeholder:s.formatMessage({id:"agent.settings.auto.close.tip.placeholder"}),value:E,toolbarKeys:(0,p.eD)(),style:{height:"200px",width:"600px"},maxLength:200,onChange:function(e){console.log("autoCloseTip onchange:",e),i.setFieldValue("autoCloseTip",e),t===l.Njn&&j?q(r()(r()({},j),{},{serviceSettings:r()(r()({},j.serviceSettings),{},{autoCloseTip:e}),draftServiceSettings:r()(r()({},j.draftServiceSettings||{}),{},{autoCloseTip:e})})):t===l._X4&&C?R(r()(r()({},C),{},{serviceSettings:r()(r()({},C.serviceSettings),{},{autoCloseTip:e}),draftServiceSettings:r()(r()({},C.draftServiceSettings||{}),{},{autoCloseTip:e})})):t===l.aZD&&T&&M(r()(r()({},T),{},{serviceSettings:r()(r()({},T.serviceSettings),{},{autoCloseTip:e}),draftServiceSettings:r()(r()({},T.draftServiceSettings||{}),{},{autoCloseTip:e})}))}},"autoCloseTipEditor")})]})}},24479:function(e,t,n){n(76711),n(90819),n(89933),n(73193),n(45332),n(10404),n(8938),n(24388),n(99665),n(98830),n(39497),n(14906),n(44194),n(12864),n(7704),n(91361),n(5932),n(2890),n(88894),n(43167),n(73614),n(33019),n(75580),n(2077),n(31549)},94212:function(e,t,n){n(76711),n(90819),n(73193),n(89933),n(45332),n(8938),n(99665),n(39497),n(14906),n(44194);var i=n(13847);n(73614),n(31549),i.Z.Option},73614:function(e,t,n){n.d(t,{Z:function(){return x}});var i=n(73193),r=n.n(i),s=n(44194),a=n(78578),o=n(81739),u=n(86222),l=n.n(u),d=n(89957),c=n.n(d),g=["welcomeFaqUids","faqUids","quickFaqUids","guessFaqUids","hotFaqUids","shortcutFaqUids","proactiveFaqUids","worktimeUids"],v=["welcomeFaqs","faqs","quickFaqs","guessFaqs","hotFaqs","shortcutFaqs","proactiveFaqs"];function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function p(e,t){if(!e)return e;if(!t||0===t.length)return e;var n={};return t.forEach((function(t){Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})),n}function S(e){if(!Array.isArray(e))return e;var t=e.slice();return t.every((function(e){return["string","number","boolean"].includes(c()(e))}))?t.map((function(e){return"string"==typeof e?e:String(e)})).sort():t}function h(e){var t=e&&f(e)?r()({},e):{};return v.forEach((function(e){t[e]&&(t[e.replace(/s$/,"Uids")]=function(e){if(Array.isArray(e))return e.map((function(e){return null==e?void 0:e.uid})).filter(Boolean).map(String)}(t[e]),delete t[e])})),g.forEach((function(e){t[e]&&(t[e]=S(t[e]))})),t}function m(e){var t=e&&f(e)?r()({},e):{};return t.worktimeUids&&(t.worktimeUids=S(t.worktimeUids)),delete t.worktimes,t}function w(e){var t=new WeakSet;return JSON.stringify(function e(n){if(null===n||"object"!==c()(n))return n;if(!t.has(n)){if(t.add(n),Array.isArray(n))return n.map((function(t){return e(t)}));var i,r=Object.keys(n).sort(),s={},a=l()(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;s[o]=e(n[o])}}catch(e){a.e(e)}finally{a.f()}return s}}(e))}function b(e,t){return w(e)===w(t)}var y=n(31549),x=function(e){var t=e.hasDiff,n=e.type,i=void 0===n?"service":n,u=e.live,l=e.draft,d=e.keys,c=e.text,g=void 0===c?"草稿未发布":c,v=e.style;return(0,s.useMemo)((function(){if("boolean"==typeof t)return t;if(!u&&!l)return!1;switch(i){case"service":return function(e,t,n){return!b(p(h(e),n),p(h(t),n))}(u,l,d);case"messageLeave":return function(e,t,n){return!b(p(m(e),n),p(m(t),n))}(u,l,d);default:return function(e,t,n){return!b(p(e||{},n),p(t||{},n))}(u,l,d)}}),[t,i,u,l,d])?(0,y.jsx)(a.Z,{title:"string"==typeof g?g:"草稿与线上不一致",children:(0,y.jsx)(o.Z,{color:"orange",style:r()({marginLeft:8,height:20,lineHeight:"18px"},v),children:"Draft"})}):null}},99665:function(e,t,n){n.d(t,{z:function(){return o}});var i=n(39497),r=n(58063),s=n(66266),a=n(31403),o=(0,r.Ue)()((0,s.mW)((0,s.tJ)((0,a.n)((function(e){return{currentAgentSettings:null,currentRobotSettings:null,currentWorkgroupSettings:null,setCurrentAgentSettings:function(t){return e({currentAgentSettings:t})},setCurrentRobotSettings:function(t){return e({currentRobotSettings:t})},setCurrentWorkgroupSettings:function(t){return e({currentWorkgroupSettings:t})},clear:function(){return e({currentAgentSettings:null,currentRobotSettings:null,currentWorkgroupSettings:null})}}})),{name:i.rpR})))}}]); |