mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-15 19:58:00 +00:00
1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[9967],{16716:function(e,t,s){s.r(t);var i=s(90819),n=s.n(i),r=s(89933),a=s.n(r),o=s(45332),d=s.n(o),l=s(44194),u=s(62558),c=s(27904),x=s(79401),g=s(49616),f=s(32973),v=s(27473),m=s(5780),j=s(78875),p=s(20228),h=s(65532),Z=s(61155),k=s(61107),M=s(80556),w=s(58791),y=s(58368),F=s(86994),R=s(48004),b=s(93689),T=s(429),C=s(27995),A=s(24429),W=s(34545),S=s(25640),Y=s(52294),D=s(5025),I=s(34599),U=s(16698),O=s(87663),E=s(94956),P=s(18751),H=s(40629),q=s(5488),z=s(28977),B=s.n(z),L=s(14870),G=s(72657),J=s(85817),N=s(18580),Q=s(31549),$=J.Z.Title,K=u.default.RangePicker,_=c.Z.Option;t.default=function(){var e,t,s=(0,L.useIntl)(),i=(0,P.Z)().translateStringTranct,r=(0,l.useState)(B()().startOf("day")),o=d()(r,2),u=o[0],z=o[1],J=(0,l.useState)(B()().endOf("day")),V=d()(J,2),X=V[0],ee=V[1],te=(0,l.useState)("today"),se=d()(te,2),ie=se[0],ne=se[1],re=(0,l.useState)(q.whQ),ae=d()(re,2),oe=ae[0],de=ae[1],le=(0,l.useState)(),ue=d()(le,2),ce=ue[0],xe=ue[1],ge=(0,l.useState)(),fe=d()(ge,2),ve=fe[0],me=fe[1],je=(0,I.u)((function(e){return e.currentOrg})),pe=(0,U.E)((function(e){return e})),he=pe.agentResult,Ze=pe.setAgentResult,ke=(0,O.$)((function(e){return e})),Me=ke.workgroupResult,we=ke.setWorkgroupResult,ye=(0,l.useState)(),Fe=d()(ye,2),Re=Fe[0],be=Fe[1],Te=(0,l.useState)(q.OwA),Ce=d()(Te,2),Ae=Ce[0],We=Ce[1],Se=(0,l.useState)(!1),Ye=d()(Se,2),De=(Ye[0],Ye[1]),Ie=[{label:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.timeRange.today"}),value:"today"},{label:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.timeRange.yesterday"}),value:"yesterday"},{label:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.timeRange.week"}),value:"week"},{label:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.timeRange.month"}),value:"month"},{label:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.timeRange.custom"}),value:"custom"}],Ue=(s.formatMessage({id:"service.statistic.status.online"}),s.formatMessage({id:"service.statistic.status.busy"}),s.formatMessage({id:"service.statistic.status.away"}),s.formatMessage({id:"service.statistic.status.offline"}),[{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.agent"}),dataIndex:"name",key:"name"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.onlineTime"}),dataIndex:"onlineTime",key:"onlineTime"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.sessionCount"}),dataIndex:"sessionCount",key:"sessionCount"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.avgResponseTime"}),dataIndex:"avgResponseTime",key:"avgResponseTime"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.avgSessionTime"}),dataIndex:"avgSessionTime",key:"avgSessionTime"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.satisfaction"}),dataIndex:"satisfaction",key:"satisfaction"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.workingHours"}),dataIndex:"workingHours",key:"workingHours"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.transferRate"}),dataIndex:"transferRate",key:"transferRate"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.firstResolutionRate"}),dataIndex:"firstResolutionRate",key:"firstResolutionRate"},{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.table.overdueCount"}),dataIndex:"overdueCount",key:"overdueCount"}]);(0,l.useEffect)((function(){if("custom"===ie)z(u),ee(X),We(q.dd4);else{var e=B()();"today"===ie?(z(e),ee(e),We(q.OwA)):"yesterday"===ie?(z(e.subtract(1,"day")),ee(e.subtract(1,"day")),We(q.OwA)):"week"===ie?(z(e.startOf("week")),ee(e.endOf("week")),We(q.dd4)):"lastWeek"===ie?(z(e.subtract(1,"week").startOf("week")),ee(e.subtract(1,"week").endOf("week")),We(q.dd4)):"month"===ie&&(z(e.startOf("month")),ee(e.endOf("month")),We(q.dd4))}}),[ie]);var Oe=function(){var e=a()(n()().mark((function e(){var t,s;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==je?void 0:je.uid},e.next=4,(0,H.LE)(t);case 4:s=e.sent,console.log("fetchAllWorkgroups: ",s),200===s.code?(D.yw.destroy(),we(s),s.data.content.length>0&&me(s.data.content[0].uid)):(D.yw.destroy(),D.yw.error(s.message));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=a()(n()().mark((function e(){var t,s;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==je?void 0:je.uid},e.next=4,(0,E._t)(t);case 4:s=e.sent,console.log("fetchAllAgents: ",s),200===s.code?(D.yw.destroy(),Ze(s),s.data.content.length>0&&xe(s.data.content[0].uid)):(D.yw.destroy(),D.yw.error(i(s.message))),console.log("queryAllAgents response",s);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=a()(n()().mark((function e(){var t,i;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return De(!0),e.prev=1,D.yw.loading("loading"),t={type:oe,startDate:null==u?void 0:u.format("YYYY-MM-DD 00:00:00"),endDate:null==X?void 0:X.format("YYYY-MM-DD 23:59:59"),workgroupUid:ve,agentUid:ce,orgUid:null==je?void 0:je.uid},e.next=6,(0,G.RU)(t);case 6:i=e.sent,console.log("queryStatisticServicesByOrg response",i,t),200===i.code?(D.yw.destroy(),be(i.data)):(D.yw.destroy(),D.yw.error(i.message)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),D.yw.error(s.formatMessage({id:"ticket.message.operation.failed"}));case 14:return e.prev=14,De(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=a()(n()().mark((function e(){var t,s;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D.yw.loading("loading"),t={type:oe,startDate:null==u?void 0:u.format("YYYY-MM-DD 00:00:00"),endDate:null==X?void 0:X.format("YYYY-MM-DD 23:59:59"),workgroupUid:ve,agentUid:ce,orgUid:null==je?void 0:je.uid},e.next=4,(0,G.RU)(t);case 4:s=e.sent,console.log("queryStatisticServicesByOrg response",s,t),200===s.code?D.yw.destroy():(D.yw.destroy(),D.yw.error(s.message));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,l.useEffect)((function(){Oe(),Ee()}),[]),(0,l.useEffect)((function(){Pe()}),[oe,ce,ve]),(0,l.useEffect)((function(){He()}),[Ae,oe,ce,ve]),(0,l.useEffect)((function(){Pe()}),[u,X]),(0,Q.jsxs)("div",{style:{padding:16},children:[(0,Q.jsx)(x.Z,{style:{marginBottom:16},children:(0,Q.jsxs)(g.Z,{direction:"vertical",style:{width:"100%"},children:[(0,Q.jsxs)(g.Z,{wrap:!0,children:[(0,Q.jsx)(f.ZP.Group,{value:ie,onChange:function(e){return ne(e.target.value)},children:Ie.map((function(e){return(0,Q.jsx)(f.ZP.Button,{value:e.value,children:e.label},e.value)}))}),"custom"===ie&&(0,Q.jsx)(K,{value:[u,X],onChange:function(e){z(e[0]),ee(e[1])}})]}),(0,Q.jsxs)(g.Z,{wrap:!0,children:[(0,Q.jsxs)(c.Z,{placeholder:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.type"}),style:{width:200},value:oe,onChange:function(e){return de(e)},children:[(0,Q.jsx)(_,{value:q.whQ,children:(0,Q.jsx)(L.FormattedMessage,{id:"i18n.all"})}),(0,Q.jsx)(_,{value:q.fyH,children:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.agent"})}),(0,Q.jsx)(_,{value:q.v5D,children:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.workgroup"})})]}),oe===q.fyH&&(0,Q.jsx)(c.Z,{placeholder:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.agent"}),style:{width:200},value:ce,onChange:function(e){return xe(e)},children:null===(e=he.data)||void 0===e||null===(e=e.content)||void 0===e?void 0:e.map((function(e){return(0,Q.jsx)(_,{value:null==e?void 0:e.uid,children:i(null==e?void 0:e.nickname)},null==e?void 0:e.uid)}))}),oe===q.v5D&&(0,Q.jsx)(c.Z,{placeholder:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.department"}),style:{width:200},value:ve,onChange:function(e){return me(e)},children:null===(t=Me.data)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.map((function(e){return(0,Q.jsx)(_,{value:null==e?void 0:e.uid,children:i(null==e?void 0:e.nickname)},null==e?void 0:e.uid)}))}),(0,Q.jsx)(v.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.export"}),children:(0,Q.jsx)(m.ZP,{icon:(0,Q.jsx)(k.Z,{}),onClick:function(){var e=localStorage.getItem(q.LA8);window.open((0,N.kG)()+"/api/v1/statistic/export?"+new URLSearchParams({type:oe,startDate:null==u?void 0:u.format("YYYY-MM-DD"),endDate:null==X?void 0:X.format("YYYY-MM-DD"),workgroupUid:ve,agentUid:ce,orgUid:null==je?void 0:je.uid,accessToken:e||""}).toString())},children:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.export"})})}),(0,Q.jsx)(v.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.refresh"}),children:(0,Q.jsx)(m.ZP,{icon:(0,Q.jsx)(M.Z,{}),onClick:function(){return Pe()},children:(0,Q.jsx)(L.FormattedMessage,{id:"ticket.statistic.filter.refresh"})})}),!1]})]})}),(0,Q.jsxs)(j.Z,{gutter:24,children:[(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.onlineAgentCount"}),value:(null==Re?void 0:Re.onlineAgentCount)||0,prefix:(0,Q.jsx)(w.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.person"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.offlineAgentCount"}),value:(null==Re?void 0:Re.offlineAgentCount)||0,prefix:(0,Q.jsx)(y.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.person"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.queuingThreadCount"}),value:(null==Re?void 0:Re.queuingThreadCount)||0,prefix:(0,Q.jsx)(w.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.person"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.currentThreadCount"}),value:(null==Re?void 0:Re.currentThreadCount)||0,prefix:(0,Q.jsx)(F.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.session"})})})})]}),(0,Q.jsxs)(j.Z,{gutter:24,style:{marginTop:24},children:[(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.maxResponseTime"}),value:(null==Re?void 0:Re.maxResponseTime)||0,prefix:(0,Q.jsx)(R.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.seconds"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.minResponseTime"}),value:(null==Re?void 0:Re.minResponseTime)||0,prefix:(0,Q.jsx)(R.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.seconds"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.avgFirstResponseTime"}),value:(null==Re?void 0:Re.avgFirstResponseTime)||0,prefix:(0,Q.jsx)(R.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.seconds"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.avgWaitingTime"}),value:(null==Re?void 0:Re.avgWaitingTime)||0,prefix:(0,Q.jsx)(R.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.seconds"})})})})]}),(0,Q.jsxs)(j.Z,{gutter:24,style:{marginTop:24},children:[(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.totalIncomingThreads"}),value:(null==Re?void 0:Re.totalIncomingThreads)||0,prefix:(0,Q.jsx)(F.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.acceptedThreadCount"}),value:(null==Re?void 0:Re.acceptedThreadCount)||0,prefix:(0,Q.jsx)(b.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.acceptRate"}),value:(null==Re?void 0:Re.acceptRate)||0,prefix:(0,Q.jsx)(b.Z,{}),suffix:"%"})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.firstSolveRate"}),value:(null==Re?void 0:Re.firstSolveRate)||0,prefix:(0,Q.jsx)(T.Z,{}),suffix:"%"})})})]}),(0,Q.jsxs)(j.Z,{gutter:24,style:{marginTop:24},children:[(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.robotThreadCount"}),value:(null==Re?void 0:Re.robotThreadCount)||0,prefix:(0,Q.jsx)(C.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.robotToHumanCount"}),value:(null==Re?void 0:Re.robotToHumanCount)||0,prefix:(0,Q.jsx)(A.Z,{}),suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.robotSolveRate"}),value:(null==Re?void 0:Re.robotSolveRate)||0,prefix:(0,Q.jsx)(b.Z,{}),suffix:"%"})})}),(0,Q.jsx)(p.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,Q.jsx)(x.Z,{variant:"borderless",children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.transferRate"}),value:(null==Re?void 0:Re.transferRate)||0,prefix:(0,Q.jsx)(W.Z,{}),suffix:"%"})})})]}),(0,Q.jsxs)(x.Z,{style:{marginTop:24},children:[(0,Q.jsx)($,{level:4,children:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.sessionDuration"})}),(0,Q.jsxs)(j.Z,{gutter:24,children:[(0,Q.jsx)(p.Z,{span:8,children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.duration.within5min"}),value:(null==Re?void 0:Re.durationWithin5Min)||0,suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.sessions"})})}),(0,Q.jsx)(p.Z,{span:8,children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.duration.within15min"}),value:(null==Re?void 0:Re.durationWithin15Min)||0,suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.sessions"})})}),(0,Q.jsx)(p.Z,{span:8,children:(0,Q.jsx)(h.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.duration.over15min"}),value:(null==Re?void 0:Re.durationOver15Min)||0,suffix:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.unit.sessions"})})})]})]}),(0,Q.jsx)(x.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.performance"}),style:{marginTop:24},extra:(0,Q.jsxs)(g.Z,{children:[(0,Q.jsx)(v.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.export.excel"}),children:(0,Q.jsx)(m.ZP,{icon:(0,Q.jsx)(S.Z,{})})}),(0,Q.jsx)(v.Z,{title:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.export.pdf"}),children:(0,Q.jsx)(m.ZP,{icon:(0,Q.jsx)(Y.Z,{})})})]}),children:(0,Q.jsx)(Z.Z,{columns:Ue,dataSource:[],scroll:{x:!0},size:"small",locale:{emptyText:(0,Q.jsx)(L.FormattedMessage,{id:"service.statistic.tips.noData"})}})})]})}},16698:function(e,t,s){s.d(t,{E:function(){return c}});var i=s(73193),n=s.n(i),r=s(76711),a=s.n(r),o=s(5488),d=s(16894),l=s(45034),u=s(47401),c=(0,d.Ue)()((0,l.mW)((0,l.tJ)((0,u.n)((function(e,t){return{agentResult:{data:{content:[]}},currentAgent:{uid:"",orgUid:""},insertAgent:function(t){e((function(e){e.agentResult.data.content.unshift(t)}))},updateAgent:function(t){e((function(e){var s=e.agentResult.data.content,i=s.findIndex((function(e){return e.uid===t.uid}));-1!==i?s[i]=t:console.warn("Agent with uid ".concat(t.uid," not found."))}))},setAgentResult:function(s){var i;(e({agentResult:s}),""===t().currentAgent.uid)&&((null===(i=s.data)||void 0===i||null===(i=i.content)||void 0===i?void 0:i.length)>0&&e({currentAgent:s.data.content[0]}))},setCurrentAgent:function(s){var i=t().agentResult.data.content,r=i.findIndex((function(e){return e.uid===s.uid}));if(-1!==r){var o=[].concat(a()(i.slice(0,r)),[s],a()(i.slice(r+1))),d=n()(n()({},t().agentResult),{},{data:{content:o}});e({agentResult:d,currentAgent:s})}else console.warn("Agent with the specified uid not found."),e({currentAgent:s})},deleteCurrentAgent:function(s){var i=t().agentResult.data.content,r=i.findIndex((function(e){return e.uid===s}));-1!==r?e({agentResult:n()(n()({},t().agentResult),{},{data:{content:[].concat(a()(i.slice(0,r)),a()(i.slice(r+1)))}})}):console.warn("Agent not found in cache:",s),t().currentAgent.uid===s&&e({currentAgent:{uid:"",orgUid:""}})},deleteAgentCache:function(){return e({},!0)}}})),{name:o.zzK})))},87663:function(e,t,s){s.d(t,{$:function(){return c}});var i=s(73193),n=s.n(i),r=s(76711),a=s.n(r),o=s(5488),d=s(16894),l=s(45034),u=s(47401),c=(0,d.Ue)()((0,l.mW)((0,l.tJ)((0,u.n)((function(e,t){return{workgroupResult:{data:{content:[]}},currentWorkgroup:{uid:"",nickname:"",avatar:"",description:"",orgUid:""},insertWorkgroup:function(t){e((function(e){e.workgroupResult.data.content.unshift(t)}))},updateWorkgroup:function(t){e((function(e){var s=e.workgroupResult.data.content,i=s.findIndex((function(e){return e.uid===t.uid}));-1!==i?s[i]=t:console.warn("Workgroup with uid ".concat(t.uid," not found."))}))},deleteWorkgroup:function(t){e((function(e){var s=e.workgroupResult.data.content,i=s.findIndex((function(e){return e.uid===t.uid}));-1!==i?s.splice(i,1):console.warn("Workgroup with uid ".concat(t.uid," not found."))}))},setWorkgroupResult:function(s){var i;(e({workgroupResult:s}),""===t().currentWorkgroup.uid)&&((null===(i=s.data)||void 0===i||null===(i=i.content)||void 0===i?void 0:i.length)>0&&e({currentWorkgroup:s.data.content[0]}))},setCurrentWorkgroup:function(s){var i=t().workgroupResult.data.content,r=i.findIndex((function(e){return e.uid===s.uid}));if(-1!==r){var o=[].concat(a()(i.slice(0,r)),[s],a()(i.slice(r+1))),d=n()(n()({},t().workgroupResult),{},{data:{content:o}});e({workgroupResult:d,currentWorkgroup:s})}else console.warn("Workgroup with the specified uid not found."),e({currentWorkgroup:s})},deleteCurrentWorkgroup:function(s){var i=t().workgroupResult.data.content,r=i.findIndex((function(e){return e.uid===s}));-1!==r?e({workgroupResult:n()(n()({},t().workgroupResult),{},{data:{content:[].concat(a()(i.slice(0,r)),a()(i.slice(r+1)))}})}):console.warn("Workgroup not found in cache:",s),t().currentWorkgroup.uid===s&&e({currentWorkgroup:{uid:"",orgUid:""}})},deleteWorkgroupCache:function(){return e({},!0)}}})),{name:o.b6l})))}}]); |