ysyt-react-agent-lib 1.1.47 → 1.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BPyR7aGg.js"),s=require("react"),i=require("./index-D-VdswNZ.js"),c=s.memo(({open:n,onCallBack:r,queryFetch:x})=>{const[o,a]=s.useState([]);return s.useEffect(()=>{(async()=>{try{await x({success:t=>{a(t.data||[])}})}catch(t){console.log(t)}})()},[n]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(i.Modal,{open:n,title:"咨询",footer:!1,onCancel:()=>r(),children:e.jsxRuntimeExports.jsx(e.ModelBody,{children:o.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无咨询坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:o.map(t=>e.jsxRuntimeExports.jsx(i.Tag,{color:"processing",onClick:()=>r(t.agent_no),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginLeft:10},children:["咨询坐席: ",t.agent_name]})]})},t.agent_no))})})})})});exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BiSWuclo.js"),s=require("react"),i=require("./index-CttvgKH4.js"),c=s.memo(({open:n,onCallBack:r,queryFetch:x})=>{const[o,a]=s.useState([]);return s.useEffect(()=>{(async()=>{try{await x({success:t=>{a(t.data||[])}})}catch(t){console.log(t)}})()},[n]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(i.Modal,{open:n,title:"咨询",footer:!1,onCancel:()=>r(),children:e.jsxRuntimeExports.jsx(e.ModelBody,{children:o.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无咨询坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:o.map(t=>e.jsxRuntimeExports.jsx(i.Tag,{color:"processing",onClick:()=>r(t.agent_no),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginLeft:10},children:["咨询坐席: ",t.agent_name]})]})},t.agent_no))})})})})});exports.default=c;
@@ -1,6 +1,6 @@
1
- import { j as e, M as l, E as r, S as i, Y as d } from "./index-D7famSD9.mjs";
1
+ import { j as e, M as l, E as r, S as i, Y as d } from "./index-R1XNIXB0.mjs";
2
2
  import { memo as m, useState as g, useEffect as x } from "react";
3
- import { M as p, T as j } from "./index-D-b2gtgG.mjs";
3
+ import { M as p, T as j } from "./index-Di_hgGLh.mjs";
4
4
  const E = m(({ open: t, onCallBack: a, queryFetch: o }) => {
5
5
  const [n, c] = g([]);
6
6
  return x(() => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BPyR7aGg.js"),t=require("react"),l=require("./index-D-VdswNZ.js"),m=t.memo(({open:o,onCallBack:n,queryFetch:u})=>{const[x,p]=t.useState([]),[r,c]=t.useState(0),[i,d]=t.useState(""),[j,a]=t.useState(!1);return t.useEffect(()=>{(async()=>{a(!0);try{await u({success:s=>{p(s.data||[])}})}catch(s){console.log(s)}a(!1)})()},[o]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(l.Modal,{open:o,title:"转接",footer:!1,onCancel:()=>n(),children:e.jsxRuntimeExports.jsxs(e.ModelBody,{children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Radio.Group,{options:[{label:"转接坐席",value:0},{label:"转接外线",value:1}],value:r,onChange:s=>c(s.target.value)})}),e.jsxRuntimeExports.jsx(e.Spin,{spinning:j,children:e.jsxRuntimeExports.jsxs("div",{style:{borderTop:"1px solid #eee",marginTop:10,paddingTop:10},children:[r===0&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无转接坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:x.map(s=>e.jsxRuntimeExports.jsx(l.Tag,{color:"processing",onClick:()=>n(s.agent_no,0),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["转接坐席: ",s.agent_name]})]})},s.agent_no))})}),r===1&&e.jsxRuntimeExports.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",gap:"0 5px"},children:[e.jsxRuntimeExports.jsx(e.Input,{style:{flex:1},value:i,onChange:s=>d(s.target.value),placeholder:"请输入外线号码, 回车转接",onPressEnter:()=>{n(i,1)}}),e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"boda",color:"#1D92E9",size:25,onClick:()=>{n(i,1)}})]})]})})]})})})});exports.default=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BiSWuclo.js"),t=require("react"),l=require("./index-CttvgKH4.js"),m=t.memo(({open:o,onCallBack:n,queryFetch:u})=>{const[x,p]=t.useState([]),[r,c]=t.useState(0),[i,d]=t.useState(""),[j,a]=t.useState(!1);return t.useEffect(()=>{(async()=>{a(!0);try{await u({success:s=>{p(s.data||[])}})}catch(s){console.log(s)}a(!1)})()},[o]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(l.Modal,{open:o,title:"转接",footer:!1,onCancel:()=>n(),children:e.jsxRuntimeExports.jsxs(e.ModelBody,{children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Radio.Group,{options:[{label:"转接坐席",value:0},{label:"转接外线",value:1}],value:r,onChange:s=>c(s.target.value)})}),e.jsxRuntimeExports.jsx(e.Spin,{spinning:j,children:e.jsxRuntimeExports.jsxs("div",{style:{borderTop:"1px solid #eee",marginTop:10,paddingTop:10},children:[r===0&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无转接坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:x.map(s=>e.jsxRuntimeExports.jsx(l.Tag,{color:"processing",onClick:()=>n(s.agent_no,0),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["转接坐席: ",s.agent_name]})]})},s.agent_no))})}),r===1&&e.jsxRuntimeExports.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",gap:"0 5px"},children:[e.jsxRuntimeExports.jsx(e.Input,{style:{flex:1},value:i,onChange:s=>d(s.target.value),placeholder:"请输入外线号码, 回车转接",onPressEnter:()=>{n(i,1)}}),e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"boda",color:"#1D92E9",size:25,onClick:()=>{n(i,1)}})]})]})})]})})})});exports.default=m;
@@ -1,6 +1,6 @@
1
- import { j as e, M as h, R as j, a as f, E as d, S as y, Y as c, I as v } from "./index-D7famSD9.mjs";
1
+ import { j as e, M as h, R as j, a as f, E as d, S as y, Y as c, I as v } from "./index-R1XNIXB0.mjs";
2
2
  import { memo as E, useState as n, useEffect as T } from "react";
3
- import { M as I, T as M } from "./index-D-b2gtgG.mjs";
3
+ import { M as I, T as M } from "./index-Di_hgGLh.mjs";
4
4
  const _ = E(({ open: l, onCallBack: a, queryFetch: p }) => {
5
5
  const [o, g] = n([]), [t, x] = n(0), [r, m] = n(""), [u, i] = n(!1);
6
6
  return T(() => {
@@ -666,7 +666,7 @@ React keys must be passed directly to JSX without using spread:
666
666
  * @author Chen, Yi-Cyuan [emn178@gmail.com]
667
667
  * @copyright Chen, Yi-Cyuan 2014-2023
668
668
  * @license MIT
669
- */Zc=j0,function(){var e="input is invalid type",A=typeof window=="object",t=A?window:{};t.JS_MD5_NO_WINDOW&&(A=!1);var n=!A&&typeof self=="object",r=!t.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;r?t=VM:n&&(t=self);var i,o=!t.JS_MD5_NO_COMMON_JS&&Zc.exports,a=!t.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",s="0123456789abcdef".split(""),l=[128,32768,8388608,-2147483648],u=[0,8,16,24],V=["hex","array","digest","buffer","arrayBuffer","base64"],d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),p=[];if(a){var m=new ArrayBuffer(68);i=new Uint8Array(m),p=new Uint32Array(m)}var C=Array.isArray;!t.JS_MD5_NO_NODE_JS&&C||(C=function(v){return Object.prototype.toString.call(v)==="[object Array]"});var f=ArrayBuffer.isView;!a||!t.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&f||(f=function(v){return typeof v=="object"&&v.buffer&&v.buffer.constructor===ArrayBuffer});var q=function(v){var E=typeof v;if(E==="string")return[v,!0];if(E!=="object"||v===null)throw new Error(e);if(a&&v.constructor===ArrayBuffer)return[new Uint8Array(v),!1];if(!C(v)&&!f(v))throw new Error(e);return[v,!1]},y=function(v){return function(E){return new M(!0).update(E)[v]()}},w=function(v){var E,h=Mh,I=Mh.Buffer;return E=I.from&&!t.JS_MD5_NO_BUFFER_FROM?I.from:function(R){return new I(R)},function(R){if(typeof R=="string")return h.createHash("md5").update(R,"utf8").digest("hex");if(R==null)throw new Error(e);return R.constructor===ArrayBuffer&&(R=new Uint8Array(R)),C(R)||f(R)||R.constructor===I?h.createHash("md5").update(E(R)).digest("hex"):v(R)}},B=function(v){return function(E,h){return new g(E,!0).update(h)[v]()}};function M(v){if(v)p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p,this.buffer8=i;else if(a){var E=new ArrayBuffer(68);this.buffer8=new Uint8Array(E),this.blocks=new Uint32Array(E)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function g(v,E){var h,I=q(v);if(v=I[0],I[1]){var R,S=[],D=v.length,T=0;for(h=0;h<D;++h)(R=v.charCodeAt(h))<128?S[T++]=R:R<2048?(S[T++]=192|R>>>6,S[T++]=128|63&R):R<55296||R>=57344?(S[T++]=224|R>>>12,S[T++]=128|R>>>6&63,S[T++]=128|63&R):(R=65536+((1023&R)<<10|1023&v.charCodeAt(++h)),S[T++]=240|R>>>18,S[T++]=128|R>>>12&63,S[T++]=128|R>>>6&63,S[T++]=128|63&R);v=S}v.length>64&&(v=new M(!0).update(v).array());var F=[],O=[];for(h=0;h<64;++h){var Y=v[h]||0;F[h]=92^Y,O[h]=54^Y}M.call(this,E),this.update(O),this.oKeyPad=F,this.inner=!0,this.sharedMemory=E}M.prototype.update=function(v){if(this.finalized)throw new Error("finalize already called");var E=q(v);v=E[0];for(var h,I,R=E[1],S=0,D=v.length,T=this.blocks,F=this.buffer8;S<D;){if(this.hashed&&(this.hashed=!1,T[0]=T[16],T[16]=T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=0),R)if(a)for(I=this.start;S<D&&I<64;++S)(h=v.charCodeAt(S))<128?F[I++]=h:h<2048?(F[I++]=192|h>>>6,F[I++]=128|63&h):h<55296||h>=57344?(F[I++]=224|h>>>12,F[I++]=128|h>>>6&63,F[I++]=128|63&h):(h=65536+((1023&h)<<10|1023&v.charCodeAt(++S)),F[I++]=240|h>>>18,F[I++]=128|h>>>12&63,F[I++]=128|h>>>6&63,F[I++]=128|63&h);else for(I=this.start;S<D&&I<64;++S)(h=v.charCodeAt(S))<128?T[I>>>2]|=h<<u[3&I++]:h<2048?(T[I>>>2]|=(192|h>>>6)<<u[3&I++],T[I>>>2]|=(128|63&h)<<u[3&I++]):h<55296||h>=57344?(T[I>>>2]|=(224|h>>>12)<<u[3&I++],T[I>>>2]|=(128|h>>>6&63)<<u[3&I++],T[I>>>2]|=(128|63&h)<<u[3&I++]):(h=65536+((1023&h)<<10|1023&v.charCodeAt(++S)),T[I>>>2]|=(240|h>>>18)<<u[3&I++],T[I>>>2]|=(128|h>>>12&63)<<u[3&I++],T[I>>>2]|=(128|h>>>6&63)<<u[3&I++],T[I>>>2]|=(128|63&h)<<u[3&I++]);else if(a)for(I=this.start;S<D&&I<64;++S)F[I++]=v[S];else for(I=this.start;S<D&&I<64;++S)T[I>>>2]|=v[S]<<u[3&I++];this.lastByteIndex=I,this.bytes+=I-this.start,I>=64?(this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var v=this.blocks,E=this.lastByteIndex;v[E>>>2]|=l[3&E],E>=56&&(this.hashed||this.hash(),v[0]=v[16],v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),v[14]=this.bytes<<3,v[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},M.prototype.hash=function(){var v,E,h,I,R,S,D=this.blocks;this.first?E=((E=((v=((v=D[0]-680876937)<<7|v>>>25)-271733879|0)^(h=((h=(-271733879^(I=((I=(-1732584194^2004318071&v)+D[1]-117830708)<<12|I>>>20)+v|0)&(-271733879^v))+D[2]-1126478375)<<17|h>>>15)+I|0)&(I^v))+D[3]-1316259209)<<22|E>>>10)+h|0:(v=this.h0,E=this.h1,h=this.h2,E=((E+=((v=((v+=((I=this.h3)^E&(h^I))+D[0]-680876936)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[1]-389564586)<<12|I>>>20)+v|0)&(v^E))+D[2]+606105819)<<17|h>>>15)+I|0)&(I^v))+D[3]-1044525330)<<22|E>>>10)+h|0),E=((E+=((v=((v+=(I^E&(h^I))+D[4]-176418897)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[5]+1200080426)<<12|I>>>20)+v|0)&(v^E))+D[6]-1473231341)<<17|h>>>15)+I|0)&(I^v))+D[7]-45705983)<<22|E>>>10)+h|0,E=((E+=((v=((v+=(I^E&(h^I))+D[8]+1770035416)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[9]-1958414417)<<12|I>>>20)+v|0)&(v^E))+D[10]-42063)<<17|h>>>15)+I|0)&(I^v))+D[11]-1990404162)<<22|E>>>10)+h|0,E=((E+=((v=((v+=(I^E&(h^I))+D[12]+1804603682)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[13]-40341101)<<12|I>>>20)+v|0)&(v^E))+D[14]-1502002290)<<17|h>>>15)+I|0)&(I^v))+D[15]+1236535329)<<22|E>>>10)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[1]-165796510)<<5|v>>>27)+E|0)^E))+D[6]-1069501632)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[11]+643717713)<<14|h>>>18)+I|0)^I))+D[0]-373897302)<<20|E>>>12)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[5]-701558691)<<5|v>>>27)+E|0)^E))+D[10]+38016083)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[15]-660478335)<<14|h>>>18)+I|0)^I))+D[4]-405537848)<<20|E>>>12)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[9]+568446438)<<5|v>>>27)+E|0)^E))+D[14]-1019803690)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[3]-187363961)<<14|h>>>18)+I|0)^I))+D[8]+1163531501)<<20|E>>>12)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[13]-1444681467)<<5|v>>>27)+E|0)^E))+D[2]-51403784)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[7]+1735328473)<<14|h>>>18)+I|0)^I))+D[12]-1926607734)<<20|E>>>12)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[5]-378558)<<4|v>>>28)+E|0))+D[8]-2022574463)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[11]+1839030562)<<16|h>>>16)+I|0))+D[14]-35309556)<<23|E>>>9)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[1]-1530992060)<<4|v>>>28)+E|0))+D[4]+1272893353)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[7]-155497632)<<16|h>>>16)+I|0))+D[10]-1094730640)<<23|E>>>9)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[13]+681279174)<<4|v>>>28)+E|0))+D[0]-358537222)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[3]-722521979)<<16|h>>>16)+I|0))+D[6]+76029189)<<23|E>>>9)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[9]-640364487)<<4|v>>>28)+E|0))+D[12]-421815835)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[15]+530742520)<<16|h>>>16)+I|0))+D[2]-995338651)<<23|E>>>9)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[0]-198630844)<<6|v>>>26)+E|0)|~h))+D[7]+1126891415)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[14]-1416354905)<<15|h>>>17)+I|0)|~v))+D[5]-57434055)<<21|E>>>11)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[12]+1700485571)<<6|v>>>26)+E|0)|~h))+D[3]-1894986606)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[10]-1051523)<<15|h>>>17)+I|0)|~v))+D[1]-2054922799)<<21|E>>>11)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[8]+1873313359)<<6|v>>>26)+E|0)|~h))+D[15]-30611744)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[6]-1560198380)<<15|h>>>17)+I|0)|~v))+D[13]+1309151649)<<21|E>>>11)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[4]-145523070)<<6|v>>>26)+E|0)|~h))+D[11]-1120210379)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[2]+718787259)<<15|h>>>17)+I|0)|~v))+D[9]-343485551)<<21|E>>>11)+h|0,this.first?(this.h0=v+1732584193|0,this.h1=E-271733879|0,this.h2=h-1732584194|0,this.h3=I+271733878|0,this.first=!1):(this.h0=this.h0+v|0,this.h1=this.h1+E|0,this.h2=this.h2+h|0,this.h3=this.h3+I|0)},M.prototype.hex=function(){this.finalize();var v=this.h0,E=this.h1,h=this.h2,I=this.h3;return s[v>>>4&15]+s[15&v]+s[v>>>12&15]+s[v>>>8&15]+s[v>>>20&15]+s[v>>>16&15]+s[v>>>28&15]+s[v>>>24&15]+s[E>>>4&15]+s[15&E]+s[E>>>12&15]+s[E>>>8&15]+s[E>>>20&15]+s[E>>>16&15]+s[E>>>28&15]+s[E>>>24&15]+s[h>>>4&15]+s[15&h]+s[h>>>12&15]+s[h>>>8&15]+s[h>>>20&15]+s[h>>>16&15]+s[h>>>28&15]+s[h>>>24&15]+s[I>>>4&15]+s[15&I]+s[I>>>12&15]+s[I>>>8&15]+s[I>>>20&15]+s[I>>>16&15]+s[I>>>28&15]+s[I>>>24&15]},M.prototype.toString=M.prototype.hex,M.prototype.digest=function(){this.finalize();var v=this.h0,E=this.h1,h=this.h2,I=this.h3;return[255&v,v>>>8&255,v>>>16&255,v>>>24&255,255&E,E>>>8&255,E>>>16&255,E>>>24&255,255&h,h>>>8&255,h>>>16&255,h>>>24&255,255&I,I>>>8&255,I>>>16&255,I>>>24&255]},M.prototype.array=M.prototype.digest,M.prototype.arrayBuffer=function(){this.finalize();var v=new ArrayBuffer(16),E=new Uint32Array(v);return E[0]=this.h0,E[1]=this.h1,E[2]=this.h2,E[3]=this.h3,v},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.base64=function(){for(var v,E,h,I="",R=this.array(),S=0;S<15;)v=R[S++],E=R[S++],h=R[S++],I+=d[v>>>2]+d[63&(v<<4|E>>>4)]+d[63&(E<<2|h>>>6)]+d[63&h];return v=R[S],I+=d[v>>>2]+d[v<<4&63]+"=="},g.prototype=new M,g.prototype.finalize=function(){if(M.prototype.finalize.call(this),this.inner){this.inner=!1;var v=this.array();M.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(v),M.prototype.finalize.call(this)}};var Q=function(){var v=y("hex");r&&(v=w(v)),v.create=function(){return new M},v.update=function(I){return v.create().update(I)};for(var E=0;E<V.length;++E){var h=V[E];v[h]=y(h)}return v}();Q.md5=Q,Q.md5.hmac=function(){var v=B("hex");v.create=function(I){return new g(I)},v.update=function(I,R){return v.create(I).update(R)};for(var E=0;E<V.length;++E){var h=V[E];v[h]=B(h)}return v}(),o?Zc.exports=Q:t.md5=Q}();var dM=j0.exports;const L0=(e,A)=>{const t=Date.now(),n=`${e}:${t}:${dM.md5(`${A}${t}`)}`,r=new TextEncoder().encode(n);return btoa(String.fromCharCode(...r))},$u=e=>{if(!e||typeof e!="string")return!1;const A=e.replace(/\s+/g,"");return A.length%4!=0?!1:/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(A)},Vs="/v1/aicc/bmserver",Dn="/v1/aicc/ccs";let Ni="",Kd="",jd="",ds="";function H0(){const e=L0(Kd,jd);return uM.create({prefixUrl:`${Ni}`,timeout:!1,headers:{Authorization:e},hooks:{afterResponse:[async(A,t,n)=>{if(n.url.indexOf("heartbeat")!==-1)return n;const r=await n.clone().json();if(r.code!==0)throw new Error(JSON.stringify(r)||"请求失败");return n.json=async()=>r,n}]}})}async function Jt(e,A){const t=H0(),n="api/"+e.replace(/^\/+/,"");return t.post(n,{json:A}).json()}const Ph=e=>Jt(`${Dn}/state/change`,e),gM=()=>async function(e,A){const t=H0(),n=e.replace(/^\/+/,"");return t.post(n,{json:A}).json()}("/heartbeat",{});class ho{constructor(){this.roleData={agentInfo:()=>{var A;if(!((A=$.agentInfo)!=null&&A.agent_no))throw new Error(JSON.stringify({code:1,msg:"请先登录"}))},requestInfo:A=>{if(!A.data)throw new Error(JSON.stringify({code:1,msg:'Parameter "data" is required'}))},changeDevice:A=>{if(!A)throw new Error(JSON.stringify({code:1,msg:'Parameter "device" is required'}));const{answer_devices:t}=$.agentInfo;if(!t.split(",").map(n=>Number(n)).includes(A))throw new Error(JSON.stringify({code:1,msg:"当前状态不支持"}))},changeState:(A,t)=>{if(!A)throw new Error(JSON.stringify({code:1,msg:'Parameter "state" is required'}));if(!t)throw new Error(JSON.stringify({code:1,msg:'Parameter "state_name" is required'}));if(A===2&&(t==="通话中"||t==="整理"))throw new Error(JSON.stringify({code:1,msg:"当前状态不支持"}));if(![1,2].includes(A))throw new Error(JSON.stringify({code:1,msg:"当前状态不支持"}))},setAgentExplicit:A=>{const{out_display_select_switch:t,out_display_data:n}=$.agentInfo;if(t!==1)throw new Error(JSON.stringify({code:1,msg:"当前坐席设置未开启允许指定外显"}));if(!A)throw new Error(JSON.stringify({code:1,msg:'Parameter "number" is required'}));if(!(n||"").split("#").includes(A))throw new Error(JSON.stringify({code:1,msg:"当前外显号码不存在"}))}},this.changeDevice=async A=>{try{if(N.get("isCalling"))throw new Error(JSON.stringify({code:1,msg:"当前正在通话中,请勿切换设备"}));this.roleData.agentInfo(),this.roleData.requestInfo(A);const{data:t,success:n}=A,{device:r}=t;r===1&&await ho.initRtcFn(),this.roleData.changeDevice(r);const{agent_no:i}=$.agentInfo;await(a=>Jt(`${Dn}/device/change`,a))({agent_no:i,answer_device:r}),N.updateAnswerDevice(r);const o=N.get("actionConfigs");N.updateActionConfigs(o),r===2&&$.stateObject.state===fe.UNREGISTERED&&await this._changeState({data:{...$.stateBeforeChange,state_name:$.stateBeforeChange.state===fe.IDLE?"空闲":"忙碌"}}),n==null||n({code:0,msg:"请求成功"})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}}formatDate(A){return`${A.getFullYear()}-${String(A.getMonth()+1).padStart(2,"0")}-${String(A.getDate()).padStart(2,"0")} ${String(A.getHours()).padStart(2,"0")}:${String(A.getMinutes()).padStart(2,"0")}:${String(A.getSeconds()).padStart(2,"0")}`}static setInitRtcFn(A){this.initRtcFn=A}async _agentLogin(A){try{const n=await(t={agent_no:A},Jt(`${Dn}/agent/login`,t));$.agentInfo=n.data}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}var t}async _changeState(A){try{$.autoStateTimer&&(clearTimeout($.autoStateTimer),$.autoStateTimer=null),this.roleData.agentInfo(),this.roleData.requestInfo(A);const{data:t,success:n}=A,{state:r,state_name:i}=t,{agent_no:o}=$.agentInfo;await Ph({agent_no:o,state_name:i,state:r}),r===fe.IDLE?N.updateActionConfigs(Pt):r===fe.BUSY&&N.updateActionConfigs(Al),$.stateObject={state:r,state_name:i},n==null||n({code:0,msg:"请求成功"})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async _getInCallCrmDetail(A){var t;try{const{phone:n}=A.data,r={};$u(n)?r.trace_id=n:r.phone=n.replace(/[\s\r\n-]+/g,"");const i=await(o=>Jt(`${Vs}/crm/popups`,o))({...r});(t=A.success)==null||t.call(A,i)}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async changeState(A){try{if(N.get("isCalling"))throw new Error(JSON.stringify({code:1,msg:"当前正在通话中,请勿切换设备"}));$.autoStateTimer&&(clearTimeout($.autoStateTimer),$.autoStateTimer=null),this.roleData.agentInfo(),this.roleData.requestInfo(A);const{data:t,success:n}=A,{state:r,state_name:i}=t;this.roleData.changeState(r,i);const{agent_no:o}=$.agentInfo;await Ph({agent_no:o,state_name:i,state:r}),($.stateObject.state===fe.IDLE||$.stateObject.state===fe.BUSY&&i!=="整理")&&($.stateBeforeChange=$.stateObject),r===fe.IDLE?N.updateActionConfigs(Pt):r===fe.BUSY&&N.updateActionConfigs(Al),$.stateObject={state:r,state_name:i},n==null||n({code:0,msg:"请求成功"})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async getIdleAgentList(A){var n;const{agent_no:t}=$.agentInfo;try{this.roleData.agentInfo();const r=await(i=>Jt(`${Dn}/agent/free`,i))({agent_no:t});(n=A.success)==null||n.call(A,r)}catch(r){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(r.message).msg),r}}async getAgentState(A){var t;try{const n=await Jt(`${Vs}/agent/statecfg/list`,{}),r=(n.data||[]).filter(i=>i.enable===0).filter(i=>i.state!==0&&i.state!==3).filter(i=>i.state_name!=="通话中"&&i.state_name!=="整理"&&i.state_name!=="未注册"&&i.state_name!=="离线接听").map(i=>({state:i.state,state_name:i.state_name})).reverse();(t=A.success)==null||t.call(A,{...n,data:r})}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async setAgentExplicit(A){var t;try{this.roleData.agentInfo(),this.roleData.requestInfo(A),this.roleData.setAgentExplicit(A.data.number);const{agent_id:n}=$.agentInfo;await(r=>Jt(`${Vs}/agent/update`,r))({agent_id:n,out_display_number:A.data.number}),N.updateSelectOutNumber(A.data.number),(t=A.success)==null||t.call(A,{code:0,msg:"请求成功"})}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async checkAgentLogin(A){var t;try{this.roleData.requestInfo(A);const{agent_no:n}=A.data;if(!n)throw new Error(JSON.stringify({code:1,msg:'Parameter "agent_no" is required'}));const r=await(i=>Jt(`${Dn}/agent/islogin`,i))({agent_no:n});(t=A.success)==null||t.call(A,r)}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async getCallRecord(A){try{this.roleData.agentInfo();const{success:t}=A,n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),i=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59),o=[this.formatDate(r),this.formatDate(i)],{agent_no:a}=$.agentInfo,s=await(d=>Jt(`${Vs}/agent/recordpage`,d))({start_time:o[0],end_time:o[1],page_no:1,page_size:10,agent_no:a}),{code:l,msg:u,data:V}=s;t==null||t({code:l,msg:u,data:V})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async logout(A){this.roleData.agentInfo();try{const{agent_no:t}=$.agentInfo,{data:n,success:r}=A;await(i=>Jt(`${Dn}/agent/logout`,i))({...n,agent_no:t}),r==null||r({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async listenCall(A){try{const{agent_no:t}=$.agentInfo,{data:n,success:r}=A;if(this.roleData.agentInfo(),this.roleData.requestInfo(A),!n.monitored_agent_no)throw new Error(JSON.stringify({code:1,msg:'Parameter "monitored_agent_no" is required'}));await(i=>Jt(`${Dn}/call/monitor`,i))({...n,monitor_agent_no:t}),$.monitoredAgentNo=n.monitored_agent_no,r==null||r({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async earCall(A){try{const{agentInfo:t,monitoredAgentNo:n}=$,{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未有监听坐席"}));await(o=>Jt(`${Dn}/call/whisper`,o))({monitored_agent_no:n,monitor_agent_no:r}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async stopEarCall(A){try{const{agentInfo:t,earSpeakAgent:n}=$;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前没有正在耳语的坐席"}));const{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;await(o=>Jt(`${Dn}/call/stopwhisper`,o))({monitor_agent_no:r,monitored_agent_no:n}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async forceInsert(A){try{const{agentInfo:t,monitoredAgentNo:n}=$,{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未有监听坐席"}));await(o=>Jt(`${Dn}/call/bargein`,o))({monitored_agent_no:n,monitor_agent_no:r}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async forceDisconnect(A){try{const{agentInfo:t,monitoredAgentNo:n}=$,{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未有监听坐席"}));await(o=>Jt(`${Dn}/call/intercept`,o))({monitored_agent_no:n,monitor_agent_no:r}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}}var io;let No=(io=class extends hn{constructor(){super(...arguments),this.type="info",this.content="",this.duration=3e3}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.remove()},this.duration+300)}render(){return $A`<div>${this.content}</div>`}},io.styles=yr`
669
+ */Zc=j0,function(){var e="input is invalid type",A=typeof window=="object",t=A?window:{};t.JS_MD5_NO_WINDOW&&(A=!1);var n=!A&&typeof self=="object",r=!t.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;r?t=VM:n&&(t=self);var i,o=!t.JS_MD5_NO_COMMON_JS&&Zc.exports,a=!t.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",s="0123456789abcdef".split(""),l=[128,32768,8388608,-2147483648],u=[0,8,16,24],V=["hex","array","digest","buffer","arrayBuffer","base64"],d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),p=[];if(a){var m=new ArrayBuffer(68);i=new Uint8Array(m),p=new Uint32Array(m)}var C=Array.isArray;!t.JS_MD5_NO_NODE_JS&&C||(C=function(v){return Object.prototype.toString.call(v)==="[object Array]"});var f=ArrayBuffer.isView;!a||!t.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&f||(f=function(v){return typeof v=="object"&&v.buffer&&v.buffer.constructor===ArrayBuffer});var q=function(v){var E=typeof v;if(E==="string")return[v,!0];if(E!=="object"||v===null)throw new Error(e);if(a&&v.constructor===ArrayBuffer)return[new Uint8Array(v),!1];if(!C(v)&&!f(v))throw new Error(e);return[v,!1]},y=function(v){return function(E){return new M(!0).update(E)[v]()}},w=function(v){var E,h=Mh,I=Mh.Buffer;return E=I.from&&!t.JS_MD5_NO_BUFFER_FROM?I.from:function(R){return new I(R)},function(R){if(typeof R=="string")return h.createHash("md5").update(R,"utf8").digest("hex");if(R==null)throw new Error(e);return R.constructor===ArrayBuffer&&(R=new Uint8Array(R)),C(R)||f(R)||R.constructor===I?h.createHash("md5").update(E(R)).digest("hex"):v(R)}},B=function(v){return function(E,h){return new g(E,!0).update(h)[v]()}};function M(v){if(v)p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p,this.buffer8=i;else if(a){var E=new ArrayBuffer(68);this.buffer8=new Uint8Array(E),this.blocks=new Uint32Array(E)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function g(v,E){var h,I=q(v);if(v=I[0],I[1]){var R,S=[],D=v.length,T=0;for(h=0;h<D;++h)(R=v.charCodeAt(h))<128?S[T++]=R:R<2048?(S[T++]=192|R>>>6,S[T++]=128|63&R):R<55296||R>=57344?(S[T++]=224|R>>>12,S[T++]=128|R>>>6&63,S[T++]=128|63&R):(R=65536+((1023&R)<<10|1023&v.charCodeAt(++h)),S[T++]=240|R>>>18,S[T++]=128|R>>>12&63,S[T++]=128|R>>>6&63,S[T++]=128|63&R);v=S}v.length>64&&(v=new M(!0).update(v).array());var F=[],O=[];for(h=0;h<64;++h){var Y=v[h]||0;F[h]=92^Y,O[h]=54^Y}M.call(this,E),this.update(O),this.oKeyPad=F,this.inner=!0,this.sharedMemory=E}M.prototype.update=function(v){if(this.finalized)throw new Error("finalize already called");var E=q(v);v=E[0];for(var h,I,R=E[1],S=0,D=v.length,T=this.blocks,F=this.buffer8;S<D;){if(this.hashed&&(this.hashed=!1,T[0]=T[16],T[16]=T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=0),R)if(a)for(I=this.start;S<D&&I<64;++S)(h=v.charCodeAt(S))<128?F[I++]=h:h<2048?(F[I++]=192|h>>>6,F[I++]=128|63&h):h<55296||h>=57344?(F[I++]=224|h>>>12,F[I++]=128|h>>>6&63,F[I++]=128|63&h):(h=65536+((1023&h)<<10|1023&v.charCodeAt(++S)),F[I++]=240|h>>>18,F[I++]=128|h>>>12&63,F[I++]=128|h>>>6&63,F[I++]=128|63&h);else for(I=this.start;S<D&&I<64;++S)(h=v.charCodeAt(S))<128?T[I>>>2]|=h<<u[3&I++]:h<2048?(T[I>>>2]|=(192|h>>>6)<<u[3&I++],T[I>>>2]|=(128|63&h)<<u[3&I++]):h<55296||h>=57344?(T[I>>>2]|=(224|h>>>12)<<u[3&I++],T[I>>>2]|=(128|h>>>6&63)<<u[3&I++],T[I>>>2]|=(128|63&h)<<u[3&I++]):(h=65536+((1023&h)<<10|1023&v.charCodeAt(++S)),T[I>>>2]|=(240|h>>>18)<<u[3&I++],T[I>>>2]|=(128|h>>>12&63)<<u[3&I++],T[I>>>2]|=(128|h>>>6&63)<<u[3&I++],T[I>>>2]|=(128|63&h)<<u[3&I++]);else if(a)for(I=this.start;S<D&&I<64;++S)F[I++]=v[S];else for(I=this.start;S<D&&I<64;++S)T[I>>>2]|=v[S]<<u[3&I++];this.lastByteIndex=I,this.bytes+=I-this.start,I>=64?(this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var v=this.blocks,E=this.lastByteIndex;v[E>>>2]|=l[3&E],E>=56&&(this.hashed||this.hash(),v[0]=v[16],v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),v[14]=this.bytes<<3,v[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},M.prototype.hash=function(){var v,E,h,I,R,S,D=this.blocks;this.first?E=((E=((v=((v=D[0]-680876937)<<7|v>>>25)-271733879|0)^(h=((h=(-271733879^(I=((I=(-1732584194^2004318071&v)+D[1]-117830708)<<12|I>>>20)+v|0)&(-271733879^v))+D[2]-1126478375)<<17|h>>>15)+I|0)&(I^v))+D[3]-1316259209)<<22|E>>>10)+h|0:(v=this.h0,E=this.h1,h=this.h2,E=((E+=((v=((v+=((I=this.h3)^E&(h^I))+D[0]-680876936)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[1]-389564586)<<12|I>>>20)+v|0)&(v^E))+D[2]+606105819)<<17|h>>>15)+I|0)&(I^v))+D[3]-1044525330)<<22|E>>>10)+h|0),E=((E+=((v=((v+=(I^E&(h^I))+D[4]-176418897)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[5]+1200080426)<<12|I>>>20)+v|0)&(v^E))+D[6]-1473231341)<<17|h>>>15)+I|0)&(I^v))+D[7]-45705983)<<22|E>>>10)+h|0,E=((E+=((v=((v+=(I^E&(h^I))+D[8]+1770035416)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[9]-1958414417)<<12|I>>>20)+v|0)&(v^E))+D[10]-42063)<<17|h>>>15)+I|0)&(I^v))+D[11]-1990404162)<<22|E>>>10)+h|0,E=((E+=((v=((v+=(I^E&(h^I))+D[12]+1804603682)<<7|v>>>25)+E|0)^(h=((h+=(E^(I=((I+=(h^v&(E^h))+D[13]-40341101)<<12|I>>>20)+v|0)&(v^E))+D[14]-1502002290)<<17|h>>>15)+I|0)&(I^v))+D[15]+1236535329)<<22|E>>>10)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[1]-165796510)<<5|v>>>27)+E|0)^E))+D[6]-1069501632)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[11]+643717713)<<14|h>>>18)+I|0)^I))+D[0]-373897302)<<20|E>>>12)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[5]-701558691)<<5|v>>>27)+E|0)^E))+D[10]+38016083)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[15]-660478335)<<14|h>>>18)+I|0)^I))+D[4]-405537848)<<20|E>>>12)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[9]+568446438)<<5|v>>>27)+E|0)^E))+D[14]-1019803690)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[3]-187363961)<<14|h>>>18)+I|0)^I))+D[8]+1163531501)<<20|E>>>12)+h|0,E=((E+=((I=((I+=(E^h&((v=((v+=(h^I&(E^h))+D[13]-1444681467)<<5|v>>>27)+E|0)^E))+D[2]-51403784)<<9|I>>>23)+v|0)^v&((h=((h+=(v^E&(I^v))+D[7]+1735328473)<<14|h>>>18)+I|0)^I))+D[12]-1926607734)<<20|E>>>12)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[5]-378558)<<4|v>>>28)+E|0))+D[8]-2022574463)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[11]+1839030562)<<16|h>>>16)+I|0))+D[14]-35309556)<<23|E>>>9)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[1]-1530992060)<<4|v>>>28)+E|0))+D[4]+1272893353)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[7]-155497632)<<16|h>>>16)+I|0))+D[10]-1094730640)<<23|E>>>9)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[13]+681279174)<<4|v>>>28)+E|0))+D[0]-358537222)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[3]-722521979)<<16|h>>>16)+I|0))+D[6]+76029189)<<23|E>>>9)+h|0,E=((E+=((S=(I=((I+=((R=E^h)^(v=((v+=(R^I)+D[9]-640364487)<<4|v>>>28)+E|0))+D[12]-421815835)<<11|I>>>21)+v|0)^v)^(h=((h+=(S^E)+D[15]+530742520)<<16|h>>>16)+I|0))+D[2]-995338651)<<23|E>>>9)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[0]-198630844)<<6|v>>>26)+E|0)|~h))+D[7]+1126891415)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[14]-1416354905)<<15|h>>>17)+I|0)|~v))+D[5]-57434055)<<21|E>>>11)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[12]+1700485571)<<6|v>>>26)+E|0)|~h))+D[3]-1894986606)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[10]-1051523)<<15|h>>>17)+I|0)|~v))+D[1]-2054922799)<<21|E>>>11)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[8]+1873313359)<<6|v>>>26)+E|0)|~h))+D[15]-30611744)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[6]-1560198380)<<15|h>>>17)+I|0)|~v))+D[13]+1309151649)<<21|E>>>11)+h|0,E=((E+=((I=((I+=(E^((v=((v+=(h^(E|~I))+D[4]-145523070)<<6|v>>>26)+E|0)|~h))+D[11]-1120210379)<<10|I>>>22)+v|0)^((h=((h+=(v^(I|~E))+D[2]+718787259)<<15|h>>>17)+I|0)|~v))+D[9]-343485551)<<21|E>>>11)+h|0,this.first?(this.h0=v+1732584193|0,this.h1=E-271733879|0,this.h2=h-1732584194|0,this.h3=I+271733878|0,this.first=!1):(this.h0=this.h0+v|0,this.h1=this.h1+E|0,this.h2=this.h2+h|0,this.h3=this.h3+I|0)},M.prototype.hex=function(){this.finalize();var v=this.h0,E=this.h1,h=this.h2,I=this.h3;return s[v>>>4&15]+s[15&v]+s[v>>>12&15]+s[v>>>8&15]+s[v>>>20&15]+s[v>>>16&15]+s[v>>>28&15]+s[v>>>24&15]+s[E>>>4&15]+s[15&E]+s[E>>>12&15]+s[E>>>8&15]+s[E>>>20&15]+s[E>>>16&15]+s[E>>>28&15]+s[E>>>24&15]+s[h>>>4&15]+s[15&h]+s[h>>>12&15]+s[h>>>8&15]+s[h>>>20&15]+s[h>>>16&15]+s[h>>>28&15]+s[h>>>24&15]+s[I>>>4&15]+s[15&I]+s[I>>>12&15]+s[I>>>8&15]+s[I>>>20&15]+s[I>>>16&15]+s[I>>>28&15]+s[I>>>24&15]},M.prototype.toString=M.prototype.hex,M.prototype.digest=function(){this.finalize();var v=this.h0,E=this.h1,h=this.h2,I=this.h3;return[255&v,v>>>8&255,v>>>16&255,v>>>24&255,255&E,E>>>8&255,E>>>16&255,E>>>24&255,255&h,h>>>8&255,h>>>16&255,h>>>24&255,255&I,I>>>8&255,I>>>16&255,I>>>24&255]},M.prototype.array=M.prototype.digest,M.prototype.arrayBuffer=function(){this.finalize();var v=new ArrayBuffer(16),E=new Uint32Array(v);return E[0]=this.h0,E[1]=this.h1,E[2]=this.h2,E[3]=this.h3,v},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.base64=function(){for(var v,E,h,I="",R=this.array(),S=0;S<15;)v=R[S++],E=R[S++],h=R[S++],I+=d[v>>>2]+d[63&(v<<4|E>>>4)]+d[63&(E<<2|h>>>6)]+d[63&h];return v=R[S],I+=d[v>>>2]+d[v<<4&63]+"=="},g.prototype=new M,g.prototype.finalize=function(){if(M.prototype.finalize.call(this),this.inner){this.inner=!1;var v=this.array();M.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(v),M.prototype.finalize.call(this)}};var Q=function(){var v=y("hex");r&&(v=w(v)),v.create=function(){return new M},v.update=function(I){return v.create().update(I)};for(var E=0;E<V.length;++E){var h=V[E];v[h]=y(h)}return v}();Q.md5=Q,Q.md5.hmac=function(){var v=B("hex");v.create=function(I){return new g(I)},v.update=function(I,R){return v.create(I).update(R)};for(var E=0;E<V.length;++E){var h=V[E];v[h]=B(h)}return v}(),o?Zc.exports=Q:t.md5=Q}();var dM=j0.exports;const L0=(e,A)=>{const t=Date.now(),n=`${e}:${t}:${dM.md5(`${A}${t}`)}`,r=new TextEncoder().encode(n);return btoa(String.fromCharCode(...r))},$u=e=>{if(/^\d+$/.test(e)||!e||typeof e!="string"||e.length%4!=0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))return!1;try{const A=atob(e);return btoa(A)===e}catch{return!1}},Vs="/v1/aicc/bmserver",Dn="/v1/aicc/ccs";let Ni="",Kd="",jd="",ds="";function H0(){const e=L0(Kd,jd);return uM.create({prefixUrl:`${Ni}`,timeout:!1,headers:{Authorization:e},hooks:{afterResponse:[async(A,t,n)=>{if(n.url.indexOf("heartbeat")!==-1)return n;const r=await n.clone().json();if(r.code!==0)throw new Error(JSON.stringify(r)||"请求失败");return n.json=async()=>r,n}]}})}async function Jt(e,A){const t=H0(),n="api/"+e.replace(/^\/+/,"");return t.post(n,{json:A}).json()}const Ph=e=>Jt(`${Dn}/state/change`,e),gM=()=>async function(e,A){const t=H0(),n=e.replace(/^\/+/,"");return t.post(n,{json:A}).json()}("/heartbeat",{});class ho{constructor(){this.roleData={agentInfo:()=>{var A;if(!((A=$.agentInfo)!=null&&A.agent_no))throw new Error(JSON.stringify({code:1,msg:"请先登录"}))},requestInfo:A=>{if(!A.data)throw new Error(JSON.stringify({code:1,msg:'Parameter "data" is required'}))},changeDevice:A=>{if(!A)throw new Error(JSON.stringify({code:1,msg:'Parameter "device" is required'}));const{answer_devices:t}=$.agentInfo;if(!t.split(",").map(n=>Number(n)).includes(A))throw new Error(JSON.stringify({code:1,msg:"当前状态不支持"}))},changeState:(A,t)=>{if(!A)throw new Error(JSON.stringify({code:1,msg:'Parameter "state" is required'}));if(!t)throw new Error(JSON.stringify({code:1,msg:'Parameter "state_name" is required'}));if(A===2&&(t==="通话中"||t==="整理"))throw new Error(JSON.stringify({code:1,msg:"当前状态不支持"}));if(![1,2].includes(A))throw new Error(JSON.stringify({code:1,msg:"当前状态不支持"}))},setAgentExplicit:A=>{const{out_display_select_switch:t,out_display_data:n}=$.agentInfo;if(t!==1)throw new Error(JSON.stringify({code:1,msg:"当前坐席设置未开启允许指定外显"}));if(!A)throw new Error(JSON.stringify({code:1,msg:'Parameter "number" is required'}));if(!(n||"").split("#").includes(A))throw new Error(JSON.stringify({code:1,msg:"当前外显号码不存在"}))}},this.changeDevice=async A=>{try{if(N.get("isCalling"))throw new Error(JSON.stringify({code:1,msg:"当前正在通话中,请勿切换设备"}));this.roleData.agentInfo(),this.roleData.requestInfo(A);const{data:t,success:n}=A,{device:r}=t;r===1&&await ho.initRtcFn(),this.roleData.changeDevice(r);const{agent_no:i}=$.agentInfo;await(a=>Jt(`${Dn}/device/change`,a))({agent_no:i,answer_device:r}),N.updateAnswerDevice(r);const o=N.get("actionConfigs");N.updateActionConfigs(o),r===2&&$.stateObject.state===fe.UNREGISTERED&&await this._changeState({data:{...$.stateBeforeChange,state_name:$.stateBeforeChange.state===fe.IDLE?"空闲":"忙碌"}}),n==null||n({code:0,msg:"请求成功"})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}}formatDate(A){return`${A.getFullYear()}-${String(A.getMonth()+1).padStart(2,"0")}-${String(A.getDate()).padStart(2,"0")} ${String(A.getHours()).padStart(2,"0")}:${String(A.getMinutes()).padStart(2,"0")}:${String(A.getSeconds()).padStart(2,"0")}`}static setInitRtcFn(A){this.initRtcFn=A}async _agentLogin(A){try{const n=await(t={agent_no:A},Jt(`${Dn}/agent/login`,t));$.agentInfo=n.data}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}var t}async _changeState(A){try{$.autoStateTimer&&(clearTimeout($.autoStateTimer),$.autoStateTimer=null),this.roleData.agentInfo(),this.roleData.requestInfo(A);const{data:t,success:n}=A,{state:r,state_name:i}=t,{agent_no:o}=$.agentInfo;await Ph({agent_no:o,state_name:i,state:r}),r===fe.IDLE?N.updateActionConfigs(Pt):r===fe.BUSY&&N.updateActionConfigs(Al),$.stateObject={state:r,state_name:i},n==null||n({code:0,msg:"请求成功"})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async _getInCallCrmDetail(A){var t;try{const{phone:n}=A.data,r={};$u(n)?r.trace_id=n:r.phone=n.replace(/[\s\r\n-]+/g,"");const i=await(o=>Jt(`${Vs}/crm/popups`,o))({...r});(t=A.success)==null||t.call(A,i)}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async changeState(A){try{if(N.get("isCalling"))throw new Error(JSON.stringify({code:1,msg:"当前正在通话中,请勿切换设备"}));$.autoStateTimer&&(clearTimeout($.autoStateTimer),$.autoStateTimer=null),this.roleData.agentInfo(),this.roleData.requestInfo(A);const{data:t,success:n}=A,{state:r,state_name:i}=t;this.roleData.changeState(r,i);const{agent_no:o}=$.agentInfo;await Ph({agent_no:o,state_name:i,state:r}),($.stateObject.state===fe.IDLE||$.stateObject.state===fe.BUSY&&i!=="整理")&&($.stateBeforeChange=$.stateObject),r===fe.IDLE?N.updateActionConfigs(Pt):r===fe.BUSY&&N.updateActionConfigs(Al),$.stateObject={state:r,state_name:i},n==null||n({code:0,msg:"请求成功"})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async getIdleAgentList(A){var n;const{agent_no:t}=$.agentInfo;try{this.roleData.agentInfo();const r=await(i=>Jt(`${Dn}/agent/free`,i))({agent_no:t});(n=A.success)==null||n.call(A,r)}catch(r){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(r.message).msg),r}}async getAgentState(A){var t;try{const n=await Jt(`${Vs}/agent/statecfg/list`,{}),r=(n.data||[]).filter(i=>i.enable===0).filter(i=>i.state!==0&&i.state!==3).filter(i=>i.state_name!=="通话中"&&i.state_name!=="整理"&&i.state_name!=="未注册"&&i.state_name!=="离线接听").map(i=>({state:i.state,state_name:i.state_name})).reverse();(t=A.success)==null||t.call(A,{...n,data:r})}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async setAgentExplicit(A){var t;try{this.roleData.agentInfo(),this.roleData.requestInfo(A),this.roleData.setAgentExplicit(A.data.number);const{agent_id:n}=$.agentInfo;await(r=>Jt(`${Vs}/agent/update`,r))({agent_id:n,out_display_number:A.data.number}),N.updateSelectOutNumber(A.data.number),(t=A.success)==null||t.call(A,{code:0,msg:"请求成功"})}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async checkAgentLogin(A){var t;try{this.roleData.requestInfo(A);const{agent_no:n}=A.data;if(!n)throw new Error(JSON.stringify({code:1,msg:'Parameter "agent_no" is required'}));const r=await(i=>Jt(`${Dn}/agent/islogin`,i))({agent_no:n});(t=A.success)==null||t.call(A,r)}catch(n){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(n.message).msg),n}}async getCallRecord(A){try{this.roleData.agentInfo();const{success:t}=A,n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),i=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59),o=[this.formatDate(r),this.formatDate(i)],{agent_no:a}=$.agentInfo,s=await(d=>Jt(`${Vs}/agent/recordpage`,d))({start_time:o[0],end_time:o[1],page_no:1,page_size:10,agent_no:a}),{code:l,msg:u,data:V}=s;t==null||t({code:l,msg:u,data:V})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async logout(A){this.roleData.agentInfo();try{const{agent_no:t}=$.agentInfo,{data:n,success:r}=A;await(i=>Jt(`${Dn}/agent/logout`,i))({...n,agent_no:t}),r==null||r({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async listenCall(A){try{const{agent_no:t}=$.agentInfo,{data:n,success:r}=A;if(this.roleData.agentInfo(),this.roleData.requestInfo(A),!n.monitored_agent_no)throw new Error(JSON.stringify({code:1,msg:'Parameter "monitored_agent_no" is required'}));await(i=>Jt(`${Dn}/call/monitor`,i))({...n,monitor_agent_no:t}),$.monitoredAgentNo=n.monitored_agent_no,r==null||r({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async earCall(A){try{const{agentInfo:t,monitoredAgentNo:n}=$,{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未有监听坐席"}));await(o=>Jt(`${Dn}/call/whisper`,o))({monitored_agent_no:n,monitor_agent_no:r}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async stopEarCall(A){try{const{agentInfo:t,earSpeakAgent:n}=$;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前没有正在耳语的坐席"}));const{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;await(o=>Jt(`${Dn}/call/stopwhisper`,o))({monitor_agent_no:r,monitored_agent_no:n}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async forceInsert(A){try{const{agentInfo:t,monitoredAgentNo:n}=$,{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未有监听坐席"}));await(o=>Jt(`${Dn}/call/bargein`,o))({monitored_agent_no:n,monitor_agent_no:r}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}async forceDisconnect(A){try{const{agentInfo:t,monitoredAgentNo:n}=$,{agent_no:r}=t;this.roleData.agentInfo();const{success:i}=A;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未有监听坐席"}));await(o=>Jt(`${Dn}/call/intercept`,o))({monitored_agent_no:n,monitor_agent_no:r}),i==null||i({code:0,msg:""})}catch(t){throw VA.emit(xA.FAIL_NOTIFICATION,JSON.parse(t.message).msg),t}}}var io;let No=(io=class extends hn{constructor(){super(...arguments),this.type="info",this.content="",this.duration=3e3}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.remove()},this.duration+300)}render(){return $A`<div>${this.content}</div>`}},io.styles=yr`
670
670
  :host {
671
671
  display: block;
672
672
  margin-top: 10px;
@@ -1053,7 +1053,7 @@ React keys must be passed directly to JSX without using spread:
1053
1053
  `:""}
1054
1054
  </div>
1055
1055
  </my-popover>
1056
- `;ni(r,this.rttHTML)}}class Li{static requestPermission(){"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()}static async requestMediaPermissions(){try{return(await navigator.mediaDevices.enumerateDevices()).some(t=>t.kind==="audioinput"&&t.label!=="")?null:await navigator.mediaDevices.getUserMedia({audio:!0})}catch(A){return console.warn("获取音频权限失败:",A),null}}static show(A,t,n,r){if("Notification"in window&&Notification.permission==="granted"){const i=new Notification(A,{body:t,tag:`xy-global-notification${new Date().getTime()}`,renotify:!0});i.onclick=()=>{window.focus(),i.close(),n==null||n()},setTimeout(()=>i.close(),1e3*(r||3))}}static async checkMediaPermissions(){try{return(await navigator.mediaDevices.enumerateDevices()).some(A=>A.kind==="audioinput"&&A.label!=="")}catch(A){return console.warn("无法检查设备权限:",A),!1}}}const pM=console.log,zh=(...e)=>{$.logBuiltinEnabled&&pM(...e)};let cr=null;class dt{constructor(A,t){this.url=A,this.onOpenCallback=t,this.ws=null,this.heartbeatWorker=null,this.reconnectDelay=3e3,this.manualClose=!1,this.apiClient=new ho,this.sipClient=null,this.pendingMessages=new Map,this.initWebSocket()}static getInstance({url:A,sipClient:t,onOpen:n}){if(!cr){if(!A)throw new Error("WebSocket 尚未初始化");cr=new dt(A,n),cr.sipClient=t}return cr}setSipClient(A){this.sipClient=A}stateIdleChange(){const{state:A}=$.stateObject;A!==fe.IDLE&&this.apiClient._changeState({data:{...$.stateBeforeChange,state_name:$.stateBeforeChange.state===fe.IDLE?"空闲":"忙碌"}})}inCallAutoAnswer(){const{soft_device_auto_answer:A,auto_answer_time:t}=$.agentInfo,n=A===1,r=N.get("direction");if(n&&r===Bt.INCOMING){const i=Number(t)||0;i>0&&($.autoAnswerTimer=setTimeout(()=>{var o;(o=this.sipClient)==null||o.answerCall(),$.autoAnswerTimer=null},1e3*i-500))}}async getCustomerInfo(A){try{await this.apiClient._getInCallCrmDetail({data:{phone:A},success:t=>{N.updateCustomerInfo(t.data||{phone:t.data.phone,is_vip:0,customer_name:"未知客户",city:"未知",province:"未知",contact_count:0,in_contact_count:0,trace_id:t.data.trace_id,contact_count_month:0,in_contact_count_month:0})}})}catch{}}putAgentState(A,t){if(!A)return;if(t===5)return void this.stateIdleChange();$.sessionId="";const{post_call_process_time:n}=$.agentInfo,r=n||0;if($.autoStateTimer&&(clearTimeout($.autoStateTimer),$.autoStateTimer=null),N.updateCustomerInfo(void 0),r>0){const{state:i}=$.stateObject;if(i===fe.IDLE)return;this.apiClient._changeState({data:{state:fe.BUSY,state_name:"整理"}}),$.autoStateTimer=setTimeout(()=>{$.autoStateTimer=null,this.stateIdleChange()},1e3*r)}else this.stateIdleChange()}stateBusyChange(){$.sessionId="",clearTimeout($.autoStateTimer),N.updateCustomerInfo(void 0),this.apiClient._changeState({data:{state:fe.BUSY,state_name:"忙碌"}})}initWebSocket(){var t;if(((t=this.ws)==null?void 0:t.readyState)===1)return;const A=L0(Kd,jd);this.ws=new WebSocket(this.url+A),this.ws.onopen=()=>{const n=new Date().getTime();this.sendMessage({type:0,msg_id:n}),this.pendingMessages.set(n,performance.now()),this.startHeartbeat(),this.manualClose=!1,this.onOpenCallback&&this.onOpenCallback()},this.ws.onmessage=async n=>{var u;const r=JSON.parse(n.data),{type:i,data:o,code:a,msg:s,msg_id:l}=r;if(i===0&&l){const V=this.pendingMessages.get(l),d=performance.now()-V;$.latency=parseFloat(d.toFixed(2)),this.pendingMessages.delete(l)}if(i!==0&&zh("%cWebSocket 收到消息:","color: blue; font-weight: bold;",r),i!==ae.OUT_CALL&&i!==ae.PREVIEW_OUT_CALL||(a!==0?(N.reset(),VA.emit(eA.OUT_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s),N.updateActionConfigs(Pt),setTimeout(()=>{N.updateCustomerInfo(void 0)},500),this.stateIdleChange()):a===0&&(VA.emit(eA.OUT_SUCCESS),clearTimeout($.autoStateTimer))),i===ae.AGENT_STATE){const{state:V,state_name:d}=o;$.stateObject={state:V,state_name:d},(u=$.stateBeforeChange)!=null&&u.state||$.stateObject.state!==fe.IDLE&&($.stateObject.state!==fe.BUSY||d==="整理")||($.stateBeforeChange=$.stateObject),d==="振铃中"&&N.updateDisplayText(Xe.AGENT_RINGING),V===fe.UNREGISTERED&&N.updateActionConfigs(Zw),V===fe.IDLE&&$.stateObject.state===fe.UNREGISTERED&&N.updateActionConfigs(Pt),VA.emit(eA.AGENT_STATE,{state:V,state_name:d})}if(i===ae.OUT_CALL_INCOMING_CALL){try{await this.getCustomerInfo(o.trace_id||o.customer_phone)}catch(V){console.error(V)}o.preview_task_id?VA.emit(eA.PREVIEW_OUT_INCOMING_CALL,{customer_phone:o.customer_phone,session_id:o.session_id,preview_task_id:o.preview_task_id,trace_id:o.trace_id}):VA.emit(eA.OUT_INCOMING_CALL,{customer_phone:o.customer_phone,session_id:o.session_id,trace_id:o.trace_id}),$.sessionId=o.session_id,N.updateActionConfigs(Kw)}if(i===ae.OUT_CALL_END)if(N.updateDisplayText(""),o.device_type===1&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.OUT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===2&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.OUR_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===2&&o.agent_no!==$.agentInfo.agent_no)N.get("isCalling")&&(N.updateDisplayText(Xe.CALLING),VA.emit(eA.OTHER_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Qr));else if(o.device_type===3&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.THREE_WAY_OUR_SIDE_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===4&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.TRANSFER_END,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===4&&o.agent_no!==$.agentInfo.agent_no){VA.emit(eA.TRANSFER_FAILED,"未知原因"),VA.emit(xA.FAIL_NOTIFICATION,"转接失败");const V=N.get("direction");V===Bt.OUTGOING?N.updateActionConfigs(Qr):V===Bt.INCOMING&&N.updateActionConfigs(ei)}else o.device_type===5&&o.agent_no===$.agentInfo.agent_no&&($.monitoredAgentNo="",$.earSpeakAgent="",N.reset(),VA.emit(eA.LISTEN_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0,5));if(i===ae.OUT_CALL_RINGING&&o.type===1&&(VA.emit(eA.OUT_RINGING,{session_id:$.sessionId,type:o.type}),N.updateDisplayText(Xe.RINGING)),i===ae.OUT_CALL_ANSWER&&(clearTimeout($.autoStateTimer),N.updateIsCalling(!0),VA.emit(eA.OUT_OFF_ANSWER,{session_id:$.sessionId}),N.updateOutCallIsAnswer(!0),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(Qr)),i===ae.CONSULT_RINGING&&(VA.emit(eA.CONSULT_RINGING,{session_id:o.session_id}),N.updateDisplayText(Xe.AGENT_RINGING),N.updateActionConfigs([]),clearTimeout($.autoStateTimer)),i===ae.CONSULT_ANSWER&&(VA.emit(eA.CONSULT_OFF_HOOK,{session_id:o.session_id}),N.updateConsultIsAnswer(!0),N.updateDisplayText(Xe.CONSULTING),N.updateActionConfigs(jw)),i===ae.CONSULT_FAIL&&(VA.emit(eA.CONSULT_FAILED,{custom_reason:o.custom_reason}),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(Qr)),i===ae.CONSULT_CALL_IN&&(VA.emit(eA.CONSULT_INCOMING,{agent_no:o.agent_no,agent_mane:o.agent_name,session_id:o.session_id}),$.sessionId=o.session_id,N.updateIsCalling(!0),N.updateDirection(Bt.CONSULT),N.updateDisplayText(Xe.CONSULT_CALL_IN),N.updateActionConfigs(ss),$.enableBrowserAlert&&Li.show("📞 咨询来电",`坐席 [${o.agent_name}] 正在咨询...`,()=>{VA.emit(xA.NOTIFICATION_CLICK,{agent_mane:o.agent_name,agent_no:o.agent_no})},$.browserAlertTime)),i===ae.CONSULT_CALL_IN_SUCCESS&&(VA.emit(eA.CONSULT_CALL_IN_SUCCESS,{session_id:o.session_id}),N.updateConsultIsAnswer(!0),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(Lw)),i===ae.CONSULT_RETURN_CALL_SUCCESS&&(o.status==="success"?(N.updateConsultIsAnswer(!1),VA.emit(eA.CONSULT_RETURN_CALL_SUCCESS),N.updateDisplayText(Xe.CALLING),VA.emit(eA.OTHER_SIDE_CONSULT_HANGUP),N.updateActionConfigs(Qr)):VA.emit(xA.FAIL_NOTIFICATION,"媒体失败")),i===ae.MUTE&&(a===0?(N.updateIsMuted(!0),VA.emit(eA.MUTE_SUCCESS),N.updateDisplayText(Xe.MUTING)):(VA.emit(eA.MUTE_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.UNMUTE&&(a===0?(N.updateIsMuted(!1),VA.emit(eA.UNMUTE_SUCCESS),N.updateDisplayText(Xe.CALLING)):(VA.emit(eA.UNMUTE_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CALL_HOLD&&(a===0?(N.updateIsHold(!0),N.updateDisplayText(Xe.HOLDING),VA.emit(eA.HOLD_SUCCESS)):(VA.emit(eA.HOLD_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CALL_UNHOLD&&(a===0?(N.updateDisplayText(Xe.CALLING),N.updateIsHold(!1),VA.emit(eA.UNHOLD_SUCCESS)):(VA.emit(eA.UNHOLD_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CONSULT_TRANSFER&&(a===0?VA.emit(eA.CONSULT_TRANSFER_SUCCESS):(VA.emit(eA.CONSULT_TRANSFER_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CONSULT_TRANSFER_FAILED&&VA.emit(eA.CONSULT_TRANSFER_FAILED,o.status),i===ae.CONSULT_TRANSFER_OFF_HOOK&&(N.updateDirection(Bt.INCOMING),N.updateDisplayText(Xe.CALLING),VA.emit(eA.CONSULT_TRANSFER_OFF_HOOK),N.updateActionConfigs(ei),N.updateIncomingIsAnswer(!0),N.updateConsultIsAnswer(!1)),i===ae.INCOMING_CALL){clearTimeout($.autoStateTimer),$.sessionId=o.session_id;try{await this.getCustomerInfo(o.trace_id||o.customer_phone)}catch(V){console.error(V)}N.updateIsCalling(!0),N.updateDirection(Bt.INCOMING),N.updateDisplayText(Xe.INCOMING_CALL),this.inCallAutoAnswer(),o.direction===1&&VA.emit(eA.INCOMING_CALL,{customer_phone:o.customer_phone,trace_id:o.trace_id,session_id:o.session_id}),o.direction===3&&VA.emit(eA.PREDICT_INCOMING_CALL,{customer_phone:o.customer_phone,trace_id:o.trace_id,session_id:o.session_id}),o.direction===6&&VA.emit(eA.DUAL_CALL_INCOMING_CALL,{customer_phone:o.customer_phone,trace_id:o.trace_id,session_id:o.session_id}),N.updateActionConfigs(ss),$.enableBrowserAlert&&Li.show("📞 客户来电",`客户 [${o.customer_phone}] 正在呼入...`,()=>{VA.emit(xA.NOTIFICATION_CLICK,{customer_phone:o.customer_phone})},$.browserAlertTime)}if(i===ae.INCOMING_CALL_OFF_HOOK&&(N.updateIncomingIsAnswer(!0),VA.emit(eA.INCOMING_CALL_OFF_HOOK,{session_id:$.sessionId}),N.updateActionConfigs(ei),N.updateDisplayText(Xe.CALLING)),i===ae.INCOMING_CALL_END)if(N.updateDisplayText(""),o.device_type===1&&o.agent_no===$.agentInfo.agent_no)this.putAgentState(!0),N.reset(),VA.emit(eA.INCOMING_CALL_END,{session_id:o.session_id}),N.updateActionConfigs(Pt);else if(o.device_type===2&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.OUR_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),this.putAgentState(!0),N.updateActionConfigs(Pt);else if(o.device_type===2&&o.agent_no!==$.agentInfo.agent_no)N.updateDisplayText(Xe.CALLING),VA.emit(eA.OTHER_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Qr);else if(o.device_type===3&&o.agent_no===$.agentInfo.agent_no)this.putAgentState(!0),N.reset(),VA.emit(eA.THREE_WAY_OUR_SIDE_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt);else if(o.device_type===4&&o.agent_no===$.agentInfo.agent_no)this.putAgentState(!0),N.reset(),VA.emit(eA.TRANSFER_END,{session_id:o.session_id}),N.updateActionConfigs(Pt);else if(o.device_type===4&&o.agent_no!==$.agentInfo.agent_no){VA.emit(eA.TRANSFER_FAILED,"未知原因"),VA.emit(xA.FAIL_NOTIFICATION,"转接失败");const V=N.get("direction");V===Bt.OUTGOING?N.updateActionConfigs(Qr):V===Bt.INCOMING&&N.updateActionConfigs(ei)}else o.device_type===5&&o.agent_no===$.agentInfo.agent_no&&(this.putAgentState(!0,5),$.monitoredAgentNo="",$.earSpeakAgent="",N.reset(),VA.emit(eA.LISTEN_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt));if(i===ae.SATISFACTION_EVALUATION&&(a===0?VA.emit(eA.SATISFACTION_EVALUATION_SUCCESS):(VA.emit(eA.SATISFACTION_EVALUATION_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CONSULT_THREE_WAY&&(a!==0?(VA.emit(eA.CONSULT_THREE_WAY_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s)):a===0&&N.updateIsMeeting(!0)),i===ae.CONSULT_THREE_WAY_RESULT&&(o.status==="success"?(N.updateDirection(Bt.MEETING),N.updateDisplayText(Xe.MEETING),N.updateActionConfigs(Hw),VA.emit(eA.CONSULT_THREE_WAY_SUCCESS)):(VA.emit(eA.CONSULT_THREE_WAY_FAILED,{conf_name:o.conf_name}),N.updateIsMeeting(!1))),i===ae.TRANSFER_INCOMING_CALL&&(clearTimeout($.autoStateTimer),o.agent_no===$.agentInfo.agent_no?(N.updateDisplayText(Xe.TRANSFERRING),VA.emit(eA.TRANSFER_PROGRESS),N.updateActionConfigs([]),N.updateTransferIsAnswer(!0)):($.sessionId=o.session_id,VA.emit(eA.TRANSFER_INCOMING_CALL,{agent_no:o.agent_no,agent_name:o.agent_name,session_id:o.session_id}),N.updateIsCalling(!0),N.updateDirection(Bt.TRANSFER),N.updateDisplayText(Xe.TRANSFER_INCOMING_CALL),N.updateActionConfigs(ss),$.enableBrowserAlert&&Li.show("📞 转接来电",`坐席 [${o.agent_no}] 正在转接...`,()=>{VA.emit(xA.NOTIFICATION_CLICK,{agent_no:o.agent_no})},$.browserAlertTime))),i===ae.TRANSFER_OFF_HOOK&&(VA.emit(eA.TRANSFER_OFF_HOOK,{session_id:$.sessionId}),N.updateTransferIsAnswer(!1),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(ei)),i===ae.TRANSFER_FAILED&&o.status==="failed"){VA.emit(eA.TRANSFER_FAILED,"未知原因"),VA.emit(xA.FAIL_NOTIFICATION,"转接失败");const V=N.get("direction");V===Bt.OUTGOING?N.updateActionConfigs(Qr):V===Bt.INCOMING&&N.updateActionConfigs(ei)}i===ae.KICK_OFFLINE&&VA.emit(xA.KICK_OFF),i===ae.CONTINUOUS_NOT_ANSWER&&(VA.emit(xA.FAIL_NOTIFICATION,`已连续 ${o.miss_count} 次未接, 设置忙碌`),this.stateBusyChange()),i===ae.SIGN_OUT&&VA.emit(xA.SIGN_OUT),i===ae.SIGN_IN_SWITCH_DEVICE&&VA.emit(xA.SIGN_IN_SWITCH_DEVICE,o),i===ae.LISTEN_INCOMING_CALL&&(clearTimeout($.autoStateTimer),$.sessionId=o.session_id,N.updateIsCalling(!0),N.updateDirection(Bt.INCOMING),this.inCallAutoAnswer(),N.updateDisplayText(Xe.LISTENING),N.updateActionConfigs(ss),VA.emit(eA.LISTEN_INCOMING_CALL,{session_id:o.session_id}),$.enableBrowserAlert&&Li.show("📞 监听来电","正在来电...",()=>{VA.emit(xA.NOTIFICATION_CLICK,{customer_phone:o.customer_phone})},$.browserAlertTime)),i===ae.LISTEN_INCOMING_CALL_OFF_HOOK&&($.monitoredAgentNo=o.monitored_agent_no,$.earSpeakAgent="",N.updateIncomingIsAnswer(!0),VA.emit(eA.LISTEN_INCOMING_CALL_OFF_HOOK,{session_id:$.sessionId,monitored_agent_no:o.monitored_agent_no}),N.updateActionConfigs(Zh),N.updateDisplayText(Xe.CALLING)),i===ae.LISTEN_CALL_FAILED&&o.status==="failed"&&(VA.emit(eA.LISTEN_CALL_FAILED),$.monitoredAgentNo=""),i===ae.EAR_SPEECH&&(o.status==="success"?(o.monitored_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(Jw),VA.emit(eA.EAR_SPEECH_BE_SUCCESS)),o.monitor_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(Pw),VA.emit(eA.EAR_SPEECH_SUCCESS,{monitored_agent_no:o.monitored_agent_no,monitor_agent_no:o.monitor_agent_no}),$.earSpeakAgent=o.monitored_agent_no)):VA.emit(eA.EAR_SPEECH_FAILED)),i===ae.STOP_EAR_SPEECH&&(o.status==="success"?(o.monitored_agent_no===$.agentInfo.agent_no&&N.updateActionConfigs(ei),o.monitor_agent_no===$.agentInfo.agent_no&&N.updateActionConfigs(Zh),$.earSpeakAgent="",VA.emit(eA.STOP_EAR_SPEECH_SUCCESS)):VA.emit(eA.STOP_EAR_SPEECH_FAILED)),i===ae.CALL_FORCE_INSERT&&(o.status==="success"?(o.monitored_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(zw),VA.emit(eA.CALL_FORCE_INSERT_SUCCESS,{monitored_agent_no:o.monitored_agent_no,monitor_agent_no:o.monitor_agent_no})),o.monitor_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(Ww),VA.emit(eA.CALL_FORCE_INSERT_SUCCESS_LISTENER,{monitored_agent_no:o.monitored_agent_no,monitor_agent_no:o.monitor_agent_no}))):VA.emit(eA.CALL_FORCE_INSERT_FAILED))},this.ws.onclose=n=>{VA.emit(xA.FAIL_NOTIFICATION,"链接已断开,请检查网络"),this.stopHeartbeat(),this.manualClose||setTimeout(()=>this.initWebSocket(),this.reconnectDelay)},this.ws.onerror=n=>{var r;VA.emit(xA.FAIL_NOTIFICATION,"连接失败,请检查网络"),(r=this.ws)==null||r.close()}}startHeartbeat(){const A=new Blob([`
1056
+ `;ni(r,this.rttHTML)}}class Li{static requestPermission(){"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()}static async requestMediaPermissions(){try{return(await navigator.mediaDevices.enumerateDevices()).some(t=>t.kind==="audioinput"&&t.label!=="")?null:await navigator.mediaDevices.getUserMedia({audio:!0})}catch(A){return console.warn("获取音频权限失败:",A),null}}static show(A,t,n,r){if("Notification"in window&&Notification.permission==="granted"){const i=new Notification(A,{body:t,tag:`xy-global-notification${new Date().getTime()}`,renotify:!0});i.onclick=()=>{window.focus(),i.close(),n==null||n()},setTimeout(()=>i.close(),1e3*(r||3))}}static async checkMediaPermissions(){try{return(await navigator.mediaDevices.enumerateDevices()).some(A=>A.kind==="audioinput"&&A.label!=="")}catch(A){return console.warn("无法检查设备权限:",A),!1}}}const pM=console.log,zh=(...e)=>{$.logBuiltinEnabled&&pM(...e)};let cr=null;class dt{constructor(A,t){this.url=A,this.onOpenCallback=t,this.ws=null,this.heartbeatWorker=null,this.reconnectDelay=3e3,this.manualClose=!1,this.apiClient=new ho,this.sipClient=null,this.pendingMessages=new Map,this.initWebSocket()}static getInstance({url:A,sipClient:t,onOpen:n}){if(!cr){if(!A)throw new Error("WebSocket 尚未初始化");cr=new dt(A,n),cr.sipClient=t}return cr}setSipClient(A){this.sipClient=A}stateIdleChange(){const{state:A}=$.stateObject;A!==fe.IDLE&&this.apiClient._changeState({data:{...$.stateBeforeChange,state_name:$.stateBeforeChange.state===fe.IDLE?"空闲":"忙碌"}})}inCallAutoAnswer(){const{soft_device_auto_answer:A,auto_answer_time:t}=$.agentInfo,n=A===1,r=N.get("direction");if(n&&r===Bt.INCOMING){const i=Number(t)||0;i>0&&($.autoAnswerTimer=setTimeout(()=>{var o;(o=this.sipClient)==null||o.answerCall(),$.autoAnswerTimer=null},1e3*i-500))}}async getCustomerInfo(A){try{await this.apiClient._getInCallCrmDetail({data:{phone:A},success:t=>{N.updateCustomerInfo(t.data||{phone:t.data.phone,is_vip:0,customer_name:"未知客户",city:"未知",province:"未知",contact_count:0,in_contact_count:0,trace_id:t.data.trace_id,contact_count_month:0,in_contact_count_month:0})}})}catch{}}putAgentState(A,t){if(!A)return;if(t===5)return void this.stateIdleChange();$.sessionId="";const{post_call_process_time:n}=$.agentInfo,r=n||0;if($.autoStateTimer&&(clearTimeout($.autoStateTimer),$.autoStateTimer=null),N.updateCustomerInfo(void 0),r>0){const{state:i}=$.stateObject;if(i===fe.IDLE)return;this.apiClient._changeState({data:{state:fe.BUSY,state_name:"整理"}}),$.autoStateTimer=setTimeout(()=>{$.autoStateTimer=null,this.stateIdleChange()},1e3*r)}else this.stateIdleChange()}stateBusyChange(){$.sessionId="",clearTimeout($.autoStateTimer),N.updateCustomerInfo(void 0),this.apiClient._changeState({data:{state:fe.BUSY,state_name:"忙碌"}})}initWebSocket(){var t;if(((t=this.ws)==null?void 0:t.readyState)===1||!N.get("isNextState")||this.manualClose)return;const A=L0(Kd,jd);this.ws=new WebSocket(this.url+A),this.ws.onopen=()=>{const n=new Date().getTime();this.sendMessage({type:0,msg_id:n}),this.pendingMessages.set(n,performance.now()),this.startHeartbeat(),this.manualClose=!1,this.onOpenCallback&&this.onOpenCallback()},this.ws.onmessage=async n=>{var u;const r=JSON.parse(n.data),{type:i,data:o,code:a,msg:s,msg_id:l}=r;if(i===0&&l){const V=this.pendingMessages.get(l),d=performance.now()-V;$.latency=parseFloat(d.toFixed(2)),this.pendingMessages.delete(l)}if(i!==0&&zh("%cWebSocket 收到消息:","color: blue; font-weight: bold;",r),i!==ae.OUT_CALL&&i!==ae.PREVIEW_OUT_CALL||(a!==0?(N.reset(),VA.emit(eA.OUT_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s),N.updateActionConfigs(Pt),setTimeout(()=>{N.updateCustomerInfo(void 0)},500),this.stateIdleChange()):a===0&&(VA.emit(eA.OUT_SUCCESS),clearTimeout($.autoStateTimer))),i===ae.AGENT_STATE){const{state:V,state_name:d}=o;$.stateObject={state:V,state_name:d},(u=$.stateBeforeChange)!=null&&u.state||$.stateObject.state!==fe.IDLE&&($.stateObject.state!==fe.BUSY||d==="整理")||($.stateBeforeChange=$.stateObject),d==="振铃中"&&N.updateDisplayText(Xe.AGENT_RINGING),V===fe.UNREGISTERED&&N.updateActionConfigs(Zw),V===fe.IDLE&&$.stateObject.state===fe.UNREGISTERED&&N.updateActionConfigs(Pt),VA.emit(eA.AGENT_STATE,{state:V,state_name:d})}if(i===ae.OUT_CALL_INCOMING_CALL){try{await this.getCustomerInfo(o.trace_id||o.customer_phone)}catch(V){console.error(V)}o.preview_task_id?VA.emit(eA.PREVIEW_OUT_INCOMING_CALL,{customer_phone:o.customer_phone,session_id:o.session_id,preview_task_id:o.preview_task_id,trace_id:o.trace_id}):VA.emit(eA.OUT_INCOMING_CALL,{customer_phone:o.customer_phone,session_id:o.session_id,trace_id:o.trace_id}),$.sessionId=o.session_id,N.updateActionConfigs(Kw)}if(i===ae.OUT_CALL_END)if(N.updateDisplayText(""),o.device_type===1&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.OUT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===2&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.OUR_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===2&&o.agent_no!==$.agentInfo.agent_no)N.get("isCalling")&&(N.updateDisplayText(Xe.CALLING),VA.emit(eA.OTHER_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Qr));else if(o.device_type===3&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.THREE_WAY_OUR_SIDE_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===4&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.TRANSFER_END,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0);else if(o.device_type===4&&o.agent_no!==$.agentInfo.agent_no){VA.emit(eA.TRANSFER_FAILED,"未知原因"),VA.emit(xA.FAIL_NOTIFICATION,"转接失败");const V=N.get("direction");V===Bt.OUTGOING?N.updateActionConfigs(Qr):V===Bt.INCOMING&&N.updateActionConfigs(ei)}else o.device_type===5&&o.agent_no===$.agentInfo.agent_no&&($.monitoredAgentNo="",$.earSpeakAgent="",N.reset(),VA.emit(eA.LISTEN_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt),this.putAgentState(!0,5));if(i===ae.OUT_CALL_RINGING&&o.type===1&&(VA.emit(eA.OUT_RINGING,{session_id:$.sessionId,type:o.type}),N.updateDisplayText(Xe.RINGING)),i===ae.OUT_CALL_ANSWER&&(clearTimeout($.autoStateTimer),N.updateIsCalling(!0),VA.emit(eA.OUT_OFF_ANSWER,{session_id:$.sessionId}),N.updateOutCallIsAnswer(!0),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(Qr)),i===ae.CONSULT_RINGING&&(VA.emit(eA.CONSULT_RINGING,{session_id:o.session_id}),N.updateDisplayText(Xe.AGENT_RINGING),N.updateActionConfigs([]),clearTimeout($.autoStateTimer)),i===ae.CONSULT_ANSWER&&(VA.emit(eA.CONSULT_OFF_HOOK,{session_id:o.session_id}),N.updateConsultIsAnswer(!0),N.updateDisplayText(Xe.CONSULTING),N.updateActionConfigs(jw)),i===ae.CONSULT_FAIL&&(VA.emit(eA.CONSULT_FAILED,{custom_reason:o.custom_reason}),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(Qr)),i===ae.CONSULT_CALL_IN&&(VA.emit(eA.CONSULT_INCOMING,{agent_no:o.agent_no,agent_mane:o.agent_name,session_id:o.session_id}),$.sessionId=o.session_id,N.updateIsCalling(!0),N.updateDirection(Bt.CONSULT),N.updateDisplayText(Xe.CONSULT_CALL_IN),N.updateActionConfigs(ss),$.enableBrowserAlert&&Li.show("📞 咨询来电",`坐席 [${o.agent_name}] 正在咨询...`,()=>{VA.emit(xA.NOTIFICATION_CLICK,{agent_mane:o.agent_name,agent_no:o.agent_no})},$.browserAlertTime)),i===ae.CONSULT_CALL_IN_SUCCESS&&(VA.emit(eA.CONSULT_CALL_IN_SUCCESS,{session_id:o.session_id}),N.updateConsultIsAnswer(!0),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(Lw)),i===ae.CONSULT_RETURN_CALL_SUCCESS&&(o.status==="success"?(N.updateConsultIsAnswer(!1),VA.emit(eA.CONSULT_RETURN_CALL_SUCCESS),N.updateDisplayText(Xe.CALLING),VA.emit(eA.OTHER_SIDE_CONSULT_HANGUP),N.updateActionConfigs(Qr)):VA.emit(xA.FAIL_NOTIFICATION,"媒体失败")),i===ae.MUTE&&(a===0?(N.updateIsMuted(!0),VA.emit(eA.MUTE_SUCCESS),N.updateDisplayText(Xe.MUTING)):(VA.emit(eA.MUTE_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.UNMUTE&&(a===0?(N.updateIsMuted(!1),VA.emit(eA.UNMUTE_SUCCESS),N.updateDisplayText(Xe.CALLING)):(VA.emit(eA.UNMUTE_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CALL_HOLD&&(a===0?(N.updateIsHold(!0),N.updateDisplayText(Xe.HOLDING),VA.emit(eA.HOLD_SUCCESS)):(VA.emit(eA.HOLD_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CALL_UNHOLD&&(a===0?(N.updateDisplayText(Xe.CALLING),N.updateIsHold(!1),VA.emit(eA.UNHOLD_SUCCESS)):(VA.emit(eA.UNHOLD_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CONSULT_TRANSFER&&(a===0?VA.emit(eA.CONSULT_TRANSFER_SUCCESS):(VA.emit(eA.CONSULT_TRANSFER_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CONSULT_TRANSFER_FAILED&&VA.emit(eA.CONSULT_TRANSFER_FAILED,o.status),i===ae.CONSULT_TRANSFER_OFF_HOOK&&(N.updateDirection(Bt.INCOMING),N.updateDisplayText(Xe.CALLING),VA.emit(eA.CONSULT_TRANSFER_OFF_HOOK),N.updateActionConfigs(ei),N.updateIncomingIsAnswer(!0),N.updateConsultIsAnswer(!1)),i===ae.INCOMING_CALL){clearTimeout($.autoStateTimer),$.sessionId=o.session_id;try{await this.getCustomerInfo(o.trace_id||o.customer_phone)}catch(V){console.error(V)}N.updateIsCalling(!0),N.updateDirection(Bt.INCOMING),N.updateDisplayText(Xe.INCOMING_CALL),this.inCallAutoAnswer(),o.direction===1&&VA.emit(eA.INCOMING_CALL,{customer_phone:o.customer_phone,trace_id:o.trace_id,session_id:o.session_id}),o.direction===3&&VA.emit(eA.PREDICT_INCOMING_CALL,{customer_phone:o.customer_phone,trace_id:o.trace_id,session_id:o.session_id}),o.direction===6&&VA.emit(eA.DUAL_CALL_INCOMING_CALL,{customer_phone:o.customer_phone,trace_id:o.trace_id,session_id:o.session_id}),N.updateActionConfigs(ss),$.enableBrowserAlert&&Li.show("📞 客户来电",`客户 [${o.customer_phone}] 正在呼入...`,()=>{VA.emit(xA.NOTIFICATION_CLICK,{customer_phone:o.customer_phone})},$.browserAlertTime)}if(i===ae.INCOMING_CALL_OFF_HOOK&&(N.updateIncomingIsAnswer(!0),VA.emit(eA.INCOMING_CALL_OFF_HOOK,{session_id:$.sessionId}),N.updateActionConfigs(ei),N.updateDisplayText(Xe.CALLING)),i===ae.INCOMING_CALL_END)if(N.updateDisplayText(""),o.device_type===1&&o.agent_no===$.agentInfo.agent_no)this.putAgentState(!0),N.reset(),VA.emit(eA.INCOMING_CALL_END,{session_id:o.session_id}),N.updateActionConfigs(Pt);else if(o.device_type===2&&o.agent_no===$.agentInfo.agent_no)N.reset(),VA.emit(eA.OUR_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),this.putAgentState(!0),N.updateActionConfigs(Pt);else if(o.device_type===2&&o.agent_no!==$.agentInfo.agent_no)N.updateDisplayText(Xe.CALLING),VA.emit(eA.OTHER_SIDE_CONSULT_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Qr);else if(o.device_type===3&&o.agent_no===$.agentInfo.agent_no)this.putAgentState(!0),N.reset(),VA.emit(eA.THREE_WAY_OUR_SIDE_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt);else if(o.device_type===4&&o.agent_no===$.agentInfo.agent_no)this.putAgentState(!0),N.reset(),VA.emit(eA.TRANSFER_END,{session_id:o.session_id}),N.updateActionConfigs(Pt);else if(o.device_type===4&&o.agent_no!==$.agentInfo.agent_no){VA.emit(eA.TRANSFER_FAILED,"未知原因"),VA.emit(xA.FAIL_NOTIFICATION,"转接失败");const V=N.get("direction");V===Bt.OUTGOING?N.updateActionConfigs(Qr):V===Bt.INCOMING&&N.updateActionConfigs(ei)}else o.device_type===5&&o.agent_no===$.agentInfo.agent_no&&(this.putAgentState(!0,5),$.monitoredAgentNo="",$.earSpeakAgent="",N.reset(),VA.emit(eA.LISTEN_HANGUP,{session_id:o.session_id}),N.updateActionConfigs(Pt));if(i===ae.SATISFACTION_EVALUATION&&(a===0?VA.emit(eA.SATISFACTION_EVALUATION_SUCCESS):(VA.emit(eA.SATISFACTION_EVALUATION_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s))),i===ae.CONSULT_THREE_WAY&&(a!==0?(VA.emit(eA.CONSULT_THREE_WAY_FAILED,s),VA.emit(xA.FAIL_NOTIFICATION,s)):a===0&&N.updateIsMeeting(!0)),i===ae.CONSULT_THREE_WAY_RESULT&&(o.status==="success"?(N.updateDirection(Bt.MEETING),N.updateDisplayText(Xe.MEETING),N.updateActionConfigs(Hw),VA.emit(eA.CONSULT_THREE_WAY_SUCCESS)):(VA.emit(eA.CONSULT_THREE_WAY_FAILED,{conf_name:o.conf_name}),N.updateIsMeeting(!1))),i===ae.TRANSFER_INCOMING_CALL&&(clearTimeout($.autoStateTimer),o.agent_no===$.agentInfo.agent_no?(N.updateDisplayText(Xe.TRANSFERRING),VA.emit(eA.TRANSFER_PROGRESS),N.updateActionConfigs([]),N.updateTransferIsAnswer(!0)):($.sessionId=o.session_id,VA.emit(eA.TRANSFER_INCOMING_CALL,{agent_no:o.agent_no,agent_name:o.agent_name,session_id:o.session_id}),N.updateIsCalling(!0),N.updateDirection(Bt.TRANSFER),N.updateDisplayText(Xe.TRANSFER_INCOMING_CALL),N.updateActionConfigs(ss),$.enableBrowserAlert&&Li.show("📞 转接来电",`坐席 [${o.agent_no}] 正在转接...`,()=>{VA.emit(xA.NOTIFICATION_CLICK,{agent_no:o.agent_no})},$.browserAlertTime))),i===ae.TRANSFER_OFF_HOOK&&(VA.emit(eA.TRANSFER_OFF_HOOK,{session_id:$.sessionId}),N.updateTransferIsAnswer(!1),N.updateDisplayText(Xe.CALLING),N.updateActionConfigs(ei)),i===ae.TRANSFER_FAILED&&o.status==="failed"){VA.emit(eA.TRANSFER_FAILED,"未知原因"),VA.emit(xA.FAIL_NOTIFICATION,"转接失败");const V=N.get("direction");V===Bt.OUTGOING?N.updateActionConfigs(Qr):V===Bt.INCOMING&&N.updateActionConfigs(ei)}i===ae.KICK_OFFLINE&&VA.emit(xA.KICK_OFF),i===ae.CONTINUOUS_NOT_ANSWER&&(VA.emit(xA.FAIL_NOTIFICATION,`已连续 ${o.miss_count} 次未接, 设置忙碌`),this.stateBusyChange()),i===ae.SIGN_OUT&&VA.emit(xA.SIGN_OUT),i===ae.SIGN_IN_SWITCH_DEVICE&&VA.emit(xA.SIGN_IN_SWITCH_DEVICE,o),i===ae.LISTEN_INCOMING_CALL&&(clearTimeout($.autoStateTimer),$.sessionId=o.session_id,N.updateIsCalling(!0),N.updateDirection(Bt.INCOMING),this.inCallAutoAnswer(),N.updateDisplayText(Xe.LISTENING),N.updateActionConfigs(ss),VA.emit(eA.LISTEN_INCOMING_CALL,{session_id:o.session_id}),$.enableBrowserAlert&&Li.show("📞 监听来电","正在来电...",()=>{VA.emit(xA.NOTIFICATION_CLICK,{customer_phone:o.customer_phone})},$.browserAlertTime)),i===ae.LISTEN_INCOMING_CALL_OFF_HOOK&&($.monitoredAgentNo=o.monitored_agent_no,$.earSpeakAgent="",N.updateIncomingIsAnswer(!0),VA.emit(eA.LISTEN_INCOMING_CALL_OFF_HOOK,{session_id:$.sessionId,monitored_agent_no:o.monitored_agent_no}),N.updateActionConfigs(Zh),N.updateDisplayText(Xe.CALLING)),i===ae.LISTEN_CALL_FAILED&&o.status==="failed"&&(VA.emit(eA.LISTEN_CALL_FAILED),$.monitoredAgentNo=""),i===ae.EAR_SPEECH&&(o.status==="success"?(o.monitored_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(Jw),VA.emit(eA.EAR_SPEECH_BE_SUCCESS)),o.monitor_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(Pw),VA.emit(eA.EAR_SPEECH_SUCCESS,{monitored_agent_no:o.monitored_agent_no,monitor_agent_no:o.monitor_agent_no}),$.earSpeakAgent=o.monitored_agent_no)):VA.emit(eA.EAR_SPEECH_FAILED)),i===ae.STOP_EAR_SPEECH&&(o.status==="success"?(o.monitored_agent_no===$.agentInfo.agent_no&&N.updateActionConfigs(ei),o.monitor_agent_no===$.agentInfo.agent_no&&N.updateActionConfigs(Zh),$.earSpeakAgent="",VA.emit(eA.STOP_EAR_SPEECH_SUCCESS)):VA.emit(eA.STOP_EAR_SPEECH_FAILED)),i===ae.CALL_FORCE_INSERT&&(o.status==="success"?(o.monitored_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(zw),VA.emit(eA.CALL_FORCE_INSERT_SUCCESS,{monitored_agent_no:o.monitored_agent_no,monitor_agent_no:o.monitor_agent_no})),o.monitor_agent_no===$.agentInfo.agent_no&&(N.updateActionConfigs(Ww),VA.emit(eA.CALL_FORCE_INSERT_SUCCESS_LISTENER,{monitored_agent_no:o.monitored_agent_no,monitor_agent_no:o.monitor_agent_no}))):VA.emit(eA.CALL_FORCE_INSERT_FAILED))},this.ws.onclose=n=>{VA.emit(xA.FAIL_NOTIFICATION,"链接已断开,请检查网络"),this.stopHeartbeat();const r=N.get("isNextState");!this.manualClose&&r&&setTimeout(()=>this.initWebSocket(),this.reconnectDelay)},this.ws.onerror=n=>{var r;VA.emit(xA.FAIL_NOTIFICATION,"连接失败,请检查网络"),(r=this.ws)==null||r.close()}}startHeartbeat(){const A=new Blob([`
1057
1057
  let timer;
1058
1058
  self.onmessage = function (e) {
1059
1059
  if (e.data === 'start') {
@@ -1556,7 +1556,7 @@ html body {
1556
1556
  &:hover {
1557
1557
  opacity: 0.9;
1558
1558
  }
1559
- `;function PF({title:e,content:A,icon:t,onOk:n,onCancel:r}){const i=document.createElement("div");document.body.appendChild(i);const o=NF.createRoot(i),a=()=>{o.unmount(),i.remove()},s=async()=>{n&&await n(),a()},l=()=>{r==null||r(),a()};o.render(lA.jsx(ZF,{children:lA.jsxs(KF,{children:[lA.jsxs(jF,{children:[t&&lA.jsx(LF,{children:t}),e]}),lA.jsx(HF,{children:A}),lA.jsxs(JF,{children:[lA.jsx(eq,{onClick:l,children:"取消"}),lA.jsx(eq,{primary:!0,onClick:s,children:"确定"})]})]})}))}const WF={1:lA.jsx(Me,{name:"ruandianhua"}),2:lA.jsx(Me,{name:"pnhone"}),3:lA.jsx(Me,{name:"sip-phone"})},zF={call_number:"",answer:"接听",reject:"拒接",hangup:"挂机",dtmf:"DTMF",unhold:"取消保持",hold:"保持",mute:"静音",unmute:"取消静音",satisfaction:"满意度",consult:"咨询",consult_transfer:"咨询转接",consult_retrieve:"取回通话",conference:"三方会议",whisper:"耳语",cancel_whisper:"取消耳语",force_insert:"强插",force_disconnect:"强拆"},XF={空闲:1,离线:0,未注册:4},_F=x.lazy(()=>Promise.resolve().then(()=>require("./ConsultModel-DBv36gPT.js"))),$F=x.lazy(()=>Promise.resolve().then(()=>require("./TransferModel-L-8SrP6_.js"))),gu=lt.div`
1559
+ `;function PF({title:e,content:A,icon:t,onOk:n,onCancel:r}){const i=document.createElement("div");document.body.appendChild(i);const o=NF.createRoot(i),a=()=>{o.unmount(),i.remove()},s=async()=>{n&&await n(),a()},l=()=>{r==null||r(),a()};o.render(lA.jsx(ZF,{children:lA.jsxs(KF,{children:[lA.jsxs(jF,{children:[t&&lA.jsx(LF,{children:t}),e]}),lA.jsx(HF,{children:A}),lA.jsxs(JF,{children:[lA.jsx(eq,{onClick:l,children:"取消"}),lA.jsx(eq,{primary:!0,onClick:s,children:"确定"})]})]})}))}const WF={1:lA.jsx(Me,{name:"ruandianhua"}),2:lA.jsx(Me,{name:"pnhone"}),3:lA.jsx(Me,{name:"sip-phone"})},zF={call_number:"",answer:"接听",reject:"拒接",hangup:"挂机",dtmf:"DTMF",unhold:"取消保持",hold:"保持",mute:"静音",unmute:"取消静音",satisfaction:"满意度",consult:"咨询",consult_transfer:"咨询转接",consult_retrieve:"取回通话",conference:"三方会议",whisper:"耳语",cancel_whisper:"取消耳语",force_insert:"强插",force_disconnect:"强拆"},XF={空闲:1,离线:0,未注册:4},_F=x.lazy(()=>Promise.resolve().then(()=>require("./ConsultModel-Dk5o1Hby.js"))),$F=x.lazy(()=>Promise.resolve().then(()=>require("./TransferModel-BCOEZmAa.js"))),gu=lt.div`
1560
1560
  width: 25px;
1561
1561
  height: 25px;
1562
1562
  background: ${({bg:e})=>e};
@@ -1,4 +1,4 @@
1
- "use strict";const b=require("react"),a=require("./index-BPyR7aGg.js");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=st(b),it=new a.Keyframe("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),ct=new a.Keyframe("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),dt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:o}=e,n=`${o}-fade`,r=t?"&":"";return[a.initMotion(n,it,ct,e.motionDurationMid,t),{[`
1
+ "use strict";const b=require("react"),a=require("./index-BiSWuclo.js");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=st(b),it=new a.Keyframe("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),ct=new a.Keyframe("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),dt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:o}=e,n=`${o}-fade`,r=t?"&":"";return[a.initMotion(n,it,ct,e.motionDurationMid,t),{[`
2
2
  ${r}${n}-enter,
3
3
  ${r}${n}-appear
4
4
  `]:{opacity:0,animationTimingFunction:"linear"},[`${r}${n}-leave`]:{animationTimingFunction:"linear"}}]},ut=e=>{const{paddingXXS:t,lineWidth:o,tagPaddingHorizontal:n,componentCls:r,calc:l}=e,i=l(n).sub(o).equal(),u=l(t).sub(o).equal();return{[r]:Object.assign(Object.assign({},a.resetComponent(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${a.unit(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${r}-close-icon`]:{marginInlineStart:u,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:i}}),[`${r}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},Ce=e=>{const{lineWidth:t,fontSizeIcon:o,calc:n}=e,r=e.fontSizeSM;return a.merge(e,{tagFontSize:r,tagLineHeight:a.unit(n(e.lineHeightSM).mul(r).equal()),tagIconSize:n(o).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},pe=e=>({defaultBg:new a.FastColor(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),Re=a.genStyleHooks("Tag",e=>{const t=Ce(e);return ut(t)},pe);function oe(e){if(e)return{closable:e.closable,closeIcon:e.closeIcon}}function $e(e){const{closable:t,closeIcon:o}=e||{};return b.useMemo(()=>{if(!t&&(t===!1||o===!1||o===null))return!1;if(t===void 0&&o===void 0)return null;let n={closeIcon:typeof o!="boolean"&&o!==null?o:void 0};return t&&typeof t=="object"&&(n=Object.assign(Object.assign({},n),t)),n},[t,o])}function xe(){const e={};for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return o.forEach(r=>{r&&Object.keys(r).forEach(l=>{r[l]!==void 0&&(e[l]=r[l])})}),e}const mt={};function Be(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mt;const n=$e(e),r=$e(t),l=typeof n!="boolean"?!!(n!=null&&n.disabled):!1,i=b.useMemo(()=>Object.assign({closeIcon:b.createElement(a.RefIcon,null)},o),[o]),u=b.useMemo(()=>n===!1?!1:n?xe(i,r,n):r===!1?!1:r?xe(i,r):i.closable?i:!1,[n,r,i]);return b.useMemo(()=>{if(u===!1)return[!1,null,l];const{closeIconRender:c}=i,{closeIcon:g}=u;let d=g;if(d!=null){c&&(d=c(g));const m=a.pickAttrs(u,!0);Object.keys(m).length&&(d=b.isValidElement(d)?b.cloneElement(d,m):b.createElement("span",Object.assign({},m),d))}return[!0,d,l]},[u,i])}var ft=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o};const gt=s.forwardRef((e,t)=>{const{prefixCls:o,style:n,className:r,checked:l,onChange:i,onClick:u}=e,c=ft(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:g,tag:d}=s.useContext(a.ConfigContext),m=y=>{i==null||i(!l),u==null||u(y)},f=g("tag",o),[v,x,C]=Re(f),p=a.classNames(f,`${f}-checkable`,{[`${f}-checkable-checked`]:l},d==null?void 0:d.className,r,x,C);return v(s.createElement("span",Object.assign({},c,{ref:t,style:Object.assign(Object.assign({},n),d==null?void 0:d.style),className:p,onClick:m})))}),Ct=e=>a.genPresetColor(e,(t,o)=>{let{textColor:n,lightBorderColor:r,lightColor:l,darkColor:i}=o;return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:n,background:l,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:i,borderColor:i},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),pt=a.genSubStyleComponent(["Tag","preset"],e=>{const t=Ce(e);return Ct(t)},pe);function bt(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const ne=(e,t,o)=>{const n=bt(o);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${o}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},vt=a.genSubStyleComponent(["Tag","status"],e=>{const t=Ce(e);return[ne(t,"success","Success"),ne(t,"processing","Info"),ne(t,"error","Error"),ne(t,"warning","Warning")]},pe);var ht=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o};const yt=s.forwardRef((e,t)=>{const{prefixCls:o,className:n,rootClassName:r,style:l,children:i,icon:u,color:c,onClose:g,bordered:d=!0,visible:m}=e,f=ht(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:v,direction:x,tag:C}=s.useContext(a.ConfigContext),[p,y]=s.useState(!0),h=a.omit(f,["closeIcon","closable"]);process.env.NODE_ENV!=="production"&&a.devUseWarning("Tag").deprecated(!("visible"in e),"visible","visible && <Tag />"),s.useEffect(()=>{m!==void 0&&y(m)},[m]);const S=a.isPresetColor(c),N=a.isPresetStatusColor(c),E=S||N,O=Object.assign(Object.assign({backgroundColor:c&&!E?c:void 0},C==null?void 0:C.style),l),$=v("tag",o),[P,j,H]=Re($),B=a.classNames($,C==null?void 0:C.className,{[`${$}-${c}`]:E,[`${$}-has-color`]:c&&!E,[`${$}-hidden`]:!p,[`${$}-rtl`]:x==="rtl",[`${$}-borderless`]:!d},n,r,j,H),_=I=>{I.stopPropagation(),g==null||g(I),!I.defaultPrevented&&y(!1)},[,V]=Be(oe(e),oe(C),{closable:!1,closeIconRender:I=>{const X=s.createElement("span",{className:`${$}-close-icon`,onClick:_},I);return a.replaceElement(I,X,M=>({onClick:q=>{var R;(R=M==null?void 0:M.onClick)===null||R===void 0||R.call(M,q),_(q)},className:a.classNames(M==null?void 0:M.className,`${$}-close-icon`)}))}}),A=typeof f.onClick=="function"||i&&i.type==="a",z=u||null,W=z?s.createElement(s.Fragment,null,z,i&&s.createElement("span",null,i)):i,L=s.createElement("span",Object.assign({},h,{ref:t,className:B,style:O}),W,V,S&&s.createElement(pt,{key:"preset",prefixCls:$}),N&&s.createElement(vt,{key:"status",prefixCls:$}));return P(A?s.createElement(a.Wave,{component:"Tag"},L):L)}),be=yt;process.env.NODE_ENV!=="production"&&(be.displayName="Tag");be.CheckableTag=gt;function ie(e){return!!(e!=null&&e.then)}const _e=e=>{const{type:t,children:o,prefixCls:n,buttonProps:r,close:l,autoFocus:i,emitEvent:u,isSilent:c,quitOnNullishReturnValue:g,actionFn:d}=e,m=s.useRef(!1),f=s.useRef(null),[v,x]=a.useSafeState(!1),C=function(){l==null||l.apply(void 0,arguments)};s.useEffect(()=>{let h=null;return i&&(h=setTimeout(()=>{var S;(S=f.current)===null||S===void 0||S.focus({preventScroll:!0})})),()=>{h&&clearTimeout(h)}},[]);const p=h=>{ie(h)&&(x(!0),h.then(function(){x(!1,!0),C.apply(void 0,arguments),m.current=!1},S=>{if(x(!1,!0),m.current=!1,!(c!=null&&c()))return Promise.reject(S)}))},y=h=>{if(m.current)return;if(m.current=!0,!d){C();return}let S;if(u){if(S=d(h),g&&!ie(S)){m.current=!1,C(h);return}}else if(d.length)S=d(l),m.current=!1;else if(S=d(),!ie(S)){C();return}p(S)};return s.createElement(a.Button,Object.assign({},a.convertLegacyProps(t),{onClick:y,loading:v,prefixCls:n},r,{ref:f}),o)},ee=b.createContext({}),{Provider:He}=ee,Se=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:o,isSilent:n,mergedOkCancel:r,rootPrefixCls:l,close:i,onCancel:u,onConfirm:c}=b.useContext(ee);return r?b.createElement(_e,{isSilent:n,actionFn:u,close:function(){i==null||i.apply(void 0,arguments),c==null||c(!1)},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${l}-btn`},o):null},Oe=()=>{const{autoFocusButton:e,close:t,isSilent:o,okButtonProps:n,rootPrefixCls:r,okTextLocale:l,okType:i,onConfirm:u,onOk:c}=b.useContext(ee);return b.createElement(_e,{isSilent:o,type:i||"primary",actionFn:c,close:function(){t==null||t.apply(void 0,arguments),u==null||u(!0)},autoFocus:e==="ok",buttonProps:n,prefixCls:`${r}-btn`},l)};var ze=s.createContext({});function Ne(e,t,o){var n=t;return!n&&o&&(n="".concat(e,"-").concat(o)),n}function Ee(e,t){var o=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof o!="number"){var r=e.document;o=r.documentElement[n],typeof o!="number"&&(o=r.body[n])}return o}function $t(e){var t=e.getBoundingClientRect(),o={left:t.left,top:t.top},n=e.ownerDocument,r=n.defaultView||n.parentWindow;return o.left+=Ee(r),o.top+=Ee(r,!0),o}const xt=s.memo(function(e){var t=e.children;return t},function(e,t){var o=t.shouldUpdate;return!o});var St={width:0,height:0,overflow:"hidden",outline:"none"},Ot={outline:"none"},ve=b.forwardRef(function(e,t){var o=e.prefixCls,n=e.className,r=e.style,l=e.title,i=e.ariaId,u=e.footer,c=e.closable,g=e.closeIcon,d=e.onClose,m=e.children,f=e.bodyStyle,v=e.bodyProps,x=e.modalRender,C=e.onMouseDown,p=e.onMouseUp,y=e.holderRef,h=e.visible,S=e.forceRender,N=e.width,E=e.height,O=e.classNames,$=e.styles,P=b.useContext(ze),j=P.panel,H=a.useComposeRef(y,j),B=b.useRef(),_=b.useRef();b.useImperativeHandle(t,function(){return{focus:function(){var R;(R=B.current)===null||R===void 0||R.focus({preventScroll:!0})},changeActive:function(R){var Y=document,G=Y.activeElement;R&&G===_.current?B.current.focus({preventScroll:!0}):!R&&G===B.current&&_.current.focus({preventScroll:!0})}}});var V={};N!==void 0&&(V.width=N),E!==void 0&&(V.height=E);var A=u?b.createElement("div",{className:a.classNames("".concat(o,"-footer"),O==null?void 0:O.footer),style:a._objectSpread2({},$==null?void 0:$.footer)},u):null,z=l?b.createElement("div",{className:a.classNames("".concat(o,"-header"),O==null?void 0:O.header),style:a._objectSpread2({},$==null?void 0:$.header)},b.createElement("div",{className:"".concat(o,"-title"),id:i},l)):null,W=b.useMemo(function(){return a._typeof(c)==="object"&&c!==null?c:c?{closeIcon:g??b.createElement("span",{className:"".concat(o,"-close-x")})}:{}},[c,g,o]),L=a.pickAttrs(W,!0),I=a._typeof(c)==="object"&&c.disabled,X=c?b.createElement("button",a._extends({type:"button",onClick:d,"aria-label":"Close"},L,{className:"".concat(o,"-close"),disabled:I}),W.closeIcon):null,M=b.createElement("div",{className:a.classNames("".concat(o,"-content"),O==null?void 0:O.content),style:$==null?void 0:$.content},X,z,b.createElement("div",a._extends({className:a.classNames("".concat(o,"-body"),O==null?void 0:O.body),style:a._objectSpread2(a._objectSpread2({},f),$==null?void 0:$.body)},v),m),A);return b.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":l?i:null,"aria-modal":"true",ref:H,style:a._objectSpread2(a._objectSpread2({},r),V),className:a.classNames(o,n),onMouseDown:C,onMouseUp:p},b.createElement("div",{ref:B,tabIndex:0,style:Ot},b.createElement(xt,{shouldUpdate:h||S},x?x(M):M)),b.createElement("div",{tabIndex:0,ref:_,style:St}))});process.env.NODE_ENV!=="production"&&(ve.displayName="Panel");var Ae=s.forwardRef(function(e,t){var o=e.prefixCls,n=e.title,r=e.style,l=e.className,i=e.visible,u=e.forceRender,c=e.destroyOnClose,g=e.motionName,d=e.ariaId,m=e.onVisibleChanged,f=e.mousePosition,v=b.useRef(),x=s.useState(),C=a._slicedToArray(x,2),p=C[0],y=C[1],h={};p&&(h.transformOrigin=p);function S(){var N=$t(v.current);y(f&&(f.x||f.y)?"".concat(f.x-N.left,"px ").concat(f.y-N.top,"px"):"")}return s.createElement(a.CSSMotion,{visible:i,onVisibleChanged:m,onAppearPrepare:S,onEnterPrepare:S,forceRender:u,motionName:g,removeOnLeave:c,ref:v},function(N,E){var O=N.className,$=N.style;return s.createElement(ve,a._extends({},e,{ref:t,title:n,ariaId:d,prefixCls:o,holderRef:E,style:a._objectSpread2(a._objectSpread2(a._objectSpread2({},$),r),h),className:a.classNames(l,O)}))})});Ae.displayName="Content";var Nt=function(t){var o=t.prefixCls,n=t.style,r=t.visible,l=t.maskProps,i=t.motionName,u=t.className;return s.createElement(a.CSSMotion,{key:"mask",visible:r,motionName:i,leavedClassName:"".concat(o,"-mask-hidden")},function(c,g){var d=c.className,m=c.style;return s.createElement("div",a._extends({ref:g,style:a._objectSpread2(a._objectSpread2({},m),n),className:a.classNames("".concat(o,"-mask"),d,u)},l))})},Et=function(t){var o=t.prefixCls,n=o===void 0?"rc-dialog":o,r=t.zIndex,l=t.visible,i=l===void 0?!1:l,u=t.keyboard,c=u===void 0?!0:u,g=t.focusTriggerAfterClose,d=g===void 0?!0:g,m=t.wrapStyle,f=t.wrapClassName,v=t.wrapProps,x=t.onClose,C=t.afterOpenChange,p=t.afterClose,y=t.transitionName,h=t.animation,S=t.closable,N=S===void 0?!0:S,E=t.mask,O=E===void 0?!0:E,$=t.maskTransitionName,P=t.maskAnimation,j=t.maskClosable,H=j===void 0?!0:j,B=t.maskStyle,_=t.maskProps,V=t.rootClassName,A=t.classNames,z=t.styles;process.env.NODE_ENV!=="production"&&(["wrapStyle","bodyStyle","maskStyle"].forEach(function(w){a.warning(!(w in t),"".concat(w," is deprecated, please use styles instead."))}),"wrapClassName"in t&&a.warning(!1,"wrapClassName is deprecated, please use classNames instead."));var W=b.useRef(),L=b.useRef(),I=b.useRef(),X=s.useState(i),M=a._slicedToArray(X,2),q=M[0],R=M[1],Y=a.useId();function G(){a.contains(L.current,document.activeElement)||(W.current=document.activeElement)}function le(){if(!a.contains(L.current,document.activeElement)){var w;(w=I.current)===null||w===void 0||w.focus()}}function k(w){if(w)le();else{if(R(!1),O&&W.current&&d){try{W.current.focus({preventScroll:!0})}catch{}W.current=null}q&&(p==null||p())}C==null||C(w)}function T(w){x==null||x(w)}var D=b.useRef(!1),J=b.useRef(),ot=function(){clearTimeout(J.current),D.current=!0},at=function(){J.current=setTimeout(function(){D.current=!1})},ye=null;H&&(ye=function(se){D.current?D.current=!1:L.current===se.target&&T(se)});function rt(w){if(c&&w.keyCode===a.KeyCode.ESC){w.stopPropagation(),T(w);return}i&&w.keyCode===a.KeyCode.TAB&&I.current.changeActive(!w.shiftKey)}b.useEffect(function(){i&&(R(!0),G())},[i]),b.useEffect(function(){return function(){clearTimeout(J.current)}},[]);var lt=a._objectSpread2(a._objectSpread2(a._objectSpread2({zIndex:r},m),z==null?void 0:z.wrapper),{},{display:q?null:"none"});return s.createElement("div",a._extends({className:a.classNames("".concat(n,"-root"),V)},a.pickAttrs(t,{data:!0})),s.createElement(Nt,{prefixCls:n,visible:O&&i,motionName:Ne(n,$,P),style:a._objectSpread2(a._objectSpread2({zIndex:r},B),z==null?void 0:z.mask),maskProps:_,className:A==null?void 0:A.mask}),s.createElement("div",a._extends({tabIndex:-1,onKeyDown:rt,className:a.classNames("".concat(n,"-wrap"),f,A==null?void 0:A.wrapper),ref:L,onClick:ye,style:lt},v),s.createElement(Ae,a._extends({},t,{onMouseDown:ot,onMouseUp:at,ref:I,closable:N,ariaId:Y,prefixCls:n,visible:i&&q,onClose:T,onVisibleChanged:k,motionName:Ne(n,y,h)}))))},Le=function(t){var o=t.visible,n=t.getContainer,r=t.forceRender,l=t.destroyOnClose,i=l===void 0?!1:l,u=t.afterClose,c=t.panelRef,g=s.useState(o),d=a._slicedToArray(g,2),m=d[0],f=d[1],v=s.useMemo(function(){return{panel:c}},[c]);return s.useEffect(function(){o&&f(!0)},[o]),!r&&i&&!m?null:s.createElement(ze.Provider,{value:v},s.createElement(a.Portal,{open:o||r||m,autoDestroy:!1,getContainer:n,autoLock:o||m},s.createElement(Et,a._extends({},t,{destroyOnClose:i,afterClose:function(){u==null||u(),f(!1)}}))))};Le.displayName="Dialog";const wt=()=>a.canUseDom()&&window.document.documentElement,ae=e=>{const{prefixCls:t,className:o,style:n,size:r,shape:l}=e,i=a.classNames({[`${t}-lg`]:r==="large",[`${t}-sm`]:r==="small"}),u=a.classNames({[`${t}-circle`]:l==="circle",[`${t}-square`]:l==="square",[`${t}-round`]:l==="round"}),c=s.useMemo(()=>typeof r=="number"?{width:r,height:r,lineHeight:`${r}px`}:{},[r]);return s.createElement("span",{className:a.classNames(t,i,u,o),style:Object.assign(Object.assign({},c),n)})},jt=new a.Keyframe("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),re=e=>({height:e,lineHeight:a.unit(e)}),Q=e=>Object.assign({width:e},re(e)),Pt=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:jt,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),ce=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},re(e)),It=e=>{const{skeletonAvatarCls:t,gradientFromColor:o,controlHeight:n,controlHeightLG:r,controlHeightSM:l}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:o},Q(n)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Q(r)),[`${t}${t}-sm`]:Object.assign({},Q(l))}},Tt=e=>{const{controlHeight:t,borderRadiusSM:o,skeletonInputCls:n,controlHeightLG:r,controlHeightSM:l,gradientFromColor:i,calc:u}=e;return{[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:o},ce(t,u)),[`${n}-lg`]:Object.assign({},ce(r,u)),[`${n}-sm`]:Object.assign({},ce(l,u))}},we=e=>Object.assign({width:e},re(e)),Mt=e=>{const{skeletonImageCls:t,imageSizeBase:o,gradientFromColor:n,borderRadiusSM:r,calc:l}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:n,borderRadius:r},we(l(o).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},we(o)),{maxWidth:l(o).mul(4).equal(),maxHeight:l(o).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},de=(e,t,o)=>{const{skeletonButtonCls:n}=e;return{[`${o}${n}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${o}${n}-round`]:{borderRadius:t}}},ue=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},re(e)),Rt=e=>{const{borderRadiusSM:t,skeletonButtonCls:o,controlHeight:n,controlHeightLG:r,controlHeightSM:l,gradientFromColor:i,calc:u}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:u(n).mul(2).equal(),minWidth:u(n).mul(2).equal()},ue(n,u))},de(e,n,o)),{[`${o}-lg`]:Object.assign({},ue(r,u))}),de(e,r,`${o}-lg`)),{[`${o}-sm`]:Object.assign({},ue(l,u))}),de(e,l,`${o}-sm`))},Bt=e=>{const{componentCls:t,skeletonAvatarCls:o,skeletonTitleCls:n,skeletonParagraphCls:r,skeletonButtonCls:l,skeletonInputCls:i,skeletonImageCls:u,controlHeight:c,controlHeightLG:g,controlHeightSM:d,gradientFromColor:m,padding:f,marginSM:v,borderRadius:x,titleHeight:C,blockRadius:p,paragraphLiHeight:y,controlHeightXS:h,paragraphMarginTop:S}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:m},Q(c)),[`${o}-circle`]:{borderRadius:"50%"},[`${o}-lg`]:Object.assign({},Q(g)),[`${o}-sm`]:Object.assign({},Q(d))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[n]:{width:"100%",height:C,background:m,borderRadius:p,[`+ ${r}`]:{marginBlockStart:d}},[r]:{padding:0,"> li":{width:"100%",height:y,listStyle:"none",background:m,borderRadius:p,"+ li":{marginBlockStart:h}}},[`${r}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${n}, ${r} > li`]:{borderRadius:x}}},[`${t}-with-avatar ${t}-content`]:{[n]:{marginBlockStart:v,[`+ ${r}`]:{marginBlockStart:S}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},Rt(e)),It(e)),Tt(e)),Mt(e)),[`${t}${t}-block`]:{width:"100%",[l]:{width:"100%"},[i]:{width:"100%"}},[`${t}${t}-active`]:{[`
@@ -1,6 +1,6 @@
1
1
  import * as r from "react";
2
2
  import $, { useContext as re, useRef as Z, useMemo as Lt, useEffect as De } from "react";
3
- import { i as Dt, K as Ne, g as se, F as kt, m as fe, u as N, r as nt, b as Pe, p as je, C as q, c as O, d as Ie, e as At, o as ge, f as Ce, h as _t, k as Vt, l as Wt, W as qt, n as Gt, B as Te, q as ot, s as Xt, _ as R, t as ke, v as Y, w as Me, x as at, y as Ae, z as Ut, A as _e, D as Ve, P as Kt, G as Qt, H as K, J as Zt, L as Yt, N as Re, O as Jt, Q as lt, T as en, U as tn, V as rt, X as nn, Z as on, $ as an, a0 as ue, a1 as ln, a2 as st, a3 as rn, a4 as sn, a5 as cn, a6 as dn, a7 as un, a8 as mn, a9 as fn, aa as gn, ab as Cn, ac as it, ad as pn, ae as vn } from "./index-D7famSD9.mjs";
3
+ import { i as Dt, K as Ne, g as se, F as kt, m as fe, u as N, r as nt, b as Pe, p as je, C as q, c as O, d as Ie, e as At, o as ge, f as Ce, h as _t, k as Vt, l as Wt, W as qt, n as Gt, B as Te, q as ot, s as Xt, _ as R, t as ke, v as Y, w as Me, x as at, y as Ae, z as Ut, A as _e, D as Ve, P as Kt, G as Qt, H as K, J as Zt, L as Yt, N as Re, O as Jt, Q as lt, T as en, U as tn, V as rt, X as nn, Z as on, $ as an, a0 as ue, a1 as ln, a2 as st, a3 as rn, a4 as sn, a5 as cn, a6 as dn, a7 as un, a8 as mn, a9 as fn, aa as gn, ab as Cn, ac as it, ad as pn, ae as vn } from "./index-R1XNIXB0.mjs";
4
4
  const bn = new Ne("antFadeIn", {
5
5
  "0%": {
6
6
  opacity: 0
@@ -12063,9 +12063,13 @@ const W0 = (e, A) => {
12063
12063
  const t = Date.now(), n = `${e}:${t}:${RM.md5(`${A}${t}`)}`, r = new TextEncoder().encode(n);
12064
12064
  return btoa(String.fromCharCode(...r));
12065
12065
  }, eV = (e) => {
12066
- if (!e || typeof e != "string") return !1;
12067
- const A = e.replace(/\s+/g, "");
12068
- return A.length % 4 != 0 ? !1 : /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(A);
12066
+ if (/^\d+$/.test(e) || !e || typeof e != "string" || e.length % 4 != 0 || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)) return !1;
12067
+ try {
12068
+ const A = atob(e);
12069
+ return btoa(A) === e;
12070
+ } catch {
12071
+ return !1;
12072
+ }
12069
12073
  }, gs = "/v1/aicc/bmserver", Yn = "/v1/aicc/ccs";
12070
12074
  let Li = "", Ld = "", Hd = "", hs = "";
12071
12075
  function z0() {
@@ -12981,7 +12985,7 @@ class ht {
12981
12985
  }
12982
12986
  initWebSocket() {
12983
12987
  var t;
12984
- if (((t = this.ws) == null ? void 0 : t.readyState) === 1) return;
12988
+ if (((t = this.ws) == null ? void 0 : t.readyState) === 1 || !Y.get("isNextState") || this.manualClose) return;
12985
12989
  const A = W0(Ld, Hd);
12986
12990
  this.ws = new WebSocket(this.url + A), this.ws.onopen = () => {
12987
12991
  const n = (/* @__PURE__ */ new Date()).getTime();
@@ -13052,7 +13056,9 @@ class ht {
13052
13056
  VA.emit(xA.NOTIFICATION_CLICK, { customer_phone: o.customer_phone });
13053
13057
  }, _.browserAlertTime)), i === ae.LISTEN_INCOMING_CALL_OFF_HOOK && (_.monitoredAgentNo = o.monitored_agent_no, _.earSpeakAgent = "", Y.updateIncomingIsAnswer(!0), VA.emit(AA.LISTEN_INCOMING_CALL_OFF_HOOK, { session_id: _.sessionId, monitored_agent_no: o.monitored_agent_no }), Y.updateActionConfigs(Wh), Y.updateDisplayText(At.CALLING)), i === ae.LISTEN_CALL_FAILED && o.status === "failed" && (VA.emit(AA.LISTEN_CALL_FAILED), _.monitoredAgentNo = ""), i === ae.EAR_SPEECH && (o.status === "success" ? (o.monitored_agent_no === _.agentInfo.agent_no && (Y.updateActionConfigs(uM), VA.emit(AA.EAR_SPEECH_BE_SUCCESS)), o.monitor_agent_no === _.agentInfo.agent_no && (Y.updateActionConfigs(VM), VA.emit(AA.EAR_SPEECH_SUCCESS, { monitored_agent_no: o.monitored_agent_no, monitor_agent_no: o.monitor_agent_no }), _.earSpeakAgent = o.monitored_agent_no)) : VA.emit(AA.EAR_SPEECH_FAILED)), i === ae.STOP_EAR_SPEECH && (o.status === "success" ? (o.monitored_agent_no === _.agentInfo.agent_no && Y.updateActionConfigs(ni), o.monitor_agent_no === _.agentInfo.agent_no && Y.updateActionConfigs(Wh), _.earSpeakAgent = "", VA.emit(AA.STOP_EAR_SPEECH_SUCCESS)) : VA.emit(AA.STOP_EAR_SPEECH_FAILED)), i === ae.CALL_FORCE_INSERT && (o.status === "success" ? (o.monitored_agent_no === _.agentInfo.agent_no && (Y.updateActionConfigs(gM), VA.emit(AA.CALL_FORCE_INSERT_SUCCESS, { monitored_agent_no: o.monitored_agent_no, monitor_agent_no: o.monitor_agent_no })), o.monitor_agent_no === _.agentInfo.agent_no && (Y.updateActionConfigs(dM), VA.emit(AA.CALL_FORCE_INSERT_SUCCESS_LISTENER, { monitored_agent_no: o.monitored_agent_no, monitor_agent_no: o.monitor_agent_no }))) : VA.emit(AA.CALL_FORCE_INSERT_FAILED));
13054
13058
  }, this.ws.onclose = (n) => {
13055
- VA.emit(xA.FAIL_NOTIFICATION, "链接已断开,请检查网络"), this.stopHeartbeat(), this.manualClose || setTimeout(() => this.initWebSocket(), this.reconnectDelay);
13059
+ VA.emit(xA.FAIL_NOTIFICATION, "链接已断开,请检查网络"), this.stopHeartbeat();
13060
+ const r = Y.get("isNextState");
13061
+ !this.manualClose && r && setTimeout(() => this.initWebSocket(), this.reconnectDelay);
13056
13062
  }, this.ws.onerror = (n) => {
13057
13063
  var r;
13058
13064
  VA.emit(xA.FAIL_NOTIFICATION, "连接失败,请检查网络"), (r = this.ws) == null || r.close();
@@ -34719,7 +34725,7 @@ const dO = {
34719
34725
  空闲: 1,
34720
34726
  离线: 0,
34721
34727
  未注册: 4
34722
- }, pO = cq(() => import("./ConsultModel-DCc70-P8.mjs")), fO = cq(() => import("./TransferModel-BZJ9Es4y.mjs")), Vu = ut.div`
34728
+ }, pO = cq(() => import("./ConsultModel-uKbk_EVn.mjs")), fO = cq(() => import("./TransferModel-BOfm5rCf.mjs")), Vu = ut.div`
34723
34729
  width: 25px;
34724
34730
  height: 25px;
34725
34731
  background: ${({
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-BPyR7aGg.js");exports.YsytAgentLogout=e.agentLogout;exports.YsytCallForceInsert=e.callForceInsert;exports.YsytCallForceSplit=e.callForceSplit;exports.YsytGetCustomerInfo=e.getCustomerInfo;exports.YsytListenCall=e.listenCall;exports.YsytMakeCall=e.makeCall;exports.YsytPreviewMakeCall=e.previewMakeCall;exports.YsytSetAgentDevice=e.setAgentDevice;exports.YsytSetAgentInitState=e.setAgentInitState;exports.YsytStartEarSpeak=e.startEarSpeak;exports.YsytStopEarSpeak=e.stopEarSpeak;exports.default=e.YsytBarPhone;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-BiSWuclo.js");exports.YsytAgentLogout=e.agentLogout;exports.YsytCallForceInsert=e.callForceInsert;exports.YsytCallForceSplit=e.callForceSplit;exports.YsytGetCustomerInfo=e.getCustomerInfo;exports.YsytListenCall=e.listenCall;exports.YsytMakeCall=e.makeCall;exports.YsytPreviewMakeCall=e.previewMakeCall;exports.YsytSetAgentDevice=e.setAgentDevice;exports.YsytSetAgentInitState=e.setAgentInitState;exports.YsytStartEarSpeak=e.startEarSpeak;exports.YsytStopEarSpeak=e.stopEarSpeak;exports.default=e.YsytBarPhone;
@@ -1,4 +1,4 @@
1
- import { ak as s, ap as e, aq as l, ah as y, am as Y, ag as o, al as r, aj as n, ai as S, an as i, ao as p, af as C } from "./index-D7famSD9.mjs";
1
+ import { ak as s, ap as e, aq as l, ah as y, am as Y, ag as o, al as r, aj as n, ai as S, an as i, ao as p, af as C } from "./index-R1XNIXB0.mjs";
2
2
  export {
3
3
  s as YsytAgentLogout,
4
4
  e as YsytCallForceInsert,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ysyt-react-agent-lib",
3
- "version": "1.1.47",
3
+ "version": "1.1.49",
4
4
  "description": "",
5
5
  "main": "dist/ysyt-react-agent-lib.cjs.js",
6
6
  "module": "dist/ysyt-react-agent-lib.es.js",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "antd": "5.24.0",
31
31
  "styled-components": "^6.1.13",
32
- "ysyt-agent-sdk": "1.1.46"
32
+ "ysyt-agent-sdk": "1.1.49"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^18.2.0",